Permalink
Browse files

Add ability to toggle versioning of Resources or element types throug…

…h system settings.
  • Loading branch information...
1 parent c9c3310 commit f507829497c7dad14cd2d34d8f17733c343ce66a @Mark-H committed Apr 8, 2012
@@ -4,6 +4,13 @@
'debug' => false,
'formtabs.resource' => true,
'formtabs.template' => true,
+
+ 'enable.resources' => true,
+ 'enable.templates' => true,
+ 'enable.templatevariables' => true,
+ 'enable.chunks' => true,
+ 'enable.snippets' => true,
+ 'enable.plugins' => true,
);
$settings = array();
@@ -1,5 +1,6 @@
This changelog shows an overview of what changed throughout VersionX releases, with the latest release or development log on top.
+Add ability to toggle versioning of Resources or element types through system settings.
Add ability to revert Resources.
Add Dutch translation (Thanks @Engelbert!)
Add new "Template Variables" tab to component. (Thanks Adam!)
@@ -31,26 +31,31 @@
*/
$eventName = $modx->event->name;
-echo $eventName;
switch($eventName) {
case 'OnDocFormSave':
- $result = $modx->versionx->newResourceVersion($resource, $mode);
+ if ($modx->getOption('versionx.enable.resources',null,true))
+ $result = $modx->versionx->newResourceVersion($resource, $mode);
break;
case 'OnTempFormSave':
- $result = $modx->versionx->newTemplateVersion($template, $mode);
+ if ($modx->getOption('versionx.enable.templates',null,true))
+ $result = $modx->versionx->newTemplateVersion($template, $mode);
break;
case 'OnTVFormSave':
- $result = $modx->versionx->newTemplateVarVersion($tv, $mode);
+ if ($modx->getOption('versionx.enable.templatevariables',null,true))
+ $result = $modx->versionx->newTemplateVarVersion($tv, $mode);
break;
case 'OnChunkFormSave':
- $result = $modx->versionx->newChunkVersion($chunk, $mode);
+ if ($modx->getOption('versionx.enable.chunks',null,true))
+ $result = $modx->versionx->newChunkVersion($chunk, $mode);
break;
case 'OnSnipFormSave':
- $result = $modx->versionx->newSnippetVersion($snippet, $mode);
+ if ($modx->getOption('versionx.enable.snippets',null,true))
+ $result = $modx->versionx->newSnippetVersion($snippet, $mode);
break;
case 'OnPluginFormSave':
- $result = $modx->versionx->newPluginVersion($plugin, $mode);
+ if ($modx->getOption('versionx.enable.plugins',null,true))
+ $result = $modx->versionx->newPluginVersion($plugin, $mode);
break;
case 'OnBeforeManagerPageInit':

0 comments on commit f507829

Please sign in to comment.