diff --git a/Makefile b/Makefile index e2ae9be38c13c10edd83f6e8395508c042378b83..b0e56f37a01f3cb4941fc69ac54d0acb4f342902 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,12 @@ BASE=donation PLUGINTYPE=vmcustom -VERSION=0.1 +VERSION=1.0 PLUGINFILES=$(BASE).php $(BASE).script.php $(BASE).xml index.html TRANSLATIONS=$(call wildcard,language/*/*.plg_$(PLUGINTYPE)_$(BASE).*ini) INDEXFILES=language/index.html $(call wildcard,language/*/index.html) -TMPLFILES=$(call wildcard,$(BASE)/tmpl/*.php) +TMPLFILES=$(call wildcard,$(BASE)/tmpl/*.php) $(call wildcard,$(BASE)/tmpl/index.html) $(call wildcard,$(BASE)/index.html) ASSETS= ZIPFILE=plg_$(PLUGINTYPE)_$(BASE)_v$(VERSION).zip diff --git a/donation.php b/donation.php index 1c2b31ba7bbefc1f8cbdbaa17cbc63abbee7fb79..47d4976a1a2fabae581460c87f2e80a7c8862227 100644 --- a/donation.php +++ b/donation.php @@ -19,8 +19,8 @@ if (!class_exists('vmCustomPlugin')) require(JPATH_VM_PLUGINS . DS . 'vmcustompl // if(!class_exists('VmTable'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'vmtable.php'); if (JVM_VERSION === 2) { - if (!defined('VMDONATION_PLUGINPATH')) define('VMDONATION_PLUGINPATH', JPATH_SITE.DS.'plugins'.DS.'vmcustom'.DS.'set_price'); - if (!defined('VMDONATION_PLUGINWEBROOT')) define('VMDONATION_PLUGINWEBROOT', 'plugins/vmcustom/set_price'); + if (!defined('VMDONATION_PLUGINPATH')) define('VMDONATION_PLUGINPATH', JPATH_SITE.DS.'plugins'.DS.'vmcustom'.DS.'donation'); + if (!defined('VMDONATION_PLUGINWEBROOT')) define('VMDONATION_PLUGINWEBROOT', 'plugins/vmcustom/donation'); } else { if (!defined('VMDONATION_PLUGINPATH')) define('VMDONATION_PLUGINPATH', JPATH_SITE.DS.'plugins'.DS.'vmcustom'); if (!defined('VMDONATION_PLUGINWEBROOT')) define('VMDONATION_PLUGINWEBROOT', 'plugins/vmcustom'); @@ -79,7 +79,8 @@ class plgVmCustomDonation extends vmCustomPlugin { foreach($plgParam as $k => $item){ if(!empty($item['customprice']) && ($product->productCustom->virtuemart_customfield_id==$k)){ - $html .='<span>'.JText::_($product->productCustom->custom_title).' '.$item['customprice'].'</span>'; + $currency = CurrencyDisplay::getInstance (); + $html .='<span>'.JText::_($product->productCustom->custom_title).' '.$currency->priceDisplay($item['customprice']).'</span>'; } } return true; diff --git a/donation.script.php b/donation.script.php index 1f4d5f25e674e57dd1a024024fcd0d1e49d986ce..f0ac4a3bfb34b54deb54f00f5af5bc35d5ed0c7e 100644 --- a/donation.script.php +++ b/donation.script.php @@ -1,7 +1,7 @@ <?php defined('_JEXEC') or die('Restricted access'); -class plgVmCustomDownloads_for_SaleInstallerScript +class plgVmCustomDonationInstallerScript { /** * Constructor diff --git a/donation.xml b/donation.xml index 11baf8030bbef3cd0f478114e9e4f15ec79ad3ca..9fc6ea63eac9af6588ababe5ec13f38cb97bd973 100644 --- a/donation.xml +++ b/donation.xml @@ -1,24 +1,27 @@ <?xml version="1.0" encoding="UTF-8" ?> <install version="1.5" type="plugin" group="vmcustom" method="upgrade"> - <name>VMCUSTOM_SETPRICE</name> + <name>VMCUSTOM_DONATION</name> <creationDate>2013-03-02</creationDate> <author>Reinhold Kainhofer</author> <authorUrl>http://www.kainhofer.com/</authorUrl> <copyright>Copyright (C) 2013 Reinhold Kainhofer. All rights reserved.</copyright> <license>http://www.gnu.org/licenses/gpl.html GNU/GPL v3+</license> - <version>0.1.0</version> - <description>VMCUSTOM_SETPRICE_DESC</description> + <version>1.0.0</version> + <description>VMCUSTOM_DONATION_DESC</description> <files> - <filename plugin="set_price">set_price.php</filename> - <filename>set_price.script.php</filename> + <filename plugin="donation">donation.php</filename> + <filename>donation.script.php</filename> <folder>language</folder> + <folder>donation</folder> <filename>index.html</filename> </files> <languages folder="language"> - <language tag="en-GB">en-GB/en-GB.plg_vmcustom_set_price.ini</language> - <language tag="en-GB">en-GB/en-GB.plg_vmcustom_set_price.sys.ini</language> + <language tag="en-GB">en-GB/en-GB.plg_vmcustom_donation.ini</language> + <language tag="en-GB">en-GB/en-GB.plg_vmcustom_donation.sys.ini</language> + <language tag="de-DE">de-DE/de-DE.plg_vmcustom_donation.ini</language> + <language tag="de-DE">de-DE/de-DE.plg_vmcustom_donation.sys.ini</language> </languages> - <scriptfile>set_price.script.php</scriptfile> + <scriptfile>donation.script.php</scriptfile> <params addpath="/administrator/components/com_virtuemart/elements"> <param type="vmjpluginwarning" /> </params> diff --git a/donation/tmpl/default.php b/donation/tmpl/default.php index 1499c6f5b54efbc0952373d9a625b43869491512..10cd97dfcbf6b8446a49e7d2da348b5e5186dd5c 100644 --- a/donation/tmpl/default.php +++ b/donation/tmpl/default.php @@ -4,7 +4,7 @@ //vmdebug('$this',$viewData[0]); //if ($field->custom_price_by_letter) $class='vmcustom-textinput';?> - <input class="<?php echo $class ?>" type="text" value="" name="customPlugin[<?php echo $viewData[0]->virtuemart_customfield_id ?>][<?php echo $this->_name?>][customprice]"><br /> + <input class="<?php echo $class ?>" type="text" value="" size="4" name="customPlugin[<?php echo $viewData[0]->virtuemart_customfield_id ?>][<?php echo $this->_name?>][customprice]"><?php echo CurrencyDisplay::getInstance ()->getSymbol(); ?><br /> <?php // preventing 2 x load javascript static $textinputjs; diff --git a/images/donate.png b/images/donate.png new file mode 100644 index 0000000000000000000000000000000000000000..254c5a2cb006ee3a98246f4666eec5d8d539508f Binary files /dev/null and b/images/donate.png differ diff --git a/images/donation_-_icon.png b/images/donation_-_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..45c59ed120bb954b3b9b81ea80eb0484c4efa0fb Binary files /dev/null and b/images/donation_-_icon.png differ diff --git a/images/donation_-_icon.xcf b/images/donation_-_icon.xcf new file mode 100644 index 0000000000000000000000000000000000000000..af9c983e303f6d1ed00a626ea23b98b77522127a Binary files /dev/null and b/images/donation_-_icon.xcf differ diff --git a/language/de-DE/de-DE.plg_vmcustom_donation.ini b/language/de-DE/de-DE.plg_vmcustom_donation.ini new file mode 100644 index 0000000000000000000000000000000000000000..3cc9820b6cce718b004373e1e79e2f3e02877f64 --- /dev/null +++ b/language/de-DE/de-DE.plg_vmcustom_donation.ini @@ -0,0 +1,8 @@ +; Virtuemart! Project +; Copyright (C) 2011 Virtuemart Team. All rights reserved. +; License http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 - No BOM + +VMCUSTOM_DONATION="VM Spenden Plugin" +VMCUSTOM_DONATION_DESC="VirtueMart Benutzerfeld Erweiterung, die Benutzern einen Spendenbetrag zum Produktpreis hinzufügen oder den Preis des Produktes selbst festlegen lässt." + diff --git a/language/de-DE/de-DE.plg_vmcustom_donation.sys.ini b/language/de-DE/de-DE.plg_vmcustom_donation.sys.ini new file mode 100644 index 0000000000000000000000000000000000000000..9cebcc9818b0292d9f2029f62be4a628f29b8db5 --- /dev/null +++ b/language/de-DE/de-DE.plg_vmcustom_donation.sys.ini @@ -0,0 +1,7 @@ +; Virtuemart! Project +; Copyright (C) 2011 Virtuemart Team. All rights reserved. +; License http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 - No BOM + +VMCUSTOM_DONATION="VM Spenden Plugin" +VMCUSTOM_DONATION_DESC="VirtueMart Benutzerfeld Erweiterung, die Benutzern einen Spendenbetrag zum Produktpreis hinzufügen oder den Preis des Produktes selbst festlegen lässt." diff --git a/releases/plg_vmcustom_donation_v1.0.zip b/releases/plg_vmcustom_donation_v1.0.zip new file mode 100644 index 0000000000000000000000000000000000000000..360038f1ee2cbbaa3a81a7e9c1a551353a176b40 Binary files /dev/null and b/releases/plg_vmcustom_donation_v1.0.zip differ