From ffb039ff3198100337d5eb006c99a7181a41ab78 Mon Sep 17 00:00:00 2001 From: Ishan Jayamanne Date: Tue, 4 Jun 2019 13:20:37 +1200 Subject: [PATCH] upgrade to ss4 compatible (#2) * upgrade to ss4 compatible * Fix wrong http class * FIX SS4 upgrade fixes * FIX removed .DS_STORE --- code/GridFieldOrderableRows.php | 28 - composer.json | 19 +- composer.lock | 2175 ++++++++++++++++- javascript/superglue.js | 25 + {code => src}/Connector.php | 4 +- {code => src}/PageControllerExtension.php | 32 +- {code => src}/PageExtension.php | 125 +- {code => src}/PinGridFieldActionProvider.php | 38 +- {code => src}/SubPageExtension.php | 23 +- .../UnpinGridFieldActionProvider.php | 35 +- 10 files changed, 2225 insertions(+), 279 deletions(-) delete mode 100644 code/GridFieldOrderableRows.php create mode 100644 javascript/superglue.js rename {code => src}/Connector.php (89%) rename {code => src}/PageControllerExtension.php (61%) rename {code => src}/PageExtension.php (77%) rename {code => src}/PinGridFieldActionProvider.php (79%) rename {code => src}/SubPageExtension.php (68%) rename {code => src}/UnpinGridFieldActionProvider.php (78%) diff --git a/code/GridFieldOrderableRows.php b/code/GridFieldOrderableRows.php deleted file mode 100644 index 71b1c51..0000000 --- a/code/GridFieldOrderableRows.php +++ /dev/null @@ -1,28 +0,0 @@ - $value) { - $ordered[$key] = $min++; - } - - parent::reorderItems($list, $ordered, $order); - } -} diff --git a/composer.json b/composer.json index bbd0cc3..5b82adb 100644 --- a/composer.json +++ b/composer.json @@ -1,19 +1,26 @@ { "name": "silverstripe/superglue", - "type": "silverstripe-module", + "type": "silverstripe-vendormodule", "require": { - "silverstripe/framework": "^3.2", - "silverstripe/cms": "^3.2", - "silverstripe-australia/gridfieldextensions": "^1.0" + "silverstripe/cms": "^4.0", + "silverstripe/framework": "^4.0", + "silverstripe-australia/gridfieldextensions": "^3.0" }, "autoload": { "psr-4": { - "SilverStripe\\SuperGlue\\": "code" + "SilverStripe\\SuperGlue\\": "src" } }, "autoload-dev": { "psr-4": { "SilverStripe\\SuperGlue\\Test\\": "tests" } - } + }, + "extra": { + "expose": [ + "javascript" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true } diff --git a/composer.lock b/composer.lock index 661101c..9041b3b 100644 --- a/composer.lock +++ b/composer.lock @@ -1,24 +1,79 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "hash": "23ee04dd60c8ef4767ce86c014a1acf0", - "content-hash": "a790b39b400c08d7987a5dcb34a9d11b", + "content-hash": "d102f2b03e43c260f843aa9081438bf2", "packages": [ + { + "name": "composer/ca-bundle", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "46afded9720f40b9dc63542af4e3e43a1177acb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/46afded9720f40b9dc63542af4e3e43a1177acb0", + "reference": "46afded9720f40b9dc63542af4e3e43a1177acb0", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5", + "psr/log": "^1.0", + "symfony/process": "^2.5 || ^3.0 || ^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "time": "2018-08-08T08:57:40+00:00" + }, { "name": "composer/installers", - "version": "v1.0.25", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/composer/installers.git", - "reference": "36e5b5843203d7f1cf6ffb0305a97e014387bd8e" + "reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/36e5b5843203d7f1cf6ffb0305a97e014387bd8e", - "reference": "36e5b5843203d7f1cf6ffb0305a97e014387bd8e", + "url": "https://api.github.com/repos/composer/installers/zipball/cfcca6b1b60bc4974324efb5783c13dca6932b5b", + "reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b", "shasum": "" }, "require": { @@ -30,7 +85,7 @@ }, "require-dev": { "composer/composer": "1.0.*@dev", - "phpunit/phpunit": "4.1.*" + "phpunit/phpunit": "^4.8.36" }, "type": "composer-plugin", "extra": { @@ -60,312 +115,2172 @@ "keywords": [ "Craft", "Dolibarr", + "Eliasis", "Hurad", "ImageCMS", + "Kanboard", + "Lan Management System", "MODX Evo", "Mautic", + "Maya", "OXID", + "Plentymarkets", + "Porto", + "RadPHP", "SMF", "Thelia", "WolfCMS", "agl", "aimeos", "annotatecms", + "attogram", "bitrix", "cakephp", "chef", + "cockpit", "codeigniter", "concrete5", "croogo", "dokuwiki", "drupal", + "eZ Platform", "elgg", + "expressionengine", "fuelphp", "grav", "installer", + "itop", "joomla", "kohana", "laravel", + "lavalite", "lithium", "magento", + "majima", "mako", "mediawiki", "modulework", + "modx", "moodle", + "osclass", "phpbb", "piwik", "ppi", "puppet", + "pxcms", + "reindex", "roundcube", "shopware", "silverstripe", + "sydes", "symfony", "typo3", "wordpress", + "yawik", "zend", "zikula" ], - "time": "2016-04-13 19:46:30" + "time": "2018-08-27T06:10:37+00:00" }, { - "name": "silverstripe-australia/gridfieldextensions", - "version": "1.3.0", + "name": "embed/embed", + "version": "v3.3.6", "source": { "type": "git", - "url": "https://github.com/silverstripe-australia/silverstripe-gridfieldextensions.git", - "reference": "ef57799a6898f4eeb1fe3ee2ab1eb2e0f58e5f9f" + "url": "https://github.com/oscarotero/Embed.git", + "reference": "4b4ab5f5a02563ba4a0707baad00eef2e376108a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/silverstripe-australia/silverstripe-gridfieldextensions/zipball/ef57799a6898f4eeb1fe3ee2ab1eb2e0f58e5f9f", - "reference": "ef57799a6898f4eeb1fe3ee2ab1eb2e0f58e5f9f", + "url": "https://api.github.com/repos/oscarotero/Embed/zipball/4b4ab5f5a02563ba4a0707baad00eef2e376108a", + "reference": "4b4ab5f5a02563ba4a0707baad00eef2e376108a", "shasum": "" }, "require": { - "silverstripe/framework": "~3.1" + "composer/ca-bundle": "^1.0", + "ext-curl": "*", + "ext-mbstring": "*", + "php": "^5.5|^7.0" }, - "replace": { - "ajshort/silverstripe-gridfieldextensions": "self.version" + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.0", + "phpunit/phpunit": "^4.8|^5.7" }, - "type": "silverstripe-module", + "type": "library", + "autoload": { + "psr-4": { + "Embed\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Oscar Otero", + "email": "oom@oscarotero.com", + "homepage": "http://oscarotero.com", + "role": "Developer" + } + ], + "description": "PHP library to retrieve page info using oembed, opengraph, etc", + "homepage": "https://github.com/oscarotero/Embed", + "keywords": [ + "embed", + "embedly", + "oembed", + "opengraph", + "twitter cards" + ], + "time": "2018-09-13T19:10:15+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", "extra": { - "installer-name": "gridfieldextensions", "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" }, - "screenshots": [ - "docs/en/_images/editable-rows.png", - "docs/en/_images/add-existing-search.png" + "files": [ + "src/functions_include.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Marcus Nyeholt", - "email": "marcus@silverstripe.com.au" + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" }, { - "name": "Andrew Short", - "email": "andrewjshort@gmail.com" + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" } ], - "description": "A collection of useful grid field components", - "homepage": "http://github.com/silverstripe-australia/silverstripe-gridfieldextensions", + "description": "PSR-7 message implementation that also provides common utility methods", "keywords": [ - "gridfield", - "silverstripe" + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" ], - "time": "2015-11-17 15:02:18" + "time": "2017-03-20T17:10:46+00:00" }, { - "name": "silverstripe/cms", - "version": "3.3.1", + "name": "intervention/image", + "version": "2.4.2", "source": { "type": "git", - "url": "https://github.com/silverstripe/silverstripe-cms.git", - "reference": "77d506547c8c8be6132c26d3125f9138e1eacfbb" + "url": "https://github.com/Intervention/image.git", + "reference": "e82d274f786e3d4b866a59b173f42e716f0783eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/silverstripe/silverstripe-cms/zipball/77d506547c8c8be6132c26d3125f9138e1eacfbb", - "reference": "77d506547c8c8be6132c26d3125f9138e1eacfbb", + "url": "https://api.github.com/repos/Intervention/image/zipball/e82d274f786e3d4b866a59b173f42e716f0783eb", + "reference": "e82d274f786e3d4b866a59b173f42e716f0783eb", "shasum": "" }, "require": { - "composer/installers": "*", - "php": ">=5.3.3", - "silverstripe/framework": "~3.3", - "silverstripe/reports": "~3.3", - "silverstripe/siteconfig": "~3.3" + "ext-fileinfo": "*", + "guzzlehttp/psr7": "~1.1", + "php": ">=5.4.0" }, - "type": "silverstripe-module", + "require-dev": { + "mockery/mockery": "~0.9.2", + "phpunit/phpunit": "^4.8 || ^5.7" + }, + "suggest": { + "ext-gd": "to use GD library based image processing.", + "ext-imagick": "to use Imagick based image processing.", + "intervention/imagecache": "Caching extension for the Intervention Image library" + }, + "type": "library", "extra": { "branch-alias": { - "3.x-dev": "3.3.x-dev" + "dev-master": "2.4-dev" + }, + "laravel": { + "providers": [ + "Intervention\\Image\\ImageServiceProvider" + ], + "aliases": { + "Image": "Intervention\\Image\\Facades\\Image" + } } }, "autoload": { - "classmap": [ - "tests/behat/" - ] + "psr-4": { + "Intervention\\Image\\": "src/Intervention/Image" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "SilverStripe", - "homepage": "http://silverstripe.com" - }, + "name": "Oliver Vogel", + "email": "oliver@olivervogel.com", + "homepage": "http://olivervogel.com/" + } + ], + "description": "Image handling and manipulation library with support for Laravel integration", + "homepage": "http://image.intervention.io/", + "keywords": [ + "gd", + "image", + "imagick", + "laravel", + "thumbnail", + "watermark" + ], + "time": "2018-05-29T14:19:03+00:00" + }, + { + "name": "league/csv", + "version": "8.2.3", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/csv.git", + "reference": "d2aab1e7bde802582c3879acf03d92716577c76d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/csv/zipball/d2aab1e7bde802582c3879acf03d92716577c76d", + "reference": "d2aab1e7bde802582c3879acf03d92716577c76d", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=5.5.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^1.9", + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.2-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Csv\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ { - "name": "The SilverStripe Community", - "homepage": "http://silverstripe.org" + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://github.com/nyamsprod/", + "role": "Developer" } ], - "description": "The SilverStripe Content Management System", - "homepage": "http://silverstripe.org", + "description": "Csv data manipulation made easy in PHP", + "homepage": "http://csv.thephpleague.com", "keywords": [ - "cms", - "silverstripe" + "csv", + "export", + "filter", + "import", + "read", + "write" ], - "time": "2016-02-29 02:01:55" + "time": "2018-02-06T08:27:03+00:00" }, { - "name": "silverstripe/framework", - "version": "3.3.1", + "name": "league/flysystem", + "version": "1.0.47", "source": { "type": "git", - "url": "https://github.com/silverstripe/silverstripe-framework.git", - "reference": "fb582332010873c1ec03f5644263667f615b1f98" + "url": "https://github.com/thephpleague/flysystem.git", + "reference": "a11e4a75f256bdacf99d20780ce42d3b8272975c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/silverstripe/silverstripe-framework/zipball/fb582332010873c1ec03f5644263667f615b1f98", - "reference": "fb582332010873c1ec03f5644263667f615b1f98", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a11e4a75f256bdacf99d20780ce42d3b8272975c", + "reference": "a11e4a75f256bdacf99d20780ce42d3b8272975c", "shasum": "" }, "require": { - "composer/installers": "~1.0", - "php": ">=5.3.3,<7" + "ext-fileinfo": "*", + "php": ">=5.5.9" + }, + "conflict": { + "league/flysystem-sftp": "<1.0.6" }, "require-dev": { - "phpunit/phpunit": "~3.7" + "phpspec/phpspec": "^3.4", + "phpunit/phpunit": "^5.7.10" }, - "type": "silverstripe-module", + "suggest": { + "ext-fileinfo": "Required for MimeType", + "ext-ftp": "Allows you to use FTP server storage", + "ext-openssl": "Allows you to use FTPS server storage", + "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", + "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", + "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", + "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", + "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", + "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", + "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", + "league/flysystem-webdav": "Allows you to use WebDAV storage", + "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", + "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", + "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" + }, + "type": "library", "extra": { "branch-alias": { - "3.x-dev": "3.3.x-dev" + "dev-master": "1.1-dev" } }, "autoload": { - "classmap": [ - "tests/behat/features/bootstrap" - ] + "psr-4": { + "League\\Flysystem\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "SilverStripe", - "homepage": "http://silverstripe.com" - }, + "name": "Frank de Jonge", + "email": "info@frenky.net" + } + ], + "description": "Filesystem abstraction: Many filesystems, one API.", + "keywords": [ + "Cloud Files", + "WebDAV", + "abstraction", + "aws", + "cloud", + "copy.com", + "dropbox", + "file systems", + "files", + "filesystem", + "filesystems", + "ftp", + "rackspace", + "remote", + "s3", + "sftp", + "storage" + ], + "time": "2018-09-14T15:30:29+00:00" + }, + { + "name": "m1/env", + "version": "2.1.2", + "source": { + "type": "git", + "url": "https://github.com/m1/Env.git", + "reference": "294addeedf15e1149eeb96ec829f2029d2017d39" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/m1/Env/zipball/294addeedf15e1149eeb96ec829f2029d2017d39", + "reference": "294addeedf15e1149eeb96ec829f2029d2017d39", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*", + "scrutinizer/ocular": "~1.1", + "squizlabs/php_codesniffer": "^2.3" + }, + "suggest": { + "josegonzalez/dotenv": "For loading of .env", + "m1/vars": "For loading of configs" + }, + "type": "library", + "autoload": { + "psr-4": { + "M1\\Env\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ { - "name": "The SilverStripe Community", - "homepage": "http://silverstripe.org" + "name": "Miles Croxford", + "email": "hello@milescroxford.com", + "homepage": "http://milescroxford.com", + "role": "Developer" } ], - "description": "The SilverStripe framework", - "homepage": "http://silverstripe.org", + "description": "Env is a lightweight library bringing .env file parser compatibility to PHP. In short - it enables you to read .env files with PHP.", + "homepage": "https://github.com/m1/Env", "keywords": [ - "framework", - "silverstripe" + ".env", + "config", + "dotenv", + "env", + "loader", + "m1", + "parser", + "support" ], - "time": "2016-02-29 02:23:25" + "time": "2018-06-19T18:55:08+00:00" }, { - "name": "silverstripe/reports", - "version": "3.3.1", + "name": "marcj/topsort", + "version": "1.1.0", "source": { "type": "git", - "url": "https://github.com/silverstripe-labs/silverstripe-reports.git", - "reference": "fb3083688e0cc7ad4bd6f678a00c2d84e8edfd99" + "url": "https://github.com/marcj/topsort.php.git", + "reference": "387086c2db60ee0a27ac5df588c0f0b30c6bdc4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/silverstripe-labs/silverstripe-reports/zipball/fb3083688e0cc7ad4bd6f678a00c2d84e8edfd99", - "reference": "fb3083688e0cc7ad4bd6f678a00c2d84e8edfd99", + "url": "https://api.github.com/repos/marcj/topsort.php/zipball/387086c2db60ee0a27ac5df588c0f0b30c6bdc4b", + "reference": "387086c2db60ee0a27ac5df588c0f0b30c6bdc4b", "shasum": "" }, "require": { - "php": ">=5.3.3", - "silverstripe/framework": "~3.3" + "php": ">=5.4" }, "require-dev": { - "phpunit/phpunit": "~3.7" + "codeclimate/php-test-reporter": "dev-master", + "phpunit/phpunit": "~4.0", + "symfony/console": "~2.5" }, - "type": "silverstripe-module", + "type": "library", + "autoload": { + "psr-4": { + "MJS\\TopSort\\": "src/", + "MJS\\TopSort\\Tests\\": "tests/Tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marc J. Schmidt", + "email": "marc@marcjschmidt.de" + } + ], + "description": "High-Performance TopSort/Dependency resolving algorithm", + "keywords": [ + "dependency resolving", + "topological sort", + "topsort" + ], + "time": "2016-11-19T14:58:11+00:00" + }, + { + "name": "monolog/monolog", + "version": "1.23.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd8c787753b3a2ad11bc60c063cff1358a32a3b4", + "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "jakub-onderka/php-parallel-lint": "0.9", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpunit/phpunit": "~4.5", + "phpunit/phpunit-mock-objects": "2.3.0", + "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", + "swiftmailer/swiftmailer": "^5.3|^6.0" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" + }, + "type": "library", "extra": { "branch-alias": { - "3.x-dev": "3.3.x-dev" + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "SilverStripe", - "homepage": "http://silverstripe.com" - }, - { - "name": "The SilverStripe Community", - "homepage": "http://silverstripe.org" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" } ], - "description": "Reports module for SilverStripe CMS", - "homepage": "http://silverstripe.org", + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", "keywords": [ - "cms", - "reports", - "silverstripe" + "log", + "logging", + "psr-3" ], - "time": "2015-12-22 01:21:03" + "time": "2017-06-19T01:22:40+00:00" }, { - "name": "silverstripe/siteconfig", - "version": "3.3.1", + "name": "nikic/php-parser", + "version": "v3.1.5", "source": { "type": "git", - "url": "https://github.com/silverstripe/silverstripe-siteconfig.git", - "reference": "3c41aaa7de144022e267df3c2b0c6c928d362ae2" + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/silverstripe/silverstripe-siteconfig/zipball/3c41aaa7de144022e267df3c2b0c6c928d362ae2", - "reference": "3c41aaa7de144022e267df3c2b0c6c928d362ae2", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", "shasum": "" }, "require": { - "silverstripe/framework": "*" + "ext-tokenizer": "*", + "php": ">=5.5" }, - "type": "silverstripe-module", + "require-dev": { + "phpunit/phpunit": "~4.0|~5.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", "extra": { "branch-alias": { - "3.x-dev": "3.3.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { - "classmap": [ - "tests/behat/" - ] + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } }, "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], "authors": [ { - "name": "Will Rossiter", - "email": "will@fullscreen.io" + "name": "Nikita Popov" } ], - "description": "Site wide settings administration.", + "description": "A PHP parser written in PHP", "keywords": [ - "silverstripe", - "siteconfig" + "parser", + "php" + ], + "time": "2018-02-28T20:30:58+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v2.0.17", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/29af24f25bab834fcbb38ad2a69fa93b867e070d", + "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "autoload": { + "files": [ + "lib/random.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "time": "2018-07-04T16:31:37+00:00" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "time": "2016-08-06T20:24:11+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "time": "2017-10-23T01:57:42+00:00" + }, + { + "name": "silverstripe-australia/gridfieldextensions", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/silverstripe-australia/silverstripe-gridfieldextensions.git", + "reference": "997a5614fc0eda378eec0ad31df27aa568e72b37" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silverstripe-australia/silverstripe-gridfieldextensions/zipball/997a5614fc0eda378eec0ad31df27aa568e72b37", + "reference": "997a5614fc0eda378eec0ad31df27aa568e72b37", + "shasum": "" + }, + "require": { + "silverstripe/framework": "~4.0" + }, + "replace": { + "ajshort/silverstripe-gridfieldextensions": "self.version", + "silverstripe-australia/gridfieldextensions": "self.version" + }, + "type": "silverstripe-module", + "extra": { + "installer-name": "gridfieldextensions", + "branch-alias": { + "dev-master": "3.0.x-dev" + }, + "screenshots": [ + "docs/en/_images/editable-rows.png", + "docs/en/_images/add-existing-search.png" + ] + }, + "autoload": { + "psr-4": { + "Symbiote\\GridFieldExtensions\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Andrew Short", + "email": "andrewjshort@gmail.com" + }, + { + "name": "Marcus Nyeholt", + "email": "marcus@symbiote.com.au" + } + ], + "description": "A collection of useful grid field components", + "homepage": "http://github.com/symbiote/silverstripe-gridfieldextensions", + "keywords": [ + "gridfield", + "silverstripe" + ], + "abandoned": "symbiote/silverstripe-gridfieldextensions", + "time": "2017-06-29T06:26:01+00:00" + }, + { + "name": "silverstripe/admin", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/silverstripe/silverstripe-admin.git", + "reference": "d7d8a79c4e8fab65cbcb1e6bbb9d98d87f51b42a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silverstripe/silverstripe-admin/zipball/d7d8a79c4e8fab65cbcb1e6bbb9d98d87f51b42a", + "reference": "d7d8a79c4e8fab65cbcb1e6bbb9d98d87f51b42a", + "shasum": "" + }, + "require": { + "silverstripe/framework": "^4@dev", + "silverstripe/vendor-plugin": "^1.0", + "silverstripe/versioned": "^1@dev" + }, + "require-dev": { + "phpunit/phpunit": "^5.7" + }, + "type": "silverstripe-vendormodule", + "extra": { + "expose": [ + "client/dist", + "client/lang", + "thirdparty" + ] + }, + "autoload": { + "psr-4": { + "SilverStripe\\Admin\\": "code/", + "SilverStripe\\Admin\\Tests\\": "tests/php/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "SilverStripe", + "homepage": "http://silverstripe.com" + }, + { + "name": "The SilverStripe Community", + "homepage": "http://silverstripe.org" + } + ], + "description": "SilverStripe admin interface", + "homepage": "http://silverstripe.org", + "keywords": [ + "admin", + "silverstripe" + ], + "time": "2018-07-30T14:12:42+00:00" + }, + { + "name": "silverstripe/assets", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/silverstripe/silverstripe-assets.git", + "reference": "2570b1049bdbb46c39ce52173938e30ff341571d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silverstripe/silverstripe-assets/zipball/2570b1049bdbb46c39ce52173938e30ff341571d", + "reference": "2570b1049bdbb46c39ce52173938e30ff341571d", + "shasum": "" + }, + "require": { + "intervention/image": "^2.3", + "php": ">=5.6.0", + "silverstripe/framework": "^4.1", + "silverstripe/vendor-plugin": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7", + "silverstripe/versioned": "^1@dev" + }, + "type": "silverstripe-vendormodule", + "extra": { + "installer-name": "silverstripe-assets" + }, + "autoload": { + "psr-4": { + "SilverStripe\\Assets\\": "src/", + "SilverStripe\\Assets\\Tests\\": "tests/php/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "SilverStripe", + "homepage": "http://silverstripe.com" + }, + { + "name": "The SilverStripe Community", + "homepage": "http://silverstripe.org" + } + ], + "description": "SilverStripe Assets component", + "homepage": "http://silverstripe.org", + "keywords": [ + "assets", + "silverstripe" + ], + "time": "2018-06-15T03:29:48+00:00" + }, + { + "name": "silverstripe/campaign-admin", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/silverstripe/silverstripe-campaign-admin.git", + "reference": "5f5d9545e1e811dc499a2bfff1de798c1c7d8777" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silverstripe/silverstripe-campaign-admin/zipball/5f5d9545e1e811dc499a2bfff1de798c1c7d8777", + "reference": "5f5d9545e1e811dc499a2bfff1de798c1c7d8777", + "shasum": "" + }, + "require": { + "silverstripe/admin": "^1@dev", + "silverstripe/framework": "^4@dev", + "silverstripe/vendor-plugin": "^1.0", + "silverstripe/versioned": "^1@dev" + }, + "require-dev": { + "phpunit/phpunit": "^5.7", + "silverstripe/asset-admin": "^1", + "silverstripe/cms": "^4" + }, + "type": "silverstripe-vendormodule", + "extra": { + "expose": [ + "client/dist", + "client/lang" + ] + }, + "autoload": { + "psr-4": { + "SilverStripe\\CampaignAdmin\\": "src/", + "SilverStripe\\CampaignAdmin\\Tests\\": "tests/php/", + "SilverStripe\\CampaignAdmin\\Tests\\Behat\\Context\\": "tests/behat/src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "SilverStripe", + "homepage": "http://silverstripe.com" + }, + { + "name": "The SilverStripe Community", + "homepage": "http://silverstripe.org" + } + ], + "description": "SilverStripe campaign admin interface", + "homepage": "http://silverstripe.org", + "keywords": [ + "admin", + "campaign", + "silverstripe", + "versioned" + ], + "time": "2018-07-30T10:25:11+00:00" + }, + { + "name": "silverstripe/cms", + "version": "4.2.1", + "source": { + "type": "git", + "url": "https://github.com/silverstripe/silverstripe-cms.git", + "reference": "c611c981e45409c8ab318f709a5d94cdd7e0ce84" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silverstripe/silverstripe-cms/zipball/c611c981e45409c8ab318f709a5d94cdd7e0ce84", + "reference": "c611c981e45409c8ab318f709a5d94cdd7e0ce84", + "shasum": "" + }, + "require": { + "silverstripe/admin": "^1.1@dev", + "silverstripe/campaign-admin": "^1.1@dev", + "silverstripe/framework": "^4.1@dev", + "silverstripe/reports": "^4.1@dev", + "silverstripe/siteconfig": "^4.1@dev", + "silverstripe/vendor-plugin": "^1.0", + "silverstripe/versioned": "^1.1@dev" + }, + "require-dev": { + "phpunit/phpunit": "^5.7" + }, + "type": "silverstripe-vendormodule", + "extra": { + "expose": [ + "client/dist", + "client/lang" + ] + }, + "autoload": { + "psr-4": { + "SilverStripe\\CMS\\": "code/", + "SilverStripe\\CMS\\Tests\\": "code/php/", + "SilverStripe\\CMS\\Tests\\Behaviour\\": "tests/behat/src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "SilverStripe", + "homepage": "http://silverstripe.com" + }, + { + "name": "The SilverStripe Community", + "homepage": "http://silverstripe.org" + } + ], + "description": "The SilverStripe Content Management System", + "homepage": "http://silverstripe.org", + "keywords": [ + "cms", + "silverstripe" + ], + "time": "2018-07-30T14:12:45+00:00" + }, + { + "name": "silverstripe/config", + "version": "1.0.6", + "source": { + "type": "git", + "url": "https://github.com/silverstripe/silverstripe-config.git", + "reference": "ab03d6dc54bd51f4b8f5ebf92612895568ac9633" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silverstripe/silverstripe-config/zipball/ab03d6dc54bd51f4b8f5ebf92612895568ac9633", + "reference": "ab03d6dc54bd51f4b8f5ebf92612895568ac9633", + "shasum": "" + }, + "require": { + "marcj/topsort": "^1.0", + "psr/simple-cache": "^1.0", + "symfony/finder": "^2.8 || ^3.2", + "symfony/yaml": "^2.8 || ^3.2" + }, + "require-dev": { + "mikey179/vfsstream": "^1.6", + "phpspec/prophecy": "^1.0", + "phpunit/phpunit": "^5.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "SilverStripe\\Config\\": "src/", + "SilverStripe\\Config\\Tests\\": "tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "SilverStripe configuration based on YAML and class statics", + "time": "2018-06-17T22:13:57+00:00" + }, + { + "name": "silverstripe/framework", + "version": "4.2.1", + "source": { + "type": "git", + "url": "https://github.com/silverstripe/silverstripe-framework.git", + "reference": "9d7eefce1dd19af1087e2ee8fe75e4cc07766d51" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silverstripe/silverstripe-framework/zipball/9d7eefce1dd19af1087e2ee8fe75e4cc07766d51", + "reference": "9d7eefce1dd19af1087e2ee8fe75e4cc07766d51", + "shasum": "" + }, + "require": { + "composer/installers": "~1.0", + "embed/embed": "^3.0", + "ext-ctype": "*", + "ext-dom": "*", + "ext-hash": "*", + "ext-intl": "*", + "ext-mbstring": "*", + "ext-session": "*", + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xml": "*", + "league/csv": "^8", + "league/flysystem": "~1.0.12", + "m1/env": "^2.1", + "monolog/monolog": "~1.11", + "nikic/php-parser": "^2 || ^3", + "paragonie/random_compat": "^2.0", + "php": ">=5.6.0", + "psr/container": "1.0.0", + "psr/container-implementation": "1.0.0", + "silverstripe/assets": "^1@dev", + "silverstripe/config": "^1@dev", + "silverstripe/vendor-plugin": "^1.0", + "swiftmailer/swiftmailer": "~5.4", + "symfony/cache": "^3.3@dev", + "symfony/config": "^3.2", + "symfony/translation": "^2.8", + "symfony/yaml": "~3.2" + }, + "provide": { + "psr/container-implementation": "1.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7", + "silverstripe/versioned": "^1" + }, + "bin": [ + "sake" + ], + "type": "silverstripe-vendormodule", + "extra": { + "expose": [ + "client/images", + "client/styles", + "src/Dev/Install/client" + ] + }, + "autoload": { + "psr-4": { + "SilverStripe\\Control\\": "src/Control/", + "SilverStripe\\Control\\Tests\\": "tests/php/Control/", + "SilverStripe\\Core\\": "src/Core/", + "SilverStripe\\Core\\Tests\\": "tests/php/Core/", + "SilverStripe\\Dev\\": "src/Dev/", + "SilverStripe\\Dev\\Tests\\": "tests/php/Dev/", + "SilverStripe\\Forms\\": "src/Forms/", + "SilverStripe\\Forms\\Tests\\": "tests/php/Forms/", + "SilverStripe\\i18n\\": "src/i18n/", + "SilverStripe\\i18n\\Tests\\": "tests/php/i18n/", + "SilverStripe\\Logging\\": "src/Logging/", + "SilverStripe\\Logging\\Tests\\": "tests/php/Logging/", + "SilverStripe\\ORM\\": "src/ORM/", + "SilverStripe\\ORM\\Tests\\": "tests/php/ORM/", + "SilverStripe\\Security\\": "src/Security/", + "SilverStripe\\Security\\Tests\\": "tests/php/Security/", + "SilverStripe\\View\\": "src/View/", + "SilverStripe\\View\\Tests\\": "tests/php/View/", + "SilverStripe\\Framework\\Tests\\Behaviour\\": "tests/behat/src/" + }, + "files": [ + "src/includes/constants.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "src/", + "src/includes/", + "thirdparty/" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "SilverStripe", + "homepage": "http://silverstripe.com" + }, + { + "name": "The SilverStripe Community", + "homepage": "http://silverstripe.org" + } + ], + "description": "The SilverStripe framework", + "homepage": "http://silverstripe.org", + "keywords": [ + "framework", + "silverstripe" + ], + "time": "2018-07-30T14:12:55+00:00" + }, + { + "name": "silverstripe/reports", + "version": "4.2.1", + "source": { + "type": "git", + "url": "https://github.com/silverstripe/silverstripe-reports.git", + "reference": "e9c73e9332a5ee3e1546cf0f35515950dd356498" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silverstripe/silverstripe-reports/zipball/e9c73e9332a5ee3e1546cf0f35515950dd356498", + "reference": "e9c73e9332a5ee3e1546cf0f35515950dd356498", + "shasum": "" + }, + "require": { + "silverstripe/admin": "^1.0@dev", + "silverstripe/assets": "^1.0@dev", + "silverstripe/config": "^1.0@dev", + "silverstripe/framework": "^4.0@dev", + "silverstripe/vendor-plugin": "^1.0", + "silverstripe/versioned": "^1.0@dev" + }, + "require-dev": { + "phpunit/phpunit": "^5.7" + }, + "type": "silverstripe-vendormodule", + "extra": { + "expose": [ + "javascript" + ] + }, + "autoload": { + "psr-4": { + "SilverStripe\\Reports\\": "code/", + "SilverStripe\\Reports\\Tests\\": "tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "SilverStripe", + "homepage": "http://silverstripe.com" + }, + { + "name": "The SilverStripe Community", + "homepage": "http://silverstripe.org" + } + ], + "description": "Reports module for SilverStripe CMS", + "homepage": "http://silverstripe.org", + "keywords": [ + "cms", + "reports", + "silverstripe" + ], + "time": "2018-07-24T22:57:44+00:00" + }, + { + "name": "silverstripe/siteconfig", + "version": "4.2.1", + "source": { + "type": "git", + "url": "https://github.com/silverstripe/silverstripe-siteconfig.git", + "reference": "afab0030c96b5341c1385165b1066a36294e440a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silverstripe/silverstripe-siteconfig/zipball/afab0030c96b5341c1385165b1066a36294e440a", + "reference": "afab0030c96b5341c1385165b1066a36294e440a", + "shasum": "" + }, + "require": { + "silverstripe/admin": "^1", + "silverstripe/framework": "^4", + "silverstripe/vendor-plugin": "^1" + }, + "require-dev": { + "phpunit/phpunit": "^5.7" + }, + "type": "silverstripe-vendormodule", + "autoload": { + "psr-4": { + "SilverStripe\\SiteConfig\\": "code/", + "SilverStripe\\SiteConfig\\Tests\\": "tests/php/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Will Rossiter", + "email": "will@fullscreen.io" + } + ], + "description": "Site wide settings administration.", + "keywords": [ + "silverstripe", + "siteconfig" + ], + "time": "2018-07-30T10:13:31+00:00" + }, + { + "name": "silverstripe/vendor-plugin", + "version": "1.3.3", + "source": { + "type": "git", + "url": "https://github.com/silverstripe/vendor-plugin.git", + "reference": "ec27b75cc67adc31c458e8ccd91e787a9534c15c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silverstripe/vendor-plugin/zipball/ec27b75cc67adc31c458e8ccd91e787a9534c15c", + "reference": "ec27b75cc67adc31c458e8ccd91e787a9534c15c", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1", + "composer/installers": "^1.4" + }, + "require-dev": { + "composer/composer": "^1.5", + "phpunit/phpunit": "^5.7" + }, + "type": "composer-plugin", + "extra": { + "class": "SilverStripe\\VendorPlugin\\VendorPlugin", + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "SilverStripe\\VendorPlugin\\": "src/", + "SilverStripe\\VendorPlugin\\Tests\\": "tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Damian Mooyman", + "email": "damian@silverstripe.com" + } + ], + "description": "Allows vendor modules to expose directories to the webroot", + "time": "2018-03-25T21:50:30+00:00" + }, + { + "name": "silverstripe/versioned", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/silverstripe/silverstripe-versioned.git", + "reference": "7805484b710f24dd6cd132c030efea914a721d46" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silverstripe/silverstripe-versioned/zipball/7805484b710f24dd6cd132c030efea914a721d46", + "reference": "7805484b710f24dd6cd132c030efea914a721d46", + "shasum": "" + }, + "require": { + "silverstripe/framework": "^4", + "silverstripe/vendor-plugin": "^1" + }, + "require-dev": { + "phpunit/phpunit": "^5.7", + "silverstripe/admin": "^1" + }, + "type": "silverstripe-vendormodule", + "autoload": { + "psr-4": { + "SilverStripe\\Versioned\\": "src/", + "SilverStripe\\Versioned\\Tests\\": "tests/php/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "SilverStripe", + "homepage": "http://silverstripe.com" + }, + { + "name": "The SilverStripe Community", + "homepage": "http://silverstripe.org" + } + ], + "description": "SilverStripe Versioned component", + "homepage": "http://silverstripe.org", + "keywords": [ + "silverstripe", + "versioned" + ], + "time": "2018-07-30T10:25:55+00:00" + }, + { + "name": "swiftmailer/swiftmailer", + "version": "v5.4.12", + "source": { + "type": "git", + "url": "https://github.com/swiftmailer/swiftmailer.git", + "reference": "181b89f18a90f8925ef805f950d47a7190e9b950" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/181b89f18a90f8925ef805f950d47a7190e9b950", + "reference": "181b89f18a90f8925ef805f950d47a7190e9b950", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "mockery/mockery": "~0.9.1", + "symfony/phpunit-bridge": "~3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.4-dev" + } + }, + "autoload": { + "files": [ + "lib/swift_required.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Corbyn" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Swiftmailer, free feature-rich PHP mailer", + "homepage": "https://swiftmailer.symfony.com", + "keywords": [ + "email", + "mail", + "mailer" + ], + "time": "2018-07-31T09:26:32+00:00" + }, + { + "name": "symfony/cache", + "version": "v3.4.16", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache.git", + "reference": "4f29972d3fae5febec5c18db70e7dd2957e74ad6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache/zipball/4f29972d3fae5febec5c18db70e7dd2957e74ad6", + "reference": "4f29972d3fae5febec5c18db70e7dd2957e74ad6", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/cache": "~1.0", + "psr/log": "~1.0", + "psr/simple-cache": "^1.0", + "symfony/polyfill-apcu": "~1.1" + }, + "conflict": { + "symfony/var-dumper": "<3.3" + }, + "provide": { + "psr/cache-implementation": "1.0", + "psr/simple-cache-implementation": "1.0" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/cache": "~1.6", + "doctrine/dbal": "~2.4", + "predis/predis": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Cache\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Cache component with PSR-6, PSR-16, and tags", + "homepage": "https://symfony.com", + "keywords": [ + "caching", + "psr6" + ], + "time": "2018-09-25T07:13:51+00:00" + }, + { + "name": "symfony/config", + "version": "v3.4.16", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "e5389132dc6320682de3643091121c048ff796b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/e5389132dc6320682de3643091121c048ff796b3", + "reference": "e5389132dc6320682de3643091121c048ff796b3", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/filesystem": "~2.8|~3.0|~4.0", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3", + "symfony/finder": "<3.3" + }, + "require-dev": { + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/event-dispatcher": "~3.3|~4.0", + "symfony/finder": "~3.3|~4.0", + "symfony/yaml": "~3.0|~4.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2018-09-08T13:15:14+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v4.1.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "a10ae719b02c47ecba5c684ca2b505f3a49bf397" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/a10ae719b02c47ecba5c684ca2b505f3a49bf397", + "reference": "a10ae719b02c47ecba5c684ca2b505f3a49bf397", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2018-09-30T03:38:13+00:00" + }, + { + "name": "symfony/finder", + "version": "v3.4.16", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "e8db87d755e14271e920e31ba834a4ae99483232" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/e8db87d755e14271e920e31ba834a4ae99483232", + "reference": "e8db87d755e14271e920e31ba834a4ae99483232", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2018-09-21T12:47:54+00:00" + }, + { + "name": "symfony/polyfill-apcu", + "version": "v1.9.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-apcu.git", + "reference": "19e1b73bf255265ad0b568f81766ae2a3266d8d2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-apcu/zipball/19e1b73bf255265ad0b568f81766ae2a3266d8d2", + "reference": "19e1b73bf255265ad0b568f81766ae2a3266d8d2", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Apcu\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting apcu_* functions to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "apcu", + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.9.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.9.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/translation", + "version": "v2.8.46", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "59b4debd89c156fd753343fcc1ca36aa5bc2d0f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/59b4debd89c156fd753343fcc1ca36aa5bc2d0f4", + "reference": "59b4debd89c156fd753343fcc1ca36aa5bc2d0f4", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/config": "<2.7" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8", + "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", + "symfony/yaml": "~2.2|~3.0.0" + }, + "suggest": { + "psr/log-implementation": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Translation Component", + "homepage": "https://symfony.com", + "time": "2018-09-21T12:46:38+00:00" + }, + { + "name": "symfony/yaml", + "version": "v3.4.16", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "61973ecda60e9f3561e929e19c07d4878b960fc1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/61973ecda60e9f3561e929e19c07d4878b960fc1", + "reference": "61973ecda60e9f3561e929e19c07d4878b960fc1", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } ], - "time": "2016-02-24 03:06:04" + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-09-24T08:15:45+00:00" } ], "packages-dev": [], "aliases": [], - "minimum-stability": "stable", + "minimum-stability": "dev", "stability-flags": [], - "prefer-stable": false, + "prefer-stable": true, "prefer-lowest": false, "platform": [], "platform-dev": [] diff --git a/javascript/superglue.js b/javascript/superglue.js new file mode 100644 index 0000000..dc7a478 --- /dev/null +++ b/javascript/superglue.js @@ -0,0 +1,25 @@ +(function ($) { + $.entwine('ss', function ($) { + // custom reload super-glue-normal gridfield when pinned an item. + $('.super-glue-pinned.ss-gridfield').entwine({ + reload: function (ajaxOpts, successCallback) { + this._super(ajaxOpts, function () { + if (ajaxOpts !== undefined) { + jQuery('.super-glue-normal').entwine('.').entwine('ss').reload(); + } + }); + }, + }); + + // custom reload super-glue-pinned gridfield when unpinned an item. + $('.super-glue-normal.ss-gridfield').entwine({ + reload: function (ajaxOpts, successCallback) { + this._super(ajaxOpts, function () { + if (ajaxOpts !== undefined) { + jQuery('.super-glue-pinned').entwine('.').entwine('ss').reload(); + } + }); + }, + }); + }); +})(jQuery); diff --git a/code/Connector.php b/src/Connector.php similarity index 89% rename from code/Connector.php rename to src/Connector.php index c5c7a81..c09b5d1 100644 --- a/code/Connector.php +++ b/src/Connector.php @@ -2,8 +2,8 @@ namespace SilverStripe\SuperGlue; -use DataList; -use SiteTree; +use SilverStripe\ORM\DataList; +use SilverStripe\CMS\Model\SiteTree; interface Connector { diff --git a/code/PageControllerExtension.php b/src/PageControllerExtension.php similarity index 61% rename from code/PageControllerExtension.php rename to src/PageControllerExtension.php index 55393ef..07ffc3d 100644 --- a/code/PageControllerExtension.php +++ b/src/PageControllerExtension.php @@ -2,20 +2,20 @@ namespace SilverStripe\SuperGlue; -use Controller; -use DataObject; -use Extension; -use PaginatedList; -use SS_HTTPResponse; +use SilverStripe\Core\Extension; +use SilverStripe\ORM\DataObject; +use SilverStripe\ORM\PaginatedList; +use SilverStripe\Control\Controller; +use SilverStripe\Control\HTTPResponse; class PageControllerExtension extends Extension { /** * @var array */ - private static $allowed_actions = array( + private static $allowed_actions = [ "LoadMore", - ); + ]; /** * @return SS_HTTPResponse @@ -30,7 +30,7 @@ public function LoadMore() /** @var Connector $connector */ $connector = new $connector(); - $items = array(); + $items = []; foreach ($pages as $page) { if (method_exists($connector, "getPageArray")) { @@ -42,19 +42,19 @@ public function LoadMore() $items[] = $item; } - $data = array( - "total" => (int) $pages->TotalItems(), - "limit" => (int) $pages->getPageLength(), - "start" => (int) $pages->getPageStart(), - "next" => $pages->NextLink(), + $data = [ + "total" => (int)$pages->TotalItems(), + "limit" => (int)$pages->getPageLength(), + "start" => (int)$pages->getPageStart(), + "next" => $pages->NextLink(), "items" => $items, - ); + ]; - if ((int) $pages->getPageStart() >= (int) $pages->TotalItems() - (int) $pages->getPageLength()) { + if ((int)$pages->getPageStart() >= (int)$pages->TotalItems() - (int)$pages->getPageLength()) { unset($data["next"]); } - $response = new SS_HTTPResponse(); + $response = new HTTPResponse(); $response->setBody(json_encode($data)); $response->addHeader("Content-type", "application/json"); diff --git a/code/PageExtension.php b/src/PageExtension.php similarity index 77% rename from code/PageExtension.php rename to src/PageExtension.php index 050c0eb..02490a8 100644 --- a/code/PageExtension.php +++ b/src/PageExtension.php @@ -2,59 +2,60 @@ namespace SilverStripe\SuperGlue; -use ArrayData; -use ClassInfo; -use Controller; -use DataExtension; -use DropdownField; -use FieldList; -use GridField; -use GridFieldDataColumns; -use HTMLText; -use ManyManyList; -use PaginatedList; -use Requirements; -use SiteTree; -use Tab; -use TextField; +use SilverStripe\View\ArrayData; +use SilverStripe\Core\ClassInfo; +use SilverStripe\ORM\DataExtension; +use SilverStripe\Forms\DropdownField; +use SilverStripe\Forms\FieldList; +use SilverStripe\Forms\GridField\GridField; +use SilverStripe\Forms\GridField\GridFieldDataColumns; +use SilverStripe\ORM\ManyManyList; +use SilverStripe\ORM\PaginatedList; +use SilverStripe\View\Requirements; +use SilverStripe\CMS\Model\SiteTree; +use SilverStripe\Forms\Tab; +use SilverStripe\Forms\TextField; +use SilverStripe\ORM\FieldType\DBHTMLText; +use SilverStripe\Control\Controller; +use Symbiote\GridFieldExtensions\GridFieldOrderableRows; class PageExtension extends DataExtension { /** * @var array */ - private static $db = array( - "SuperGlueConnector" => "Varchar(255)", - "SuperGluePinLimit" => "Int", + private static $db = [ + "SuperGlueConnector" => "Varchar(255)", + "SuperGluePinLimit" => "Int", "SuperGlueFirstPageLimit" => "Int", - "SuperGluePageLimit" => "Int", - ); + "SuperGluePageLimit" => "Int", + ]; /** * @var array */ - private static $defaults = array( - "SuperGluePinLimit" => 5, + private static $defaults = [ + "SuperGluePinLimit" => 5, "SuperGlueFirstPageLimit" => 9, - "SuperGluePageLimit" => 9, - ); + "SuperGluePageLimit" => 9, + ]; /** * @var array */ - private static $many_many = array( - "SuperGlueSubPages" => "SiteTree", - ); + private static $many_many = [ + "SuperGlueSubPages" => SiteTree::class, + ]; /** * @var array */ - private static $many_many_extraFields = array( - "SuperGlueSubPages" => array( - "SuperGlueSort" => "Int", + private static $many_many_extraFields = [ + "SuperGlueSubPages" => [ + "SuperGlueSort" => "Int", "SuperGluePinned" => "Boolean", - ), - ); + ], + ]; /** * @inheritdoc @@ -63,8 +64,8 @@ class PageExtension extends DataExtension */ public function updateSettingsFields(FieldList $fields) { - $connectors = array("" => "(none)"); - $implementors = ClassInfo::implementorsOf("SilverStripe\\SuperGlue\\Connector"); + $connectors = ["" => "(none)"]; + $implementors = ClassInfo::implementorsOf(Connector::class); foreach ($implementors as $implementor) { /** @var Connector $instance */ @@ -168,7 +169,7 @@ public function updateCMSFields(FieldList $fields) 'selected': index }); } else { - modified.push(item); + modified.push(items[i]); } } } else { @@ -185,6 +186,8 @@ public function updateCMSFields(FieldList $fields) }, 50); "); + Requirements::javascript('silverstripe/superglue:javascript/superglue.js'); + $this->setRelations(); if ($connector = $this->owner->SuperGlueConnector) { @@ -196,7 +199,7 @@ public function updateCMSFields(FieldList $fields) $pinnedGrid = new GridField( "PinnedConnectedPagesGridField", "Pinned Pages", - $this->owner->SuperGlueSubPages()->filter("SuperGluePinned", true)->sort("SuperGlueSort", "DESC") + $this->getSuperGluePinnedPages() ); $pinnedGrid->getConfig()->addComponents( @@ -204,11 +207,13 @@ public function updateCMSFields(FieldList $fields) new UnpinGridFieldActionProvider() ); + $pinnedGrid->addExtraClass('super-glue-pinned'); + if (method_exists($connector, "getGridFieldDisplayFields")) { $displayFields = $connector->getGridFieldDisplayFields($this->owner); /** @var GridFieldDataColumns $dataColumns */ - $dataColumns = $pinnedGrid->getConfig()->getComponentByType("GridFieldDataColumns"); + $dataColumns = $pinnedGrid->getConfig()->getComponentByType(GridFieldDataColumns::class); $dataColumns->setDisplayFields($displayFields); } @@ -218,9 +223,11 @@ public function updateCMSFields(FieldList $fields) $normalGrid = new GridField( "NormalConnectedPagesGridField", "Normal Pages", - $this->owner->SuperGlueSubPages()->filter("SuperGluePinned", false)->sort("SuperGlueSort", "DESC") + $this->getSuperGlueUnpinnedPages() ); + $normalGrid->addExtraClass('super-glue-normal'); + $normalGrid->getConfig()->addComponents( (new GridFieldOrderableRows())->setSortField("SuperGlueSort"), new PinGridFieldActionProvider($this->owner->SuperGluePinLimit, $this->owner->SuperGlueSubPages()->filter("SuperGluePinned", true)->count()) @@ -230,7 +237,7 @@ public function updateCMSFields(FieldList $fields) $displayFields = $connector->getGridFieldDisplayFields($this->owner); /** @var GridFieldDataColumns $dataColumns */ - $dataColumns = $normalGrid->getConfig()->getComponentByType("GridFieldDataColumns"); + $dataColumns = $normalGrid->getConfig()->getComponentByType(GridFieldDataColumns::class); $dataColumns->setDisplayFields($displayFields); } @@ -241,6 +248,28 @@ public function updateCMSFields(FieldList $fields) } } + public function getSuperGluePinnedPages() + { + if (method_exists($this->owner, 'getSuperGluePinnedPages')) { + return $this->owner->getSuperGluePinnedPages(); + } + + return $this->owner->SuperGlueSubPages() + ->filter("SuperGluePinned", true) + ->sort("SuperGlueSort", "DESC"); + } + + public function getSuperGlueUnpinnedPages() + { + if (method_exists($this->owner, 'getSuperGlueUnpinnedPages')) { + return $this->owner->getSuperGlueUnpinnedPages(); + } + + return $this->owner->SuperGlueSubPages() + ->filter("SuperGluePinned", false) + ->sort("SuperGlueSort", "DESC"); + } + /** * @inheritdoc */ @@ -267,7 +296,7 @@ private function setRelations() continue; } - $relatedList->add($potentialList->byID($potentialId), array("SuperGlueSort" => $relatedList->min("SuperGlueSort") - 1)); + $relatedList->add($potentialList->byID($potentialId), ["SuperGlueSort" => $relatedList->min("SuperGlueSort") - 1]); } // remove linked, non-potential objects @@ -296,17 +325,17 @@ public function onAfterWrite() public function SuperGlueViewSubPages() { $list = $this->owner->SuperGlueSubPages() - ->Sort(array( + ->Sort([ "SuperGluePinned" => "DESC", - "SuperGlueSort" => "ASC", - )); + "SuperGlueSort" => "ASC", + ]); $controller = Controller::curr(); $paginated = new PaginatedList($list, $controller->getRequest()); $paginated->setLimitItems(true); - if ((int) $paginated->getRequest()->getVar("start") < $this->owner->SuperGlueFirstPageLimit) { + if ((int)$paginated->getRequest()->getVar("start") < $this->owner->SuperGlueFirstPageLimit) { $paginated->setPageLength($this->owner->SuperGlueFirstPageLimit); } else { $paginated->setPageLength($this->owner->SuperGluePageLimit); @@ -316,7 +345,7 @@ public function SuperGlueViewSubPages() } /** - * @return HTMLText + * @return DBHTMLText */ public function SuperGlueView() { @@ -328,9 +357,9 @@ public function SuperGlueView() /** @var SiteTree $owner */ $owner = $this->owner; - $data = new ArrayData(array( - "Parent" => $this->owner - )); + $data = new ArrayData([ + "Parent" => $this->owner, + ]); return $data->renderWith($connector->getTemplate($owner)); } diff --git a/code/PinGridFieldActionProvider.php b/src/PinGridFieldActionProvider.php similarity index 79% rename from code/PinGridFieldActionProvider.php rename to src/PinGridFieldActionProvider.php index 0b27813..e47c001 100644 --- a/code/PinGridFieldActionProvider.php +++ b/src/PinGridFieldActionProvider.php @@ -2,15 +2,14 @@ namespace SilverStripe\SuperGlue; -use Controller; -use DataObject; -use Exception; -use GridField; -use GridField_ActionProvider; -use GridField_ColumnProvider; -use GridField_FormAction; -use SiteTree; -use SS_HTTPResponse; +use SilverStripe\Control\Controller; +use SilverStripe\ORM\DataObject; +use SilverStripe\Forms\GridField\GridField; +use SilverStripe\Forms\GridField\GridField_ActionProvider; +use SilverStripe\Forms\GridField\GridField_ColumnProvider; +use SilverStripe\Forms\GridField\GridField_FormAction; +use SilverStripe\CMS\Model\SiteTree; +use SilverStripe\Control\HTTPResponse; class PinGridFieldActionProvider implements GridField_ColumnProvider, GridField_ActionProvider { @@ -58,7 +57,7 @@ public function augmentColumns($gridField, &$columns) */ public function getColumnAttributes($gridField, $record, $columnName) { - return array("class" => "col-buttons"); + return ["class" => "col-buttons"]; } /** @@ -72,7 +71,7 @@ public function getColumnAttributes($gridField, $record, $columnName) public function getColumnMetadata($gridField, $columnName) { if ($columnName == "Actions") { - return array("title" => ""); + return ["title" => ""]; } } @@ -85,7 +84,7 @@ public function getColumnMetadata($gridField, $columnName) */ public function getColumnsHandled($gridField) { - return array("Actions"); + return ["Actions"]; } /** @@ -105,9 +104,11 @@ public function getColumnContent($gridField, $record, $columnName) "CustomAction" . $record->ID, "pin", "pin", - array("ID" => $record->ID) + ["ID" => $record->ID] ); + $field->addExtraClass('btn btn-primary'); + return $field->Field(); } @@ -123,18 +124,17 @@ public function getColumnContent($gridField, $record, $columnName) */ public function getActions($gridField) { - return array("pin"); + return ["pin"]; } /** - * @inheritdoc - * * @param GridField $gridField * @param string $actionName * @param array $arguments * @param array $data * - * @return SS_HTTPResponse + * @return HTTPResponse; + * @throws \Exception */ public function handleAction(GridField $gridField, $actionName, $arguments, $data) { @@ -148,11 +148,9 @@ public function handleAction(GridField $gridField, $actionName, $arguments, $dat if ($page && $subPage) { $components = $page->getManyManyComponents("SuperGlueSubPages"); - $components->add($subPage, array("SuperGluePinned" => 1)); + $components->add($subPage, ["SuperGluePinned" => 1]); } } } - - return Controller::curr()->redirectBack(); } } diff --git a/code/SubPageExtension.php b/src/SubPageExtension.php similarity index 68% rename from code/SubPageExtension.php rename to src/SubPageExtension.php index 4f5088b..728321d 100644 --- a/code/SubPageExtension.php +++ b/src/SubPageExtension.php @@ -2,26 +2,27 @@ namespace SilverStripe\SuperGlue; -use ClassInfo; -use DataExtension; -use ManyManyList; -use Object; +use SilverStripe\Core\ClassInfo; +use SilverStripe\ORM\DataExtension; +use SilverStripe\ORM\DataObject; +use SilverStripe\ORM\ManyManyList; +use SilverStripe\CMS\Model\SiteTree; class SubPageExtension extends DataExtension { /** * @var array */ - private static $belongs_many_many = array( - "SuperGluePages" => "SiteTree", - ); + private static $belongs_many_many = [ + "SuperGluePages" => SiteTree::class, + ]; /** * @inheritdoc */ public function onAfterWrite() { - $decorated = $this->getDecoratedBy("SilverStripe\\SuperGlue\\PageExtension"); + $decorated = $this->getDecoratedBy(PageExtension::class); foreach ($decorated as $class) { $objects = call_user_func([$class, "get"]); @@ -37,7 +38,7 @@ public function onAfterWrite() if (in_array($this->owner->ID, $listIds)) { /** @var ManyManyList $relationList */ $relationList = $object->SuperGlueSubPages(); - $relationList->add($this->owner, array("SuperGlueSort" => $relationList->min("SuperGlueSort") - 1)); + $relationList->add($this->owner, ["SuperGlueSort" => $relationList->min("SuperGlueSort") - 1]); } } } @@ -51,10 +52,10 @@ public function onAfterWrite() */ private function getDecoratedBy($extension) { - $classes = array(); + $classes = []; foreach (ClassInfo::subClassesFor("Object") as $className) { - if (Object::has_extension($className, $extension)) { + if (DataObject::has_extension($className, $extension)) { $classes[] = $className; } } diff --git a/code/UnpinGridFieldActionProvider.php b/src/UnpinGridFieldActionProvider.php similarity index 78% rename from code/UnpinGridFieldActionProvider.php rename to src/UnpinGridFieldActionProvider.php index 55f4296..bae75e9 100644 --- a/code/UnpinGridFieldActionProvider.php +++ b/src/UnpinGridFieldActionProvider.php @@ -2,15 +2,14 @@ namespace SilverStripe\SuperGlue; -use Controller; -use DataObject; -use Exception; -use GridField; -use GridField_ActionProvider; -use GridField_ColumnProvider; -use GridField_FormAction; -use SiteTree; -use SS_HTTPResponse; +use SilverStripe\Control\Controller; +use SilverStripe\ORM\DataObject; +use SilverStripe\Forms\GridField\GridField; +use SilverStripe\Forms\GridField\GridField_ActionProvider; +use SilverStripe\Forms\GridField\GridField_ColumnProvider; +use SilverStripe\Forms\GridField\GridField_FormAction; +use SilverStripe\CMS\Model\SiteTree; +use SilverStripe\Control\HTTPResponse; class UnpinGridFieldActionProvider implements GridField_ColumnProvider, GridField_ActionProvider { @@ -38,7 +37,7 @@ public function augmentColumns($gridField, &$columns) */ public function getColumnAttributes($gridField, $record, $columnName) { - return array("class" => "col-buttons"); + return ["class" => "col-buttons"]; } /** @@ -52,7 +51,7 @@ public function getColumnAttributes($gridField, $record, $columnName) public function getColumnMetadata($gridField, $columnName) { if ($columnName == "Actions") { - return array("title" => ""); + return ["title" => ""]; } } @@ -65,7 +64,7 @@ public function getColumnMetadata($gridField, $columnName) */ public function getColumnsHandled($gridField) { - return array("Actions"); + return ["Actions"]; } /** @@ -84,9 +83,11 @@ public function getColumnContent($gridField, $record, $columnName) "CustomAction" . $record->ID, "unpin", "unpin", - array("ID" => $record->ID) + ["ID" => $record->ID] ); + $field->addExtraClass('btn btn-warning'); + return $field->Field(); } @@ -99,7 +100,7 @@ public function getColumnContent($gridField, $record, $columnName) */ public function getActions($gridField) { - return array("unpin"); + return ["unpin"]; } /** @@ -110,7 +111,7 @@ public function getActions($gridField) * @param array $arguments * @param array $data * - * @return SS_HTTPResponse + * @return HTTPResponse */ public function handleAction(GridField $gridField, $actionName, $arguments, $data) { @@ -124,11 +125,9 @@ public function handleAction(GridField $gridField, $actionName, $arguments, $dat if ($page && $subPage) { $components = $page->getManyManyComponents("SuperGlueSubPages"); - $components->add($subPage, array("SuperGluePinned" => 0)); + $components->add($subPage, ["SuperGluePinned" => 0]); } } } - - return Controller::curr()->redirectBack(); } }