From cc0d2a88dc1f352abc14050cdcf0c068e1f65010 Mon Sep 17 00:00:00 2001 From: Stephen Cameron Date: Thu, 10 Dec 2020 19:36:29 +0100 Subject: [PATCH] WIP #4064 @7.5 --- web/app/mu-plugins/cube/composer.json | 2 +- web/app/mu-plugins/cube/composer.lock | 344 +++++++++++++++ .../mu-plugins/cube/src/CPT/Realisation.php | 62 +-- web/app/mu-plugins/cube/src/Common/Setup.php | 7 + web/app/mu-plugins/typerocket-loader.php | 10 - web/app/mu-plugins/typerocket/config/app.php | 152 ------- .../typerocket/config/components.php | 23 - .../mu-plugins/typerocket/config/external.php | 18 - .../mu-plugins/typerocket/config/galaxy.php | 28 -- .../mu-plugins/typerocket/config/paths.php | 124 ------ web/app/mu-plugins/typerocket/config/urls.php | 32 -- web/app/themes/Usines/composer.json | 1 + web/app/themes/Usines/composer.lock | 409 +++++++++++++++++- web/app/themes/Usines/config/poet.php | 136 ++++++ 14 files changed, 930 insertions(+), 418 deletions(-) create mode 100644 web/app/mu-plugins/cube/composer.lock delete mode 100644 web/app/mu-plugins/typerocket-loader.php delete mode 100644 web/app/mu-plugins/typerocket/config/app.php delete mode 100644 web/app/mu-plugins/typerocket/config/components.php delete mode 100644 web/app/mu-plugins/typerocket/config/external.php delete mode 100644 web/app/mu-plugins/typerocket/config/galaxy.php delete mode 100644 web/app/mu-plugins/typerocket/config/paths.php delete mode 100644 web/app/mu-plugins/typerocket/config/urls.php create mode 100644 web/app/themes/Usines/config/poet.php diff --git a/web/app/mu-plugins/cube/composer.json b/web/app/mu-plugins/cube/composer.json index cda4e82..534a93b 100644 --- a/web/app/mu-plugins/cube/composer.json +++ b/web/app/mu-plugins/cube/composer.json @@ -1,6 +1,6 @@ { "require": { - + "htmlburger/carbon-fields-plugin": "^3.2" }, "autoload": { "psr-4": { diff --git a/web/app/mu-plugins/cube/composer.lock b/web/app/mu-plugins/cube/composer.lock new file mode 100644 index 0000000..6f4167b --- /dev/null +++ b/web/app/mu-plugins/cube/composer.lock @@ -0,0 +1,344 @@ +{ + "_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#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "1a33c5ee556a63ea6941ba10bbb50dbf", + "packages": [ + { + "name": "composer/installers", + "version": "v1.9.0", + "source": { + "type": "git", + "url": "https://github.com/composer/installers.git", + "reference": "b93bcf0fa1fccb0b7d176b0967d969691cd74cca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/installers/zipball/b93bcf0fa1fccb0b7d176b0967d969691cd74cca", + "reference": "b93bcf0fa1fccb0b7d176b0967d969691cd74cca", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0" + }, + "replace": { + "roundcube/plugin-installer": "*", + "shama/baton": "*" + }, + "require-dev": { + "composer/composer": "1.6.* || 2.0.*@dev", + "composer/semver": "1.0.* || 2.0.*@dev", + "phpunit/phpunit": "^4.8.36", + "sebastian/comparator": "^1.2.4", + "symfony/process": "^2.3" + }, + "type": "composer-plugin", + "extra": { + "class": "Composer\\Installers\\Plugin", + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Installers\\": "src/Composer/Installers" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama" + } + ], + "description": "A multi-framework Composer library installer", + "homepage": "https://composer.github.io/installers/", + "keywords": [ + "Craft", + "Dolibarr", + "Eliasis", + "Hurad", + "ImageCMS", + "Kanboard", + "Lan Management System", + "MODX Evo", + "MantisBT", + "Mautic", + "Maya", + "OXID", + "Plentymarkets", + "Porto", + "RadPHP", + "SMF", + "Thelia", + "Whmcs", + "WolfCMS", + "agl", + "aimeos", + "annotatecms", + "attogram", + "bitrix", + "cakephp", + "chef", + "cockpit", + "codeigniter", + "concrete5", + "croogo", + "dokuwiki", + "drupal", + "eZ Platform", + "elgg", + "expressionengine", + "fuelphp", + "grav", + "installer", + "itop", + "joomla", + "known", + "kohana", + "laravel", + "lavalite", + "lithium", + "magento", + "majima", + "mako", + "mediawiki", + "modulework", + "modx", + "moodle", + "osclass", + "phpbb", + "piwik", + "ppi", + "puppet", + "pxcms", + "reindex", + "roundcube", + "shopware", + "silverstripe", + "sydes", + "sylius", + "symfony", + "typo3", + "wordpress", + "yawik", + "zend", + "zikula" + ], + "support": { + "issues": "https://github.com/composer/installers/issues", + "source": "https://github.com/composer/installers/tree/v1.9.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-04-07T06:57:05+00:00" + }, + { + "name": "htmlburger/carbon-fields", + "version": "v3.2.1", + "source": { + "type": "git", + "url": "https://github.com/htmlburger/carbon-fields.git", + "reference": "cd772f1c6c002207eed71f98a8c54ad9403d5644" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/htmlburger/carbon-fields/zipball/cd772f1c6c002207eed71f98a8c54ad9403d5644", + "reference": "cd772f1c6c002207eed71f98a8c54ad9403d5644", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "mockery/mockery": "^0.9.7", + "phpunit/phpunit": "~4.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Carbon_Fields\\": "core/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-only" + ], + "authors": [ + { + "name": "htmlBurger", + "email": "wordpress@htmlburger.com", + "homepage": "https://htmlburger.com/", + "role": "Developer" + }, + { + "name": "Miroslav Mitev", + "email": "mmitev.2create@gmail.com", + "role": "Developer" + }, + { + "name": "Atanas Angelov", + "email": "atanas.angelov.dev@gmail.com", + "role": "Developer" + }, + { + "name": "Georgi Stoyanov", + "email": "stoyanov.gs@gmail.com", + "role": "Developer" + }, + { + "name": "Plamen Kostadinov", + "email": "pkostadinov.2create@gmail.com", + "homepage": "http://plasmen.info/", + "role": "Developer" + }, + { + "name": "Stanimir Panchev", + "email": "Stan4omir@gmail.com", + "role": "Developer" + }, + { + "name": "Marin Atanasov", + "email": "contact@marinatanasov.com", + "homepage": "http://marinatanasov.com/", + "role": "Developer" + }, + { + "name": "Siyan Panayotov", + "homepage": "http://siyanpanayotov.com/", + "role": "Developer" + }, + { + "name": "Peter Petrov", + "email": "peter.petrov89@gmail.com", + "role": "Developer" + }, + { + "name": "Stanimir Stoyanov", + "email": "stanimir.k.stoyanov@gmail.com", + "role": "Developer" + }, + { + "name": "Kaloyan Ivanov", + "email": "kaloyanxivanov@gmail.com", + "homepage": "http://vilepixels.com/", + "role": "Developer" + }, + { + "name": "Georgi Popov", + "homepage": "http://magadanski.com/", + "role": "Developer" + }, + { + "name": "German Velchev", + "email": "germozy@gmail.com", + "role": "Developer" + }, + { + "name": "Rashko Petrov", + "email": "brutalenemy666@gmail.com", + "homepage": "http://errorfactory.com/", + "role": "Developer" + }, + { + "name": "Alexander Panayotov", + "email": "alexander.panayotov@gmail.com", + "homepage": "http://alexanderpanayotov.com/", + "role": "Developer" + }, + { + "name": "Viktor Vasilev", + "email": "liberalcho@gmail.com", + "role": "Developer" + }, + { + "name": "Georgi Georgiev", + "email": "george.georgiev96@gmail.com", + "role": "Developer" + }, + { + "name": "Atanas Vasilev", + "email": "atanasvasilev91@gmail.com", + "role": "Developer" + } + ], + "description": "WordPress developer-friendly custom fields for post types, taxonomy terms, users, comments, widgets, options and more.", + "homepage": "http://carbonfields.net/", + "support": { + "docs": "http://carbonfields.net/docs/", + "email": "wordpress@htmlburger.com", + "issues": "https://github.com/htmlburger/carbon-fields/issues", + "source": "https://github.com/htmlburger/carbon-fields" + }, + "time": "2020-11-05T17:10:48+00:00" + }, + { + "name": "htmlburger/carbon-fields-plugin", + "version": "v3.2.1", + "source": { + "type": "git", + "url": "https://github.com/htmlburger/carbon-fields-plugin.git", + "reference": "87d63fa916e3baffc73d0c270c9f873e70dc4e0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/htmlburger/carbon-fields-plugin/zipball/87d63fa916e3baffc73d0c270c9f873e70dc4e0d", + "reference": "87d63fa916e3baffc73d0c270c9f873e70dc4e0d", + "shasum": "" + }, + "require": { + "composer/installers": "^1.0", + "htmlburger/carbon-fields": "3.2.1", + "php": ">=5.3" + }, + "type": "wordpress-plugin", + "autoload": { + "psr-4": { + "Carbon_Fields_Plugin\\": "core/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0" + ], + "authors": [ + { + "name": "atanas-angelov-dev", + "email": "atanas.angelov.dev@gmail.com" + } + ], + "description": "WordPress plugin loader for Carbon Fields.", + "homepage": "http://carbonfields.net/", + "support": { + "docs": "http://carbonfields.net/docs/", + "email": "wordpress@htmlburger.com", + "issues": "https://github.com/htmlburger/carbon-fields/issues", + "source": "https://github.com/htmlburger/carbon-fields" + }, + "time": "2020-11-05T17:14:42+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.0.0" +} diff --git a/web/app/mu-plugins/cube/src/CPT/Realisation.php b/web/app/mu-plugins/cube/src/CPT/Realisation.php index a1ff3b0..1015860 100644 --- a/web/app/mu-plugins/cube/src/CPT/Realisation.php +++ b/web/app/mu-plugins/cube/src/CPT/Realisation.php @@ -2,48 +2,52 @@ namespace Cube\CPT; +use Carbon_Fields\Container; +use Carbon_Fields\Field; + class Realisation { public function register() { - // Wait for TypeRocket to load before adding post type - add_action('typerocket_loaded', function() { + // Note: custom post type settings are handled by Poet (https://github.com/Log1x/poet) + // See theme's config/poet.php for the settings + + // Define custom fields for Realisation post type using Carbon Fields + add_action('carbon_fields_register_fields', function() { - $realisation = tr_post_type('Réalisation') - ->setId('realisation') // Set manually because accent in name isn't handled properly - ->setSlug('realisations') - ->setIcon('store') - ->setArgument('supports', ['title']) // No editor for this post type - ->setTitlePlaceholder(__('Titre de la réalisation', 'usines')) - ->setTitleForm(function() { - $form = tr_form(); + Container::make('post_meta', __('Détails de réalisation', 'usines')) + ->where('post_type', '=', 'realisation') + ->add_fields([ - echo $form->image('Thumbnail') - ->setLabel(__('Vignette', 'usines')) - ->setHelp(__("Utilisé sur la page d'index", 'usines')); + Field::make('image', 'thumbnail', __('Vignette', 'usines')) + ->set_width(50) + ->set_required(), - echo $form->image('Hero Image') - ->setLabel(__("Image d'en-tête", 'usines')); + Field::make('image', 'hero_image', __("Image d'en-tête", 'usines')) + ->set_width(50) + ->set_required(), - echo $form->textarea('Description'); + Field::make('rich_text', 'description', __('Description', 'usines')) + ->set_required(), - echo $form->repeater('Photos')->setFields([ - $form->image('Photo'), - ]); + // Repeater for Images / Videos + Field::make('complex', 'gallery', __('Galerie des médias', 'usines')) + ->set_layout('tabbed-vertical') - echo $form->textarea('Testimonial') - ->setLabel(__('Témoignage', 'usines')); + // Photo element + ->add_fields('photo', __('Photo', 'usines'), [ + Field::make('image', 'image'), + ])//->set_header_template('Photo: <%- image %>') - echo $form->text('Testimonial Author') - ->setLabel(__('Auteur du témoignage', 'usines')); - }); + // Video embed element + ->add_fields('video', __('Vidéo', 'usines'), [ + Field::make('oembed', 'url', __('YouTube URL', 'usines')), + ]),//->set_header_template('Video: <%- url %>'), - // Add Realisation Category taxonomy - tr_taxonomy('Catégorie') - ->setId('realisation_category') - ->setHierarchical(true) - ->apply($realisation); + Field::make('textarea', 'testimonial', __('Témoignage', 'usines')), + Field::make('text', 'testimonial_author', __('Auteur du témoignage', 'usines')), + ]); }); } diff --git a/web/app/mu-plugins/cube/src/Common/Setup.php b/web/app/mu-plugins/cube/src/Common/Setup.php index 155790d..32cb313 100644 --- a/web/app/mu-plugins/cube/src/Common/Setup.php +++ b/web/app/mu-plugins/cube/src/Common/Setup.php @@ -2,6 +2,8 @@ namespace Cube\Common; +use Carbon_Fields\Carbon_Fields; + class Setup { /** @@ -9,6 +11,11 @@ class Setup { */ public function register() { + // Register Carbon Fields + add_action('after_setup_theme', function () { + Carbon_Fields::boot(); + }); + } } diff --git a/web/app/mu-plugins/typerocket-loader.php b/web/app/mu-plugins/typerocket-loader.php deleted file mode 100644 index 470e13f..0000000 --- a/web/app/mu-plugins/typerocket-loader.php +++ /dev/null @@ -1,10 +0,0 @@ - [ - '\TypeRocket\Extensions\PostMessages', - //'\TypeRocket\Extensions\TypeRocketUI', - //'\TypeRocket\Extensions\PageBuilder', - ], - - /* - |-------------------------------------------------------------------------- - | Services - |-------------------------------------------------------------------------- - | - | Services you want loaded into the container as singletons. You can also - | create your own services. TypeRocket some with the following builtin: - | - | - \App\Services\AuthService - | - */ - 'services' => [ - /* - * TypeRocket Service Providers... - */ - '\TypeRocket\Services\ErrorService', - '\TypeRocket\Services\MailerService', - - /* - * Application Service Providers... - */ - '\App\Services\AuthService', - ], - - /* - |-------------------------------------------------------------------------- - | Front-end - |-------------------------------------------------------------------------- - | - | Require TypeRocket on the front-end. - | - */ - 'frontend' => false, - - /* - |-------------------------------------------------------------------------- - | Debug - |-------------------------------------------------------------------------- - | - | Turn on Debugging for TypeRocket. Set to false to disable. - | - */ - 'debug' => typerocket_env('WP_DEBUG', true), - - /* - |-------------------------------------------------------------------------- - | Seed - |-------------------------------------------------------------------------- - | - | A 'random' string of text to help with security from time to time. - | - */ - 'seed' => 'seed_5fc916da61d44', - - /* - |-------------------------------------------------------------------------- - | Class Overrides - |-------------------------------------------------------------------------- - | - | Set the classes to use as the default for helper functions. - | - */ - 'class' => [ - 'form' => '\App\Elements\Form', - 'error' => '\TypeRocket\Utility\ExceptionReport' - ], - - /* - |-------------------------------------------------------------------------- - | Template Engine - |-------------------------------------------------------------------------- - | - | The template engine used to build views for the front-end and admin. - | - | Pro Only: - | - \TypeRocketPro\Template\TachyonTemplateEngine - | - \TypeRocketPro\Template\TwigTemplateEngine - | - */ - 'templates' => [ - 'views' => '\TypeRocket\Template\TemplateEngine', - ], - - /* - |-------------------------------------------------------------------------- - | Rooting - |-------------------------------------------------------------------------- - | - | The templates to use for the TypeRocket theme. Must be using TypeRocket - | as root for this feature to work. - | - */ - 'root' => [ - 'wordpress' => 'wordpress', - 'themes' => [ - 'override' => true, - 'flush' => false, - 'theme' => 'templates', - 'stylesheet' => 'theme/theme.css', - ] - ], - - /* - |-------------------------------------------------------------------------- - | Error Handling - |-------------------------------------------------------------------------- - */ - 'errors' => [ - /* - |-------------------------------------------------------------------------- - | Pro Only - Whoops PHP - |-------------------------------------------------------------------------- - | - | Use Whoops PHP when TypeRocket debugging is enabled. - | - */ - 'whoops' => true, - - /* - |-------------------------------------------------------------------------- - | Throw Errors - |-------------------------------------------------------------------------- - | - | TypeRocket defines an error handler function that throws \ErrorException. - | You can disable this functionality but it may impact the template error - | system that allows you to define 500.php theme templates. - | - | @link https://www.php.net/manual/en/function.set-error-handler.php - | - | Recommended Levels: `E_ALL` or `E_ERROR | E_PARSE` - | - */ - 'throw' => true, - 'level' => E_ERROR | E_PARSE - ] -]; diff --git a/web/app/mu-plugins/typerocket/config/components.php b/web/app/mu-plugins/typerocket/config/components.php deleted file mode 100644 index a0e0733..0000000 --- a/web/app/mu-plugins/typerocket/config/components.php +++ /dev/null @@ -1,23 +0,0 @@ - [ - 'content' => \App\Components\ContentComponent::class, - ], - - /* - |-------------------------------------------------------------------------- - | Builder - |-------------------------------------------------------------------------- - | - | List of components you want included for the builder group. - | - */ - 'builder' => [ - 'content', - ] -]; \ No newline at end of file diff --git a/web/app/mu-plugins/typerocket/config/external.php b/web/app/mu-plugins/typerocket/config/external.php deleted file mode 100644 index cf7f705..0000000 --- a/web/app/mu-plugins/typerocket/config/external.php +++ /dev/null @@ -1,18 +0,0 @@ - [ - 'api_key' => typerocket_env('TYPEROCKET_GOOGLE_MAPS_API_KEY'), - 'map_zoom' => 15, - 'ui' => false - ] -]; \ No newline at end of file diff --git a/web/app/mu-plugins/typerocket/config/galaxy.php b/web/app/mu-plugins/typerocket/config/galaxy.php deleted file mode 100644 index d3a9f93..0000000 --- a/web/app/mu-plugins/typerocket/config/galaxy.php +++ /dev/null @@ -1,28 +0,0 @@ - \TypeRocket\Utility\Helper::wordPressRootPath(), - 'wordpress' => realpath(__DIR__ .'/../../../../wp'), - - /* - |-------------------------------------------------------------------------- - | Commands - |-------------------------------------------------------------------------- - | - | Add your custom commands for Galaxy. TypeRocket commands use Symfony - | framework see http://symfony.com/doc/current/console.html - | - */ - 'commands' => [ - ] -]; diff --git a/web/app/mu-plugins/typerocket/config/paths.php b/web/app/mu-plugins/typerocket/config/paths.php deleted file mode 100644 index 56cb6c4..0000000 --- a/web/app/mu-plugins/typerocket/config/paths.php +++ /dev/null @@ -1,124 +0,0 @@ - TYPEROCKET_APP_ROOT_PATH . '/app', - - /* - |-------------------------------------------------------------------------- - | Storage - |-------------------------------------------------------------------------- - | - | The PATH where files are to be stored. - | - */ - 'storage' => TYPEROCKET_ALT_PATH . '/storage', - - /* - |-------------------------------------------------------------------------- - | Cache - |-------------------------------------------------------------------------- - | - | The PATH where files are to be cached. - | - */ - 'cache' => TYPEROCKET_ALT_PATH . '/storage/cache', - - /* - |-------------------------------------------------------------------------- - | Resources - |-------------------------------------------------------------------------- - | - | The PATH were resources can be found. - | - */ - 'resources' => TYPEROCKET_ALT_PATH . '/resources', - - /* - |-------------------------------------------------------------------------- - | Views - |-------------------------------------------------------------------------- - | - | The PATH were front-end views can be found. - | - */ - 'views' => TYPEROCKET_ALT_PATH . '/resources/views', - - /* - |-------------------------------------------------------------------------- - | Themes - |-------------------------------------------------------------------------- - | - | The PATH were theme templates can be found. Used if you install - | TypeRocket as root. - | - */ - 'themes' => TYPEROCKET_ALT_PATH . '/resources/themes', - - /* - |-------------------------------------------------------------------------- - | Routes - |-------------------------------------------------------------------------- - | - | The PATH were theme templates can be found. Used if you install - | TypeRocket as root. - | - */ - 'routes' => TYPEROCKET_ALT_PATH . '/routes', - - /* - |-------------------------------------------------------------------------- - | Migrations - |-------------------------------------------------------------------------- - | - | The PATHs for migrations and run migrations. - | - */ - 'migrations' => TYPEROCKET_ALT_PATH . '/database/migrations', - - /* - |-------------------------------------------------------------------------- - | Composer Vendor - |-------------------------------------------------------------------------- - | - | The PATH were composer vendor files are located. - | - */ - 'vendor' => TYPEROCKET_PATH . '/vendor', - - /* - |-------------------------------------------------------------------------- - | Core - |-------------------------------------------------------------------------- - | - | The PATH were composer vendor files are located. - | - */ - 'core' => TYPEROCKET_PATH . '/vendor/typerocket/core', - - /* - |-------------------------------------------------------------------------- - | Pro Core - |-------------------------------------------------------------------------- - | - | The PATH were pro composer vendor files are located. - | - */ - 'pro' => TYPEROCKET_PATH . '/vendor/typerocket/professional', - - /* - |-------------------------------------------------------------------------- - | Assets - |-------------------------------------------------------------------------- - | - | The PATH where TypeRocket theme and build assets are located. - | - */ - 'assets' => TYPEROCKET_PATH . '/wordpress/assets', -]; diff --git a/web/app/mu-plugins/typerocket/config/urls.php b/web/app/mu-plugins/typerocket/config/urls.php deleted file mode 100644 index babdc4e..0000000 --- a/web/app/mu-plugins/typerocket/config/urls.php +++ /dev/null @@ -1,32 +0,0 @@ - \TypeRocket\Utility\Helper::assetsUrlBuild(), - - /* - |-------------------------------------------------------------------------- - | Components - |-------------------------------------------------------------------------- - | - | The URL where TypeRocket component assets are found. - | - */ - 'components' => \TypeRocket\Utility\Helper::assetsUrlBuild( '/components' ), - - /* - |-------------------------------------------------------------------------- - | Typerocket Assets - |-------------------------------------------------------------------------- - | - | The URL where TypeRocket Core assets are found. - | - */ - 'typerocket' => \TypeRocket\Utility\Helper::assetsUrlBuild( '/typerocket' ), -]; diff --git a/web/app/themes/Usines/composer.json b/web/app/themes/Usines/composer.json index 01c15fc..2f916ec 100644 --- a/web/app/themes/Usines/composer.json +++ b/web/app/themes/Usines/composer.json @@ -40,6 +40,7 @@ }, "require": { "php": "^7.2.5", + "log1x/poet": "^1.1", "log1x/sage-directives": "^1.1", "log1x/sage-svg": "^1.0", "roots/acorn": "^1.1" diff --git a/web/app/themes/Usines/composer.lock b/web/app/themes/Usines/composer.lock index ab7f8e3..9f140a2 100644 --- a/web/app/themes/Usines/composer.lock +++ b/web/app/themes/Usines/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8d5070ac7d62e461adb0595fd973c589", + "content-hash": "3d8b133d442631e17530d590ef755315", "packages": [ { "name": "brick/math", @@ -62,6 +62,139 @@ ], "time": "2020-08-18T23:57:15+00:00" }, + { + "name": "caseyamcl/toc", + "version": "v2.3.1", + "source": { + "type": "git", + "url": "https://github.com/caseyamcl/toc.git", + "reference": "68fd06c26086de4732bbe7a26ae1355afa0743c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/caseyamcl/toc/zipball/68fd06c26086de4732bbe7a26ae1355afa0743c9", + "reference": "68fd06c26086de4732bbe7a26ae1355afa0743c9", + "shasum": "" + }, + "require": { + "cocur/slugify": "^1.0|^2.0|^3.0|^4.0", + "ext-dom": "*", + "knplabs/knp-menu": "^3.0", + "masterminds/html5": "^2.1", + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.5|^8.0|^9.0", + "squizlabs/php_codesniffer": "^3.5", + "twig/twig": "^2.4|^3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "TOC\\": [ + "src/", + "tests/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Casey McLaughlin", + "email": "caseyamcl@gmail.com", + "homepage": "http://caseymclaughlin.com", + "role": "Developer" + } + ], + "description": "Simple Table-of-Contents Generator for PHP. Generates TOCs based off H1...H6 tags", + "homepage": "http://github.com/caseyamcl/toc", + "keywords": [ + "TOC", + "table of contents" + ], + "support": { + "issues": "https://github.com/caseyamcl/toc/issues", + "source": "https://github.com/caseyamcl/toc/tree/v2.3.1" + }, + "time": "2020-08-20T17:45:06+00:00" + }, + { + "name": "cocur/slugify", + "version": "v4.0.0", + "source": { + "type": "git", + "url": "https://github.com/cocur/slugify.git", + "reference": "3f1ffc300f164f23abe8b64ffb3f92d35cec8307" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cocur/slugify/zipball/3f1ffc300f164f23abe8b64ffb3f92d35cec8307", + "reference": "3f1ffc300f164f23abe8b64ffb3f92d35cec8307", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=7.0" + }, + "conflict": { + "symfony/config": "<3.4 || >=4,<4.3", + "symfony/dependency-injection": "<3.4 || >=4,<4.3", + "symfony/http-kernel": "<3.4 || >=4,<4.3", + "twig/twig": "<2.12.1" + }, + "require-dev": { + "laravel/framework": "~5.1", + "latte/latte": "~2.2", + "league/container": "^2.2.0", + "mikey179/vfsstream": "~1.6.8", + "mockery/mockery": "^1.3", + "nette/di": "~2.4", + "phpunit/phpunit": "^5.7.27", + "pimple/pimple": "~1.1", + "plumphp/plum": "~0.1", + "symfony/config": "^3.4 || ^4.3 || ^5.0", + "symfony/dependency-injection": "^3.4 || ^4.3 || ^5.0", + "symfony/http-kernel": "^3.4 || ^4.3 || ^5.0", + "twig/twig": "^2.12.1 || ~3.0", + "zendframework/zend-modulemanager": "~2.2", + "zendframework/zend-servicemanager": "~2.2", + "zendframework/zend-view": "~2.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Cocur\\Slugify\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florian Eckerstorfer", + "email": "florian@eckerstorfer.co", + "homepage": "https://florian.ec" + }, + { + "name": "Ivo Bathke", + "email": "ivo.bathke@gmail.com" + } + ], + "description": "Converts a string into a slug.", + "keywords": [ + "slug", + "slugify" + ], + "support": { + "issues": "https://github.com/cocur/slugify/issues", + "source": "https://github.com/cocur/slugify/tree/master" + }, + "time": "2019-12-14T13:04:14+00:00" + }, { "name": "doctrine/inflector", "version": "2.0.3", @@ -803,6 +936,148 @@ }, "time": "2020-10-27T15:11:37+00:00" }, + { + "name": "johnbillion/extended-cpts", + "version": "4.4.1", + "source": { + "type": "git", + "url": "https://github.com/johnbillion/extended-cpts.git", + "reference": "b62d104bffbf9998a1063879565f61c289f0c6a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/johnbillion/extended-cpts/zipball/b62d104bffbf9998a1063879565f61c289f0c6a9", + "reference": "b62d104bffbf9998a1063879565f61c289f0c6a9", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "automattic/phpcs-neutron-standard": "1.5.4", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "johnbillion/falsey-assertequals-detector": "^2", + "johnbillion/php-docs-standards": "^1", + "phpcompatibility/phpcompatibility-wp": "^2", + "phpunit/phpunit": "^6", + "roots/wordpress": "*", + "vlucas/phpdotenv": "^3", + "wp-cli/db-command": "^2.0", + "wp-coding-standards/wpcs": "2.3.0", + "wp-phpunit/wp-phpunit": "*" + }, + "suggest": { + "seravo/wp-custom-bulk-actions": "Custom Bulk Actions", + "wpackagist-plugin/rewrite-testing": "Rewrite Rule Testing" + }, + "type": "library", + "extra": { + "wordpress-install-dir": "tests/wordpress" + }, + "autoload": { + "psr-4": { + "ExtCPTs\\Tests\\": "tests/phpunit" + }, + "files": [ + "extended-cpts.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "John Blackbourn", + "homepage": "https://johnblackbourn.com/" + } + ], + "description": "A library which provides extended functionality to WordPress custom post types and taxonomies.", + "homepage": "https://github.com/johnbillion/extended-cpts/", + "support": { + "issues": "https://github.com/johnbillion/extended-cpts/issues", + "source": "https://github.com/johnbillion/extended-cpts/tree/4.4.1" + }, + "funding": [ + { + "url": "https://github.com/johnbillion", + "type": "github" + } + ], + "time": "2020-12-05T20:15:02+00:00" + }, + { + "name": "knplabs/knp-menu", + "version": "v3.1.2", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/KnpMenu.git", + "reference": "9996764bc4bdc4381ecdc4617817de23948f0cdb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/KnpMenu/zipball/9996764bc4bdc4381ecdc4617817de23948f0cdb", + "reference": "9996764bc4bdc4381ecdc4617817de23948f0cdb", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "conflict": { + "twig/twig": "<1.40 || >=2,<2.9" + }, + "require-dev": { + "phpspec/prophecy": "^1.8", + "psr/container": "^1.0", + "symfony/http-foundation": "^3.4 || ^4.2|| ^5.0", + "symfony/phpunit-bridge": "^3.3 || ^4.2|| ^5.0", + "symfony/routing": "^3.4 || ^4.2|| ^5.0", + "twig/twig": "^1.40 || ^2.9 || ^3.0" + }, + "suggest": { + "twig/twig": "for the TwigRenderer and the integration with your templates" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Knp\\Menu\\": "src/Knp/Menu" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "KnpLabs", + "homepage": "https://knplabs.com" + }, + { + "name": "Christophe Coevoet", + "email": "stof@notk.org" + }, + { + "name": "The Community", + "homepage": "https://github.com/KnpLabs/KnpMenu/contributors" + } + ], + "description": "An object oriented menu library", + "homepage": "https://knplabs.com", + "keywords": [ + "menu", + "tree" + ], + "support": { + "issues": "https://github.com/KnpLabs/KnpMenu/issues", + "source": "https://github.com/KnpLabs/KnpMenu/tree/master" + }, + "time": "2020-08-15T08:01:46+00:00" + }, { "name": "league/flysystem", "version": "1.1.3", @@ -953,6 +1228,69 @@ ], "time": "2020-10-18T11:50:25+00:00" }, + { + "name": "log1x/poet", + "version": "v1.1.4", + "source": { + "type": "git", + "url": "https://github.com/Log1x/poet.git", + "reference": "0d183c1794c4ef56e5975209b1b92cee368aa404" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Log1x/poet/zipball/0d183c1794c4ef56e5975209b1b92cee368aa404", + "reference": "0d183c1794c4ef56e5975209b1b92cee368aa404", + "shasum": "" + }, + "require": { + "caseyamcl/toc": "^2.2", + "johnbillion/extended-cpts": "^4.3", + "php": ">=7.2.5" + }, + "require-dev": { + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "package", + "extra": { + "acorn": { + "providers": [ + "Log1x\\Poet\\PoetServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Log1x\\Poet\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brandon Nifong", + "email": "brandon@tendency.me" + } + ], + "description": "Configuration-based post type, taxonomy, editor color palette, block category, and block registration for Sage 10.", + "keywords": [ + "cpt", + "gutenberg", + "wordpress" + ], + "support": { + "issues": "https://github.com/log1x/poet/issues", + "source": "https://github.com/Log1x/poet/tree/v1.1.4" + }, + "funding": [ + { + "url": "https://github.com/Log1x", + "type": "github" + } + ], + "time": "2020-09-23T00:48:40+00:00" + }, { "name": "log1x/sage-directives", "version": "v1.1.8", @@ -1079,6 +1417,75 @@ ], "time": "2020-04-30T00:34:52+00:00" }, + { + "name": "masterminds/html5", + "version": "2.7.4", + "source": { + "type": "git", + "url": "https://github.com/Masterminds/html5-php.git", + "reference": "9227822783c75406cfe400984b2f095cdf03d417" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/9227822783c75406cfe400984b2f095cdf03d417", + "reference": "9227822783c75406cfe400984b2f095cdf03d417", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-dom": "*", + "ext-libxml": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Masterminds\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matt Butcher", + "email": "technosophos@gmail.com" + }, + { + "name": "Matt Farina", + "email": "matt@mattfarina.com" + }, + { + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" + } + ], + "description": "An HTML5 parser and serializer.", + "homepage": "http://masterminds.github.io/html5-php", + "keywords": [ + "HTML5", + "dom", + "html", + "parser", + "querypath", + "serializer", + "xml" + ], + "support": { + "issues": "https://github.com/Masterminds/html5-php/issues", + "source": "https://github.com/Masterminds/html5-php/tree/2.7.4" + }, + "time": "2020-10-01T13:52:52+00:00" + }, { "name": "monolog/monolog", "version": "2.1.1", diff --git a/web/app/themes/Usines/config/poet.php b/web/app/themes/Usines/config/poet.php new file mode 100644 index 0000000..ef9ac22 --- /dev/null +++ b/web/app/themes/Usines/config/poet.php @@ -0,0 +1,136 @@ + + | + */ + + 'post' => [ + 'realisation' => [ + 'labels' => [ + 'singular' => 'Réalisation', + 'plural' => 'Réalisations', + 'slug' => 'realisations', + ], + 'enter_title_here' => __('Titre de la réalisation', 'usines'), + 'menu_icon' => 'dashicons-store', + 'supports' => ['title'], // No editor for this post type + 'show_in_rest' => false, + 'has_archive' => true, + ], + ], + + /* + |-------------------------------------------------------------------------- + | Taxonomies + |-------------------------------------------------------------------------- + | + | Here you may specify the taxonomies to be registered by Poet using the + | Extended CPTs library. + | + */ + + 'taxonomy' => [ + 'realisation_category' => [ + 'links' => ['realisation'], + 'meta_box' => 'radio', + 'labels' => [ + 'singular' => 'Catégorie', + 'plural' => 'Catégories', + ], + ], + ], + + /* + |-------------------------------------------------------------------------- + | Blocks + |-------------------------------------------------------------------------- + | + | Here you may specify the block types to be registered by Poet and + | rendered using Blade. + | + | Blocks are registered using the `namespace/label` defined when + | registering the block with the editor. If no namespace is provided, + | the current theme text domain will be used instead. + | + | Given the block `sage/accordion`, your block view would be located at: + | ↪ `views/blocks/accordion.blade.php` + | + | Block views have the following variables available: + | ↪ $data – An object containing the block data. + | ↪ $content – A string containing the InnerBlocks content. + | Returns `null` when empty. + | + */ + + 'block' => [ + // 'sage/accordion', + ], + + /* + |-------------------------------------------------------------------------- + | Block Categories + |-------------------------------------------------------------------------- + | + | Here you may specify block categories to be registered by Poet for use + | in the editor. + | + */ + + 'categories' => [ + // 'cta' => [ + // 'title' => 'Call to Action', + // 'icon' => 'star-filled', + // ], + ], + + /* + |-------------------------------------------------------------------------- + | Editor Palette + |-------------------------------------------------------------------------- + | + | Here you may specify the color palette registered in the Gutenberg + | editor. + | + | A color palette can be passed as an array or by passing the filename of + | a JSON file containing the palette. + | + | If a color is passed a value directly, the slug will automatically be + | converted to Title Case and used as the color name. + | + | If the palette is explicitly set to `true` – Poet will attempt to + | register the palette using the default `palette.json` filename generated + | by + | + */ + + 'palette' => [ + // 'red' => '#ff0000', + // 'blue' => '#0000ff', + ], + + /* + |-------------------------------------------------------------------------- + | Admin Menu + |-------------------------------------------------------------------------- + | + | Here you may specify admin menu item page slugs you would like moved to + | the Tools menu in an attempt to clean up unwanted core/plugin bloat. + | + | Alternatively, you may also explicitly pass `false` to any menu item to + | remove it entirely. + | + */ + + 'menu' => [ + // 'gutenberg', + ], + +]; -- 2.39.5