├── .gitignore ├── _bootstrap └── index.php ├── _build ├── build.schema.php ├── build.transport.php ├── createtables.php ├── data │ ├── settings.php │ ├── transport.dashboardwidgets.php │ ├── transport.menus.php │ ├── transport.plugins.php │ ├── transport.settings.php │ └── transport.snippets.php ├── events │ └── events.versionx.php ├── resolvers │ ├── cleanup.resolver.php │ ├── composer.resolver.php │ ├── setupoptions.resolver.php │ └── tables.resolver.php ├── schema │ └── versionx.mysql.schema.xml ├── setup.options.php └── validators │ └── requirements.script.php ├── _packages ├── versionx-2.4.0-pl.transport.zip ├── versionx-3.0.0-beta1.transport.zip ├── versionx-3.0.0-beta2.transport.zip ├── versionx-3.1.1-pl.transport.zip └── versionx-3.1.2-pl.transport.zip ├── assets └── components │ └── versionx │ ├── connector.php │ ├── css │ └── mgr │ │ └── mgr.css │ └── js │ └── mgr │ ├── grid.deltas.js │ ├── grid.objects.js │ ├── index.js │ ├── versionx.class.js │ ├── widgets │ └── resources.widget.js │ ├── window.deltas.js │ └── window.milestone.js ├── config.core.sample.php ├── core └── components │ └── versionx │ ├── composer.json │ ├── composer.lock │ ├── composer.phar │ ├── controllers │ └── index.class.php │ ├── cron.php │ ├── docs │ ├── changelog.txt │ ├── license.txt │ ├── readme.txt │ └── version.inc.php │ ├── elements │ ├── plugins │ │ └── versionx.plugin.php │ └── widgets │ │ └── resources.dashboardwidget.php │ ├── lexicon │ ├── cs │ │ └── default.inc.php │ ├── da │ │ └── default.inc.php │ ├── de │ │ └── default.inc.php │ ├── en │ │ └── default.inc.php │ ├── fr │ │ └── default.inc.php │ ├── nl │ │ └── default.inc.php │ ├── ru │ │ └── default.inc.php │ └── sv │ │ └── default.inc.php │ ├── migrate.php │ ├── model │ ├── versionx.class.php │ └── versionx │ │ ├── metadata.mysql.php │ │ ├── mysql │ │ ├── vxchunk.class.php │ │ ├── vxchunk.map.inc.php │ │ ├── vxdelta.class.php │ │ ├── vxdelta.map.inc.php │ │ ├── vxdeltaeditor.class.php │ │ ├── vxdeltaeditor.map.inc.php │ │ ├── vxdeltafield.class.php │ │ ├── vxdeltafield.map.inc.php │ │ ├── vxplugin.class.php │ │ ├── vxplugin.map.inc.php │ │ ├── vxresource.class.php │ │ ├── vxresource.map.inc.php │ │ ├── vxsnippet.class.php │ │ ├── vxsnippet.map.inc.php │ │ ├── vxtemplate.class.php │ │ ├── vxtemplate.map.inc.php │ │ ├── vxtemplatevar.class.php │ │ └── vxtemplatevar.map.inc.php │ │ ├── vxchunk.class.php │ │ ├── vxdelta.class.php │ │ ├── vxdeltaeditor.class.php │ │ ├── vxdeltafield.class.php │ │ ├── vxplugin.class.php │ │ ├── vxresource.class.php │ │ ├── vxsnippet.class.php │ │ ├── vxtemplate.class.php │ │ └── vxtemplatevar.class.php │ ├── processors │ └── mgr │ │ ├── deltas │ │ ├── getlist.class.php │ │ ├── milestone.class.php │ │ ├── optimize.class.php │ │ ├── preview.class.php │ │ └── revert.class.php │ │ ├── filters │ │ ├── classes.class.php │ │ ├── editors.class.php │ │ └── packages.class.php │ │ └── objects │ │ └── getlist.class.php │ ├── src │ ├── DeltaManager.php │ ├── DeltaMerger.php │ ├── Enums │ │ └── RevertAction.php │ ├── Fields │ │ ├── Field.php │ │ ├── Image.php │ │ ├── Properties.php │ │ └── Text.php │ ├── Types │ │ ├── Chunk.php │ │ ├── Plugin.php │ │ ├── Resource.php │ │ ├── ResourcePreview.php │ │ ├── Snippet.php │ │ ├── TV.php │ │ ├── Template.php │ │ └── Type.php │ ├── Utils.php │ └── VersionX.php │ └── templates │ └── mgr │ ├── diff.tpl │ ├── fields │ └── image.tpl │ ├── tab.tpl │ └── versionx.tpl └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | config.core.php 3 | _packages/*/ 4 | core/components/versionx/vendor 5 | assets/components/versionx/node_modules 6 | -------------------------------------------------------------------------------- /_build/build.schema.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a real estate property listings component 8 | * for MODX Revolution. 9 | * 10 | * VersionX is free software; you can redistribute it and/or modify it under 11 | * the terms of the GNU General Public License as published by the Free Software 12 | * Foundation; either version 2 of the License, or (at your option) any later 13 | * version. 14 | * 15 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 17 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License along with 20 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 21 | * Suite 330, Boston, MA 02111-1307 USA 22 | * 23 | */ 24 | $mtime = microtime(); 25 | $mtime = explode(" ", $mtime); 26 | $mtime = $mtime[1] + $mtime[0]; 27 | $tstart = $mtime; 28 | set_time_limit(0); 29 | 30 | require_once dirname(dirname(__FILE__)) . '/config.core.php'; 31 | include_once MODX_CORE_PATH . 'model/modx/modx.class.php'; 32 | $modx= new modX(); 33 | $modx->initialize('mgr'); 34 | $modx->loadClass('transport.modPackageBuilder','',false, true); 35 | $modx->setLogLevel(modX::LOG_LEVEL_INFO); 36 | $modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML'); 37 | 38 | $root = dirname(dirname(__FILE__)).'/'; 39 | $sources = array( 40 | 'root' => $root, 41 | 'core' => $root.'core/components/versionx/', 42 | 'model' => $root.'core/components/versionx/model/', 43 | 'assets' => $root.'assets/components/versionx/', 44 | 'schema' => $root.'_build/schema/', 45 | ); 46 | $manager= $modx->getManager(); 47 | $generator= $manager->getGenerator(); 48 | $generator->classTemplate= << 54 | * 55 | * This file is part of VersionX, a versioning solution for MODX Revolution 56 | * 57 | * VersionX is free software; you can redistribute it and/or modify it under 58 | * the terms of the GNU General Public License as published by the Free Software 59 | * Foundation; either version 2 of the License, or (at your option) any later 60 | * version. 61 | * 62 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 63 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 64 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 65 | * 66 | * You should have received a copy of the GNU General Public License along with 67 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 68 | * Suite 330, Boston, MA 02111-1307 USA 69 | * 70 | */ 71 | class [+class+] extends [+extends+] {} 72 | ?> 73 | EOD; 74 | $generator->platformTemplate= << 80 | * 81 | * This file is part of VersionX, a versioning solution for MODX Revolution 82 | * 83 | * VersionX is free software; you can redistribute it and/or modify it under 84 | * the terms of the GNU General Public License as published by the Free Software 85 | * Foundation; either version 2 of the License, or (at your option) any later 86 | * version. 87 | * 88 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 89 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 90 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 91 | * 92 | * You should have received a copy of the GNU General Public License along with 93 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 94 | * Suite 330, Boston, MA 02111-1307 USA 95 | * 96 | */ 97 | require_once (strtr(realpath(dirname(dirname(__FILE__))), '\\\\', '/') . '/[+class-lowercase+].class.php'); 98 | class [+class+]_[+platform+] extends [+class+] {} 99 | ?> 100 | EOD; 101 | $generator->mapHeader= << 107 | * 108 | * This file is part of VersionX, a versioning solution for MODX Revolution 109 | * 110 | * VersionX is free software; you can redistribute it and/or modify it under 111 | * the terms of the GNU General Public License as published by the Free Software 112 | * Foundation; either version 2 of the License, or (at your option) any later 113 | * version. 114 | * 115 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 116 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 117 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 118 | * 119 | * You should have received a copy of the GNU General Public License along with 120 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 121 | * Suite 330, Boston, MA 02111-1307 USA 122 | * 123 | */ 124 | EOD; 125 | 126 | $generator->parseSchema($sources['schema'].'versionx.mysql.schema.xml', $sources['model']); 127 | 128 | $mtime= microtime(); 129 | $mtime= explode(" ", $mtime); 130 | $mtime= $mtime[1] + $mtime[0]; 131 | $tend= $mtime; 132 | $totalTime= ($tend - $tstart); 133 | $totalTime= sprintf("%2.4f s", $totalTime); 134 | 135 | echo "\nExecution time: {$totalTime}\n"; 136 | 137 | exit (); 138 | -------------------------------------------------------------------------------- /_build/createtables.php: -------------------------------------------------------------------------------- 1 | initialize('mgr'); 8 | $modelPath = $modx->getOption('versionx.core_path',null,$modx->getOption('core_path').'components/versionx/').'model/'; 9 | 10 | $modx->addPackage('versionx',$modelPath); 11 | 12 | $manager = $modx->getManager(); 13 | $modx->setLogLevel(modX::LOG_LEVEL_INFO); 14 | $modx->setLogTarget('HTML'); 15 | 16 | $objects = array('vxResource','vxTemplate','vxSnippet','vxChunk','vxPlugin','vxTemplateVar'); 17 | 18 | foreach ($objects as $obj) { 19 | $manager->createObjectContainer($obj); 20 | } 21 | echo 'Done'; 22 | ?> -------------------------------------------------------------------------------- /_build/data/settings.php: -------------------------------------------------------------------------------- 1 | [ 5 | 'area' => 'Custom Objects', 6 | 'value' => '', 7 | ], 8 | 'formtabs.resource' => [ 9 | 'area' => 'Form Tabs', 10 | 'value' => true, 11 | ], 12 | 'formtabs.template' => [ 13 | 'area' => 'Form Tabs', 14 | 'value' => true, 15 | ], 16 | 'formtabs.templatevariables' => [ 17 | 'area' => 'Form Tabs', 18 | 'value' => true, 19 | ], 20 | 'formtabs.chunk' => [ 21 | 'area' => 'Form Tabs', 22 | 'value' => true, 23 | ], 24 | 'formtabs.snippet' => [ 25 | 'area' => 'Form Tabs', 26 | 'value' => true, 27 | ], 28 | 'formtabs.plugin' => [ 29 | 'area' => 'Form Tabs', 30 | 'value' => true, 31 | ], 32 | 'enable.resources' => [ 33 | 'area' => 'Enable', 34 | 'value' => true, 35 | ], 36 | 'enable.templates' => [ 37 | 'area' => 'Enable', 38 | 'value' => true, 39 | ], 40 | 'enable.templatevariables' => [ 41 | 'area' => 'Enable', 42 | 'value' => true, 43 | ], 44 | 'enable.chunks' => [ 45 | 'area' => 'Enable', 46 | 'value' => true, 47 | ], 48 | 'enable.snippets' => [ 49 | 'area' => 'Enable', 50 | 'value' => true, 51 | ], 52 | 'enable.plugins' => [ 53 | 'area' => 'Enable', 54 | 'value' => true, 55 | ], 56 | ]; -------------------------------------------------------------------------------- /_build/data/transport.dashboardwidgets.php: -------------------------------------------------------------------------------- 1 | newObject('modDashboardWidget'); 14 | $widgets[0]->fromArray([ 15 | 'name' => 'versionx.widget.resources', 16 | 'description' => 'versionx.widget.resources.desc', 17 | 'type' => 'file', 18 | 'size' => 'half', 19 | 'content' => $basePath . 'components/versionx/elements/widgets/resources.dashboardwidget.php', 20 | 'namespace' => 'versionx', 21 | 'lexicon' => 'versionx:default', 22 | ], '', true, true); 23 | 24 | return $widgets; -------------------------------------------------------------------------------- /_build/data/transport.menus.php: -------------------------------------------------------------------------------- 1 | newObject('modMenu'); 9 | $menu->fromArray([ 10 | 'text' => 'versionx', 11 | 'description' => 'versionx.menu_desc', 12 | 'parent' => 'components', 13 | 'namespace' => 'versionx', 14 | 'action' => 'index', 15 | ], '', true, true); 16 | 17 | $vehicle = $builder->createVehicle($menu, [ 18 | xPDOTransport::PRESERVE_KEYS => true, 19 | xPDOTransport::UPDATE_OBJECT => true, 20 | xPDOTransport::UNIQUE_KEY => 'text', 21 | ]); 22 | $builder->putVehicle($vehicle); 23 | unset($vehicle, $childActions, $action, $menu); -------------------------------------------------------------------------------- /_build/data/transport.plugins.php: -------------------------------------------------------------------------------- 1 | newObject('modPlugin'); 12 | $plugins[0]->set('id', 1); 13 | $plugins[0]->set('name', 'VersionX'); 14 | $plugins[0]->set('description', 'The plugin that enables VersionX of tracking your content.'); 15 | $plugins[0]->set('plugincode', getSnippetContent($sources['plugins'] . 'versionx.plugin.php')); 16 | $plugins[0]->set('category', 0); 17 | 18 | $events = include $sources['events'] . 'events.versionx.php'; 19 | if (is_array($events) && !empty($events)) { 20 | $plugins[0]->addMany($events); 21 | $modx->log(xPDO::LOG_LEVEL_INFO, 'Packaged in '.count($events).' Plugin Events for VersionX.'); 22 | flush(); 23 | } else { 24 | $modx->log(xPDO::LOG_LEVEL_ERROR, 'Could not find plugin events for VersionX!'); 25 | } 26 | unset($events); 27 | 28 | return $plugins; 29 | 30 | ?> -------------------------------------------------------------------------------- /_build/data/transport.settings.php: -------------------------------------------------------------------------------- 1 | $options) { 11 | $val = $options['value']; 12 | 13 | if (isset($options['xtype'])) { 14 | $xtype = $options['xtype']; 15 | } elseif (is_int($val)) { 16 | $xtype = 'numberfield'; 17 | } elseif (is_bool($val)) { 18 | $xtype = 'modx-combo-boolean'; 19 | } else { 20 | $xtype = 'textfield'; 21 | } 22 | 23 | $settings[$key] = $modx->newObject('modSystemSetting'); 24 | $settings[$key]->fromArray([ 25 | 'key' => 'versionx.' . $key, 26 | 'xtype' => $xtype, 27 | 'value' => $options['value'], 28 | 'namespace' => 'versionx', 29 | 'area' => $options['area'], 30 | 'editedon' => time(), 31 | ], '', true, true); 32 | } 33 | 34 | return $settings; 35 | 36 | 37 | -------------------------------------------------------------------------------- /_build/data/transport.snippets.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a real estate property listings component 8 | * for MODX Revolution. 9 | * 10 | * VersionX is free software; you can redistribute it and/or modify it under 11 | * the terms of the GNU General Public License as published by the Free Software 12 | * Foundation; either version 2 of the License, or (at your option) any later 13 | * version. 14 | * 15 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 17 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License along with 20 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 21 | * Suite 330, Boston, MA 02111-1307 USA 22 | * 23 | */ 24 | 25 | ?> 26 | -------------------------------------------------------------------------------- /_build/events/events.versionx.php: -------------------------------------------------------------------------------- 1 | newObject('modPluginEvent'); 27 | $events[$ev]->fromArray([ 28 | 'event' => $ev, 29 | // Lower priority to make sure other plugins do their processing first. 30 | 'priority' => 10, 31 | 'propertyset' => 0, 32 | ], '', true, true); 33 | } 34 | 35 | return $events; 36 | 37 | 38 | -------------------------------------------------------------------------------- /_build/resolvers/cleanup.resolver.php: -------------------------------------------------------------------------------- 1 | xpdo) { 8 | switch ($options[xPDOTransport::PACKAGE_ACTION]) { 9 | case xPDOTransport::ACTION_INSTALL: 10 | case xPDOTransport::ACTION_UPGRADE: 11 | $files = [ 12 | MODX_CORE_PATH . 'components/versionx/processors/mgr/chunks/get_versions.php', 13 | MODX_CORE_PATH . 'components/versionx/processors/mgr/chunks/getlist.php', 14 | MODX_CORE_PATH . 'components/versionx/processors/mgr/chunks/revert.php', 15 | MODX_CORE_PATH . 'components/versionx/processors/mgr/plugins/get_versions.php', 16 | MODX_CORE_PATH . 'components/versionx/processors/mgr/plugins/getlist.php', 17 | MODX_CORE_PATH . 'components/versionx/processors/mgr/plugins/revert.php', 18 | MODX_CORE_PATH . 'components/versionx/processors/mgr/resources/get_versions.php', 19 | MODX_CORE_PATH . 'components/versionx/processors/mgr/resources/getlist.php', 20 | MODX_CORE_PATH . 'components/versionx/processors/mgr/resources/revert.php', 21 | MODX_CORE_PATH . 'components/versionx/processors/mgr/snippets/get_versions.php', 22 | MODX_CORE_PATH . 'components/versionx/processors/mgr/snippets/getlist.php', 23 | MODX_CORE_PATH . 'components/versionx/processors/mgr/snippets/revert.php', 24 | MODX_CORE_PATH . 'components/versionx/processors/mgr/templates/get_versions.php', 25 | MODX_CORE_PATH . 'components/versionx/processors/mgr/templates/getlist.php', 26 | MODX_CORE_PATH . 'components/versionx/processors/mgr/templates/revert.php', 27 | MODX_CORE_PATH . 'components/versionx/processors/mgr/templatevars/get_versions.php', 28 | MODX_CORE_PATH . 'components/versionx/processors/mgr/templatevars/getlist.php', 29 | MODX_CORE_PATH . 'components/versionx/processors/mgr/templatevars/revert.php', 30 | ]; 31 | 32 | foreach ($files as $file) { 33 | if (file_exists($file)) { 34 | is_dir($file) ? rmdir($file) : unlink($file); 35 | } 36 | } 37 | 38 | break; 39 | case xPDOTransport::ACTION_UNINSTALL: 40 | break; 41 | } 42 | } 43 | return true; 44 | -------------------------------------------------------------------------------- /_build/resolvers/composer.resolver.php: -------------------------------------------------------------------------------- 1 | xpdo) { 16 | return false; 17 | } 18 | 19 | $modx = $transport->xpdo; 20 | 21 | // Only run on install and upgrade 22 | if (!in_array($options[xPDOTransport::PACKAGE_ACTION], [xPDOTransport::ACTION_INSTALL, xPDOTransport::ACTION_UPGRADE], true)) { 23 | return true; 24 | } 25 | 26 | $modx->log(modX::LOG_LEVEL_INFO, 'Installing/updating dependencies, this may take some time...'); 27 | 28 | $path = MODX_CORE_PATH . 'components/versionx/'; 29 | // Tell composer where to look 30 | putenv("COMPOSER={$path}composer.json"); 31 | putenv("COMPOSER_HOME={$path}.composer"); 32 | putenv("COMPOSER_VENDOR_DIR={$path}vendor/"); 33 | // And make PHP think we're in a different path too, to prevent autoloading namespaces relative to where composer is executed breaking 34 | chdir($path); 35 | 36 | require "phar://{$path}composer.phar/vendor/autoload.php"; 37 | 38 | $io = new BufferIO('', StreamOutput::VERBOSITY_NORMAL, new HtmlOutputFormatter()); 39 | $composer = Factory::create($io); 40 | $install = Installer::create($io, $composer); 41 | $install 42 | ->setPreferDist(true) 43 | ->setDevMode(false) 44 | ->setOptimizeAutoloader(true) 45 | ->setUpdate(false) 46 | ->setPreferStable(true); 47 | 48 | $success = true; 49 | try { 50 | $install->run(); 51 | } catch (Exception $e) { 52 | $success = false; 53 | $modx->log(modX::LOG_LEVEL_ERROR, get_class($e) . ' installing dependencies: ' . $e->getMessage()); 54 | echo get_class($e) . ': ' . $e->getMessage() . "\n"; 55 | } 56 | 57 | $output = $io->getOutput(); 58 | $output = nl2br(trim($output)); 59 | $modx->log(modX::LOG_LEVEL_INFO, $output); 60 | 61 | return $success; 62 | -------------------------------------------------------------------------------- /_build/resolvers/setupoptions.resolver.php: -------------------------------------------------------------------------------- 1 | xpdo)) { 18 | $modx = $object->xpdo; 19 | } 20 | if (!isset($modx)) { 21 | $options = [ 22 | 'vx_snapshot_resources' => true, 23 | 'vx_snapshot_templates' => true, 24 | 'vx_snapshot_chunks' => true, 25 | 'vx_snapshot_snippets' => true, 26 | 'vx_snapshot_plugins' => true, 27 | 'vx_snapshot_tmplvars' => true, 28 | ]; 29 | } 30 | 31 | switch ($options[xPDOTransport::PACKAGE_ACTION]) { 32 | case xPDOTransport::ACTION_UPGRADE: 33 | case xPDOTransport::ACTION_INSTALL: 34 | @set_time_limit(0); 35 | 36 | /* @var VersionX $versionX */ 37 | $path = MODX_CORE_PATH . 'components/versionx/'; 38 | 39 | require_once $path . '/vendor/autoload.php'; 40 | $versionX = new VersionX($modx); 41 | 42 | $modx->log(modX::LOG_LEVEL_INFO,'Starting snapshot process for selected objects...'); 43 | 44 | if (!empty($options['vx_snapshot_resources'])) { 45 | createInitialDelta($versionX, modResource::class, new Resource($versionX), 'Resource'); 46 | } 47 | 48 | if (!empty($options['vx_snapshot_templates'])) { 49 | createInitialDelta($versionX, modTemplate::class, new Template($versionX), 'Template'); 50 | } 51 | 52 | if (!empty($options['vx_snapshot_chunks'])) { 53 | createInitialDelta($versionX, modChunk::class, new Chunk($versionX), 'Chunk'); 54 | } 55 | 56 | if (!empty($options['vx_snapshot_snippets'])) { 57 | createInitialDelta($versionX, modSnippet::class, new Snippet($versionX), 'Snippet'); 58 | } 59 | 60 | if (!empty($options['vx_snapshot_plugins'])) { 61 | createInitialDelta($versionX, modPlugin::class, new Plugin($versionX),'Plugin'); 62 | } 63 | 64 | if (!empty($options['vx_snapshot_tmplvars'])) { 65 | createInitialDelta($versionX, modTemplateVar::class, new TV($versionX), 'TV'); 66 | } 67 | 68 | break; 69 | } 70 | 71 | /** 72 | * Attempts to create an initial delta for each object of the given type (resource, snippet etc.) 73 | * If a delta already exists from a previous install, skip and continue. 74 | * 75 | * @param VersionX $versionX 76 | * @param string $class 77 | * @param Type $type 78 | * @param string $name 79 | * @return void 80 | */ 81 | function createInitialDelta(VersionX $versionX, string $class, Type $type, string $name): void 82 | { 83 | global $modx; 84 | 85 | $modx->log(modX::LOG_LEVEL_INFO,"Iterating over {$name}s and creating initial deltas.."); 86 | 87 | $count = 0; 88 | foreach ($modx->getIterator($class) as $object) { 89 | // Only create a delta if none currently exist for the given object 90 | if (!$modx->getObject(vxDelta::class, [ 91 | 'principal_package' => 'core', 92 | 'principal_class' => $class, 93 | 'principal' => $object->get('id'), 94 | ])) { 95 | // Create an initial delta for this object 96 | if (!$versionX->deltas()->createDelta($object->get('id'), $type)) { 97 | $modx->log(modX::LOG_LEVEL_WARN,"Error creating snapshot for {$name} {$object->get('id')}"); 98 | continue; 99 | } 100 | } 101 | 102 | // Add to count if a delta was created or one already exists 103 | $count++; 104 | 105 | if (is_int($count / 25)) { 106 | $modx->log(modX::LOG_LEVEL_INFO,"Checked {$count} {$name}s so far."); 107 | } 108 | } 109 | 110 | $modx->log(modX::LOG_LEVEL_WARN,"Iterated over {$count} {$name}s."); 111 | } 112 | 113 | return true; 114 | -------------------------------------------------------------------------------- /_build/resolvers/tables.resolver.php: -------------------------------------------------------------------------------- 1 | xpdo) { 9 | switch ($options[xPDOTransport::PACKAGE_ACTION]) { 10 | case xPDOTransport::ACTION_UPGRADE: 11 | case xPDOTransport::ACTION_INSTALL: 12 | $modx = $object->xpdo; 13 | 14 | $modelPath = $modx->getOption( 15 | 'versionx.core_path', 16 | null, 17 | $modx->getOption('core_path') . 'components/versionx/' 18 | ) . 'model/'; 19 | 20 | $modx->addPackage('versionx', $modelPath); 21 | $manager = $modx->getManager(); 22 | $loglevel = $modx->setLogLevel(modx::LOG_LEVEL_ERROR); 23 | 24 | $objects = [ 25 | 'vxDelta', 26 | 'vxDeltaField', 27 | 'vxDeltaEditor', 28 | ]; 29 | foreach ($objects as $obj) { 30 | $manager->createObjectContainer($obj); 31 | } 32 | 33 | // Set to fatal errors only while updating database, to avoid false positives displayed. 34 | $modx->setLogLevel(modX::LOG_LEVEL_FATAL); 35 | 36 | // VersionX 3.1.3 37 | // These fields are added to keep track of data types to be used when reverting 38 | $manager->addField('vxDeltaField', 'before_type', ['after' => 'field_type']); 39 | $manager->addField('vxDeltaField', 'after_type', ['after' => 'before_type']); 40 | 41 | $modx->setLogLevel($loglevel); 42 | 43 | break; 44 | } 45 | 46 | } 47 | return true; 48 | 49 | -------------------------------------------------------------------------------- /_build/setup.options.php: -------------------------------------------------------------------------------- 1 | 9 | .versionx-header { 10 | display: flex; 11 | align-items: center; 12 | gap: 8px; 13 | margin-top: -30px; 14 | } 15 | .versionx-header .version { 16 | position: relative; 17 | bottom: 15px; 18 | right: 5px; 19 | color: #fff; 20 | background: #ff9640 !important; 21 | border-radius: 50%; 22 | width: 25px; 23 | height: 25px; 24 | text-align: center; 25 | vertical-align: center; 26 | line-height: 24px; 27 | font-size: 20px; 28 | box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.15); 29 | } 30 | 31 |
32 |

VersionX

33 |
3
34 |
35 |

Resource and element versioning for MODX

36 |
37 |

Migrating from version 2.x

38 |

VersionX 3 is a complete rewrite from version 2 and a command line migration script is included to migrate your data to the new version. After installing, from the command line, run:

php core/components/versionx/migrate.php

39 |
40 |

If you already have resources and elements in place, you can let the setup process create a snapshot of them to the VersionX tables, providing you with a baseline to start comparing from. The system will check for existing versions and only create a snapshot when needed.

41 |
42 |

Note: depending on the amount of resources and elements you currently have in place as well as your server's configuration, this process can take quite some time.

43 |
44 |

Choose what to create snapshots for:

45 |
46 | 47 |
48 | 49 |
50 | 51 |
52 | 53 |
54 | 55 |
56 | 57 | 58 |
59 | 60 |

If you found VersionX useful, please consider making a donation to support its development. Thank you!

61 | 62 | HTML; 63 | break; 64 | default: 65 | case xPDOTransport::ACTION_UNINSTALL: 66 | $output = ''; 67 | break; 68 | } 69 | 70 | return $output; 71 | -------------------------------------------------------------------------------- /_build/validators/requirements.script.php: -------------------------------------------------------------------------------- 1 | xpdo; 4 | 5 | if (!function_exists('checkVersion')) { 6 | /** 7 | * @param string $description 8 | * @param string $current 9 | * @param array $definition 10 | * @param modX $modx 11 | * @return bool 12 | */ 13 | function checkVersion($description, $current, array $definition, $modx) 14 | { 15 | $pass = true; 16 | $passGlyph = '✔'; 17 | $failGlyph = '×'; 18 | $warnGlyph = '⚠'; 19 | 20 | // Determine the minimum version (the one that we require today) and the recommended version (the version we'll 21 | // start requiring in 9 months from now). 22 | $realMinimum = false; 23 | $recommended = false; 24 | $recommendedDate = false; 25 | foreach ($definition as $date => $minVersion) { 26 | $date = strtotime($date); 27 | if ($date <= time()) { 28 | $realMinimum = $minVersion; 29 | } 30 | if ($date <= time() + (60 * 60 * 24 * 270)) { 31 | $recommended = $minVersion; 32 | $recommendedDate = $date; 33 | } 34 | } 35 | 36 | if ($realMinimum) { 37 | $level = xPDO::LOG_LEVEL_INFO; 38 | $glyph = $passGlyph; 39 | $checkMinimumVersion = $realMinimum; 40 | if (substr_count($realMinimum, '.') < 2) { 41 | $checkMinimumVersion .= '.0-dev'; 42 | } 43 | if (version_compare($current, $checkMinimumVersion) <= 0) { 44 | $level = xPDO::LOG_LEVEL_ERROR; 45 | $pass = false; 46 | $glyph = $failGlyph; 47 | } 48 | $modx->log($level, "- {$description} {$realMinimum}+ (minimum): {$glyph} {$current}"); 49 | } 50 | if ($pass && $recommended && $recommended !== $realMinimum) { 51 | $level = xPDO::LOG_LEVEL_INFO; 52 | $glyph = $passGlyph; 53 | $checkRecommendedVersion = $recommended; 54 | if (substr_count($realMinimum, '.') < 2) { 55 | $checkRecommendedVersion .= '.0-dev'; 56 | } 57 | if (version_compare($current, $checkRecommendedVersion) <= 0) { 58 | $level = xPDO::LOG_LEVEL_WARN; 59 | $glyph = $warnGlyph; 60 | } 61 | $recommendedDateFormatted = date('Y-m-d', $recommendedDate); 62 | $modx->log($level, "- {$description} {$recommended}+ (minimum per {$recommendedDateFormatted}): {$glyph} {$current}"); 63 | } 64 | 65 | return $pass; 66 | } 67 | } 68 | $success = false; 69 | switch($options[xPDOTransport::PACKAGE_ACTION]) { 70 | case xPDOTransport::ACTION_INSTALL: 71 | case xPDOTransport::ACTION_UPGRADE: 72 | $success = true; 73 | $modx->log(xPDO::LOG_LEVEL_INFO, 'Checking if the minimum requirements are met...'); 74 | 75 | $modxVersion = $modx->getVersionData(); 76 | if (!checkVersion('MODX', $modxVersion['full_version'], [ 77 | '2019-11-27 12:00:00' => '2.7', 78 | ], $modx)) { 79 | $success = false; 80 | } 81 | 82 | if (!checkVersion('PHP', PHP_VERSION, [ 83 | '2022-12-06 12:00:00' => '7.4', 84 | ], $modx)) { 85 | $success = false; 86 | } 87 | 88 | if ($success) { 89 | $modx->log(xPDO::LOG_LEVEL_INFO, 'Minimum requirements look good!'); 90 | 91 | // Check for EOL PHP versions 92 | $modx->log(xPDO::LOG_LEVEL_INFO, 'Checking (optional) recommended versions...'); 93 | checkVersion('PHP', PHP_VERSION, [ 94 | '2022-12-06 12:00:00' => '8.0', 95 | '2023-12-06 12:00:00' => '8.1', 96 | '2024-12-06 12:00:00' => '8.2', 97 | ], $modx); 98 | } 99 | else { 100 | $modx->log(xPDO::LOG_LEVEL_ERROR, 'Your server or MODX installation does not meet the minimum requirements for this extra. Installation cannot continue.'); 101 | } 102 | 103 | break; 104 | case xPDOTransport::ACTION_UNINSTALL: 105 | $success = true; 106 | break; 107 | } 108 | return $success; -------------------------------------------------------------------------------- /_packages/versionx-2.4.0-pl.transport.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modmore/VersionX/dbba7be991a8c61b66a1052f3ecd5ded05eafb5c/_packages/versionx-2.4.0-pl.transport.zip -------------------------------------------------------------------------------- /_packages/versionx-3.0.0-beta1.transport.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modmore/VersionX/dbba7be991a8c61b66a1052f3ecd5ded05eafb5c/_packages/versionx-3.0.0-beta1.transport.zip -------------------------------------------------------------------------------- /_packages/versionx-3.0.0-beta2.transport.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modmore/VersionX/dbba7be991a8c61b66a1052f3ecd5ded05eafb5c/_packages/versionx-3.0.0-beta2.transport.zip -------------------------------------------------------------------------------- /_packages/versionx-3.1.1-pl.transport.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modmore/VersionX/dbba7be991a8c61b66a1052f3ecd5ded05eafb5c/_packages/versionx-3.1.1-pl.transport.zip -------------------------------------------------------------------------------- /_packages/versionx-3.1.2-pl.transport.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modmore/VersionX/dbba7be991a8c61b66a1052f3ecd5ded05eafb5c/_packages/versionx-3.1.2-pl.transport.zip -------------------------------------------------------------------------------- /assets/components/versionx/connector.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * VersionX is free software; you can redistribute it and/or modify it under the 8 | * terms of the GNU General Public License as published by the Free Software 9 | * Foundation; either version 2 of the License, or (at your option) any later 10 | * version. 11 | * 12 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 13 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 14 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple 18 | * Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * @package versionx 21 | */ 22 | 23 | require_once dirname(dirname(dirname(__DIR__))).'/config.core.php'; 24 | require_once MODX_CORE_PATH.'config/'.MODX_CONFIG_KEY.'.inc.php'; 25 | require_once MODX_CONNECTORS_PATH.'index.php'; 26 | 27 | $corePath = $modx->getOption('versionx.core_path',null,$modx->getOption('core_path').'components/versionx/'); 28 | require_once $corePath.'model/versionx.class.php'; 29 | $modx->versionx = new VersionX($modx); 30 | 31 | $modx->lexicon->load('versionx:default'); 32 | 33 | /* handle request */ 34 | $path = $modx->getOption('processorsPath',$modx->versionx->config,$corePath.'processors/'); 35 | $modx->request->handleRequest(array( 36 | 'processors_path' => $path, 37 | 'location' => '', 38 | )); -------------------------------------------------------------------------------- /assets/components/versionx/js/mgr/grid.objects.js: -------------------------------------------------------------------------------- 1 | VersionX.grid.Objects = function(config) { 2 | config = config || {}; 3 | Ext.applyIf(config,{ 4 | url: VersionX.config.connector_url, 5 | id: 'versionx-grid-objects', 6 | cls: 'versionx-grid-objects', 7 | bodyCssClass: 'versionx-grid-objects-body', 8 | baseParams: { 9 | action: 'mgr/objects/getlist', 10 | }, 11 | fields: [ 12 | {name: 'id', type: 'int'}, 13 | {name: 'principal_package', type: 'string'}, 14 | {name: 'principal_class', type: 'string'}, 15 | {name: 'principal', type: 'int'}, 16 | {name: 'type', type: 'string'}, 17 | {name: 'time_start', type: 'string'}, 18 | {name: 'time_end', type: 'string'}, 19 | {name: 'user_id', type: 'int'}, 20 | {name: 'username', type: 'string'}, 21 | {name: 'name', type: 'string'}, 22 | ], 23 | paging: true, 24 | pageSize: 20, 25 | remoteSort: true, 26 | actionsColumnWidth: 5, 27 | filters: ['query', 'date_from', 'date_to', 'class', 'editor', 'package'], 28 | columns: this.getColumns(), 29 | tbar: [{ 30 | xtype: 'versionx-field-search', 31 | emptyText: _('versionx.filters.search_by_name'), 32 | grid: this, 33 | },'->',{ 34 | xtype: 'versionx-combo-classes', 35 | showClearFilter: true, 36 | width: 110, 37 | listeners: { 38 | select: { 39 | fn: this.filter, 40 | scope: this 41 | }, 42 | }, 43 | },{ 44 | xtype: 'versionx-combo-editors', 45 | showClearFilter: true, 46 | width: 110, 47 | listeners: { 48 | select: { 49 | fn: this.filter, 50 | scope: this 51 | }, 52 | }, 53 | },{ 54 | xtype: 'versionx-combo-packages', 55 | showClearFilter: true, 56 | width: 110, 57 | listeners: { 58 | select: { 59 | fn: this.filter, 60 | scope: this 61 | }, 62 | }, 63 | },{ 64 | xtype: 'datefield', 65 | name: 'date_from', 66 | emptyText: _('versionx.filters.date_from'), 67 | format: 'Y-m-d', 68 | width: 120, 69 | listeners: { 70 | select: { 71 | fn: this.filter, 72 | scope: this 73 | }, 74 | }, 75 | },{ 76 | xtype: 'datefield', 77 | name: 'date_to', 78 | emptyText: _('versionx.filters.date_to'), 79 | format: 'Y-m-d', 80 | width: 120, 81 | listeners: { 82 | select: { 83 | fn: this.filter, 84 | scope: this 85 | }, 86 | }, 87 | },{ 88 | text: '', 89 | handler: this.clearFilters, 90 | }] 91 | }); 92 | VersionX.grid.Objects.superclass.constructor.call(this,config); 93 | this.config = config; 94 | this.getView().getRowClass = function(record, index, rowParams, store) { 95 | return 'versionx-row'; 96 | }; 97 | }; 98 | Ext.extend(VersionX.grid.Objects, MODx.grid.Grid, { 99 | getColumns: function() { 100 | return [{ 101 | header: _('versionx.objects.delta'), 102 | dataIndex: 'id', 103 | hidden: true 104 | },{ 105 | header: _('versionx.objects.when'), 106 | dataIndex: 'time_end', 107 | width: 15, 108 | sortable: true, 109 | renderer: this.renderWhen 110 | },{ 111 | header: _('versionx.objects.name'), 112 | dataIndex: 'name', 113 | width: 20, 114 | sortable: true, 115 | renderer: this.renderName 116 | },{ 117 | header: _('versionx.objects.class'), 118 | dataIndex: 'principal_class', 119 | width: 20, 120 | sortable: true, 121 | },{ 122 | header: _('versionx.objects.id'), 123 | dataIndex: 'principal', 124 | width: 10, 125 | sortable: true, 126 | },{ 127 | header: _('versionx.objects.package'), 128 | dataIndex: 'principal_package', 129 | width: 10, 130 | sortable: true, 131 | },{ 132 | header: _('versionx.objects.editor'), 133 | dataIndex: 'username', 134 | width: 20, 135 | sortable: true, 136 | }]; 137 | }, 138 | filter: function (tf, nv, ov) { 139 | var value = tf.getValue(); 140 | if (tf.xtype === 'datefield' && typeof value === 'object') { 141 | value = Ext.util.Format.date(value, 'Y-m-d'); 142 | } 143 | this.getStore().baseParams[tf.name] = value; 144 | this.getBottomToolbar().changePage(1); 145 | }, 146 | clearFilters: function() { 147 | var grid = this, 148 | s = this.getStore(); 149 | this.config.filters.forEach(function(filter) { 150 | grid.getTopToolbar().find('name', filter)[0].reset(); 151 | s.baseParams[filter] = ''; 152 | }); 153 | this.getBottomToolbar().changePage(1); 154 | }, 155 | getMenu: function() { 156 | var m = []; 157 | m.push({ 158 | text: _('versionx.objects.view_details'), 159 | handler: this.viewDetails 160 | }); 161 | return m; 162 | }, 163 | viewDetails: function(v, e) { 164 | if (this.viewDetailsWindow) { 165 | this.viewDetailsWindow.destroy(); 166 | } 167 | 168 | this.viewDetailsWindow = MODx.load({ 169 | xtype: 'versionx-window-deltas', 170 | record: this.menu.record, 171 | listeners: { 172 | 'success': {fn: this.refresh, scope: this} 173 | } 174 | }); 175 | this.viewDetailsWindow.show(e.target); 176 | }, 177 | renderWhen: function(v, m, r) { 178 | let bits = v.split(' '); 179 | return `
${bits[0]}
${bits[1]}
`; 180 | }, 181 | renderName: function(v, m, r) { 182 | return `
${v}
`; 183 | } 184 | }); 185 | Ext.reg('versionx-grid-objects', VersionX.grid.Objects); -------------------------------------------------------------------------------- /assets/components/versionx/js/mgr/index.js: -------------------------------------------------------------------------------- 1 | Ext.onReady(function() { 2 | MODx.load({ 3 | xtype: 'versionx-page-home', 4 | renderTo: 'versionx' 5 | }); 6 | }); 7 | 8 | VersionX.panel.Home = function(config) { 9 | config = config || {}; 10 | Ext.applyIf(config, { 11 | id: 'versionx-panel-home', 12 | cls: 'container', 13 | layout: 'anchor', 14 | items: [{ 15 | html: ` 16 |
17 |

${_('versionx')}

18 |
19 |

${_('versionx.description')}

20 | `, 21 | cls: 'modx-page-header', 22 | },{ 23 | xtype: 'versionx-grid-objects', 24 | cls: 'main-wrapper', 25 | }] 26 | }); 27 | VersionX.panel.Home.superclass.constructor.call(this, config); 28 | }; 29 | Ext.extend(VersionX.panel.Home, MODx.Panel); 30 | Ext.reg('versionx-panel-home', VersionX.panel.Home); 31 | 32 | VersionX.page.Home = function(config) { 33 | config = config || {}; 34 | Ext.applyIf(config,{ 35 | border: false, 36 | id : 'versionx-page-wrapper', 37 | components: [{ 38 | cls: 'container', 39 | xtype: 'versionx-panel-home' 40 | }], 41 | buttons: this.getButtons(config) 42 | }); 43 | VersionX.page.Home.superclass.constructor.call(this,config); 44 | }; 45 | Ext.extend(VersionX.page.Home, MODx.Component,{ 46 | getButtons: function() { 47 | var buttons = [{ 48 | text: `  ${_('versionx.optimize_storage')}`, 49 | handler: this.optimizeStorage, 50 | cls: 'primary-button', 51 | scope: this, 52 | },{ 53 | text: _('help_ex'), 54 | handler: this.loadHelpPane, 55 | scope: this, 56 | id: 'modx-abtn-help' 57 | }]; 58 | 59 | if (!VersionX.config.has_donated) { 60 | buttons.push([{ 61 | text: _('versionx.donate'), 62 | handler: this.donate, 63 | scope: this 64 | }]); 65 | } 66 | 67 | return buttons; 68 | }, 69 | 70 | loadHelpPane: function() { 71 | MODx.config.help_url = 'https://docs.modx.com/3.x/en/extras/versionx/index#usage-features?embed=1'; 72 | MODx.loadHelpPane(); 73 | }, 74 | 75 | donate: function() { 76 | window.open('https://modmore.com/extras/versionx/donate/'); 77 | }, 78 | 79 | optimizeStorage: function(btn, e) { 80 | MODx.msg.confirm({ 81 | title: `  ${_('versionx.optimize_storage')}`, 82 | text: `

${_('versionx.optimize_storage.confirm_text')}


83 |

84 | ${_('versionx.optimize_storage.confirm_text2')} 85 |

`, 86 | url: VersionX.config.connector_url, 87 | params: { 88 | action: 'mgr/deltas/optimize', 89 | }, 90 | listeners: { 91 | 'success': {fn: function(r) { 92 | MODx.msg.status({ 93 | title: _('success') 94 | ,message: r.message || _('versionx.optimize_storage.successful') 95 | }); 96 | }, scope:this} 97 | }, 98 | }); 99 | } 100 | }); 101 | Ext.reg('versionx-page-home', VersionX.page.Home); -------------------------------------------------------------------------------- /assets/components/versionx/js/mgr/versionx.class.js: -------------------------------------------------------------------------------- 1 | var VersionX = function (config) { 2 | config = config || {}; 3 | VersionX.superclass.constructor.call(this, config); 4 | }; 5 | Ext.extend(VersionX, Ext.Component, { 6 | page: {}, 7 | window: {}, 8 | grid: {}, 9 | tree: {}, 10 | panel: {}, 11 | combo: {}, 12 | field: {}, 13 | config: {}, 14 | stats: {}, 15 | inVersion: false, 16 | }); 17 | Ext.reg('versionx', VersionX); 18 | VersionX = new VersionX(); 19 | 20 | VersionX.panel.VersionHeader = function (config) { 21 | config = config || {}; 22 | config.title = config.title || 'New Section'; 23 | Ext.apply(config, { 24 | border: false, 25 | forceLayout: true, 26 | items: [{ 27 | html: '

' + config.title + '

' 28 | }] 29 | }); 30 | VersionX.panel.VersionHeader.superclass.constructor.call(this, config); 31 | }; 32 | Ext.extend(VersionX.panel.VersionHeader, MODx.Panel); 33 | Ext.reg('versionx-panel-versionheader', VersionX.panel.VersionHeader); 34 | 35 | /** 36 | * @param config 37 | * @constructor 38 | */ 39 | VersionX.field.Search = function(config) { 40 | config = config || {}; 41 | var grid = config.grid || null 42 | 43 | Ext.applyIf(config, { 44 | xtype: 'trigger', 45 | name: 'query', 46 | emptyText: _('versionx.search'), 47 | width: 250, 48 | ctCls: 'versionx-search', 49 | onTriggerClick: function() { 50 | this.reset(); 51 | this.fireEvent('click'); 52 | }, 53 | listeners: { 54 | 'render': { 55 | fn: function(cmp) { 56 | new Ext.KeyMap(cmp.getEl(), { 57 | key: Ext.EventObject.ENTER, 58 | fn: function() { 59 | grid.filter(this); 60 | return true; 61 | }, 62 | scope: cmp 63 | }); 64 | }, 65 | scope:grid, 66 | }, 67 | 'click': { 68 | fn: function(trigger) { 69 | grid.getStore().setBaseParam('query', ''); 70 | grid.getStore().load(); 71 | }, 72 | scope: grid, 73 | } 74 | } 75 | }); 76 | VersionX.field.Search.superclass.constructor.call(this,config); 77 | }; 78 | Ext.extend(VersionX.field.Search, Ext.form.TriggerField); 79 | Ext.reg('versionx-field-search', VersionX.field.Search); 80 | 81 | VersionX.combo.Filter = function(config) { 82 | Ext.applyIf(config, { 83 | url: VersionX.config.connector_url, 84 | showClearFilter: config.showClearFilter || 0, 85 | paging: false, 86 | editable: true, 87 | typeAhead: false, 88 | }); 89 | VersionX.combo.Filter.superclass.constructor.call(this, config); 90 | var combo = this; 91 | this.on('beforeselect', function(combo, rec, index) { 92 | if (rec.data.id === 'clr' || rec.data[combo.valueField] === 'clr') { 93 | combo.clearValue(); 94 | rec.data = {}; 95 | } 96 | }); 97 | this.getStore().on('load', function(store, rec, opts) { 98 | if (combo.showClearFilter) { 99 | combo.insertRecord(store, 0, _('versionx.filters.clear_filter'), 'clr'); 100 | } 101 | }); 102 | }; 103 | Ext.extend(VersionX.combo.Filter, MODx.combo.ComboBox, { 104 | insertRecord: function(store, index, label, val) { 105 | var data = [], 106 | displayField = this.displayField || 'name', 107 | record = {id: val}; 108 | record[displayField] = label; 109 | data.push(new Ext.data.Record(record)); 110 | store.insert(index, data); 111 | } 112 | }); 113 | Ext.reg('versionx-combo-filter', VersionX.combo.Filter); 114 | 115 | VersionX.combo.Classes = function(config) { 116 | config = config || {}; 117 | Ext.applyIf(config, { 118 | name: 'class', 119 | displayField: 'name', 120 | valueField: 'id', 121 | hiddenName: 'class', 122 | fields: ['id', 'name'], 123 | baseParams: { 124 | action: 'mgr/filters/classes', 125 | combo: true, 126 | limit: '0', 127 | }, 128 | emptyText: _('versionx.filters.class'), 129 | }); 130 | VersionX.combo.Classes.superclass.constructor.call(this, config); 131 | }; 132 | Ext.extend(VersionX.combo.Classes, VersionX.combo.Filter); 133 | Ext.reg('versionx-combo-classes', VersionX.combo.Classes); 134 | 135 | VersionX.combo.Editors = function(config) { 136 | config = config || {}; 137 | Ext.applyIf(config, { 138 | name: 'editor', 139 | displayField: 'name', 140 | valueField: 'id', 141 | hiddenName: 'editor', 142 | fields: ['id', 'name'], 143 | baseParams: { 144 | action: 'mgr/filters/editors', 145 | combo: true, 146 | }, 147 | emptyText: _('versionx.filters.editor'), 148 | }); 149 | VersionX.combo.Editors.superclass.constructor.call(this, config); 150 | }; 151 | Ext.extend(VersionX.combo.Editors, VersionX.combo.Filter); 152 | Ext.reg('versionx-combo-editors', VersionX.combo.Editors); 153 | 154 | VersionX.combo.Packages = function(config) { 155 | config = config || {}; 156 | Ext.applyIf(config, { 157 | name: 'package', 158 | displayField: 'name', 159 | valueField: 'id', 160 | hiddenName: 'package', 161 | fields: ['id', 'name'], 162 | baseParams: { 163 | action: 'mgr/filters/packages', 164 | combo: true, 165 | limit: '0', 166 | }, 167 | emptyText: _('versionx.filters.package'), 168 | }); 169 | VersionX.combo.Packages.superclass.constructor.call(this, config); 170 | }; 171 | Ext.extend(VersionX.combo.Packages, VersionX.combo.Filter); 172 | Ext.reg('versionx-combo-packages', VersionX.combo.Packages); -------------------------------------------------------------------------------- /assets/components/versionx/js/mgr/widgets/resources.widget.js: -------------------------------------------------------------------------------- 1 | VersionX.grid.ResourcesWidget = function(config) { 2 | config = config || {}; 3 | Ext.applyIf(config, { 4 | id: 'versionx-grid-resources-widget', 5 | baseParams: { 6 | action: 'mgr/objects/getlist', 7 | class: 'modResource', 8 | }, 9 | tbar: [], 10 | columns: this.getColumns(), 11 | listeners: { 12 | afterrender: this.onAfterRender, 13 | scope: this 14 | }, 15 | actionsColumnWidth: 10, 16 | paging: false, 17 | pageSize: 10, 18 | }); 19 | VersionX.grid.ResourcesWidget.superclass.constructor.call(this,config); 20 | }; 21 | Ext.extend(VersionX.grid.ResourcesWidget, VersionX.grid.Objects, { 22 | getColumns: function() { 23 | let columns = this.superclass().getColumns(), 24 | newColumns = []; 25 | 26 | columns.forEach(function(column) { 27 | if (['id','time_end','name','username'].includes(column.dataIndex)) { 28 | newColumns.push(column); 29 | } 30 | }); 31 | 32 | return newColumns; 33 | }, 34 | getMenu: function() { 35 | var m = []; 36 | m.push({ 37 | text: _('versionx.widget.resources.update'), 38 | handler: this.updateResource 39 | }); 40 | m.push({ 41 | text: _('versionx.objects.view_details'), 42 | handler: this.viewDetails 43 | }); 44 | return m; 45 | }, 46 | updateResource: function() { 47 | window.location = '?a=resource/update&id=' + this.menu.record.principal 48 | }, 49 | // Workaround to resize the grid when in a dashboard widget 50 | onAfterRender: function() { 51 | var cnt = Ext.getCmp('modx-content') 52 | // Dashboard widget "parent" (renderTo) 53 | ,parent = Ext.get('versionx-widget-resource-div'); 54 | 55 | if (cnt && parent) { 56 | cnt.on('afterlayout', function(elem, layout) { 57 | this.setWidth(parent.getWidth()); 58 | }, this); 59 | } 60 | } 61 | }); 62 | Ext.reg('versionx-grid-resources-widget', VersionX.grid.ResourcesWidget); -------------------------------------------------------------------------------- /assets/components/versionx/js/mgr/window.deltas.js: -------------------------------------------------------------------------------- 1 | VersionX.window.Deltas = function(config) { 2 | config = config || {}; 3 | var win = this; 4 | console.log(config.record); 5 | Ext.applyIf(config, { 6 | title: _('versionx.objects.viewing_object_details', { 7 | name: config.record.name, 8 | class: config.record.principal_class, 9 | id: config.record.principal, 10 | time_end: config.record.time_end, 11 | }), 12 | url: VersionX.config.connectorUrl, 13 | baseParams: { 14 | action: 'mgr/' 15 | }, 16 | cls: 'versionx-window', 17 | modal: true, 18 | autoHeight: false, 19 | constrain: true, 20 | buttons: [{ 21 | text: config.cancelBtnText || _('cancel') 22 | ,scope: this 23 | ,handler: function() { config.closeAction !== 'close' ? this.hide() : this.close(); } 24 | }], 25 | fields: [{ 26 | xtype: 'versionx-grid-deltas', 27 | principal_package: config.record.principal_package, 28 | principal_class: config.record.principal_class, 29 | principal: config.record.principal, 30 | type: config.record.type, 31 | }], 32 | }); 33 | VersionX.window.Deltas.superclass.constructor.call(this, config); 34 | // Set a large size that's still smaller than the viewport. 35 | this.on('afterrender', function(win) { 36 | var maxWidth = Ext.getBody().getViewSize().width - 200, 37 | width = 1200; 38 | 39 | if (width > maxWidth) { 40 | width = maxWidth; 41 | } 42 | 43 | var height = Ext.getBody().getViewSize().height - 30; 44 | win.setSize(width, height); 45 | win.center(); 46 | 47 | }); 48 | 49 | // Force grid to fit window height 50 | this.on('afterlayout', function(win) { 51 | var grid = win.fp.find('itemId', 'versionx-grid-deltas')[0], 52 | el = grid.getView().scroller.dom; 53 | el.style.height = (win.getInnerHeight() - 130) + 'px'; 54 | }); 55 | 56 | // Make sure when resizing the browser window, the Ext window stays in bounds 57 | Ext.EventManager.onWindowResize(function() { 58 | var height = Ext.getBody().getViewSize().height - 30; 59 | if (win.getHeight() > height) { 60 | win.setHeight(height); 61 | win.center(); 62 | } 63 | var width = Ext.getBody().getViewSize().width - 200; 64 | if (win.getWidth() > width) { 65 | win.setWidth(width); 66 | win.center(); 67 | } 68 | var grid = win.fp.find('itemId', 'versionx-grid-deltas')[0], 69 | el = grid.getView().scroller.dom; 70 | el.style.height = (height - 225) + 'px'; 71 | }); 72 | } 73 | Ext.extend(VersionX.window.Deltas, MODx.Window); 74 | Ext.reg('versionx-window-deltas', VersionX.window.Deltas); 75 | -------------------------------------------------------------------------------- /assets/components/versionx/js/mgr/window.milestone.js: -------------------------------------------------------------------------------- 1 | VersionX.window.Milestone = function(config) { 2 | config = config || {}; 3 | var win = this; 4 | Ext.applyIf(config, { 5 | title: 'Create Milestone', 6 | url: VersionX.config.connector_url, 7 | baseParams: { 8 | action: 'mgr/deltas/milestone', 9 | delta_id: config.delta_id, 10 | what: 'add', 11 | }, 12 | cls: 'versionx-milestone-window', 13 | tbar: [{ 14 | xtype: 'tbtext', 15 | html: 'Milestone deltas are preserved and won\'t be merged with other deltas' 16 | }], 17 | fields: [{ 18 | xtype: 'textfield', 19 | fieldLabel: 'Milestone name', 20 | name: 'milestone', 21 | anchor: '1' 22 | },{ 23 | xtype: 'label', 24 | cls: 'desc-under', 25 | text: 'Add a name for this milestone delta' 26 | }], 27 | }); 28 | VersionX.window.Milestone.superclass.constructor.call(this, config); 29 | } 30 | Ext.extend(VersionX.window.Milestone, MODx.Window); 31 | Ext.reg('versionx-window-milestone', VersionX.window.Milestone); -------------------------------------------------------------------------------- /config.core.sample.php: -------------------------------------------------------------------------------- 1 | versionX = new VersionX($this->modx); 14 | 15 | $modxVersion = $this->modx->getVersionData(); 16 | 17 | // Set "versionx_mv2" class for CSS if not on MODX 3.x 18 | $version = ''; 19 | if (version_compare($modxVersion['full_version'], '3.0.0', '<')) { 20 | $version = << 22 | window.addEventListener("DOMContentLoaded", function () { document.body.className = document.body.className + ' versionx_mv2'; }); 23 | 24 | HTML; 25 | } 26 | 27 | $this->cacheBust = '?vxv=' . urlencode($this->versionX->config['version']); 28 | $this->addJavascript($this->versionX->config['js_url'] . 'mgr/versionx.class.js' . $this->cacheBust); 29 | $this->addHtml(' 30 | ' . $version . ' 31 | 36 | '); 37 | } 38 | 39 | public function loadCustomCssJs() 40 | { 41 | $this->addJavascript($this->versionX->config['js_url'] . 'mgr/window.milestone.js' . $this->cacheBust); 42 | $this->addJavascript($this->versionX->config['js_url'] . 'mgr/grid.deltas.js' . $this->cacheBust); 43 | $this->addJavascript($this->versionX->config['js_url'] . 'mgr/window.deltas.js' . $this->cacheBust); 44 | $this->addJavascript($this->versionX->config['js_url'] . 'mgr/grid.objects.js' . $this->cacheBust); 45 | $this->addLastJavascript($this->versionX->config['js_url'] . 'mgr/index.js' . $this->cacheBust); 46 | $this->addCss($this->versionX->config['css_url'] . 'mgr/mgr.css'); 47 | 48 | 49 | } 50 | 51 | public function getLanguageTopics(): array 52 | { 53 | return ['versionx:default']; 54 | } 55 | 56 | public function getPageTitle(): ?string 57 | { 58 | return $this->modx->lexicon('versionx'); 59 | } 60 | 61 | public function getTemplateFile(): string 62 | { 63 | return $this->versionX->config['core_path'] . 'templates/mgr/versionx.tpl'; 64 | } 65 | } -------------------------------------------------------------------------------- /core/components/versionx/cron.php: -------------------------------------------------------------------------------- 1 | loadCustomClasses(); 11 | $versionX->deltas()->optimizeDeltas(); 12 | 13 | @session_write_close(); 14 | exit(); -------------------------------------------------------------------------------- /core/components/versionx/docs/version.inc.php: -------------------------------------------------------------------------------- 1 | event->name; 30 | 31 | $path = $modx->getOption('versionx.core_path', null, MODX_CORE_PATH . 'components/versionx/'); 32 | require $path . 'vendor/autoload.php'; 33 | 34 | if (!$versionX = new VersionX($modx)) { 35 | $modx->log(modX::LOG_LEVEL_ERROR, 'Could not load VersionX'); 36 | return; 37 | } 38 | 39 | switch($eventName) { 40 | case 'OnDocFormSave': 41 | case 'FredOnFredResourceSave': 42 | if ($modx->getOption('versionx.enable.resources',null,true) && $id) { 43 | $type = new Resource($versionX); 44 | $result = $versionX->deltas()->createDelta($id, $type); 45 | } 46 | break; 47 | 48 | case 'OnTempFormSave': 49 | if ($modx->getOption('versionx.enable.templates',null,true) && $id) { 50 | $type = new Template($versionX); 51 | $result = $versionX->deltas()->createDelta($id, $type); 52 | } 53 | break; 54 | 55 | case 'OnTVFormSave': 56 | if ($modx->getOption('versionx.enable.templatevariables',null,true) && $id) { 57 | $type = new TV($versionX); 58 | $result = $versionX->deltas()->createDelta($id, $type); 59 | } 60 | break; 61 | 62 | case 'OnChunkFormSave': 63 | if ($modx->getOption('versionx.enable.chunks',null,true) && $id) { 64 | $type = new Chunk($versionX); 65 | $result = $versionX->deltas()->createDelta($id, $type); 66 | } 67 | break; 68 | 69 | case 'OnSnipFormSave': 70 | if ($modx->getOption('versionx.enable.snippets',null,true) && $id) { 71 | $type = new Snippet($versionX); 72 | $result = $versionX->deltas()->createDelta($id, $type); 73 | } 74 | break; 75 | 76 | case 'OnPluginFormSave': 77 | if ($modx->getOption('versionx.enable.plugins',null,true) && $id) { 78 | $type = new Plugin($versionX); 79 | $result = $versionX->deltas()->createDelta($id, $type); 80 | } 81 | break; 82 | 83 | case 'OnBeforeManagerPageInit': // Required for autoloading 84 | case 'OnManagerPageInit': 85 | case 'OnHandleRequest': 86 | 87 | break; 88 | 89 | /* Add tabs */ 90 | case 'OnDocFormPrerender': 91 | if ($mode == modSystemEvent::MODE_UPD && $modx->getOption('versionx.formtabs.resource',null,true)) { 92 | $versionX->outputVersionsTab($id, new Resource($versionX)); 93 | } 94 | break; 95 | 96 | case 'OnTempFormPrerender': 97 | if ($mode == modSystemEvent::MODE_UPD && $modx->getOption('versionx.formtabs.template',null,true)) { 98 | $versionX->outputVersionsTab($id, new Template($versionX)); 99 | } 100 | break; 101 | 102 | case 'OnTVFormPrerender': 103 | if ($mode == modSystemEvent::MODE_UPD && $modx->getOption('versionx.formtabs.templatevariable',null,true)) { 104 | $versionX->outputVersionsTab($id, new TV($versionX)); 105 | } 106 | break; 107 | 108 | case 'OnChunkFormPrerender': 109 | if ($mode == modSystemEvent::MODE_UPD && $modx->getOption('versionx.formtabs.chunk',null,true)) { 110 | $versionX->outputVersionsTab($id, new Chunk($versionX)); 111 | } 112 | break; 113 | 114 | case 'OnSnipFormPrerender': 115 | if ($mode == modSystemEvent::MODE_UPD && $modx->getOption('versionx.formtabs.snippet',null,true)) { 116 | $versionX->outputVersionsTab($id, new Snippet($versionX)); 117 | } 118 | break; 119 | 120 | case 'OnPluginFormPrerender': 121 | if ($mode == modSystemEvent::MODE_UPD && $modx->getOption('versionx.formtabs.plugin',null,true)) { 122 | $versionX->outputVersionsTab($id, new Plugin($versionX)); 123 | } 124 | break; 125 | 126 | case 'OnResourceMagicPreview': 127 | /** @var array $properties */ 128 | if (empty($properties['versionx'])) { 129 | break; 130 | } 131 | 132 | $versionX = new VersionX($modx); 133 | $deltaId = $properties['delta_id']; 134 | 135 | $delta = $modx->getObject(\vxDelta::class, ['id' => $deltaId]); 136 | if ($delta->get('type_class') !== Resource::class) { 137 | break; 138 | }; 139 | 140 | $previewType = new \modmore\VersionX\Types\ResourcePreview($versionX); 141 | 142 | // Check type of revert preview ('delta' or 'point in time') 143 | if ($properties['revert'] === 'delta') { 144 | $now = Carbon::now()->toDateTimeString(); 145 | $fields = $modx->getCollection(\vxDeltaField::class, [ 146 | 'delta' => $deltaId, 147 | ]); 148 | foreach ($fields as $field) { 149 | $resource->set($field->get('field'), $field->get('before')); 150 | } 151 | $resource = $previewType->afterRevert(RevertAction::DELTA, $fields, $resource, $now); 152 | } 153 | elseif ($properties['revert'] === 'pit') { 154 | // Get the first version of every field after the "time_end" on the selected delta 155 | $fields = []; 156 | foreach ($versionX->deltas()->getClosestDeltaFields($previewType, $resource, [], $delta->get('time_start')) as $item) { 157 | $fields[$item->get('field')] = $item; 158 | } 159 | // Apply the field values to the object 160 | // We want to revert to all fields to the after value of a specific point in time. 161 | foreach ($fields as $field) { 162 | $resource->set($field->get('field'), $field->get('before')); 163 | } 164 | } 165 | 166 | break; 167 | } 168 | 169 | return true; -------------------------------------------------------------------------------- /core/components/versionx/elements/widgets/resources.dashboardwidget.php: -------------------------------------------------------------------------------- 1 | modx->getOption( 12 | 'versionx.core_path', 13 | null, 14 | $this->modx->getOption('core_path') . 'components/versionx/' 15 | ); 16 | 17 | require_once $corePath . 'model/versionx.class.php'; 18 | $versionx = new VersionX($this->modx); 19 | 20 | $langs = $versionx->_getLangs(); 21 | 22 | $vxUrl = $versionx->config['assets_url']; 23 | $this->modx->regClientCSS($vxUrl . 'css/mgr/mgr.css'); 24 | $this->modx->regClientStartupHTMLBlock(<< 26 | 27 | 28 | 29 | 30 | 31 | 41 | HTML); 42 | 43 | return '
'; 44 | } 45 | } 46 | 47 | return 'vxResourceHistoryWidget'; 48 | -------------------------------------------------------------------------------- /core/components/versionx/lexicon/cs/default.inc.php: -------------------------------------------------------------------------------- 1 |
9 | VersionX je svobodný software, avšak vaše pomoc je stále potřeba, aby se vývoj nezastavil. Pokud je pro vás VersionX užitečný, zvažte poskytnutí daru na podporu VersionX. Děkuji.'; 10 | 11 | // Deltas grid 12 | $_lang['versionx.deltas.versions'] = 'Versions'; 13 | $_lang['versionx.deltas.details'] = 'Details'; 14 | $_lang['versionx.deltas.confirm_milestone_removal'] = 'Confirm Milestone Removal'; 15 | $_lang['versionx.deltas.confirm_milestone_removal.text'] = 'Are you sure you want to remove the milestone tag? Doing so means this delta will be included in the next merge.'; 16 | $_lang['versionx.deltas.undo'] = 'undo'; 17 | $_lang['versionx.deltas.confirm_undo'] = 'Confirm Undo'; 18 | $_lang['versionx.deltas.confirm_undo.text'] = 'Are you sure you want to undo this change?'; 19 | $_lang['versionx.deltas.confirm_revert'] = 'Confirm Revert'; 20 | $_lang['versionx.deltas.confirm_revert.text'] = 'Are you sure you want to revert all changes in this delta?'; 21 | $_lang['versionx.deltas.revert_all_fields'] = 'Revert All Fields to [[+time]]'; 22 | $_lang['versionx.deltas.revert_all_fields_to_point_in_time'] = 'Revert all fields to this point in time'; 23 | $_lang['versionx.deltas.revert_all_fields.text'] = "

Are you sure you want to revert all fields to this point in time? [[+time]]

"; 24 | $_lang['versionx.deltas.milestone'] = 'milestone'; 25 | $_lang['versionx.deltas.milestone_remove'] = 'Remove milestone status from delta'; 26 | $_lang['versionx.deltas.milestone_make'] = 'Make this delta a milestone'; 27 | $_lang['versionx.deltas.preview'] = 'Preview'; 28 | $_lang['versionx.deltas.revert_these_changes'] = 'Revert these changes'; 29 | 30 | // Grid filters 31 | $_lang['versionx.filters.clear_filter'] = '( Clear filter )'; 32 | $_lang['versionx.filters.class'] = 'Class...'; 33 | $_lang['versionx.filters.date_from'] = 'Date from...'; 34 | $_lang['versionx.filters.date_to'] = 'Date to...'; 35 | $_lang['versionx.filters.editor'] = 'Editor...'; 36 | $_lang['versionx.filters.package'] = 'Package...'; 37 | $_lang['versionx.filters.search'] = 'Search...'; 38 | $_lang['versionx.filters.search_by_field'] = 'Search by field...'; 39 | $_lang['versionx.filters.search_by_name'] = 'Search by name...'; 40 | 41 | // Versioned objects grid 42 | $_lang['versionx.objects.class'] = 'Class'; 43 | $_lang['versionx.objects.delta'] = 'Delta'; 44 | $_lang['versionx.objects.editor'] = 'Editor'; 45 | $_lang['versionx.objects.id'] = 'ID'; 46 | $_lang['versionx.objects.name'] = 'Name'; 47 | $_lang['versionx.objects.package'] = 'Package'; 48 | $_lang['versionx.objects.when'] = 'When'; 49 | $_lang['versionx.objects.view_details'] = 'View Details'; 50 | $_lang['versionx.objects.viewing_object_details'] = '[[+name]] • [[+class]] (id: [[+id]]) • [[+time_end]]'; 51 | 52 | // Optimize storage 53 | $_lang['versionx.optimize_storage'] = 'Optimize Storage'; 54 | $_lang['versionx.optimize_storage.confirm_text'] = 'Optimizing storage will merge older deltas, and typically runs each night, potentially reducing the size of the database.'; 55 | $_lang['versionx.optimize_storage.confirm_text2'] = 'Are you sure you want to run it manually now?'; 56 | $_lang['versionx.optimize_storage.successful'] = 'Optimization successful'; 57 | 58 | // Dashboard widgets 59 | $_lang['versionx.widget.resources'] = 'Recent Resource Changes'; 60 | $_lang['versionx.widget.resources.desc'] = '[VersionX] Shows a grid with the most recent resource changes for all users.'; 61 | $_lang['versionx.widget.resources.update'] = 'Update Resource'; -------------------------------------------------------------------------------- /core/components/versionx/lexicon/da/default.inc.php: -------------------------------------------------------------------------------- 1 |
9 | VersionX er gratis software, men din hjælp er nødvendig for at holde udviklingen i gang. Hvis VersionX har hjulpet dig, så overvej at give en donation for at støtte VersionX. Mange tak.'; 10 | 11 | // Deltas grid 12 | $_lang['versionx.deltas.versions'] = 'Versions'; 13 | $_lang['versionx.deltas.details'] = 'Details'; 14 | $_lang['versionx.deltas.confirm_milestone_removal'] = 'Confirm Milestone Removal'; 15 | $_lang['versionx.deltas.confirm_milestone_removal.text'] = 'Are you sure you want to remove the milestone tag? Doing so means this delta will be included in the next merge.'; 16 | $_lang['versionx.deltas.undo'] = 'undo'; 17 | $_lang['versionx.deltas.confirm_undo'] = 'Confirm Undo'; 18 | $_lang['versionx.deltas.confirm_undo.text'] = 'Are you sure you want to undo this change?'; 19 | $_lang['versionx.deltas.confirm_revert'] = 'Confirm Revert'; 20 | $_lang['versionx.deltas.confirm_revert.text'] = 'Are you sure you want to revert all changes in this delta?'; 21 | $_lang['versionx.deltas.revert_all_fields'] = 'Revert All Fields to [[+time]]'; 22 | $_lang['versionx.deltas.revert_all_fields_to_point_in_time'] = 'Revert all fields to this point in time'; 23 | $_lang['versionx.deltas.revert_all_fields.text'] = "

Are you sure you want to revert all fields to this point in time? [[+time]]

"; 24 | $_lang['versionx.deltas.milestone'] = 'milestone'; 25 | $_lang['versionx.deltas.milestone_remove'] = 'Remove milestone status from delta'; 26 | $_lang['versionx.deltas.milestone_make'] = 'Make this delta a milestone'; 27 | $_lang['versionx.deltas.preview'] = 'Preview'; 28 | $_lang['versionx.deltas.revert_these_changes'] = 'Revert these changes'; 29 | 30 | // Grid filters 31 | $_lang['versionx.filters.clear_filter'] = '( Clear filter )'; 32 | $_lang['versionx.filters.class'] = 'Class...'; 33 | $_lang['versionx.filters.date_from'] = 'Date from...'; 34 | $_lang['versionx.filters.date_to'] = 'Date to...'; 35 | $_lang['versionx.filters.editor'] = 'Editor...'; 36 | $_lang['versionx.filters.package'] = 'Package...'; 37 | $_lang['versionx.filters.search'] = 'Search...'; 38 | $_lang['versionx.filters.search_by_field'] = 'Search by field...'; 39 | $_lang['versionx.filters.search_by_name'] = 'Search by name...'; 40 | 41 | // Versioned objects grid 42 | $_lang['versionx.objects.class'] = 'Class'; 43 | $_lang['versionx.objects.delta'] = 'Delta'; 44 | $_lang['versionx.objects.editor'] = 'Editor'; 45 | $_lang['versionx.objects.id'] = 'ID'; 46 | $_lang['versionx.objects.name'] = 'Name'; 47 | $_lang['versionx.objects.package'] = 'Package'; 48 | $_lang['versionx.objects.when'] = 'When'; 49 | $_lang['versionx.objects.view_details'] = 'View Details'; 50 | $_lang['versionx.objects.viewing_object_details'] = '[[+name]] • [[+class]] (id: [[+id]]) • [[+time_end]]'; 51 | 52 | // Optimize storage 53 | $_lang['versionx.optimize_storage'] = 'Optimize Storage'; 54 | $_lang['versionx.optimize_storage.confirm_text'] = 'Optimizing storage will merge older deltas, and typically runs each night, potentially reducing the size of the database.'; 55 | $_lang['versionx.optimize_storage.confirm_text2'] = 'Are you sure you want to run it manually now?'; 56 | $_lang['versionx.optimize_storage.successful'] = 'Optimization successful'; 57 | 58 | // Dashboard widgets 59 | $_lang['versionx.widget.resources'] = 'Recent Resource Changes'; 60 | $_lang['versionx.widget.resources.desc'] = '[VersionX] Shows a grid with the most recent resource changes for all users.'; 61 | $_lang['versionx.widget.resources.update'] = 'Update Resource'; -------------------------------------------------------------------------------- /core/components/versionx/lexicon/de/default.inc.php: -------------------------------------------------------------------------------- 1 |
12 | VersionX ist kostenlose Software, aber Ihre Hilfe wird benötigt, um die Entwicklung am Laufen zu halten. Wenn sich VersionX als hilfreich erwiesen hat, ziehen Sie bitte eine Spende zur Unterstützung von VersionX in Betracht. Vielen Dank.'; 13 | 14 | // Deltas grid 15 | $_lang['versionx.deltas.versions'] = 'Versions'; 16 | $_lang['versionx.deltas.details'] = 'Details'; 17 | $_lang['versionx.deltas.confirm_milestone_removal'] = 'Confirm Milestone Removal'; 18 | $_lang['versionx.deltas.confirm_milestone_removal.text'] = 'Are you sure you want to remove the milestone tag? Doing so means this delta will be included in the next merge.'; 19 | $_lang['versionx.deltas.undo'] = 'verwerfen'; 20 | $_lang['versionx.deltas.confirm_undo'] = 'Confirm Undo'; 21 | $_lang['versionx.deltas.confirm_undo.text'] = 'Are you sure you want to undo this change?'; 22 | $_lang['versionx.deltas.confirm_revert'] = 'Confirm Revert'; 23 | $_lang['versionx.deltas.confirm_revert.text'] = 'Are you sure you want to revert all changes in this delta?'; 24 | $_lang['versionx.deltas.revert_all_fields'] = 'Revert All Fields to [[+time]]'; 25 | $_lang['versionx.deltas.revert_all_fields_to_point_in_time'] = 'Revert all fields to this point in time'; 26 | $_lang['versionx.deltas.revert_all_fields.text'] = "

Are you sure you want to revert all fields to this point in time? [[+time]]

"; 27 | $_lang['versionx.deltas.milestone'] = 'milestone'; 28 | $_lang['versionx.deltas.milestone_remove'] = 'Remove milestone status from delta'; 29 | $_lang['versionx.deltas.milestone_make'] = 'Make this delta a milestone'; 30 | $_lang['versionx.deltas.preview'] = 'Preview'; 31 | $_lang['versionx.deltas.revert_these_changes'] = 'Revert these changes'; 32 | 33 | // Grid filters 34 | $_lang['versionx.filters.clear_filter'] = '( Clear filter )'; 35 | $_lang['versionx.filters.class'] = 'Class...'; 36 | $_lang['versionx.filters.date_from'] = 'Date from...'; 37 | $_lang['versionx.filters.date_to'] = 'Date to...'; 38 | $_lang['versionx.filters.editor'] = 'Editor...'; 39 | $_lang['versionx.filters.package'] = 'Package...'; 40 | $_lang['versionx.filters.search'] = 'Suche ...'; 41 | $_lang['versionx.filters.search_by_field'] = 'Suche nach Feld ...'; 42 | $_lang['versionx.filters.search_by_name'] = 'Suche nach Name ...'; 43 | 44 | // Versioned objects grid 45 | $_lang['versionx.objects.class'] = 'Class'; 46 | $_lang['versionx.objects.delta'] = 'Delta'; 47 | $_lang['versionx.objects.editor'] = 'Editor'; 48 | $_lang['versionx.objects.id'] = 'ID'; 49 | $_lang['versionx.objects.name'] = 'Name'; 50 | $_lang['versionx.objects.package'] = 'Package'; 51 | $_lang['versionx.objects.when'] = 'When'; 52 | $_lang['versionx.objects.view_details'] = 'View Details'; 53 | $_lang['versionx.objects.viewing_object_details'] = '[[+name]] • [[+class]] (id: [[+id]]) • [[+time_end]]'; 54 | 55 | // Optimize storage 56 | $_lang['versionx.optimize_storage'] = 'Optimieren der Speicherung'; 57 | $_lang['versionx.optimize_storage.confirm_text'] = 'Optimizing storage will merge older deltas, and typically runs each night, potentially reducing the size of the database.'; 58 | $_lang['versionx.optimize_storage.confirm_text2'] = 'Are you sure you want to run it manually now?'; 59 | $_lang['versionx.optimize_storage.successful'] = 'Optimization successful'; 60 | 61 | // Dashboard widgets 62 | $_lang['versionx.widget.resources'] = 'Recent Resource Changes'; 63 | $_lang['versionx.widget.resources.desc'] = '[VersionX] Shows a grid with the most recent resource changes for all users.'; 64 | $_lang['versionx.widget.resources.update'] = 'Update Resource'; -------------------------------------------------------------------------------- /core/components/versionx/lexicon/en/default.inc.php: -------------------------------------------------------------------------------- 1 |
12 | VersionX is free software, however your help is needed to keep the development going. If VersionX has proven helpful, please consider making a donation to support VersionX. Thank you.'; 13 | 14 | // Deltas grid 15 | $_lang['versionx.deltas.versions'] = 'Versions'; 16 | $_lang['versionx.deltas.details'] = 'Details'; 17 | $_lang['versionx.deltas.confirm_milestone_removal'] = 'Confirm Milestone Removal'; 18 | $_lang['versionx.deltas.confirm_milestone_removal.text'] = 'Are you sure you want to remove the milestone tag? Doing so means this delta will be included in the next merge.'; 19 | $_lang['versionx.deltas.undo'] = 'undo'; 20 | $_lang['versionx.deltas.confirm_undo'] = 'Confirm Undo'; 21 | $_lang['versionx.deltas.confirm_undo.text'] = 'Are you sure you want to undo this change?'; 22 | $_lang['versionx.deltas.confirm_revert'] = 'Confirm Revert'; 23 | $_lang['versionx.deltas.confirm_revert.text'] = 'Are you sure you want to revert all changes in this delta?'; 24 | $_lang['versionx.deltas.revert_all_fields'] = 'Revert All Fields to [[+time]]'; 25 | $_lang['versionx.deltas.revert_all_fields_to_point_in_time'] = 'Revert all fields to this point in time'; 26 | $_lang['versionx.deltas.revert_all_fields.text'] = "

Are you sure you want to revert all fields to this point in time? [[+time]]

"; 27 | $_lang['versionx.deltas.milestone'] = 'milestone'; 28 | $_lang['versionx.deltas.milestone_remove'] = 'Remove milestone status from delta'; 29 | $_lang['versionx.deltas.milestone_make'] = 'Make this delta a milestone'; 30 | $_lang['versionx.deltas.preview'] = 'Preview'; 31 | $_lang['versionx.deltas.revert_these_changes'] = 'Revert these changes'; 32 | 33 | // Grid filters 34 | $_lang['versionx.filters.clear_filter'] = '( Clear filter )'; 35 | $_lang['versionx.filters.class'] = 'Class...'; 36 | $_lang['versionx.filters.date_from'] = 'Date from...'; 37 | $_lang['versionx.filters.date_to'] = 'Date to...'; 38 | $_lang['versionx.filters.editor'] = 'Editor...'; 39 | $_lang['versionx.filters.package'] = 'Package...'; 40 | $_lang['versionx.filters.search'] = 'Search...'; 41 | $_lang['versionx.filters.search_by_field'] = 'Search by field...'; 42 | $_lang['versionx.filters.search_by_name'] = 'Search by name...'; 43 | 44 | // Versioned objects grid 45 | $_lang['versionx.objects.class'] = 'Class'; 46 | $_lang['versionx.objects.delta'] = 'Delta'; 47 | $_lang['versionx.objects.editor'] = 'Editor'; 48 | $_lang['versionx.objects.id'] = 'ID'; 49 | $_lang['versionx.objects.name'] = 'Name'; 50 | $_lang['versionx.objects.package'] = 'Package'; 51 | $_lang['versionx.objects.when'] = 'When'; 52 | $_lang['versionx.objects.view_details'] = 'View Details'; 53 | $_lang['versionx.objects.viewing_object_details'] = '[[+name]] • [[+class]] (id: [[+id]]) • [[+time_end]]'; 54 | 55 | // Optimize storage 56 | $_lang['versionx.optimize_storage'] = 'Optimize Storage'; 57 | $_lang['versionx.optimize_storage.confirm_text'] = 'Optimizing storage will merge older deltas, and typically runs each night, potentially reducing the size of the database.'; 58 | $_lang['versionx.optimize_storage.confirm_text2'] = 'Are you sure you want to run it manually now?'; 59 | $_lang['versionx.optimize_storage.successful'] = 'Optimization successful'; 60 | 61 | // Dashboard widgets 62 | $_lang['versionx.widget.resources'] = 'Recent Resource Changes'; 63 | $_lang['versionx.widget.resources.desc'] = '[VersionX] Shows a grid with the most recent resource changes for all users.'; 64 | $_lang['versionx.widget.resources.update'] = 'Update Resource'; -------------------------------------------------------------------------------- /core/components/versionx/lexicon/fr/default.inc.php: -------------------------------------------------------------------------------- 1 |
9 | VersionX est gratuit, toutefois votre aide est bienvenue pour poursuivre le développement. Si VersionX s\'avère utile pour vous, n\'hésitez pas à faire un don de support. Merci.'; 10 | 11 | // Deltas grid 12 | $_lang['versionx.deltas.versions'] = 'Versions'; 13 | $_lang['versionx.deltas.details'] = 'Details'; 14 | $_lang['versionx.deltas.confirm_milestone_removal'] = 'Confirm Milestone Removal'; 15 | $_lang['versionx.deltas.confirm_milestone_removal.text'] = 'Are you sure you want to remove the milestone tag? Doing so means this delta will be included in the next merge.'; 16 | $_lang['versionx.deltas.undo'] = 'undo'; 17 | $_lang['versionx.deltas.confirm_undo'] = 'Confirm Undo'; 18 | $_lang['versionx.deltas.confirm_undo.text'] = 'Are you sure you want to undo this change?'; 19 | $_lang['versionx.deltas.confirm_revert'] = 'Confirm Revert'; 20 | $_lang['versionx.deltas.confirm_revert.text'] = 'Are you sure you want to revert all changes in this delta?'; 21 | $_lang['versionx.deltas.revert_all_fields'] = 'Revert All Fields to [[+time]]'; 22 | $_lang['versionx.deltas.revert_all_fields_to_point_in_time'] = 'Revert all fields to this point in time'; 23 | $_lang['versionx.deltas.revert_all_fields.text'] = "

Are you sure you want to revert all fields to this point in time? [[+time]]

"; 24 | $_lang['versionx.deltas.milestone'] = 'milestone'; 25 | $_lang['versionx.deltas.milestone_remove'] = 'Remove milestone status from delta'; 26 | $_lang['versionx.deltas.milestone_make'] = 'Make this delta a milestone'; 27 | $_lang['versionx.deltas.preview'] = 'Preview'; 28 | $_lang['versionx.deltas.revert_these_changes'] = 'Revert these changes'; 29 | 30 | // Grid filters 31 | $_lang['versionx.filters.clear_filter'] = '( Clear filter )'; 32 | $_lang['versionx.filters.class'] = 'Class...'; 33 | $_lang['versionx.filters.date_from'] = 'Date from...'; 34 | $_lang['versionx.filters.date_to'] = 'Date to...'; 35 | $_lang['versionx.filters.editor'] = 'Editor...'; 36 | $_lang['versionx.filters.package'] = 'Package...'; 37 | $_lang['versionx.filters.search'] = 'Search...'; 38 | $_lang['versionx.filters.search_by_field'] = 'Search by field...'; 39 | $_lang['versionx.filters.search_by_name'] = 'Search by name...'; 40 | 41 | // Versioned objects grid 42 | $_lang['versionx.objects.class'] = 'Class'; 43 | $_lang['versionx.objects.delta'] = 'Delta'; 44 | $_lang['versionx.objects.editor'] = 'Editor'; 45 | $_lang['versionx.objects.id'] = 'ID'; 46 | $_lang['versionx.objects.name'] = 'Name'; 47 | $_lang['versionx.objects.package'] = 'Package'; 48 | $_lang['versionx.objects.when'] = 'When'; 49 | $_lang['versionx.objects.view_details'] = 'View Details'; 50 | $_lang['versionx.objects.viewing_object_details'] = '[[+name]] • [[+class]] (id: [[+id]]) • [[+time_end]]'; 51 | 52 | // Optimize storage 53 | $_lang['versionx.optimize_storage'] = 'Optimize Storage'; 54 | $_lang['versionx.optimize_storage.confirm_text'] = 'Optimizing storage will merge older deltas, and typically runs each night, potentially reducing the size of the database.'; 55 | $_lang['versionx.optimize_storage.confirm_text2'] = 'Are you sure you want to run it manually now?'; 56 | $_lang['versionx.optimize_storage.successful'] = 'Optimization successful'; 57 | 58 | // Dashboard widgets 59 | $_lang['versionx.widget.resources'] = 'Recent Resource Changes'; 60 | $_lang['versionx.widget.resources.desc'] = '[VersionX] Shows a grid with the most recent resource changes for all users.'; 61 | $_lang['versionx.widget.resources.update'] = 'Update Resource'; -------------------------------------------------------------------------------- /core/components/versionx/lexicon/nl/default.inc.php: -------------------------------------------------------------------------------- 1 |
9 | VersionX is gratis software, maar uw hulp is nodig om de ontwikkeling voort te zetten. Als VersionX voor u waardevol is gebleken wil ik u vragen een donatie te overwegen.'; 10 | 11 | // Deltas grid 12 | $_lang['versionx.deltas.versions'] = 'Versions'; 13 | $_lang['versionx.deltas.details'] = 'Details'; 14 | $_lang['versionx.deltas.confirm_milestone_removal'] = 'Confirm Milestone Removal'; 15 | $_lang['versionx.deltas.confirm_milestone_removal.text'] = 'Are you sure you want to remove the milestone tag? Doing so means this delta will be included in the next merge.'; 16 | $_lang['versionx.deltas.undo'] = 'undo'; 17 | $_lang['versionx.deltas.confirm_undo'] = 'Confirm Undo'; 18 | $_lang['versionx.deltas.confirm_undo.text'] = 'Are you sure you want to undo this change?'; 19 | $_lang['versionx.deltas.confirm_revert'] = 'Confirm Revert'; 20 | $_lang['versionx.deltas.confirm_revert.text'] = 'Are you sure you want to revert all changes in this delta?'; 21 | $_lang['versionx.deltas.revert_all_fields'] = 'Revert All Fields to [[+time]]'; 22 | $_lang['versionx.deltas.revert_all_fields_to_point_in_time'] = 'Revert all fields to this point in time'; 23 | $_lang['versionx.deltas.revert_all_fields.text'] = "

Are you sure you want to revert all fields to this point in time? [[+time]]

"; 24 | $_lang['versionx.deltas.milestone'] = 'milestone'; 25 | $_lang['versionx.deltas.milestone_remove'] = 'Remove milestone status from delta'; 26 | $_lang['versionx.deltas.milestone_make'] = 'Make this delta a milestone'; 27 | $_lang['versionx.deltas.preview'] = 'Preview'; 28 | $_lang['versionx.deltas.revert_these_changes'] = 'Revert these changes'; 29 | 30 | // Grid filters 31 | $_lang['versionx.filters.clear_filter'] = '( Clear filter )'; 32 | $_lang['versionx.filters.class'] = 'Class...'; 33 | $_lang['versionx.filters.date_from'] = 'Date from...'; 34 | $_lang['versionx.filters.date_to'] = 'Date to...'; 35 | $_lang['versionx.filters.editor'] = 'Editor...'; 36 | $_lang['versionx.filters.package'] = 'Package...'; 37 | $_lang['versionx.filters.search'] = 'Search...'; 38 | $_lang['versionx.filters.search_by_field'] = 'Search by field...'; 39 | $_lang['versionx.filters.search_by_name'] = 'Search by name...'; 40 | 41 | // Versioned objects grid 42 | $_lang['versionx.objects.class'] = 'Class'; 43 | $_lang['versionx.objects.delta'] = 'Delta'; 44 | $_lang['versionx.objects.editor'] = 'Editor'; 45 | $_lang['versionx.objects.id'] = 'ID'; 46 | $_lang['versionx.objects.name'] = 'Name'; 47 | $_lang['versionx.objects.package'] = 'Package'; 48 | $_lang['versionx.objects.when'] = 'When'; 49 | $_lang['versionx.objects.view_details'] = 'View Details'; 50 | $_lang['versionx.objects.viewing_object_details'] = '[[+name]] • [[+class]] (id: [[+id]]) • [[+time_end]]'; 51 | 52 | // Optimize storage 53 | $_lang['versionx.optimize_storage'] = 'Optimize Storage'; 54 | $_lang['versionx.optimize_storage.confirm_text'] = 'Optimizing storage will merge older deltas, and typically runs each night, potentially reducing the size of the database.'; 55 | $_lang['versionx.optimize_storage.confirm_text2'] = 'Are you sure you want to run it manually now?'; 56 | $_lang['versionx.optimize_storage.successful'] = 'Optimization successful'; 57 | 58 | // Dashboard widgets 59 | $_lang['versionx.widget.resources'] = 'Recent Resource Changes'; 60 | $_lang['versionx.widget.resources.desc'] = '[VersionX] Shows a grid with the most recent resource changes for all users.'; 61 | $_lang['versionx.widget.resources.update'] = 'Update Resource'; -------------------------------------------------------------------------------- /core/components/versionx/lexicon/ru/default.inc.php: -------------------------------------------------------------------------------- 1 |
9 | VersionX является свободным ПО, поэтому нужна ваша помощь - следить за разработкой. Если VersionX оказался полезным, пожалуйста, рассмотрите возможность внести пожертвования, чтобы поддержать проект. Спасибо.'; 10 | 11 | // Deltas grid 12 | $_lang['versionx.deltas.versions'] = 'Versions'; 13 | $_lang['versionx.deltas.details'] = 'Details'; 14 | $_lang['versionx.deltas.confirm_milestone_removal'] = 'Confirm Milestone Removal'; 15 | $_lang['versionx.deltas.confirm_milestone_removal.text'] = 'Are you sure you want to remove the milestone tag? Doing so means this delta will be included in the next merge.'; 16 | $_lang['versionx.deltas.undo'] = 'undo'; 17 | $_lang['versionx.deltas.confirm_undo'] = 'Confirm Undo'; 18 | $_lang['versionx.deltas.confirm_undo.text'] = 'Are you sure you want to undo this change?'; 19 | $_lang['versionx.deltas.confirm_revert'] = 'Confirm Revert'; 20 | $_lang['versionx.deltas.confirm_revert.text'] = 'Are you sure you want to revert all changes in this delta?'; 21 | $_lang['versionx.deltas.revert_all_fields'] = 'Revert All Fields to [[+time]]'; 22 | $_lang['versionx.deltas.revert_all_fields_to_point_in_time'] = 'Revert all fields to this point in time'; 23 | $_lang['versionx.deltas.revert_all_fields.text'] = "

Are you sure you want to revert all fields to this point in time? [[+time]]

"; 24 | $_lang['versionx.deltas.milestone'] = 'milestone'; 25 | $_lang['versionx.deltas.milestone_remove'] = 'Remove milestone status from delta'; 26 | $_lang['versionx.deltas.milestone_make'] = 'Make this delta a milestone'; 27 | $_lang['versionx.deltas.preview'] = 'Preview'; 28 | $_lang['versionx.deltas.revert_these_changes'] = 'Revert these changes'; 29 | 30 | // Grid filters 31 | $_lang['versionx.filters.clear_filter'] = '( Clear filter )'; 32 | $_lang['versionx.filters.class'] = 'Class...'; 33 | $_lang['versionx.filters.date_from'] = 'Date from...'; 34 | $_lang['versionx.filters.date_to'] = 'Date to...'; 35 | $_lang['versionx.filters.editor'] = 'Editor...'; 36 | $_lang['versionx.filters.package'] = 'Package...'; 37 | $_lang['versionx.filters.search'] = 'Search...'; 38 | $_lang['versionx.filters.search_by_field'] = 'Search by field...'; 39 | $_lang['versionx.filters.search_by_name'] = 'Search by name...'; 40 | 41 | // Versioned objects grid 42 | $_lang['versionx.objects.class'] = 'Class'; 43 | $_lang['versionx.objects.delta'] = 'Delta'; 44 | $_lang['versionx.objects.editor'] = 'Editor'; 45 | $_lang['versionx.objects.id'] = 'ID'; 46 | $_lang['versionx.objects.name'] = 'Name'; 47 | $_lang['versionx.objects.package'] = 'Package'; 48 | $_lang['versionx.objects.when'] = 'When'; 49 | $_lang['versionx.objects.view_details'] = 'View Details'; 50 | $_lang['versionx.objects.viewing_object_details'] = '[[+name]] • [[+class]] (id: [[+id]]) • [[+time_end]]'; 51 | 52 | // Optimize storage 53 | $_lang['versionx.optimize_storage'] = 'Optimize Storage'; 54 | $_lang['versionx.optimize_storage.confirm_text'] = 'Optimizing storage will merge older deltas, and typically runs each night, potentially reducing the size of the database.'; 55 | $_lang['versionx.optimize_storage.confirm_text2'] = 'Are you sure you want to run it manually now?'; 56 | $_lang['versionx.optimize_storage.successful'] = 'Optimization successful'; 57 | 58 | // Dashboard widgets 59 | $_lang['versionx.widget.resources'] = 'Recent Resource Changes'; 60 | $_lang['versionx.widget.resources.desc'] = '[VersionX] Shows a grid with the most recent resource changes for all users.'; 61 | $_lang['versionx.widget.resources.update'] = 'Update Resource'; -------------------------------------------------------------------------------- /core/components/versionx/lexicon/sv/default.inc.php: -------------------------------------------------------------------------------- 1 |
9 | VersionX är gratis mjukvara, men din hjälp behövs för att hålla utveckligen igång. Om VersionX har visat sig vara användbart, vänligen överväg att göra en donation för att stödja VersionX. Tack.'; 10 | 11 | // Deltas grid 12 | $_lang['versionx.deltas.versions'] = 'Versions'; 13 | $_lang['versionx.deltas.details'] = 'Details'; 14 | $_lang['versionx.deltas.confirm_milestone_removal'] = 'Confirm Milestone Removal'; 15 | $_lang['versionx.deltas.confirm_milestone_removal.text'] = 'Are you sure you want to remove the milestone tag? Doing so means this delta will be included in the next merge.'; 16 | $_lang['versionx.deltas.undo'] = 'undo'; 17 | $_lang['versionx.deltas.confirm_undo'] = 'Confirm Undo'; 18 | $_lang['versionx.deltas.confirm_undo.text'] = 'Are you sure you want to undo this change?'; 19 | $_lang['versionx.deltas.confirm_revert'] = 'Confirm Revert'; 20 | $_lang['versionx.deltas.confirm_revert.text'] = 'Are you sure you want to revert all changes in this delta?'; 21 | $_lang['versionx.deltas.revert_all_fields'] = 'Revert All Fields to [[+time]]'; 22 | $_lang['versionx.deltas.revert_all_fields_to_point_in_time'] = 'Revert all fields to this point in time'; 23 | $_lang['versionx.deltas.revert_all_fields.text'] = "

Are you sure you want to revert all fields to this point in time? [[+time]]

"; 24 | $_lang['versionx.deltas.milestone'] = 'milestone'; 25 | $_lang['versionx.deltas.milestone_remove'] = 'Remove milestone status from delta'; 26 | $_lang['versionx.deltas.milestone_make'] = 'Make this delta a milestone'; 27 | $_lang['versionx.deltas.preview'] = 'Preview'; 28 | $_lang['versionx.deltas.revert_these_changes'] = 'Revert these changes'; 29 | 30 | // Grid filters 31 | $_lang['versionx.filters.clear_filter'] = '( Clear filter )'; 32 | $_lang['versionx.filters.class'] = 'Class...'; 33 | $_lang['versionx.filters.date_from'] = 'Date from...'; 34 | $_lang['versionx.filters.date_to'] = 'Date to...'; 35 | $_lang['versionx.filters.editor'] = 'Editor...'; 36 | $_lang['versionx.filters.package'] = 'Package...'; 37 | $_lang['versionx.filters.search'] = 'Search...'; 38 | $_lang['versionx.filters.search_by_field'] = 'Search by field...'; 39 | $_lang['versionx.filters.search_by_name'] = 'Search by name...'; 40 | 41 | // Versioned objects grid 42 | $_lang['versionx.objects.class'] = 'Class'; 43 | $_lang['versionx.objects.delta'] = 'Delta'; 44 | $_lang['versionx.objects.editor'] = 'Editor'; 45 | $_lang['versionx.objects.id'] = 'ID'; 46 | $_lang['versionx.objects.name'] = 'Name'; 47 | $_lang['versionx.objects.package'] = 'Package'; 48 | $_lang['versionx.objects.when'] = 'When'; 49 | $_lang['versionx.objects.view_details'] = 'View Details'; 50 | $_lang['versionx.objects.viewing_object_details'] = '[[+name]] • [[+class]] (id: [[+id]]) • [[+time_end]]'; 51 | 52 | // Optimize storage 53 | $_lang['versionx.optimize_storage'] = 'Optimize Storage'; 54 | $_lang['versionx.optimize_storage.confirm_text'] = 'Optimizing storage will merge older deltas, and typically runs each night, potentially reducing the size of the database.'; 55 | $_lang['versionx.optimize_storage.confirm_text2'] = 'Are you sure you want to run it manually now?'; 56 | $_lang['versionx.optimize_storage.successful'] = 'Optimization successful'; 57 | 58 | // Dashboard widgets 59 | $_lang['versionx.widget.resources'] = 'Recent Resource Changes'; 60 | $_lang['versionx.widget.resources.desc'] = '[VersionX] Shows a grid with the most recent resource changes for all users.'; 61 | $_lang['versionx.widget.resources.update'] = 'Update Resource'; -------------------------------------------------------------------------------- /core/components/versionx/model/versionx.class.php: -------------------------------------------------------------------------------- 1 | 5 | array ( 6 | 0 => 'vxDelta', 7 | 1 => 'vxDeltaEditor', 8 | 2 => 'vxDeltaField', 9 | ), 10 | 'xPDOObject' => 11 | array ( 12 | 0 => 'vxResource', 13 | 1 => 'vxTemplate', 14 | 2 => 'vxChunk', 15 | 3 => 'vxSnippet', 16 | 4 => 'vxPlugin', 17 | 5 => 'vxTemplateVar', 18 | ), 19 | ); -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/mysql/vxchunk.class.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | require_once (strtr(realpath(dirname(dirname(__FILE__))), '\\', '/') . '/vxchunk.class.php'); 24 | class vxChunk_mysql extends vxChunk {} 25 | ?> -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/mysql/vxchunk.map.inc.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | $xpdo_meta_map['vxChunk']= array ( 24 | 'package' => 'versionx', 25 | 'version' => '1.1', 26 | 'table' => 'versionx_chunk', 27 | 'extends' => 'xPDOObject', 28 | 'tableMeta' => 29 | array ( 30 | 'engine' => 'InnoDB', 31 | ), 32 | 'fields' => 33 | array ( 34 | 'version_id' => NULL, 35 | 'content_id' => NULL, 36 | 'saved' => 'CURRENT_TIMESTAMP', 37 | 'user' => 0, 38 | 'mode' => 'update', 39 | 'marked' => 0, 40 | 'name' => '', 41 | 'description' => 'Chunk', 42 | 'category' => 0, 43 | 'snippet' => NULL, 44 | 'locked' => 0, 45 | 'properties' => NULL, 46 | ), 47 | 'fieldMeta' => 48 | array ( 49 | 'version_id' => 50 | array ( 51 | 'dbtype' => 'int', 52 | 'precision' => '11', 53 | 'phptype' => 'integer', 54 | 'null' => false, 55 | 'index' => 'pk', 56 | 'generated' => 'native', 57 | 'attributes' => 'unsigned', 58 | ), 59 | 'content_id' => 60 | array ( 61 | 'dbtype' => 'int', 62 | 'precision' => '11', 63 | 'phptype' => 'integer', 64 | 'null' => false, 65 | 'index' => 'fk', 66 | 'attributes' => 'unsigned', 67 | ), 68 | 'saved' => 69 | array ( 70 | 'dbtype' => 'timestamp', 71 | 'phptype' => 'timestamp', 72 | 'null' => false, 73 | 'default' => 'CURRENT_TIMESTAMP', 74 | ), 75 | 'user' => 76 | array ( 77 | 'dbtype' => 'int', 78 | 'precision' => '11', 79 | 'phptype' => 'integer', 80 | 'null' => false, 81 | 'default' => 0, 82 | 'index' => 'fk', 83 | ), 84 | 'mode' => 85 | array ( 86 | 'dbtype' => 'varchar', 87 | 'precision' => '24', 88 | 'phptype' => 'string', 89 | 'null' => false, 90 | 'default' => 'update', 91 | ), 92 | 'marked' => 93 | array ( 94 | 'dbtype' => 'tinyint', 95 | 'precision' => '1', 96 | 'phptype' => 'boolean', 97 | 'default' => 0, 98 | ), 99 | 'name' => 100 | array ( 101 | 'dbtype' => 'varchar', 102 | 'precision' => '50', 103 | 'phptype' => 'string', 104 | 'null' => false, 105 | 'default' => '', 106 | ), 107 | 'description' => 108 | array ( 109 | 'dbtype' => 'varchar', 110 | 'precision' => '255', 111 | 'phptype' => 'string', 112 | 'null' => false, 113 | 'default' => 'Chunk', 114 | ), 115 | 'category' => 116 | array ( 117 | 'dbtype' => 'int', 118 | 'precision' => '11', 119 | 'phptype' => 'integer', 120 | 'null' => false, 121 | 'default' => 0, 122 | 'index' => 'fk', 123 | ), 124 | 'snippet' => 125 | array ( 126 | 'dbtype' => 'mediumtext', 127 | 'phptype' => 'string', 128 | ), 129 | 'locked' => 130 | array ( 131 | 'dbtype' => 'tinyint', 132 | 'precision' => '1', 133 | 'attributes' => 'unsigned', 134 | 'phptype' => 'boolean', 135 | 'null' => false, 136 | 'default' => 0, 137 | ), 138 | 'properties' => 139 | array ( 140 | 'dbtype' => 'mediumtext', 141 | 'phptype' => 'array', 142 | 'null' => true, 143 | ), 144 | ), 145 | 'indexes' => 146 | array ( 147 | 'PRIMARY' => 148 | array ( 149 | 'alias' => 'PRIMARY', 150 | 'primary' => true, 151 | 'unique' => true, 152 | 'type' => 'BTREE', 153 | 'columns' => 154 | array ( 155 | 'version_id' => 156 | array ( 157 | 'length' => '', 158 | 'collation' => 'A', 159 | 'null' => false, 160 | ), 161 | ), 162 | ), 163 | 'content_id' => 164 | array ( 165 | 'alias' => 'content_id', 166 | 'primary' => false, 167 | 'unique' => false, 168 | 'type' => 'BTREE', 169 | 'columns' => 170 | array ( 171 | 'content_id' => 172 | array ( 173 | 'length' => '', 174 | 'collation' => 'A', 175 | 'null' => false, 176 | ), 177 | ), 178 | ), 179 | ), 180 | 'aggregates' => 181 | array ( 182 | 'User' => 183 | array ( 184 | 'class' => 'modUser', 185 | 'local' => 'user', 186 | 'foreign' => 'id', 187 | 'owner' => 'foreign', 188 | 'cardinality' => 'one', 189 | ), 190 | 'Chunk' => 191 | array ( 192 | 'class' => 'modChunk', 193 | 'local' => 'content_id', 194 | 'foreign' => 'id', 195 | 'owner' => 'foreign', 196 | 'cardinality' => 'one', 197 | ), 198 | ), 199 | ); 200 | -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/mysql/vxdelta.class.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | require_once (strtr(realpath(dirname(dirname(__FILE__))), '\\', '/') . '/vxdelta.class.php'); 24 | class vxDelta_mysql extends vxDelta {} 25 | ?> -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/mysql/vxdelta.map.inc.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | $xpdo_meta_map['vxDelta']= array ( 24 | 'package' => 'versionx', 25 | 'version' => '1.1', 26 | 'table' => 'versionx_delta', 27 | 'extends' => 'xPDOSimpleObject', 28 | 'tableMeta' => 29 | array ( 30 | 'engine' => 'InnoDB', 31 | ), 32 | 'fields' => 33 | array ( 34 | 'principal_package' => 'core', 35 | 'principal_class' => NULL, 36 | 'principal' => 0, 37 | 'type_class' => NULL, 38 | 'milestone' => '', 39 | 'time_start' => 'CURRENT_TIMESTAMP', 40 | 'time_end' => 'CURRENT_TIMESTAMP', 41 | ), 42 | 'fieldMeta' => 43 | array ( 44 | 'principal_package' => 45 | array ( 46 | 'dbtype' => 'varchar', 47 | 'precision' => '128', 48 | 'phptype' => 'string', 49 | 'null' => false, 50 | 'default' => 'core', 51 | ), 52 | 'principal_class' => 53 | array ( 54 | 'dbtype' => 'varchar', 55 | 'precision' => '128', 56 | 'phptype' => 'string', 57 | 'null' => false, 58 | ), 59 | 'principal' => 60 | array ( 61 | 'dbtype' => 'int', 62 | 'precision' => '10', 63 | 'attributes' => 'unsigned', 64 | 'phptype' => 'integer', 65 | 'null' => false, 66 | 'default' => 0, 67 | ), 68 | 'type_class' => 69 | array ( 70 | 'dbtype' => 'varchar', 71 | 'precision' => '128', 72 | 'phptype' => 'string', 73 | 'null' => false, 74 | ), 75 | 'milestone' => 76 | array ( 77 | 'dbtype' => 'varchar', 78 | 'precision' => '128', 79 | 'phptype' => 'string', 80 | 'null' => false, 81 | 'default' => '', 82 | ), 83 | 'time_start' => 84 | array ( 85 | 'dbtype' => 'timestamp', 86 | 'phptype' => 'timestamp', 87 | 'null' => false, 88 | 'default' => 'CURRENT_TIMESTAMP', 89 | ), 90 | 'time_end' => 91 | array ( 92 | 'dbtype' => 'timestamp', 93 | 'phptype' => 'timestamp', 94 | 'null' => false, 95 | 'default' => 'CURRENT_TIMESTAMP', 96 | ), 97 | ), 98 | 'indexes' => 99 | array ( 100 | 'principal_class' => 101 | array ( 102 | 'alias' => 'principal_class', 103 | 'primary' => false, 104 | 'unique' => false, 105 | 'type' => 'BTREE', 106 | 'columns' => 107 | array ( 108 | 'principal_class' => 109 | array ( 110 | 'length' => '', 111 | 'collation' => 'A', 112 | 'null' => false, 113 | ), 114 | ), 115 | ), 116 | 'principal' => 117 | array ( 118 | 'alias' => 'principal', 119 | 'primary' => false, 120 | 'unique' => false, 121 | 'type' => 'BTREE', 122 | 'columns' => 123 | array ( 124 | 'principal' => 125 | array ( 126 | 'length' => '', 127 | 'collation' => 'A', 128 | 'null' => false, 129 | ), 130 | ), 131 | ), 132 | 'time_start' => 133 | array ( 134 | 'alias' => 'time_start', 135 | 'primary' => false, 136 | 'unique' => false, 137 | 'type' => 'BTREE', 138 | 'columns' => 139 | array ( 140 | 'time_start' => 141 | array ( 142 | 'length' => '', 143 | 'collation' => 'A', 144 | 'null' => false, 145 | ), 146 | ), 147 | ), 148 | 'time_end' => 149 | array ( 150 | 'alias' => 'time_end', 151 | 'primary' => false, 152 | 'unique' => false, 153 | 'type' => 'BTREE', 154 | 'columns' => 155 | array ( 156 | 'time_end' => 157 | array ( 158 | 'length' => '', 159 | 'collation' => 'A', 160 | 'null' => false, 161 | ), 162 | ), 163 | ), 164 | ), 165 | ); 166 | -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/mysql/vxdeltaeditor.class.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | require_once (strtr(realpath(dirname(dirname(__FILE__))), '\\', '/') . '/vxdeltaeditor.class.php'); 24 | class vxDeltaEditor_mysql extends vxDeltaEditor {} 25 | ?> -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/mysql/vxdeltaeditor.map.inc.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | $xpdo_meta_map['vxDeltaEditor']= array ( 24 | 'package' => 'versionx', 25 | 'version' => '1.1', 26 | 'table' => 'versionx_delta_editor', 27 | 'extends' => 'xPDOSimpleObject', 28 | 'tableMeta' => 29 | array ( 30 | 'engine' => 'InnoDB', 31 | ), 32 | 'fields' => 33 | array ( 34 | 'delta' => 0, 35 | 'user' => 0, 36 | ), 37 | 'fieldMeta' => 38 | array ( 39 | 'delta' => 40 | array ( 41 | 'dbtype' => 'int', 42 | 'precision' => '10', 43 | 'attributes' => 'unsigned', 44 | 'phptype' => 'integer', 45 | 'null' => false, 46 | 'default' => 0, 47 | ), 48 | 'user' => 49 | array ( 50 | 'dbtype' => 'int', 51 | 'precision' => '10', 52 | 'attributes' => 'unsigned', 53 | 'phptype' => 'integer', 54 | 'null' => false, 55 | 'default' => 0, 56 | ), 57 | ), 58 | 'indexes' => 59 | array ( 60 | 'delta' => 61 | array ( 62 | 'alias' => 'delta', 63 | 'primary' => false, 64 | 'unique' => false, 65 | 'type' => 'BTREE', 66 | 'columns' => 67 | array ( 68 | 'delta' => 69 | array ( 70 | 'length' => '', 71 | 'collation' => 'A', 72 | 'null' => false, 73 | ), 74 | ), 75 | ), 76 | 'user' => 77 | array ( 78 | 'alias' => 'user', 79 | 'primary' => false, 80 | 'unique' => false, 81 | 'type' => 'BTREE', 82 | 'columns' => 83 | array ( 84 | 'user' => 85 | array ( 86 | 'length' => '', 87 | 'collation' => 'A', 88 | 'null' => false, 89 | ), 90 | ), 91 | ), 92 | ), 93 | ); 94 | -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/mysql/vxdeltafield.class.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | require_once (strtr(realpath(dirname(dirname(__FILE__))), '\\', '/') . '/vxdeltafield.class.php'); 24 | class vxDeltaField_mysql extends vxDeltaField {} 25 | ?> -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/mysql/vxdeltafield.map.inc.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | $xpdo_meta_map['vxDeltaField']= array ( 24 | 'package' => 'versionx', 25 | 'version' => '1.1', 26 | 'table' => 'versionx_delta_field', 27 | 'extends' => 'xPDOSimpleObject', 28 | 'tableMeta' => 29 | array ( 30 | 'engine' => 'InnoDB', 31 | ), 32 | 'fields' => 33 | array ( 34 | 'delta' => 0, 35 | 'field' => NULL, 36 | 'field_type' => 'text', 37 | 'before_type' => '', 38 | 'after_type' => '', 39 | 'before' => '', 40 | 'after' => '', 41 | ), 42 | 'fieldMeta' => 43 | array ( 44 | 'delta' => 45 | array ( 46 | 'dbtype' => 'int', 47 | 'precision' => '10', 48 | 'attributes' => 'unsigned', 49 | 'phptype' => 'integer', 50 | 'null' => false, 51 | 'default' => 0, 52 | ), 53 | 'field' => 54 | array ( 55 | 'dbtype' => 'varchar', 56 | 'precision' => '128', 57 | 'phptype' => 'string', 58 | 'null' => false, 59 | ), 60 | 'field_type' => 61 | array ( 62 | 'dbtype' => 'varchar', 63 | 'precision' => '128', 64 | 'phptype' => 'string', 65 | 'null' => false, 66 | 'default' => 'text', 67 | ), 68 | 'before_type' => 69 | array ( 70 | 'dbtype' => 'varchar', 71 | 'precision' => '7', 72 | 'phptype' => 'string', 73 | 'null' => false, 74 | 'default' => '', 75 | ), 76 | 'after_type' => 77 | array ( 78 | 'dbtype' => 'varchar', 79 | 'precision' => '7', 80 | 'phptype' => 'string', 81 | 'null' => false, 82 | 'default' => '', 83 | ), 84 | 'before' => 85 | array ( 86 | 'dbtype' => 'mediumtext', 87 | 'phptype' => 'string', 88 | 'null' => false, 89 | 'default' => '', 90 | ), 91 | 'after' => 92 | array ( 93 | 'dbtype' => 'mediumtext', 94 | 'phptype' => 'string', 95 | 'null' => false, 96 | 'default' => '', 97 | ), 98 | ), 99 | 'indexes' => 100 | array ( 101 | 'delta' => 102 | array ( 103 | 'alias' => 'delta', 104 | 'primary' => false, 105 | 'unique' => false, 106 | 'type' => 'BTREE', 107 | 'columns' => 108 | array ( 109 | 'delta' => 110 | array ( 111 | 'length' => '', 112 | 'collation' => 'A', 113 | 'null' => false, 114 | ), 115 | ), 116 | ), 117 | 'field' => 118 | array ( 119 | 'alias' => 'field', 120 | 'primary' => false, 121 | 'unique' => false, 122 | 'type' => 'BTREE', 123 | 'columns' => 124 | array ( 125 | 'field' => 126 | array ( 127 | 'length' => '', 128 | 'collation' => 'A', 129 | 'null' => false, 130 | ), 131 | ), 132 | ), 133 | ), 134 | ); 135 | -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/mysql/vxplugin.class.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | require_once (strtr(realpath(dirname(dirname(__FILE__))), '\\', '/') . '/vxplugin.class.php'); 24 | class vxPlugin_mysql extends vxPlugin {} 25 | ?> -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/mysql/vxplugin.map.inc.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | $xpdo_meta_map['vxPlugin']= array ( 24 | 'package' => 'versionx', 25 | 'version' => '1.1', 26 | 'table' => 'versionx_plugin', 27 | 'extends' => 'xPDOObject', 28 | 'tableMeta' => 29 | array ( 30 | 'engine' => 'InnoDB', 31 | ), 32 | 'fields' => 33 | array ( 34 | 'version_id' => NULL, 35 | 'content_id' => NULL, 36 | 'saved' => 'CURRENT_TIMESTAMP', 37 | 'user' => 0, 38 | 'mode' => 'update', 39 | 'marked' => 0, 40 | 'name' => '', 41 | 'description' => 'Chunk', 42 | 'category' => 0, 43 | 'plugincode' => '', 44 | 'locked' => 0, 45 | 'properties' => NULL, 46 | 'disabled' => 0, 47 | ), 48 | 'fieldMeta' => 49 | array ( 50 | 'version_id' => 51 | array ( 52 | 'dbtype' => 'int', 53 | 'precision' => '11', 54 | 'phptype' => 'integer', 55 | 'null' => false, 56 | 'index' => 'pk', 57 | 'generated' => 'native', 58 | 'attributes' => 'unsigned', 59 | ), 60 | 'content_id' => 61 | array ( 62 | 'dbtype' => 'int', 63 | 'precision' => '11', 64 | 'phptype' => 'integer', 65 | 'null' => false, 66 | 'index' => 'fk', 67 | 'attributes' => 'unsigned', 68 | ), 69 | 'saved' => 70 | array ( 71 | 'dbtype' => 'timestamp', 72 | 'phptype' => 'timestamp', 73 | 'null' => false, 74 | 'default' => 'CURRENT_TIMESTAMP', 75 | ), 76 | 'user' => 77 | array ( 78 | 'dbtype' => 'int', 79 | 'precision' => '11', 80 | 'phptype' => 'integer', 81 | 'null' => false, 82 | 'default' => 0, 83 | 'index' => 'fk', 84 | ), 85 | 'mode' => 86 | array ( 87 | 'dbtype' => 'varchar', 88 | 'precision' => '24', 89 | 'phptype' => 'string', 90 | 'null' => false, 91 | 'default' => 'update', 92 | ), 93 | 'marked' => 94 | array ( 95 | 'dbtype' => 'tinyint', 96 | 'precision' => '1', 97 | 'phptype' => 'boolean', 98 | 'default' => 0, 99 | ), 100 | 'name' => 101 | array ( 102 | 'dbtype' => 'varchar', 103 | 'precision' => '50', 104 | 'phptype' => 'string', 105 | 'null' => false, 106 | 'default' => '', 107 | ), 108 | 'description' => 109 | array ( 110 | 'dbtype' => 'varchar', 111 | 'precision' => '255', 112 | 'phptype' => 'string', 113 | 'null' => false, 114 | 'default' => 'Chunk', 115 | ), 116 | 'category' => 117 | array ( 118 | 'dbtype' => 'int', 119 | 'precision' => '11', 120 | 'phptype' => 'integer', 121 | 'null' => false, 122 | 'default' => 0, 123 | 'index' => 'fk', 124 | ), 125 | 'plugincode' => 126 | array ( 127 | 'dbtype' => 'mediumtext', 128 | 'phptype' => 'string', 129 | 'null' => false, 130 | 'default' => '', 131 | ), 132 | 'locked' => 133 | array ( 134 | 'dbtype' => 'tinyint', 135 | 'precision' => '1', 136 | 'attributes' => 'unsigned', 137 | 'phptype' => 'boolean', 138 | 'null' => false, 139 | 'default' => 0, 140 | ), 141 | 'properties' => 142 | array ( 143 | 'dbtype' => 'mediumtext', 144 | 'phptype' => 'array', 145 | 'null' => true, 146 | ), 147 | 'disabled' => 148 | array ( 149 | 'dbtype' => 'tinyint', 150 | 'precision' => '1', 151 | 'attributes' => 'unsigned', 152 | 'phptype' => 'boolean', 153 | 'null' => false, 154 | 'default' => 0, 155 | ), 156 | ), 157 | 'indexes' => 158 | array ( 159 | 'PRIMARY' => 160 | array ( 161 | 'alias' => 'PRIMARY', 162 | 'primary' => true, 163 | 'unique' => true, 164 | 'type' => 'BTREE', 165 | 'columns' => 166 | array ( 167 | 'version_id' => 168 | array ( 169 | 'length' => '', 170 | 'collation' => 'A', 171 | 'null' => false, 172 | ), 173 | ), 174 | ), 175 | 'content_id' => 176 | array ( 177 | 'alias' => 'content_id', 178 | 'primary' => false, 179 | 'unique' => false, 180 | 'type' => 'BTREE', 181 | 'columns' => 182 | array ( 183 | 'content_id' => 184 | array ( 185 | 'length' => '', 186 | 'collation' => 'A', 187 | 'null' => false, 188 | ), 189 | ), 190 | ), 191 | ), 192 | 'aggregates' => 193 | array ( 194 | 'User' => 195 | array ( 196 | 'class' => 'modUser', 197 | 'local' => 'user', 198 | 'foreign' => 'id', 199 | 'owner' => 'foreign', 200 | 'cardinality' => 'one', 201 | ), 202 | 'Plugin' => 203 | array ( 204 | 'class' => 'modPlugin', 205 | 'local' => 'content_id', 206 | 'foreign' => 'id', 207 | 'owner' => 'foreign', 208 | 'cardinality' => 'one', 209 | ), 210 | ), 211 | ); 212 | -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/mysql/vxresource.class.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | require_once (strtr(realpath(dirname(dirname(__FILE__))), '\\', '/') . '/vxresource.class.php'); 24 | class vxResource_mysql extends vxResource {} 25 | ?> -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/mysql/vxresource.map.inc.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | $xpdo_meta_map['vxResource']= array ( 24 | 'package' => 'versionx', 25 | 'version' => '1.1', 26 | 'table' => 'versionx_resource', 27 | 'extends' => 'xPDOObject', 28 | 'tableMeta' => 29 | array ( 30 | 'engine' => 'InnoDB', 31 | ), 32 | 'fields' => 33 | array ( 34 | 'version_id' => NULL, 35 | 'content_id' => NULL, 36 | 'saved' => 'CURRENT_TIMESTAMP', 37 | 'user' => 0, 38 | 'mode' => 'update', 39 | 'marked' => 0, 40 | 'title' => 'Unnamed', 41 | 'context_key' => 'web', 42 | 'class' => 'modDocument', 43 | 'content' => NULL, 44 | 'fields' => NULL, 45 | 'tvs' => NULL, 46 | ), 47 | 'fieldMeta' => 48 | array ( 49 | 'version_id' => 50 | array ( 51 | 'dbtype' => 'int', 52 | 'precision' => '11', 53 | 'phptype' => 'integer', 54 | 'null' => false, 55 | 'index' => 'pk', 56 | 'generated' => 'native', 57 | 'attributes' => 'unsigned', 58 | ), 59 | 'content_id' => 60 | array ( 61 | 'dbtype' => 'int', 62 | 'precision' => '11', 63 | 'phptype' => 'integer', 64 | 'null' => false, 65 | 'index' => 'fk', 66 | 'attributes' => 'unsigned', 67 | ), 68 | 'saved' => 69 | array ( 70 | 'dbtype' => 'timestamp', 71 | 'phptype' => 'timestamp', 72 | 'null' => false, 73 | 'default' => 'CURRENT_TIMESTAMP', 74 | ), 75 | 'user' => 76 | array ( 77 | 'dbtype' => 'int', 78 | 'precision' => '11', 79 | 'phptype' => 'integer', 80 | 'null' => false, 81 | 'default' => 0, 82 | 'index' => 'fk', 83 | ), 84 | 'mode' => 85 | array ( 86 | 'dbtype' => 'varchar', 87 | 'precision' => '24', 88 | 'phptype' => 'string', 89 | 'null' => false, 90 | 'default' => 'update', 91 | ), 92 | 'marked' => 93 | array ( 94 | 'dbtype' => 'tinyint', 95 | 'precision' => '1', 96 | 'phptype' => 'boolean', 97 | 'default' => 0, 98 | ), 99 | 'title' => 100 | array ( 101 | 'dbtype' => 'varchar', 102 | 'precision' => '255', 103 | 'phptype' => 'string', 104 | 'null' => false, 105 | 'default' => 'Unnamed', 106 | ), 107 | 'context_key' => 108 | array ( 109 | 'dbtype' => 'varchar', 110 | 'precision' => '255', 111 | 'phptype' => 'string', 112 | 'null' => false, 113 | 'default' => 'web', 114 | ), 115 | 'class' => 116 | array ( 117 | 'dbtype' => 'varchar', 118 | 'precision' => '255', 119 | 'phptype' => 'string', 120 | 'null' => false, 121 | 'default' => 'modDocument', 122 | ), 123 | 'content' => 124 | array ( 125 | 'dbtype' => 'mediumtext', 126 | 'phptype' => 'string', 127 | 'null' => false, 128 | ), 129 | 'fields' => 130 | array ( 131 | 'dbtype' => 'mediumtext', 132 | 'phptype' => 'array', 133 | 'null' => false, 134 | ), 135 | 'tvs' => 136 | array ( 137 | 'dbtype' => 'mediumtext', 138 | 'phptype' => 'array', 139 | 'null' => false, 140 | ), 141 | ), 142 | 'indexes' => 143 | array ( 144 | 'PRIMARY' => 145 | array ( 146 | 'alias' => 'PRIMARY', 147 | 'primary' => true, 148 | 'unique' => true, 149 | 'type' => 'BTREE', 150 | 'columns' => 151 | array ( 152 | 'version_id' => 153 | array ( 154 | 'length' => '', 155 | 'collation' => 'A', 156 | 'null' => false, 157 | ), 158 | ), 159 | ), 160 | 'content_id' => 161 | array ( 162 | 'alias' => 'content_id', 163 | 'primary' => false, 164 | 'unique' => false, 165 | 'type' => 'BTREE', 166 | 'columns' => 167 | array ( 168 | 'content_id' => 169 | array ( 170 | 'length' => '', 171 | 'collation' => 'A', 172 | 'null' => false, 173 | ), 174 | ), 175 | ), 176 | ), 177 | 'aggregates' => 178 | array ( 179 | 'User' => 180 | array ( 181 | 'class' => 'modUser', 182 | 'local' => 'user', 183 | 'foreign' => 'id', 184 | 'owner' => 'foreign', 185 | 'cardinality' => 'one', 186 | ), 187 | 'Resource' => 188 | array ( 189 | 'class' => 'modResource', 190 | 'local' => 'content_id', 191 | 'foreign' => 'id', 192 | 'owner' => 'foreign', 193 | 'cardinality' => 'one', 194 | ), 195 | ), 196 | ); 197 | -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/mysql/vxsnippet.class.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | require_once (strtr(realpath(dirname(dirname(__FILE__))), '\\', '/') . '/vxsnippet.class.php'); 24 | class vxSnippet_mysql extends vxSnippet {} 25 | ?> -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/mysql/vxsnippet.map.inc.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | $xpdo_meta_map['vxSnippet']= array ( 24 | 'package' => 'versionx', 25 | 'version' => '1.1', 26 | 'table' => 'versionx_snippet', 27 | 'extends' => 'xPDOObject', 28 | 'tableMeta' => 29 | array ( 30 | 'engine' => 'InnoDB', 31 | ), 32 | 'fields' => 33 | array ( 34 | 'version_id' => NULL, 35 | 'content_id' => NULL, 36 | 'saved' => 'CURRENT_TIMESTAMP', 37 | 'user' => 0, 38 | 'mode' => 'update', 39 | 'marked' => 0, 40 | 'name' => '', 41 | 'description' => 'Chunk', 42 | 'category' => 0, 43 | 'snippet' => NULL, 44 | 'locked' => 0, 45 | 'properties' => NULL, 46 | ), 47 | 'fieldMeta' => 48 | array ( 49 | 'version_id' => 50 | array ( 51 | 'dbtype' => 'int', 52 | 'precision' => '11', 53 | 'phptype' => 'integer', 54 | 'null' => false, 55 | 'index' => 'pk', 56 | 'generated' => 'native', 57 | 'attributes' => 'unsigned', 58 | ), 59 | 'content_id' => 60 | array ( 61 | 'dbtype' => 'int', 62 | 'precision' => '11', 63 | 'phptype' => 'integer', 64 | 'null' => false, 65 | 'index' => 'fk', 66 | 'attributes' => 'unsigned', 67 | ), 68 | 'saved' => 69 | array ( 70 | 'dbtype' => 'timestamp', 71 | 'phptype' => 'timestamp', 72 | 'null' => false, 73 | 'default' => 'CURRENT_TIMESTAMP', 74 | ), 75 | 'user' => 76 | array ( 77 | 'dbtype' => 'int', 78 | 'precision' => '11', 79 | 'phptype' => 'integer', 80 | 'null' => false, 81 | 'default' => 0, 82 | 'index' => 'fk', 83 | ), 84 | 'mode' => 85 | array ( 86 | 'dbtype' => 'varchar', 87 | 'precision' => '24', 88 | 'phptype' => 'string', 89 | 'null' => false, 90 | 'default' => 'update', 91 | ), 92 | 'marked' => 93 | array ( 94 | 'dbtype' => 'tinyint', 95 | 'precision' => '1', 96 | 'phptype' => 'boolean', 97 | 'default' => 0, 98 | ), 99 | 'name' => 100 | array ( 101 | 'dbtype' => 'varchar', 102 | 'precision' => '50', 103 | 'phptype' => 'string', 104 | 'null' => false, 105 | 'default' => '', 106 | ), 107 | 'description' => 108 | array ( 109 | 'dbtype' => 'varchar', 110 | 'precision' => '255', 111 | 'phptype' => 'string', 112 | 'null' => false, 113 | 'default' => 'Chunk', 114 | ), 115 | 'category' => 116 | array ( 117 | 'dbtype' => 'int', 118 | 'precision' => '11', 119 | 'phptype' => 'integer', 120 | 'null' => false, 121 | 'default' => 0, 122 | 'index' => 'fk', 123 | ), 124 | 'snippet' => 125 | array ( 126 | 'dbtype' => 'mediumtext', 127 | 'phptype' => 'string', 128 | ), 129 | 'locked' => 130 | array ( 131 | 'dbtype' => 'tinyint', 132 | 'precision' => '1', 133 | 'attributes' => 'unsigned', 134 | 'phptype' => 'boolean', 135 | 'null' => false, 136 | 'default' => 0, 137 | ), 138 | 'properties' => 139 | array ( 140 | 'dbtype' => 'mediumtext', 141 | 'phptype' => 'array', 142 | 'null' => true, 143 | ), 144 | ), 145 | 'indexes' => 146 | array ( 147 | 'PRIMARY' => 148 | array ( 149 | 'alias' => 'PRIMARY', 150 | 'primary' => true, 151 | 'unique' => true, 152 | 'type' => 'BTREE', 153 | 'columns' => 154 | array ( 155 | 'version_id' => 156 | array ( 157 | 'length' => '', 158 | 'collation' => 'A', 159 | 'null' => false, 160 | ), 161 | ), 162 | ), 163 | 'content_id' => 164 | array ( 165 | 'alias' => 'content_id', 166 | 'primary' => false, 167 | 'unique' => false, 168 | 'type' => 'BTREE', 169 | 'columns' => 170 | array ( 171 | 'content_id' => 172 | array ( 173 | 'length' => '', 174 | 'collation' => 'A', 175 | 'null' => false, 176 | ), 177 | ), 178 | ), 179 | ), 180 | 'aggregates' => 181 | array ( 182 | 'User' => 183 | array ( 184 | 'class' => 'modUser', 185 | 'local' => 'user', 186 | 'foreign' => 'id', 187 | 'owner' => 'foreign', 188 | 'cardinality' => 'one', 189 | ), 190 | 'Snippet' => 191 | array ( 192 | 'class' => 'modSnippet', 193 | 'local' => 'content_id', 194 | 'foreign' => 'id', 195 | 'owner' => 'foreign', 196 | 'cardinality' => 'one', 197 | ), 198 | ), 199 | ); 200 | -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/mysql/vxtemplate.class.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | require_once (strtr(realpath(dirname(dirname(__FILE__))), '\\', '/') . '/vxtemplate.class.php'); 24 | class vxTemplate_mysql extends vxTemplate {} 25 | ?> -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/mysql/vxtemplate.map.inc.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | $xpdo_meta_map['vxTemplate']= array ( 24 | 'package' => 'versionx', 25 | 'version' => '1.1', 26 | 'table' => 'versionx_template', 27 | 'extends' => 'xPDOObject', 28 | 'tableMeta' => 29 | array ( 30 | 'engine' => 'InnoDB', 31 | ), 32 | 'fields' => 33 | array ( 34 | 'version_id' => NULL, 35 | 'content_id' => NULL, 36 | 'saved' => 'CURRENT_TIMESTAMP', 37 | 'user' => 0, 38 | 'mode' => 'update', 39 | 'marked' => 0, 40 | 'templatename' => NULL, 41 | 'description' => 'Template', 42 | 'category' => 0, 43 | 'content' => '', 44 | 'locked' => 0, 45 | 'properties' => NULL, 46 | ), 47 | 'fieldMeta' => 48 | array ( 49 | 'version_id' => 50 | array ( 51 | 'dbtype' => 'int', 52 | 'precision' => '11', 53 | 'phptype' => 'integer', 54 | 'null' => false, 55 | 'index' => 'pk', 56 | 'generated' => 'native', 57 | 'attributes' => 'unsigned', 58 | ), 59 | 'content_id' => 60 | array ( 61 | 'dbtype' => 'int', 62 | 'precision' => '11', 63 | 'phptype' => 'integer', 64 | 'null' => false, 65 | 'index' => 'fk', 66 | 'attributes' => 'unsigned', 67 | ), 68 | 'saved' => 69 | array ( 70 | 'dbtype' => 'timestamp', 71 | 'phptype' => 'timestamp', 72 | 'null' => false, 73 | 'default' => 'CURRENT_TIMESTAMP', 74 | ), 75 | 'user' => 76 | array ( 77 | 'dbtype' => 'int', 78 | 'precision' => '11', 79 | 'phptype' => 'integer', 80 | 'null' => false, 81 | 'default' => 0, 82 | 'index' => 'fk', 83 | ), 84 | 'mode' => 85 | array ( 86 | 'dbtype' => 'varchar', 87 | 'precision' => '24', 88 | 'phptype' => 'string', 89 | 'null' => false, 90 | 'default' => 'update', 91 | ), 92 | 'marked' => 93 | array ( 94 | 'dbtype' => 'tinyint', 95 | 'precision' => '1', 96 | 'phptype' => 'boolean', 97 | 'default' => 0, 98 | ), 99 | 'templatename' => 100 | array ( 101 | 'dbtype' => 'varchar', 102 | 'precision' => '50', 103 | 'phptype' => 'string', 104 | 'null' => false, 105 | ), 106 | 'description' => 107 | array ( 108 | 'dbtype' => 'varchar', 109 | 'precision' => '255', 110 | 'phptype' => 'string', 111 | 'default' => 'Template', 112 | ), 113 | 'category' => 114 | array ( 115 | 'dbtype' => 'int', 116 | 'precision' => '11', 117 | 'phptype' => 'integer', 118 | 'null' => false, 119 | 'default' => 0, 120 | 'index' => 'fk', 121 | ), 122 | 'content' => 123 | array ( 124 | 'dbtype' => 'mediumtext', 125 | 'phptype' => 'string', 126 | 'null' => false, 127 | 'default' => '', 128 | ), 129 | 'locked' => 130 | array ( 131 | 'dbtype' => 'tinyint', 132 | 'precision' => '1', 133 | 'attributes' => 'unsigned', 134 | 'phptype' => 'boolean', 135 | 'null' => false, 136 | 'default' => 0, 137 | ), 138 | 'properties' => 139 | array ( 140 | 'dbtype' => 'mediumtext', 141 | 'phptype' => 'array', 142 | 'null' => true, 143 | ), 144 | ), 145 | 'indexes' => 146 | array ( 147 | 'PRIMARY' => 148 | array ( 149 | 'alias' => 'PRIMARY', 150 | 'primary' => true, 151 | 'unique' => true, 152 | 'type' => 'BTREE', 153 | 'columns' => 154 | array ( 155 | 'version_id' => 156 | array ( 157 | 'length' => '', 158 | 'collation' => 'A', 159 | 'null' => false, 160 | ), 161 | ), 162 | ), 163 | 'content_id' => 164 | array ( 165 | 'alias' => 'content_id', 166 | 'primary' => false, 167 | 'unique' => false, 168 | 'type' => 'BTREE', 169 | 'columns' => 170 | array ( 171 | 'content_id' => 172 | array ( 173 | 'length' => '', 174 | 'collation' => 'A', 175 | 'null' => false, 176 | ), 177 | ), 178 | ), 179 | ), 180 | 'aggregates' => 181 | array ( 182 | 'User' => 183 | array ( 184 | 'class' => 'modUser', 185 | 'local' => 'user', 186 | 'foreign' => 'id', 187 | 'owner' => 'foreign', 188 | 'cardinality' => 'one', 189 | ), 190 | 'Template' => 191 | array ( 192 | 'class' => 'modTemplate', 193 | 'local' => 'content_id', 194 | 'foreign' => 'id', 195 | 'owner' => 'foreign', 196 | 'cardinality' => 'one', 197 | ), 198 | ), 199 | ); 200 | -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/mysql/vxtemplatevar.class.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | require_once (strtr(realpath(dirname(dirname(__FILE__))), '\\', '/') . '/vxtemplatevar.class.php'); 24 | class vxTemplateVar_mysql extends vxTemplateVar {} 25 | ?> -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/mysql/vxtemplatevar.map.inc.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | $xpdo_meta_map['vxTemplateVar']= array ( 24 | 'package' => 'versionx', 25 | 'version' => '1.1', 26 | 'table' => 'versionx_templatevar', 27 | 'extends' => 'xPDOObject', 28 | 'tableMeta' => 29 | array ( 30 | 'engine' => 'InnoDB', 31 | ), 32 | 'fields' => 33 | array ( 34 | 'version_id' => NULL, 35 | 'content_id' => NULL, 36 | 'saved' => 'CURRENT_TIMESTAMP', 37 | 'user' => 0, 38 | 'mode' => 'update', 39 | 'marked' => 0, 40 | 'type' => '', 41 | 'name' => '', 42 | 'caption' => '', 43 | 'description' => '', 44 | 'category' => 0, 45 | 'locked' => 0, 46 | 'rank' => 0, 47 | 'display' => '', 48 | 'default_text' => NULL, 49 | 'properties' => NULL, 50 | 'input_properties' => NULL, 51 | 'output_properties' => NULL, 52 | ), 53 | 'fieldMeta' => 54 | array ( 55 | 'version_id' => 56 | array ( 57 | 'dbtype' => 'int', 58 | 'precision' => '11', 59 | 'phptype' => 'integer', 60 | 'null' => false, 61 | 'index' => 'pk', 62 | 'generated' => 'native', 63 | 'attributes' => 'unsigned', 64 | ), 65 | 'content_id' => 66 | array ( 67 | 'dbtype' => 'int', 68 | 'precision' => '11', 69 | 'phptype' => 'integer', 70 | 'null' => false, 71 | 'index' => 'fk', 72 | 'attributes' => 'unsigned', 73 | ), 74 | 'saved' => 75 | array ( 76 | 'dbtype' => 'timestamp', 77 | 'phptype' => 'timestamp', 78 | 'null' => false, 79 | 'default' => 'CURRENT_TIMESTAMP', 80 | ), 81 | 'user' => 82 | array ( 83 | 'dbtype' => 'int', 84 | 'precision' => '11', 85 | 'phptype' => 'integer', 86 | 'null' => false, 87 | 'default' => 0, 88 | 'index' => 'fk', 89 | ), 90 | 'mode' => 91 | array ( 92 | 'dbtype' => 'varchar', 93 | 'precision' => '24', 94 | 'phptype' => 'string', 95 | 'null' => false, 96 | 'default' => 'update', 97 | ), 98 | 'marked' => 99 | array ( 100 | 'dbtype' => 'tinyint', 101 | 'precision' => '1', 102 | 'phptype' => 'boolean', 103 | 'default' => 0, 104 | ), 105 | 'type' => 106 | array ( 107 | 'dbtype' => 'varchar', 108 | 'precision' => '20', 109 | 'phptype' => 'string', 110 | 'null' => false, 111 | 'default' => '', 112 | ), 113 | 'name' => 114 | array ( 115 | 'dbtype' => 'varchar', 116 | 'precision' => '50', 117 | 'phptype' => 'string', 118 | 'null' => false, 119 | 'default' => '', 120 | ), 121 | 'caption' => 122 | array ( 123 | 'dbtype' => 'varchar', 124 | 'precision' => '80', 125 | 'phptype' => 'string', 126 | 'null' => false, 127 | 'default' => '', 128 | ), 129 | 'description' => 130 | array ( 131 | 'dbtype' => 'varchar', 132 | 'precision' => '255', 133 | 'phptype' => 'string', 134 | 'null' => false, 135 | 'default' => '', 136 | ), 137 | 'category' => 138 | array ( 139 | 'dbtype' => 'int', 140 | 'precision' => '11', 141 | 'phptype' => 'integer', 142 | 'null' => false, 143 | 'default' => 0, 144 | ), 145 | 'locked' => 146 | array ( 147 | 'dbtype' => 'tinyint', 148 | 'precision' => '1', 149 | 'attributes' => 'unsigned', 150 | 'phptype' => 'boolean', 151 | 'null' => false, 152 | 'default' => 0, 153 | ), 154 | 'rank' => 155 | array ( 156 | 'dbtype' => 'int', 157 | 'precision' => '11', 158 | 'phptype' => 'integer', 159 | 'null' => false, 160 | 'default' => 0, 161 | ), 162 | 'display' => 163 | array ( 164 | 'dbtype' => 'varchar', 165 | 'precision' => '20', 166 | 'phptype' => 'string', 167 | 'null' => false, 168 | 'default' => '', 169 | ), 170 | 'default_text' => 171 | array ( 172 | 'dbtype' => 'varchar', 173 | 'precision' => '2000', 174 | 'phptype' => 'string', 175 | ), 176 | 'properties' => 177 | array ( 178 | 'dbtype' => 'mediumtext', 179 | 'phptype' => 'array', 180 | 'null' => true, 181 | ), 182 | 'input_properties' => 183 | array ( 184 | 'dbtype' => 'mediumtext', 185 | 'phptype' => 'array', 186 | 'null' => true, 187 | ), 188 | 'output_properties' => 189 | array ( 190 | 'dbtype' => 'mediumtext', 191 | 'phptype' => 'array', 192 | 'null' => true, 193 | ), 194 | ), 195 | 'indexes' => 196 | array ( 197 | 'PRIMARY' => 198 | array ( 199 | 'alias' => 'PRIMARY', 200 | 'primary' => true, 201 | 'unique' => true, 202 | 'type' => 'BTREE', 203 | 'columns' => 204 | array ( 205 | 'version_id' => 206 | array ( 207 | 'length' => '', 208 | 'collation' => 'A', 209 | 'null' => false, 210 | ), 211 | ), 212 | ), 213 | 'content_id' => 214 | array ( 215 | 'alias' => 'content_id', 216 | 'primary' => false, 217 | 'unique' => false, 218 | 'type' => 'BTREE', 219 | 'columns' => 220 | array ( 221 | 'content_id' => 222 | array ( 223 | 'length' => '', 224 | 'collation' => 'A', 225 | 'null' => false, 226 | ), 227 | ), 228 | ), 229 | ), 230 | 'aggregates' => 231 | array ( 232 | 'User' => 233 | array ( 234 | 'class' => 'modUser', 235 | 'local' => 'user', 236 | 'foreign' => 'id', 237 | 'owner' => 'foreign', 238 | 'cardinality' => 'one', 239 | ), 240 | 'TemplateVar' => 241 | array ( 242 | 'class' => 'modTemplateVar', 243 | 'local' => 'content_id', 244 | 'foreign' => 'id', 245 | 'owner' => 'foreign', 246 | 'cardinality' => 'one', 247 | ), 248 | ), 249 | ); 250 | -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/vxchunk.class.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | * @deprecated 23 | */ 24 | class vxChunk extends xPDOObject { 25 | public static $excludeFields = array( 26 | 'version_id', 27 | 'saved', 28 | 'user', 29 | 'mode', 30 | 'marked', 31 | ); 32 | 33 | public static $tabJavascript = array( 34 | 'chunks/panel.chunks.js', 35 | 'chunks/grid.chunks.js', 36 | ); 37 | 38 | public static $tabTpl = 'mgr/tabs/chunks'; 39 | 40 | /** 41 | * Gets the excluded fields. 42 | * @static 43 | * @return array 44 | */ 45 | public static function getExcludeFields () { 46 | return self::$excludeFields; 47 | } 48 | 49 | /** 50 | * @static 51 | * @return array 52 | */ 53 | public static function getTabJavascript() { 54 | return self::$tabJavascript; 55 | } 56 | 57 | /** 58 | * Gets the tab template file name. 59 | * @static 60 | * @return string 61 | */ 62 | public static function getTabTpl() { 63 | return self::$tabTpl; 64 | } 65 | 66 | /** 67 | * Reverts a chunk to the selected version. 68 | * @param array $options 69 | * 70 | * @return bool 71 | */ 72 | public function revert(array $options = array()) { 73 | if (!$this->get('content_id')) { 74 | return false; 75 | } 76 | 77 | /* @var modChunk $chunk */ 78 | $chunk = $this->xpdo->getObject('modChunk',$this->get('content_id')); 79 | if (!($chunk instanceof modChunk)) { 80 | /* Could not find the chunk, so we'll assume it was deleted. We'll create a new chunk and force that ID. */ 81 | $chunk = $this->xpdo->newObject('modChunk'); 82 | $chunk->set('id', $this->get('content_id')); 83 | } 84 | 85 | $chunk->fromArray(array( 86 | 'name' => $this->get('name'), 87 | 'description' => $this->get('description'), 88 | 'category' => ($this->xpdo->getCount('modCategory',array('id' => $this->get('category'))) > 0) ? $this->get('category') : 0, 89 | 'snippet' => $this->get('snippet'), 90 | 'locked' => $this->get('locked'), 91 | ), '', true); 92 | 93 | 94 | return $chunk->save(); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/vxdelta.class.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | class vxDelta extends xPDOSimpleObject {} 24 | ?> -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/vxdeltaeditor.class.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | class vxDeltaEditor extends xPDOSimpleObject {} 24 | ?> -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/vxdeltafield.class.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | */ 23 | class vxDeltaField extends xPDOSimpleObject {} 24 | ?> -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/vxplugin.class.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | * @deprecated 23 | */ 24 | class vxPlugin extends xPDOObject { 25 | public static $excludeFields = array( 26 | 'version_id', 27 | 'saved', 28 | 'user', 29 | 'mode', 30 | 'marked', 31 | ); 32 | 33 | public static $tabJavascript = array( 34 | 'plugins/panel.plugins.js', 35 | 'plugins/grid.plugins.js', 36 | ); 37 | 38 | public static $tabTpl = 'mgr/tabs/plugins'; 39 | /** 40 | * Gets the excluded fields. 41 | * @static 42 | * @return array 43 | */ 44 | public static function getExcludeFields () { 45 | return self::$excludeFields; 46 | } 47 | /** 48 | * @static 49 | * @return array 50 | */ 51 | public static function getTabJavascript() { 52 | return self::$tabJavascript; 53 | } 54 | 55 | /** 56 | * Gets the tab template file name. 57 | * @static 58 | * @return string 59 | */ 60 | public static function getTabTpl() { 61 | return self::$tabTpl; 62 | } 63 | 64 | /** 65 | * Reverts a snippet to the selected version. 66 | * @param array $options 67 | * 68 | * @return bool 69 | */ 70 | public function revert(array $options = array()) { 71 | if (!$this->get('content_id')) { 72 | return false; 73 | } 74 | 75 | /* @var modPlugin $object */ 76 | $object = $this->xpdo->getObject('modPlugin',$this->get('content_id')); 77 | if (!($object instanceof modPlugin)) { 78 | /* Could not find the snippet, so we'll assume it was deleted. We'll create a new one and force that ID. */ 79 | $object = $this->xpdo->newObject('modPlugin'); 80 | $object->set('id', $this->get('content_id')); 81 | } 82 | 83 | $object->fromArray(array( 84 | 'name' => $this->get('name'), 85 | 'description' => $this->get('description'), 86 | 'category' => ($this->xpdo->getCount('modCategory',array('id' => $this->get('category'))) > 0) ? $this->get('category') : 0, 87 | 'plugincode' => $this->get('plugincode'), 88 | 'locked' => $this->get('locked'), 89 | 'disabled' => $this->get('disabled'), 90 | ), '', true); 91 | 92 | return $object->save(); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/vxresource.class.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | * @deprecated 23 | */ 24 | class vxResource extends xPDOObject { 25 | public static $excludeFields = array( 26 | 'version_id', 27 | 'saved', 28 | 'user', 29 | 'mode', 30 | 'marked', 31 | 32 | 'fields' => array( 33 | 'createdon', 34 | 'createdby', 35 | 'editedon', 36 | 'editedby', 37 | ) 38 | ); 39 | 40 | public static $tabJavascript = array( 41 | 'resources/panel.resources.js', 42 | 'resources/grid.resources.js', 43 | ); 44 | 45 | public static $tabTpl = 'mgr/tabs/resources'; 46 | 47 | /** 48 | * Gets the excluded fields. 49 | * @static 50 | * @return array 51 | */ 52 | public static function getExcludeFields () { 53 | return self::$excludeFields; 54 | } 55 | 56 | /** 57 | * Gets the Javascript filenames that are required for tabs. 58 | * @static 59 | * @return array 60 | */ 61 | public static function getTabJavascript() { 62 | return self::$tabJavascript; 63 | } 64 | 65 | /** 66 | * Gets the tab template file name. 67 | * @static 68 | * @return string 69 | */ 70 | public static function getTabTpl() { 71 | return self::$tabTpl; 72 | } 73 | 74 | /** 75 | * Reverts a resource to the selected version. 76 | * @param array $options 77 | * 78 | * @return bool 79 | */ 80 | public function revert(array $options = array()) { 81 | if (!$this->get('content_id')) { 82 | return false; 83 | } 84 | 85 | /* @var modResource $resource */ 86 | $resource = $this->xpdo->getObject('modResource',$this->get('content_id')); 87 | if (!($resource instanceof modResource)) { 88 | /* Could not find the resource, so we'll assume it was deleted. We'll create a new resource and force that ID. */ 89 | $resource = $this->xpdo->newObject($this->get('class')); 90 | $resource->set('id', $this->get('content_id')); 91 | } 92 | 93 | $content = $this->get('content'); 94 | $fields = $this->get('fields'); 95 | $tvs = $this->get('tvs'); 96 | 97 | $resource->setContent($content); 98 | foreach ($fields as $key => $value) { 99 | if (in_array($key, array('id', 'type'))) { continue; } 100 | $resource->set($key, $value); 101 | } 102 | 103 | foreach ($tvs as $tv) { 104 | if (!$resource->setTVValue($tv['id'], $tv['value'])) { 105 | $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, '[VersionX:vxResource/revert] Resource: ' . $this->get('content_id') . ' | Unable of setting TV ' . $tv['id'] . ' to ' . $tv['value']); 106 | return false; 107 | } 108 | } 109 | 110 | return $resource->save(); 111 | } 112 | } 113 | 114 | -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/vxsnippet.class.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | * @deprecated 23 | */ 24 | class vxSnippet extends xPDOObject { 25 | public static $excludeFields = array( 26 | 'version_id', 27 | 'saved', 28 | 'user', 29 | 'mode', 30 | 'marked', 31 | ); 32 | 33 | public static $tabJavascript = array( 34 | 'snippets/panel.snippets.js', 35 | 'snippets/grid.snippets.js', 36 | ); 37 | 38 | public static $tabTpl = 'mgr/tabs/snippets'; 39 | /** 40 | * Gets the excluded fields. 41 | * @static 42 | * @return array 43 | */ 44 | public static function getExcludeFields () { 45 | return self::$excludeFields; 46 | } 47 | /** 48 | * @static 49 | * @return array 50 | */ 51 | public static function getTabJavascript() { 52 | return self::$tabJavascript; 53 | } 54 | 55 | /** 56 | * Gets the tab template file name. 57 | * @static 58 | * @return string 59 | */ 60 | public static function getTabTpl() { 61 | return self::$tabTpl; 62 | } 63 | 64 | /** 65 | * Reverts a snippet to the selected version. 66 | * @param array $options 67 | * 68 | * @return bool 69 | */ 70 | public function revert(array $options = array()) { 71 | if (!$this->get('content_id')) { 72 | return false; 73 | } 74 | 75 | /* @var modSnippet $object */ 76 | $object = $this->xpdo->getObject('modSnippet',$this->get('content_id')); 77 | if (!($object instanceof modSnippet)) { 78 | /* Could not find the snippet, so we'll assume it was deleted. We'll create a new one and force that ID. */ 79 | $object = $this->xpdo->newObject('modSnippet'); 80 | $object->set('id', $this->get('content_id')); 81 | } 82 | 83 | $object->fromArray(array( 84 | 'name' => $this->get('name'), 85 | 'description' => $this->get('description'), 86 | 'category' => ($this->xpdo->getCount('modCategory',array('id' => $this->get('category'))) > 0) ? $this->get('category') : 0, 87 | 'snippet' => $this->get('snippet'), 88 | 'locked' => $this->get('locked'), 89 | ), '', true); 90 | 91 | return $object->save(); 92 | } 93 | } 94 | 95 | -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/vxtemplate.class.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | * @deprecated 23 | */ 24 | class vxTemplate extends xPDOObject { 25 | public static $excludeFields = array( 26 | 'version_id', 27 | 'saved', 28 | 'user', 29 | 'mode', 30 | 'marked', 31 | ); 32 | 33 | public static $tabJavascript = array( 34 | 'templates/panel.templates.js', 35 | 'templates/grid.templates.js', 36 | ); 37 | 38 | public static $tabTpl = 'mgr/tabs/templates'; 39 | 40 | /** 41 | * Gets the excluded fields. 42 | * @static 43 | * @return array 44 | */ 45 | public static function getExcludeFields () { 46 | return self::$excludeFields; 47 | } 48 | 49 | /** 50 | * Gets the Javascript filenames that are required for tabs. 51 | * @static 52 | * @return array 53 | */ 54 | public static function getTabJavascript() { 55 | return self::$tabJavascript; 56 | } 57 | 58 | /** 59 | * Gets the tab template file name. 60 | * @static 61 | * @return string 62 | */ 63 | public static function getTabTpl() { 64 | return self::$tabTpl; 65 | } 66 | 67 | 68 | /** 69 | * Reverts a template to the selected version. 70 | * @param array $options 71 | * 72 | * @return bool 73 | */ 74 | public function revert(array $options = array()) { 75 | if (!$this->get('content_id')) { 76 | return false; 77 | } 78 | 79 | /* @var modTemplate $template */ 80 | $template = $this->xpdo->getObject('modTemplate',$this->get('content_id')); 81 | if (!($template instanceof modTemplate)) { 82 | /* Could not find the template, so we'll assume it was deleted. We'll create a new one and force that ID. */ 83 | $template = $this->xpdo->newObject('modTemplate'); 84 | $template->set('id', $this->get('content_id')); 85 | } 86 | 87 | $template->fromArray(array( 88 | 'templatename' => $this->get('templatename'), 89 | 'description' => $this->get('description'), 90 | 'category' => ($this->xpdo->getCount('modCategory',array('id' => $this->get('category'))) > 0) ? $this->get('category') : 0, 91 | 'content' => $this->get('content'), 92 | 'locked' => $this->get('locked'), 93 | ), '', true); 94 | 95 | return $template->save(); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /core/components/versionx/model/versionx/vxtemplatevar.class.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This file is part of VersionX, a versioning solution for MODX Revolution 8 | * 9 | * VersionX is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License as published by the Free Software 11 | * Foundation; either version 2 of the License, or (at your option) any later 12 | * version. 13 | * 14 | * VersionX is distributed in the hope that it will be useful, but WITHOUT ANY 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * VersionX; if not, write to the Free Software Foundation, Inc., 59 Temple Place, 20 | * Suite 330, Boston, MA 02111-1307 USA 21 | * 22 | * @deprecated 23 | */ 24 | class vxTemplateVar extends xPDOObject { 25 | public static $excludeFields = array( 26 | 'version_id', 27 | 'saved', 28 | 'user', 29 | 'mode', 30 | 'marked', 31 | ); 32 | 33 | public static $tabJavascript = array( 34 | 'templatevars/panel.templatevars.js', 35 | 'templatevars/grid.templatevars.js', 36 | ); 37 | 38 | public static $tabTpl = 'mgr/tabs/templatevars'; 39 | /** 40 | * Gets the Javascript filenames that are required for tabs. 41 | * @static 42 | * @return array 43 | */ 44 | 45 | /** 46 | * Gets the excluded fields. 47 | * @static 48 | * @return array 49 | */ 50 | public static function getExcludeFields () { 51 | return self::$excludeFields; 52 | } 53 | 54 | public static function getTabJavascript() { 55 | return self::$tabJavascript; 56 | } 57 | 58 | /** 59 | * Gets the tab template file name. 60 | * @static 61 | * @return string 62 | */ 63 | public static function getTabTpl() { 64 | return self::$tabTpl; 65 | } 66 | 67 | /** 68 | * Reverts a snippet to the selected version. 69 | * @param array $options 70 | * 71 | * @return bool 72 | */ 73 | public function revert(array $options = array()) { 74 | if (!$this->get('content_id')) { 75 | return false; 76 | } 77 | 78 | /* @var modTemplateVar $object */ 79 | $object = $this->xpdo->getObject('modTemplateVar',$this->get('content_id')); 80 | if (!($object instanceof modTemplateVar)) { 81 | /* Could not find the TV, so we'll assume it was deleted. We'll create a new one and force that ID. */ 82 | $object = $this->xpdo->newObject('modTemplateVar'); 83 | $object->set('id', $this->get('content_id')); 84 | } 85 | 86 | $object->fromArray(array( 87 | 'name' => $this->get('name'), 88 | 'caption' => $this->get('caption'), 89 | 'description' => $this->get('description'), 90 | 'category' => ($this->xpdo->getCount('modCategory',array('id' => $this->get('category'))) > 0) ? $this->get('category') : 0, 91 | 'rank' => $this->get('rank'), 92 | 'display' => $this->get('display'), 93 | 'default_text' => $this->get('default_text'), 94 | 'properties' => $this->get('properties'), 95 | 'input_properties' => $this->get('input_properties'), 96 | 'output_properties' => $this->get('output_properties'), 97 | ), '', true); 98 | 99 | return $object->save(); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /core/components/versionx/processors/mgr/deltas/getlist.class.php: -------------------------------------------------------------------------------- 1 | versionX = new VersionX($this->modx); 21 | if (!in_array($this->getProperty('type'), VersionX::CORE_TYPES)) { 22 | $this->versionX->loadCustomClasses(); 23 | } 24 | 25 | $typeClass = '\\' . $this->getProperty('type'); 26 | $this->type = new $typeClass($this->versionX); 27 | 28 | $this->modx->getService('smarty', 'smarty.modSmarty', '', [ 29 | 'template_dir' => $this->versionX->config['templates_path'], 30 | ]); 31 | 32 | $this->magicPreviewLoaded = $this->versionX->magicPreviewLoaded(); 33 | 34 | return $init; 35 | } 36 | 37 | public function prepareQueryBeforeCount(xPDOQuery $c): xPDOQuery 38 | { 39 | $c->leftJoin('vxDeltaEditor', 'Editor', [ 40 | 'Editor.delta = vxDelta.id', 41 | ]); 42 | $c->leftJoin('modUser', 'User', [ 43 | 'User.id = Editor.user' 44 | ]); 45 | $c->leftJoin('modUserProfile', 'Profile', ['Profile.internalKey = User.id']); 46 | 47 | $c->where([ 48 | 'vxDelta.principal' => $this->getProperty('principal'), 49 | 'vxDelta.principal_class' => $this->getProperty('principal_class'), 50 | 'vxDelta.principal_package' => $this->getProperty('principal_package'), 51 | ]); 52 | 53 | // Search filter 54 | $query = $this->getProperty('query', ''); 55 | if (!empty($query)) { 56 | // Allow searching by field name 57 | $c->where([ 58 | "EXISTS ( 59 | SELECT DeltaField.field 60 | FROM {$this->modx->getTableName(vxDeltaField::class)} DeltaField 61 | WHERE DeltaField.delta = vxDelta.id AND 62 | DeltaField.field LIKE '%{$query}%' 63 | )", 64 | ]); 65 | } 66 | 67 | // Date from filter 68 | $dateFrom = $this->getProperty('date_from'); 69 | if (!empty($dateFrom)) { 70 | $c->where([ 71 | 'time_start:>=' => $dateFrom, 72 | 'OR:time_end:>=' => $dateFrom, 73 | ]); 74 | } 75 | 76 | // Date to filter 77 | $dateTo = $this->getProperty('date_to'); 78 | if (!empty($dateTo)) { 79 | $c->where([ 80 | 'time_start:<=' => $dateTo, 81 | 'OR:time_end:<=' => $dateTo, 82 | ]); 83 | } 84 | 85 | // Editor filter 86 | $editor = $this->getProperty('editor'); 87 | if (!empty($editor)) { 88 | $c->where([ 89 | 'User.username' => $editor, 90 | ]); 91 | } 92 | 93 | $c->select([ 94 | 'vxDelta.*', 95 | 'user_id' => 'User.id', 96 | 'User.username', 97 | ]); 98 | 99 | // $c->prepare(); 100 | // $this->modx->log(1, $c->toSQL()); 101 | 102 | return $c; 103 | } 104 | 105 | public function prepareRow(xPDOObject $object): array 106 | { 107 | // TODO: Maybe getting the fields like this isn't the most efficient 108 | $fields = $this->modx->getCollection(vxDeltaField::class, [ 109 | 'delta' => $object->get('id'), 110 | ]); 111 | 112 | // Sort fields as per the Type::getFieldOrder(); 113 | $order = $this->type->getFieldOrder(); 114 | $sorted = []; 115 | foreach ($order as $position) { 116 | foreach ($fields as $field) { 117 | if ($field->get('field') === $position) { 118 | $sorted[] = $field; 119 | } 120 | } 121 | } 122 | // Merge removing duplicates 123 | $fields = array_unique(array_merge($sorted, $fields), SORT_REGULAR); 124 | 125 | $row = $object->toArray(); 126 | 127 | // Flag if MagicPreview is loaded so preview buttons can be used 128 | $row['show_previews'] = $this->magicPreviewLoaded; 129 | 130 | $diffFile = $this->versionX->config['templates_path'] . 'mgr/diff.tpl'; 131 | if (!file_exists($diffFile)) { 132 | return []; 133 | } 134 | 135 | $row['diffs'] = ''; 136 | foreach($fields as $field) { 137 | // Attempt to get diff from cache 138 | $key = "{$object->get('principal_package')}" 139 | . "/{$object->get('principal_class')}" 140 | . "/{$object->get('principal')}" 141 | . "/{$object->get('id')}" 142 | . "/{$field->get('id')}"; 143 | 144 | // Use cached render if available 145 | if (!$renderedDiff = $this->modx->cacheManager->get($key, VersionX::CACHE_OPT)) { 146 | // Otherwise calculate diff 147 | $fieldType = $this->type->getFieldClass($field->get('field')); 148 | $fieldTypeObj = new $fieldType($field->get('after')); 149 | $renderedDiff = $fieldTypeObj->render($field->get('before'), $field->get('after')); 150 | 151 | // Save in cache 152 | if ($renderedDiff) { 153 | $this->modx->cacheManager->set($key, $renderedDiff, 7200, VersionX::CACHE_OPT); 154 | } 155 | } 156 | 157 | $this->modx->smarty->assign([ 158 | 'name' => $field->get('field'), 159 | 'diff' => $renderedDiff, 160 | 'field_id' => $field->get('id'), 161 | 'delta_id' => $field->get('delta'), 162 | 'initial' => $object->get('milestone') === '_initial_', 163 | 'undo' => $this->modx->lexicon('versionx.deltas.undo'), 164 | ]); 165 | $row['diffs'] .= $this->modx->smarty->fetch($diffFile); 166 | } 167 | 168 | return $row; 169 | } 170 | } 171 | 172 | return VersionXDeltasGetlistProcessor::class; 173 | -------------------------------------------------------------------------------- /core/components/versionx/processors/mgr/deltas/milestone.class.php: -------------------------------------------------------------------------------- 1 | versionX = new VersionX($this->modx); 14 | 15 | $deltaId = $this->getProperty('delta_id'); 16 | if (empty($deltaId)) { 17 | $this->modx->log(modX::LOG_LEVEL_ERROR, '[VersionX] Delta id not sent to milestone processor!'); 18 | return 'Delta id not found.'; 19 | } 20 | $this->deltaId = $this->getProperty('delta_id'); 21 | 22 | if ($this->getProperty('what') === 'add') { 23 | $milestone = $this->getProperty('milestone'); 24 | 25 | if (empty($milestone)) { 26 | $this->modx->log(modX::LOG_LEVEL_ERROR, '[VersionX] Milestone tag not sent to milestone processor!'); 27 | return 'Milestone tag missing'; 28 | } 29 | $this->milestone = $this->getProperty('milestone'); 30 | } 31 | 32 | return $init; 33 | } 34 | 35 | public function process() 36 | { 37 | switch ($this->getProperty('what')) { 38 | case 'remove': 39 | // Remove milestone name from delta 40 | if ($this->versionX->deltas()->removeMilestone($this->deltaId)) { 41 | return $this->success('Success'); 42 | } 43 | 44 | break; 45 | 46 | case 'add': 47 | // Add milestone name to delta 48 | if ($this->versionX->deltas()->addMilestone($this->deltaId, $this->milestone)) { 49 | return $this->success('Success'); 50 | } 51 | break; 52 | } 53 | 54 | return $this->failure(); 55 | } 56 | } 57 | return 'VersionXDeltaMilestoneProcessor'; -------------------------------------------------------------------------------- /core/components/versionx/processors/mgr/deltas/optimize.class.php: -------------------------------------------------------------------------------- 1 | versionX = new VersionX($this->modx); 16 | $this->versionX->loadCustomClasses(); 17 | 18 | return $init; 19 | } 20 | 21 | public function process() 22 | { 23 | 24 | $this->versionX->deltas()->optimizeDeltas(); 25 | return $this->success('Success'); 26 | } 27 | } 28 | return 'VersionXOptimizeDeltasProcessor'; -------------------------------------------------------------------------------- /core/components/versionx/processors/mgr/deltas/preview.class.php: -------------------------------------------------------------------------------- 1 | modx->getOption( 12 | 'magicpreview.core_path', 13 | null, 14 | $this->modx->getOption('core_path') . 'components/magicpreview/' 15 | ); 16 | $this->magicPreview ??= $this->modx->getService( 17 | 'magicpreview', 18 | 'MagicPreview', 19 | $path . '/model/magicpreview/' 20 | ); 21 | 22 | return $init; 23 | } 24 | 25 | public function process() 26 | { 27 | $resource = $this->modx->getObject(modResource::class, ['id' => $this->getProperty('id')]); 28 | if (!$resource) { 29 | return $this->failure('Resource not found'); 30 | } 31 | 32 | $properties = array_merge($this->properties, $resource->toArray()); 33 | /** @var modProcessorResponse $response */ 34 | $response = $this->modx->runProcessor('resource/preview', $properties, [ 35 | 'processors_path' => $this->magicPreview->config['processorsPath'], 36 | ]); 37 | 38 | return $this->success('', $response->getResponse()['object']); 39 | } 40 | } 41 | return 'VersionXRevertPreviewProcessor'; -------------------------------------------------------------------------------- /core/components/versionx/processors/mgr/deltas/revert.class.php: -------------------------------------------------------------------------------- 1 | versionX = new VersionX($this->modx); 16 | 17 | $typeClass = '\\' . $this->getProperty('type'); 18 | $this->type = new $typeClass($this->versionX); 19 | 20 | $objectId = $this->getProperty('principal'); 21 | if (empty($objectId)) { 22 | $this->modx->log(modX::LOG_LEVEL_ERROR, '[VersionX] Principal id not sent to revert processor!'); 23 | return 'Principal object id not found.'; 24 | } 25 | 26 | $deltaId = $this->getProperty('delta_id'); 27 | if (empty($deltaId)) { 28 | $this->modx->log(modX::LOG_LEVEL_ERROR, '[VersionX] Delta id not sent to revert processor!'); 29 | return 'Delta id not found.'; 30 | } 31 | 32 | $this->objectId = $this->getProperty('principal'); 33 | $this->deltaId = $this->getProperty('delta_id'); 34 | $this->fieldId = $this->getProperty('field_id'); 35 | 36 | $this->versionX->loadCustomClasses(); 37 | 38 | return $init; 39 | } 40 | 41 | public function process() 42 | { 43 | switch ($this->getProperty('what')) { 44 | case 'revert_field': 45 | // Reverts a single field change on the object 46 | $this->versionX->deltas()->revertObject($this->deltaId, $this->objectId, $this->type, $this->fieldId); 47 | break; 48 | 49 | case 'revert_delta': 50 | // Reverts all field changes on the object that are related to the delta 51 | $this->versionX->deltas()->revertObject($this->deltaId, $this->objectId, $this->type); 52 | break; 53 | 54 | case 'revert_all': 55 | // Reverts all fields on the object to the end_time on the delta 56 | $this->versionX->deltas()->revertToPointInTime($this->deltaId, $this->objectId, $this->type); 57 | break; 58 | } 59 | 60 | return $this->success('Success'); 61 | } 62 | } 63 | return 'VersionXObjectRevertProcessor'; -------------------------------------------------------------------------------- /core/components/versionx/processors/mgr/filters/classes.class.php: -------------------------------------------------------------------------------- 1 | get('principal_class'); 16 | return [ 17 | 'id' => $name, 18 | 'name' => $name, 19 | ]; 20 | } 21 | } 22 | return 'VersionXClassFilterProcessor'; 23 | -------------------------------------------------------------------------------- /core/components/versionx/processors/mgr/filters/editors.class.php: -------------------------------------------------------------------------------- 1 | innerJoin(modUser::class, 'User', [ 16 | 'vxDeltaEditor.user = User.id', 17 | ]); 18 | 19 | $c->select([ 20 | 'id' => 'MIN(vxDeltaEditor.id)', 21 | 'username' => 'User.username', 22 | ]); 23 | 24 | $query = trim($this->getProperty('query')); 25 | if ($query) { 26 | $c->where(['User.username:LIKE' => '%'.$query.'%']); 27 | } 28 | 29 | $c->groupBy('User.username'); 30 | 31 | return $c; 32 | } 33 | 34 | /** 35 | * @param xPDOObject $object 36 | * @return array 37 | */ 38 | public function prepareRow(xPDOObject $object): array 39 | { 40 | $name = $object->get('username'); 41 | return [ 42 | 'id' => $name, 43 | 'name' => $name, 44 | ]; 45 | } 46 | } 47 | return 'VersionXEditorsFilterProcessor'; 48 | -------------------------------------------------------------------------------- /core/components/versionx/processors/mgr/filters/packages.class.php: -------------------------------------------------------------------------------- 1 | get('principal_package'); 16 | return [ 17 | 'id' => $name, 18 | 'name' => $name, 19 | ]; 20 | } 21 | } 22 | return 'VersionXPackagesFilterProcessor'; 23 | -------------------------------------------------------------------------------- /core/components/versionx/src/Enums/RevertAction.php: -------------------------------------------------------------------------------- 1 | value) { 30 | $this->value = $value; 31 | } 32 | 33 | $this->fieldName = $name; 34 | $this->options = $options; 35 | $this->parse(); 36 | } 37 | 38 | /** 39 | * Runs when the Field is created 40 | * Override in derivatives if the value needs to be manipulated 41 | * @return void 42 | */ 43 | protected function parse() 44 | {} 45 | 46 | /** 47 | * @return mixed 48 | */ 49 | public function getValue($options = []) 50 | { 51 | return $this->value; 52 | } 53 | 54 | public function getName() 55 | { 56 | return $this->fieldName; 57 | } 58 | 59 | /** 60 | * @return string 61 | */ 62 | public function getTpl(): string 63 | { 64 | return $this->tpl; 65 | } 66 | 67 | public function render(string $prevValue, string $newValue, array $options = []): string 68 | { 69 | return DeltaManager::calculateDiff($prevValue, $newValue); 70 | } 71 | } -------------------------------------------------------------------------------- /core/components/versionx/src/Fields/Image.php: -------------------------------------------------------------------------------- 1 | value)) { 10 | $this->value = self::splitPropertyValues($this->value, $this->fieldName); 11 | } 12 | } 13 | 14 | /** 15 | * 16 | * @param array $arrayField 17 | * @param string $name 18 | * @param array $fields 19 | * @return array 20 | */ 21 | public static function splitPropertyValues(array $arrayField, string $name = '', array &$fields = []): array 22 | { 23 | $arrays = []; 24 | foreach ($arrayField as $field => $value) { 25 | if (empty($name)) { 26 | $fields[$field] = $value; 27 | continue; 28 | } 29 | if (is_numeric($field)) { 30 | $fields[$name][$field] = $value; 31 | continue; 32 | } 33 | if (!is_array($value)) { 34 | $fields["{$name}.{$field}"] = $value; 35 | continue; 36 | } 37 | 38 | $arrays[$field] = $value; 39 | } 40 | 41 | foreach ($arrays as $field => $value) { 42 | self::splitPropertyValues($value, "{$name}.{$field}", $fields); 43 | } 44 | 45 | return $fields; 46 | } 47 | 48 | /** 49 | * @param \vxDeltaField $field 50 | * @param mixed $data 51 | * @return mixed 52 | */ 53 | public static function revertPropertyValue(\vxDeltaField $field, &$data) 54 | { 55 | if (!is_array($data)) { 56 | return $data; 57 | } 58 | 59 | $pieces = explode('.', $field->get('field')); 60 | $last = end($pieces); 61 | foreach ($pieces as $piece) { 62 | if (!array_key_exists($piece, $data)) { 63 | continue; 64 | } 65 | 66 | // The last 'piece' will be the key we're after. 67 | if ($piece === $last) { 68 | $beforeValue = $field->get('before'); 69 | $beforeType = $field->get('before_type'); 70 | 71 | if (in_array($beforeType, ['array', 'object'])) { 72 | // Decode if it's meant to be an array/object 73 | $decoded = json_decode($beforeValue, true); 74 | $data[$piece] = $decoded ?: $field->get('before'); 75 | } 76 | else if (in_array(strtolower($beforeType), self::ACCEPTED_VALUE_TYPES)) { 77 | // Cast as the set type 78 | $data[$piece] = settype($beforeValue, $beforeType); 79 | } 80 | else { 81 | // If we're here treat as a string 82 | $data[$piece] = $field->get('before'); 83 | } 84 | 85 | } 86 | else { 87 | $data = &$data[$piece]; 88 | } 89 | } 90 | 91 | return $data; 92 | } 93 | 94 | } -------------------------------------------------------------------------------- /core/components/versionx/src/Fields/Text.php: -------------------------------------------------------------------------------- 1 | Properties::class, 34 | ]; 35 | protected array $tvTypes = [ 36 | Image::class => [ 37 | 'image', 38 | ], 39 | ]; 40 | 41 | /** 42 | * Opportunity to add additional \vxDeltaField objects to the array. For example, adding TV values when saving 43 | * a resource. 44 | * @param \vxDeltaField[] $fields - Array of fields to save in the new delta 45 | * @param array $prevFields - Array of fields from the previous delta 46 | * @param \xPDOObject $object - The object being versioned 47 | * @return \vxDeltaField[] - The list of fields to be saved in the new delta. 48 | */ 49 | public function includeFieldsOnCreate(array $fields, array $prevFields, \xPDOObject $object): array 50 | { 51 | // Determine what TV values currently exist for this resource. 52 | /** @var \modResource $object */ 53 | $tvs = $object->getTemplateVars(); 54 | $tvNames = []; 55 | foreach ($tvs as $tv) { 56 | $tvNames[] = $tv->get('name'); 57 | } 58 | 59 | // Grab the most recent TV value fields 60 | $prevFields = $this->versionX->deltas()->getClosestDeltaFields($this, $object, $tvNames); 61 | 62 | // Loop through TVs matching previous delta fields by TV name 63 | /* @var \MODX\Revolution\modTemplateVar|\modTemplateVar $tv */ 64 | foreach ($tvs as $tv) { 65 | $prevValue = ''; 66 | foreach ($prevFields as $prevField) { 67 | if ($prevField->get('field') === $tv->get('name')) { 68 | $prevValue = $prevField->get('after'); 69 | break; 70 | } 71 | } 72 | 73 | // If a TV passes a null value (e.g. an empty Image TV), set it as an empty string so it can be compared 74 | $tvValue = $tv->get('value'); 75 | if ($tvValue === null) { 76 | $tvValue = ''; 77 | } 78 | 79 | // Check if TV type is assigned to a VersionX field type 80 | $fieldObj = null; 81 | foreach ($this->tvTypes as $class => $types) { 82 | if (in_array($tv->get('type'), $types)) { 83 | // If found, include the TV and resource id as config options to assist with rendering 84 | $fieldObj = new $class($tvValue, $tv->get('name')); 85 | } 86 | } 87 | 88 | // Default Text if no VersionX field types matched 89 | if (!isset($fieldObj)) { 90 | $fieldObj = new Text($tvValue); 91 | } 92 | 93 | $field = $this->modx->newObject(\vxDeltaField::class, [ 94 | 'field' => $tv->get('name'), 95 | 'field_type' => get_class($fieldObj), 96 | 'before' => $prevValue, 97 | 'after' => $tvValue, 98 | 'diff' => $fieldObj->render($prevValue, $fieldObj->getValue()), 99 | ]); 100 | 101 | $fields[] = $field; 102 | } 103 | 104 | return $fields; 105 | } 106 | 107 | 108 | /** 109 | * Runs before object being reverted is saved. 110 | * @param string $action - 'all', 'delta', or 'single' 111 | * @param array $fields - the delta fields that are being saved to the object 112 | * @param \xPDOObject $object - the object being reverted 113 | * @param string $now 114 | * @param string|null $deltaTimestamp 115 | * @return \xPDOObject 116 | */ 117 | public function afterRevert(string $action, array $fields, \xPDOObject $object, string $now, string $deltaTimestamp = null): \xPDOObject 118 | { 119 | // Be sure to call the parent method, so we get common field processing 120 | $object = parent::afterRevert($action, $fields, $object, $now, $deltaTimestamp); 121 | 122 | $object->set('editedby', $this->modx->user->get('id')); 123 | $object->set('editedon', $now); 124 | 125 | // Get any TVs attached to this resource 126 | $tvs = $object->getMany('TemplateVars'); 127 | 128 | // Get TVs not included in selected delta if RevertAction::ALL 129 | if ($action === RevertAction::ALL) { 130 | $tvNames = []; 131 | foreach ($tvs as $tv) { 132 | $tvNames[] = $tv->get('name'); 133 | } 134 | 135 | // Grab the most recent TV value fields 136 | $fields = array_merge( 137 | $fields, 138 | $this->versionX->deltas()->getClosestDeltaFields($this, $object, $tvNames, $deltaTimestamp) 139 | ); 140 | } 141 | 142 | foreach ($fields as $field) { 143 | $this->revertTVValues($field, $object, $tvs); 144 | } 145 | 146 | // Skip saving if not allowed e.g. in ResourcePreview 147 | if ($this->persistChanges && !$object->save(true)) { 148 | $this->modx->log(MODX_LOG_LEVEL_ERROR, 149 | '[VersionX] Error saving ' . get_class($object) . ' with id: ' . $object->get('id')); 150 | } 151 | 152 | return $object; 153 | } 154 | 155 | /** 156 | * Match field and TV names, updating TVs with delta field values. 157 | * @param \vxDeltaField $field 158 | * @param \xPDOObject $object 159 | * @param array $tvs 160 | * @return void 161 | */ 162 | protected function revertTVValues(\vxDeltaField $field, \xPDOObject $object, array $tvs) 163 | { 164 | // TODO: consider recreating a TV if it has since been deleted... but may not be possible. 165 | foreach ($tvs as $tv) { 166 | if ($tv->get('name') === $field->get('field')) { 167 | // Get actual TV object to save, now that we have the id. 168 | $tvObj = $this->modx->getObject(\modTemplateVarResource::class, [ 169 | 'tmplvarid' => $tv->get('id'), 170 | 'contentid' => $object->get('id'), 171 | ]); 172 | 173 | $tvObj->set('value', $field->get('before')); 174 | 175 | // Skip saving if not allowed e.g. in ResourcePreview 176 | if ($this->persistChanges) { 177 | $tvObj->save(); 178 | } 179 | } 180 | } 181 | } 182 | } -------------------------------------------------------------------------------- /core/components/versionx/src/Types/ResourcePreview.php: -------------------------------------------------------------------------------- 1 | $value) { 21 | if (is_array($value)) { 22 | $value = '{' . self::flattenArray($value) .'}'; 23 | } 24 | if (!empty($value)) { 25 | $string[] = $key . ':' . $value; 26 | } 27 | } 28 | return implode(',', $string); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /core/components/versionx/templates/mgr/diff.tpl: -------------------------------------------------------------------------------- 1 |
2 |
3 |
{$name}
4 |
5 | {if !$initial} 6 | 9 | {/if} 10 |
11 |
{$diff}
12 |
-------------------------------------------------------------------------------- /core/components/versionx/templates/mgr/fields/image.tpl: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
6 | 7 |
8 |
-------------------------------------------------------------------------------- /core/components/versionx/templates/mgr/tab.tpl: -------------------------------------------------------------------------------- 1 | 44 | -------------------------------------------------------------------------------- /core/components/versionx/templates/mgr/versionx.tpl: -------------------------------------------------------------------------------- 1 |
--------------------------------------------------------------------------------