Skip to content
Snippets Groups Projects
Commit 60e48eeb authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Fix warnings, correct plugin template

parent c4556fcb
No related branches found
No related tags found
No related merge requests found
...@@ -60,7 +60,7 @@ class plgVmShopperOrdernumberInstallerScript ...@@ -60,7 +60,7 @@ class plgVmShopperOrdernumberInstallerScript
public function install(JAdapterInstance $adapter) public function install(JAdapterInstance $adapter)
{ {
// enabling plugin // enabling plugin
$db =& JFactory::getDBO(); $db = JFactory::getDBO();
$db->setQuery('update #__extensions set enabled = 1 where type = "plugin" and element = "ordernumber" and folder = "vmshopper"'); $db->setQuery('update #__extensions set enabled = 1 where type = "plugin" and element = "ordernumber" and folder = "vmshopper"');
$db->query(); $db->query();
......
BASE=YOUR_PLUGIN_NAME BASE=YOUR_PLUGIN_NAME
PLUGINTYPE=vmshipmentrules PLUGINTYPE=vmshopper
ZIPBASE=opentools_vmshipmentrules ZIPBASE=opentools_vmshopper
VERSION=1.0 VERSION=1.0
PLUGINFILES=$(BASE).php $(BASE).script.php $(BASE).xml index.html PLUGINFILES=$(BASE).php $(BASE).script.php $(BASE).xml index.html
TRANSLATIONS=$(call wildcard,language/en*/*.plg_$(PLUGINTYPE)_$(BASE).*ini) TRANSLATIONS=$(call wildcard,language/en*/*.plg_$(PLUGINTYPE)_$(BASE).*ini)
INDEXFILES=language/index.html $(call wildcard,language/**/index.html) INDEXFILES=language/index.html $(call wildcard,language/**/index.html)
FIELDS=$(call wildcard,fields/*)
ZIPFILE=plg_$(ZIPBASE)_$(BASE)_v$(VERSION).zip ZIPFILE=plg_$(ZIPBASE)_$(BASE)_v$(VERSION).zip
all: zip all: zip
zip: $(PLUGINFILES) $(TRANSLATIONS) $(ADVANCEDFILES) $(INDEXFILES) zip: $(PLUGINFILES) $(TRANSLATIONS) $(ADVANCEDFILES) $(INDEXFILES)
@echo "Packing all files into distribution file $(ZIPFILE):" @echo "Packing all files into distribution file $(ZIPFILE):"
@zip -r $(ZIPFILE) $(PLUGINFILES) $(TRANSLATIONS) $(INDEXFILES) @zip -r $(ZIPFILE) $(PLUGINFILES) $(TRANSLATIONS) $(INDEXFILES) $(FIELDS)
clean: clean:
rm -f $(ZIPFILE) rm -f $(ZIPFILE)
...@@ -5,7 +5,6 @@ defined ('_JEXEC') or die('Restricted access'); ...@@ -5,7 +5,6 @@ defined ('_JEXEC') or die('Restricted access');
/** /**
* Plugin providing Custom variables for the VM Ordernumber plugin * Plugin providing Custom variables for the VM Ordernumber plugin
* *
* @subpackage Plugins - VmShipmentRules
* @copyright Copyright (C) 2014 Reinhold Kainhofer, office@open-tools.net * @copyright Copyright (C) 2014 Reinhold Kainhofer, office@open-tools.net
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant * VirtueMart is free software. This version may have been modified pursuant
...@@ -17,13 +16,14 @@ defined ('_JEXEC') or die('Restricted access'); ...@@ -17,13 +16,14 @@ defined ('_JEXEC') or die('Restricted access');
* http://open-tools.net/ * http://open-tools.net/
* *
*/ */
if (!class_exists ('VmPlugin')) { if (!class_exists('vmShopperPlugin'))
require(JPATH_VM_PLUGINS . DS . 'vmplugin.php'); require(JPATH_VM_PLUGINS . DS . 'vmshopperplugin.php');
}
/** Extension plugin for the Odernumber plugin for VirtueMart /** Extension plugin for the Ordernumber plugin for VirtueMart
*/ */
class plgVmShopperYOUR_PLUGIN_NAME extends VmPlugin { class plgVmShopperYOUR_PLUGIN_NAME extends VmShopperPlugin {
// Unfortunately, this dummy function needs to be implementd, because it's abstract in the parent class!
public function plgVmOnUpdateOrderBEShopper($_orderID) {}
/** Trigger to add variables to be used in the number formats /** Trigger to add variables to be used in the number formats
* You can add new variables to the $cartvals array or modify existing ones. They will be directly * You can add new variables to the $cartvals array or modify existing ones. They will be directly
* available in all formats. This trigger will be called whenever the ordernumber plugin creates a * available in all formats. This trigger will be called whenever the ordernumber plugin creates a
......
...@@ -49,7 +49,7 @@ class plgVmShopperYOUR_PLUGIN_NAMEInstallerScript ...@@ -49,7 +49,7 @@ class plgVmShopperYOUR_PLUGIN_NAMEInstallerScript
public function install(JAdapterInstance $adapter) public function install(JAdapterInstance $adapter)
{ {
// enabling plugin upon installation // enabling plugin upon installation
$db =& JFactory::getDBO(); $db = JFactory::getDBO();
$db->setQuery('update #__extensions set enabled = 1 where type = "plugin" and element = "YOUR_PLUGIN_NAME" and folder = "vmshopper"'); $db->setQuery('update #__extensions set enabled = 1 where type = "plugin" and element = "YOUR_PLUGIN_NAME" and folder = "vmshopper"');
$db->query(); $db->query();
......
...@@ -18,10 +18,7 @@ ...@@ -18,10 +18,7 @@
</languages> </languages>
<scriptfile>YOUR_PLUGIN_NAME.script.php</scriptfile> <scriptfile>YOUR_PLUGIN_NAME.script.php</scriptfile>
<!-- VM 3.x support (fields rather than params): --> <!-- Joomla 2.x and 3.x support (fields rather than params): -->
<vmconfig></vmconfig> <config></config>
<!-- VM 2.0 support (params rather than fields): -->
<params></params>
</extension> </extension>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment