diff --git a/Makefile b/Makefile index e7ec3bf28b8a21adff407d01828f4ecf2b6de755..0488e956b531b09cf7e16fb6bedb4bbddcc05f3c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ BASE=vmAutoParentCategories PLUGINTYPE=system -VERSION=0.1 +VERSION=1.0 PLUGINFILES=$(BASE).php $(BASE).xml index.html # TRANSDIR=../../../administrator/language/ diff --git a/de-DE.plg_system_vmAutoParentCategories.sys.ini b/de-DE.plg_system_vmAutoParentCategories.sys.ini index 78c38de4336dcbb20ed597e3b443105796e843b5..47b1033fb01598cf7fb0ad7fbcd3c8009bc80f4f 100644 --- a/de-DE.plg_system_vmAutoParentCategories.sys.ini +++ b/de-DE.plg_system_vmAutoParentCategories.sys.ini @@ -3,7 +3,7 @@ ; @Website : http://kainhofer.com ; @license - http://www.gnu.org/licenses/gpl.html GNU/GPL -VMAUTOCATEGORIES_DESCRIPTION="<h2>Virtuemart 2 automatische Produktkategorien Plugin</h2><p style='font-weight: normal'>Dieses Plugin kann den VirtueMart Produkten automatische alle übergeordneten Kategorien des Produkts zuweisen, oder all übergeordneten Kategorien entfernen. Ebenso können bei Produktvarianten die Kategorien des übergeordneten Produkts zugeordnet, oder alle Kategorien entfernt werden.</p><p style='font-weight: normal'>Um das Plugin manuell auszuführen, <a href="_QQ_"?vmAutoParentCategories=run"_QQ_">klicken Sie hier</a>.</p>" +VMAUTOCATEGORIES_DESCRIPTION="<h2>Virtuemart 2 automatische Produktkategorien Plugin</h2><p style='font-weight: normal'>Dieses Plugin kann den VirtueMart Produkten automatische alle übergeordneten Kategorien des Produkts zuweisen, oder all übergeordneten Kategorien entfernen. Ebenso können bei Produktvarianten die Kategorien des übergeordneten Produkts zugeordnet, oder alle Kategorien entfernt werden.</p><p style='font-weight: normal'>Um das Plugin manuell auszuführen, <a href="_QQ_"?vmAutoParentCategories=run"_QQ_">klicken Sie hier</a> (dazu muss das Plugin aber auch aktiviert sein!).</p>" VMAUTOCATEGORIES_RUN="Führe Plugin aus:" VMAUTOCATEGORIES_RUN_DESC="Wählen Sie aus, wann das Plugin ausgeführt wird und die Kategorien der VirtueMart Produkte modifiziert." diff --git a/en-GB.plg_system_vmAutoParentCategories.sys.ini b/en-GB.plg_system_vmAutoParentCategories.sys.ini index e3d7cb638e388b04a447e4ff8a4189781730f391..6408a0cfad38967076a6fe76a9856da254921bb4 100644 --- a/en-GB.plg_system_vmAutoParentCategories.sys.ini +++ b/en-GB.plg_system_vmAutoParentCategories.sys.ini @@ -3,7 +3,7 @@ ; @Website : http://kainhofer.com ; @license - http://www.gnu.org/licenses/gpl.html GNU/GPL -VMAUTOCATEGORIES_DESCRIPTION="<h2>Virtuemart 2 Auto Product Categories plugin</h2><p style='font-weight: normal'>Automatically add VirtueMart products to all parent categories of the categories assigned to it, or remove all parent categories. Additionally, child products can also be adjusted with their parents' categories, or removed from all categories.</p><p style='font-weight: normal'>To call the plugin explicitly, <a href="_QQ_"?vmAutoParentCategories=run"_QQ_">click here</a>.</p>" +VMAUTOCATEGORIES_DESCRIPTION="<h2>Virtuemart 2 Auto Product Categories plugin</h2><p style='font-weight: normal'>Automatically add VirtueMart products to all parent categories of the categories assigned to it, or remove all parent categories. Additionally, child products can also be adjusted with their parents' categories, or removed from all categories.</p><p style='font-weight: normal'>To call the plugin explicitly, <a href="_QQ_"?vmAutoParentCategories=run"_QQ_">click here</a> (will only work if the plugin is enabled!).</p>" VMAUTOCATEGORIES_RUN="Run plugin on:" VMAUTOCATEGORIES_RUN_DESC="Select when the plugin shall be run and automatically modify the VirtueMart categories of your products." diff --git a/images/plg_vmAutoParentCategories_Config.png b/images/plg_vmAutoParentCategories_Config.png new file mode 100644 index 0000000000000000000000000000000000000000..fb884ca7994cd8b481b70377d7ae352df01a3f54 Binary files /dev/null and b/images/plg_vmAutoParentCategories_Config.png differ diff --git a/images/plg_vmAutoParentCategories_Message.png b/images/plg_vmAutoParentCategories_Message.png new file mode 100644 index 0000000000000000000000000000000000000000..0daed6c5cd1cb664fbdedb6ad2fdc11da0d4adec Binary files /dev/null and b/images/plg_vmAutoParentCategories_Message.png differ diff --git a/images/plg_vmAutoParentCategories_Working.png b/images/plg_vmAutoParentCategories_Working.png new file mode 100644 index 0000000000000000000000000000000000000000..d44aaae4bd6138bbf57e7925c132cc3bf94d51e9 Binary files /dev/null and b/images/plg_vmAutoParentCategories_Working.png differ diff --git a/releases/plg_system_vmAutoParentCategories_v1.0.zip b/releases/plg_system_vmAutoParentCategories_v1.0.zip new file mode 100644 index 0000000000000000000000000000000000000000..1e8e897725661abfdb8de53dcdeec91e5dea6f49 Binary files /dev/null and b/releases/plg_system_vmAutoParentCategories_v1.0.zip differ diff --git a/releases/plg_system_vmProductAutoParentCategories_v0.1.zip b/releases/plg_system_vmProductAutoParentCategories_v0.1.zip deleted file mode 100644 index fc83139412024d883f876f94cd72f5eaeb517ff4..0000000000000000000000000000000000000000 Binary files a/releases/plg_system_vmProductAutoParentCategories_v0.1.zip and /dev/null differ diff --git a/vmAutoParentCategories.php b/vmAutoParentCategories.php index 7f764ceb7a6b29311ded80f38289927eb590a11b..1e456864df982f17950392bb7db5577aa6942d93 100644 --- a/vmAutoParentCategories.php +++ b/vmAutoParentCategories.php @@ -1,6 +1,7 @@ <?php /** * @plugin VMAutoParentCategories + * Version 1.0, 2012-12-18 * @copyright Copyright (C) 2012 Reinhold Kainhofer - All rights reserved. * @Website : http://www.kainhofer.com * @license - http://www.gnu.org/licenses/gpl.html GNU/GPL @@ -88,7 +89,7 @@ class plgSystemVMAutoParentCategories extends JPlugin { } function getCategoriesAllParents($categories, $catparents) { - $newcats=[]; + $newcats=array(); foreach ($categories as $c) { $newcats[$c]=1; $c1=$c; @@ -221,7 +222,7 @@ class plgSystemVMAutoParentCategories extends JPlugin { } if ($modified>0) { $this->progressMessage(JText::sprintf('VMAUTOCATEGORIES_PROGRESS_ARTICLES_MODIFIED', $modified)); - } elseif (in_array ($this->_dbg, ['report_always', 'report_no_change', 'debug', 'debug_no_changes'])) { + } elseif (in_array ($this->_dbg, array('report_always', 'report_no_change', 'debug', 'debug_no_changes'))) { $this->progressMessage(JText::sprintf('VMAUTOCATEGORIES_PROGRESS_ARTICLES_NO_MODIFICATIONS')); } @@ -238,7 +239,7 @@ class plgSystemVMAutoParentCategories extends JPlugin { case 'add_two_leaves': $newcats = $this->getCategoriesOneParent($cats, $catparents); break; case 'remove_except_leaf': $newcats = $this->getCategoriesOnlyLeaf($cats, $catparents); break; case 'copy_parent': $newcats = $this->getProductCategories($topparent->virtuemart_product_id); break; - case 'remove_all': $newcats = []; break; + case 'remove_all': $newcats = array(); break; } $added=array_diff($newcats,$cats); $removed=array_diff($cats,$newcats); @@ -258,7 +259,7 @@ class plgSystemVMAutoParentCategories extends JPlugin { } if ($childrenmodified>0) { $this->progressMessage(JText::sprintf('VMAUTOCATEGORIES_PROGRESS_CHILDREN_MODIFIED', $childrenmodified)); - } elseif (in_array ($this->_dbg, ['report_always', 'report_no_change', 'debug', 'debug_no_changes'])) { + } elseif (in_array ($this->_dbg, array('report_always', 'report_no_change', 'debug', 'debug_no_changes'))) { $this->progressMessage(JText::sprintf('VMAUTOCATEGORIES_PROGRESS_CHILDREN_NO_MODIFICATIONS')); } } diff --git a/vmAutoParentCategories.xml b/vmAutoParentCategories.xml index cdc97d586eca9a88d08b77c095f441f331bb7ac6..59757dfef99c3824db1df1688d2020cc699744b6 100644 --- a/vmAutoParentCategories.xml +++ b/vmAutoParentCategories.xml @@ -7,7 +7,7 @@ <license>http://www.gnu.org/licenses/gpl.html GNU/GPL v3+</license> <authorEmail>reinhold@kainhofer.com/</authorEmail> <authorUrl>http://kainhofer.com</authorUrl> - <version>0.0.2</version> + <version>1.0.0</version> <description>VMAUTOCATEGORIES_DESCRIPTION</description> <files> @@ -15,8 +15,8 @@ <filename plugin="vmAutoParentCategories">index.html</filename> </files> <languages> - <language tag="en-GB">en-GB.plg_system_vmAutoParentCategories.ini</language> - <language tag="de-DE">de-DE.plg_system_vmAutoParentCategories.ini</language> + <language tag="en-GB">en-GB.plg_system_vmAutoParentCategories.sys.ini</language> + <language tag="de-DE">de-DE.plg_system_vmAutoParentCategories.sys.ini</language> </languages> <config>