]> _ Git - c6-wordpress.git/commitdiff
Adding missing custom mu-plugin files. WIP #2684 @0.25
authorStephen Cameron <stephen@cubedesigners.com>
Tue, 23 Apr 2019 14:54:52 +0000 (16:54 +0200)
committerStephen Cameron <stephen@cubedesigners.com>
Tue, 23 Apr 2019 14:54:52 +0000 (16:54 +0200)
13 files changed:
.gitignore
wp-content/mu-plugins/cube-loader.php [new file with mode: 0644]
wp-content/mu-plugins/cube/composer.json [new file with mode: 0644]
wp-content/mu-plugins/cube/composer.lock [new file with mode: 0644]
wp-content/mu-plugins/cube/src/Common/Setup.php [new file with mode: 0644]
wp-content/mu-plugins/cube/src/Elementor/Setup.php [new file with mode: 0644]
wp-content/mu-plugins/cube/src/Elementor/Widgets/HeroBlock.php [new file with mode: 0644]
wp-content/mu-plugins/cube/src/Elementor/Widgets/PageHeading.php [new file with mode: 0644]
wp-content/mu-plugins/cube/src/Elementor/Widgets/TextBlock.php [new file with mode: 0644]
wp-content/mu-plugins/cube/src/Init.php [new file with mode: 0644]
wp-content/themes/c6/resources/assets/styles/common/mixins.styl
wp-content/themes/c6/resources/assets/styles/common/variables.styl
wp-content/themes/c6/resources/assets/styles/widgets/text-block.styl

index 62edd717acb8b7f3ee9cff172bf540164946cab5..f3ca18fc01e27f2030ab213c4ff5c36641d201da 100644 (file)
@@ -4,6 +4,9 @@ node_modules
 /wp-content/*
 /wp-content/themes/index.php
 !/wp-content/themes/
+!/wp-content/mu-plugins/
+/wp-content/mu-plugins/cube/vendor
+/wp-content/mu-plugins/wp-migrate-db-pro-compatibility.php
 /wp-includes
 /wp-admin
 
diff --git a/wp-content/mu-plugins/cube-loader.php b/wp-content/mu-plugins/cube-loader.php
new file mode 100644 (file)
index 0000000..ede46dd
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Plugin Name: Custom theme features
+ * Description: Loads all custom functionality such as new post types and taxonomies.
+ * Version:  1.0
+ * Author: Cubedesigners
+ * Author URI: https://www.cubedesigners.com
+ */
+
+namespace Cube;
+
+defined('ABSPATH') or die('Direct access blocked');
+
+// Folder name for all plugin files (needed because MU-plugins can't be in folders so we need to put the loader outside)
+$plugin_dir = 'cube';
+$autoloader = __DIR__ . "/$plugin_dir/vendor/autoload.php";
+
+// Namespaced constants for easier path and URL references
+define(__NAMESPACE__ . '\NS', __NAMESPACE__ . '\\'); // Namespace shortcut: NS
+define(NS . 'PLUGIN_PATH', trailingslashit(plugin_dir_path(__FILE__) . $plugin_dir));
+define(NS . 'PLUGIN_URL', trailingslashit(plugin_dir_url(__FILE__) . $plugin_dir));
+
+// Load Composer libraries
+if (file_exists($autoloader)) {
+    require_once $autoloader;
+}
+
+if (class_exists(NS . 'Init')) {
+    Init::register_classes();
+}
diff --git a/wp-content/mu-plugins/cube/composer.json b/wp-content/mu-plugins/cube/composer.json
new file mode 100644 (file)
index 0000000..de46cfe
--- /dev/null
@@ -0,0 +1,12 @@
+{
+    "require": {
+        "htmlburger/carbon-fields": "^2.2",
+        "jjgrainger/posttypes": "^2.0",
+        "devio/pipedrive": "^1.0"
+    },
+    "autoload": {
+        "psr-4": {
+            "Cube\\": "./src"
+        }
+    }
+}
diff --git a/wp-content/mu-plugins/cube/composer.lock b/wp-content/mu-plugins/cube/composer.lock
new file mode 100644 (file)
index 0000000..ee29148
--- /dev/null
@@ -0,0 +1,904 @@
+{
+    "_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",
+        "This file is @generated automatically"
+    ],
+    "hash": "efecdd73ba1be8a701f53a646bc1eb22",
+    "content-hash": "44feaffdf26cfe89afe8e48ee3568c13",
+    "packages": [
+        {
+            "name": "devio/pipedrive",
+            "version": "1.0.7",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/IsraelOrtuno/pipedrive.git",
+                "reference": "5c5cfc2bcd17900276a434185791e62daf0160f3"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/IsraelOrtuno/pipedrive/zipball/5c5cfc2bcd17900276a434185791e62daf0160f3",
+                "reference": "5c5cfc2bcd17900276a434185791e62daf0160f3",
+                "shasum": ""
+            },
+            "require": {
+                "guzzlehttp/guzzle": "~6.0|~5.0|~4.0",
+                "illuminate/support": "~4.0|~5.0"
+            },
+            "require-dev": {
+                "phpspec/phpspec": "^2.4",
+                "symfony/var-dumper": "^2.7"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Devio\\Pipedrive\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Israel Ortuño",
+                    "email": "ai.ortuno@gmail.com"
+                }
+            ],
+            "description": "Complete Pipedrive API client for PHP and/or Laravel",
+            "keywords": [
+                "api",
+                "client",
+                "laravel",
+                "pipedrive"
+            ],
+            "time": "2018-01-25 10:28:30"
+        },
+        {
+            "name": "doctrine/inflector",
+            "version": "v1.3.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/doctrine/inflector.git",
+                "reference": "5527a48b7313d15261292c149e55e26eae771b0a"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/doctrine/inflector/zipball/5527a48b7313d15261292c149e55e26eae771b0a",
+                "reference": "5527a48b7313d15261292c149e55e26eae771b0a",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.1"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^6.2"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.3.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Roman Borschel",
+                    "email": "roman@code-factory.org"
+                },
+                {
+                    "name": "Benjamin Eberlei",
+                    "email": "kontakt@beberlei.de"
+                },
+                {
+                    "name": "Guilherme Blanco",
+                    "email": "guilhermeblanco@gmail.com"
+                },
+                {
+                    "name": "Jonathan Wage",
+                    "email": "jonwage@gmail.com"
+                },
+                {
+                    "name": "Johannes Schmitt",
+                    "email": "schmittjoh@gmail.com"
+                }
+            ],
+            "description": "Common String Manipulations with regard to casing and singular/plural rules.",
+            "homepage": "http://www.doctrine-project.org",
+            "keywords": [
+                "inflection",
+                "pluralize",
+                "singularize",
+                "string"
+            ],
+            "time": "2018-01-09 20:05:19"
+        },
+        {
+            "name": "guzzlehttp/guzzle",
+            "version": "6.3.3",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/guzzle/guzzle.git",
+                "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
+                "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
+                "shasum": ""
+            },
+            "require": {
+                "guzzlehttp/promises": "^1.0",
+                "guzzlehttp/psr7": "^1.4",
+                "php": ">=5.5"
+            },
+            "require-dev": {
+                "ext-curl": "*",
+                "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
+                "psr/log": "^1.0"
+            },
+            "suggest": {
+                "psr/log": "Required for using the Log middleware"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "6.3-dev"
+                }
+            },
+            "autoload": {
+                "files": [
+                    "src/functions_include.php"
+                ],
+                "psr-4": {
+                    "GuzzleHttp\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Michael Dowling",
+                    "email": "mtdowling@gmail.com",
+                    "homepage": "https://github.com/mtdowling"
+                }
+            ],
+            "description": "Guzzle is a PHP HTTP client library",
+            "homepage": "http://guzzlephp.org/",
+            "keywords": [
+                "client",
+                "curl",
+                "framework",
+                "http",
+                "http client",
+                "rest",
+                "web service"
+            ],
+            "time": "2018-04-22 15:46:56"
+        },
+        {
+            "name": "guzzlehttp/promises",
+            "version": "v1.3.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/guzzle/promises.git",
+                "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
+                "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.5.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^4.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.4-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "GuzzleHttp\\Promise\\": "src/"
+                },
+                "files": [
+                    "src/functions_include.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Michael Dowling",
+                    "email": "mtdowling@gmail.com",
+                    "homepage": "https://github.com/mtdowling"
+                }
+            ],
+            "description": "Guzzle promises library",
+            "keywords": [
+                "promise"
+            ],
+            "time": "2016-12-20 10:07:11"
+        },
+        {
+            "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": {
+                "branch-alias": {
+                    "dev-master": "1.4-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "GuzzleHttp\\Psr7\\": "src/"
+                },
+                "files": [
+                    "src/functions_include.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Michael Dowling",
+                    "email": "mtdowling@gmail.com",
+                    "homepage": "https://github.com/mtdowling"
+                },
+                {
+                    "name": "Tobias Schultze",
+                    "homepage": "https://github.com/Tobion"
+                }
+            ],
+            "description": "PSR-7 message implementation that also provides common utility methods",
+            "keywords": [
+                "http",
+                "message",
+                "request",
+                "response",
+                "stream",
+                "uri",
+                "url"
+            ],
+            "time": "2017-03-20 17:10:46"
+        },
+        {
+            "name": "htmlburger/carbon-fields",
+            "version": "2.2.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/htmlburger/carbon-fields.git",
+                "reference": "f2e7e7b306f872b606b16909d2a2ee906381d5d1"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/htmlburger/carbon-fields/zipball/f2e7e7b306f872b606b16909d2a2ee906381d5d1",
+                "reference": "f2e7e7b306f872b606b16909d2a2ee906381d5d1",
+                "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": "Marin Atanasov",
+                    "email": "contact@marinatanasov.com",
+                    "homepage": "http://marinatanasov.com/",
+                    "role": "Developer"
+                },
+                {
+                    "name": "Siyan Panayotov",
+                    "homepage": "http://siyanpanayotov.com/",
+                    "role": "Developer"
+                },
+                {
+                    "name": "Georgi Stoyanov",
+                    "email": "stoyanov.gs@gmail.com",
+                    "role": "Developer"
+                },
+                {
+                    "name": "Stanimir Panchev",
+                    "email": "Stan4omir@gmail.com",
+                    "role": "Developer"
+                },
+                {
+                    "name": "Peter Petrov",
+                    "email": "peter.petrov89@gmail.com",
+                    "role": "Developer"
+                },
+                {
+                    "name": "Plamen Kostadinov",
+                    "email": "pkostadinov.2create@gmail.com",
+                    "homepage": "http://plasmen.info/",
+                    "role": "Developer"
+                },
+                {
+                    "name": "Stanimir Stoyanov",
+                    "email": "stanimir.k.stoyanov@gmail.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": "Miroslav Mitev",
+                    "email": "mmitev.2create@gmail.com",
+                    "role": "Developer"
+                },
+                {
+                    "name": "Kaloyan Ivanov",
+                    "email": "kaloyanxivanov@gmail.com",
+                    "homepage": "http://vilepixels.com/",
+                    "role": "Developer"
+                },
+                {
+                    "name": "Atanas Angelov",
+                    "email": "atanas.angelov.dev@gmail.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"
+                }
+            ],
+            "description": "WordPress developer-friendly custom fields for post types, taxonomy terms, users, comments, widgets, options and more.",
+            "homepage": "http://carbonfields.net/",
+            "time": "2018-03-16 09:06:14"
+        },
+        {
+            "name": "illuminate/contracts",
+            "version": "v5.6.24",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/illuminate/contracts.git",
+                "reference": "3dc639feabe0f302f574157a782ede323881a944"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/illuminate/contracts/zipball/3dc639feabe0f302f574157a782ede323881a944",
+                "reference": "3dc639feabe0f302f574157a782ede323881a944",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.1.3",
+                "psr/container": "~1.0",
+                "psr/simple-cache": "~1.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "5.6-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Illuminate\\Contracts\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Taylor Otwell",
+                    "email": "taylor@laravel.com"
+                }
+            ],
+            "description": "The Illuminate Contracts package.",
+            "homepage": "https://laravel.com",
+            "time": "2018-05-11 23:38:58"
+        },
+        {
+            "name": "illuminate/support",
+            "version": "v5.6.24",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/illuminate/support.git",
+                "reference": "b13296a75443797d6a71d0ccd437ca801b12d300"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/illuminate/support/zipball/b13296a75443797d6a71d0ccd437ca801b12d300",
+                "reference": "b13296a75443797d6a71d0ccd437ca801b12d300",
+                "shasum": ""
+            },
+            "require": {
+                "doctrine/inflector": "~1.1",
+                "ext-mbstring": "*",
+                "illuminate/contracts": "5.6.*",
+                "nesbot/carbon": "^1.24.1",
+                "php": "^7.1.3"
+            },
+            "conflict": {
+                "tightenco/collect": "<5.5.33"
+            },
+            "suggest": {
+                "illuminate/filesystem": "Required to use the composer class (5.6.*).",
+                "ramsey/uuid": "Required to use Str::uuid() (^3.7).",
+                "symfony/process": "Required to use the composer class (~4.0).",
+                "symfony/var-dumper": "Required to use the dd function (~4.0)."
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "5.6-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Illuminate\\Support\\": ""
+                },
+                "files": [
+                    "helpers.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Taylor Otwell",
+                    "email": "taylor@laravel.com"
+                }
+            ],
+            "description": "The Illuminate Support package.",
+            "homepage": "https://laravel.com",
+            "time": "2018-06-02 14:30:18"
+        },
+        {
+            "name": "jjgrainger/posttypes",
+            "version": "2.0.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/jjgrainger/PostTypes.git",
+                "reference": "04525d30d30ec19fef3478676b4f27aa405ac3a6"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/jjgrainger/PostTypes/zipball/04525d30d30ec19fef3478676b4f27aa405ac3a6",
+                "reference": "04525d30d30ec19fef3478676b4f27aa405ac3a6",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.6"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "5.7",
+                "squizlabs/php_codesniffer": "^2.8"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "PostTypes\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Joe Grainger",
+                    "email": "hello@jjgrainger.co.uk",
+                    "homepage": "http://jjgrainger.co.uk"
+                }
+            ],
+            "description": "Simple WordPress custom post types.",
+            "homepage": "https://github.com/jjgrainger/posttype",
+            "time": "2018-03-27 18:30:06"
+        },
+        {
+            "name": "nesbot/carbon",
+            "version": "1.29.2",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/briannesbitt/Carbon.git",
+                "reference": "ed6aa898982f441ccc9b2acdec51490f2bc5d337"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/ed6aa898982f441ccc9b2acdec51490f2bc5d337",
+                "reference": "ed6aa898982f441ccc9b2acdec51490f2bc5d337",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.9",
+                "symfony/translation": "~2.6 || ~3.0 || ~4.0"
+            },
+            "require-dev": {
+                "friendsofphp/php-cs-fixer": "~2",
+                "phpunit/phpunit": "^4.8.35 || ^5.7"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Brian Nesbitt",
+                    "email": "brian@nesbot.com",
+                    "homepage": "http://nesbot.com"
+                }
+            ],
+            "description": "A simple API extension for DateTime.",
+            "homepage": "http://carbon.nesbot.com",
+            "keywords": [
+                "date",
+                "datetime",
+                "time"
+            ],
+            "time": "2018-05-29 15:23:46"
+        },
+        {
+            "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-14 16:28:37"
+        },
+        {
+            "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-06 14:39:51"
+        },
+        {
+            "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-23 01:57:42"
+        },
+        {
+            "name": "symfony/polyfill-mbstring",
+            "version": "v1.8.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-mbstring.git",
+                "reference": "3296adf6a6454a050679cde90f95350ad604b171"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171",
+                "reference": "3296adf6a6454a050679cde90f95350ad604b171",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "suggest": {
+                "ext-mbstring": "For best performance"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.8-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-04-26 10:06:28"
+        },
+        {
+            "name": "symfony/translation",
+            "version": "v4.1.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/translation.git",
+                "reference": "16328f5b217cebc8dd4adfe4aeeaa8c377581f5a"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/translation/zipball/16328f5b217cebc8dd4adfe4aeeaa8c377581f5a",
+                "reference": "16328f5b217cebc8dd4adfe4aeeaa8c377581f5a",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.1.3",
+                "symfony/polyfill-mbstring": "~1.0"
+            },
+            "conflict": {
+                "symfony/config": "<3.4",
+                "symfony/dependency-injection": "<3.4",
+                "symfony/yaml": "<3.4"
+            },
+            "require-dev": {
+                "psr/log": "~1.0",
+                "symfony/config": "~3.4|~4.0",
+                "symfony/console": "~3.4|~4.0",
+                "symfony/dependency-injection": "~3.4|~4.0",
+                "symfony/finder": "~2.8|~3.0|~4.0",
+                "symfony/intl": "~3.4|~4.0",
+                "symfony/yaml": "~3.4|~4.0"
+            },
+            "suggest": {
+                "psr/log-implementation": "To use logging capability in translator",
+                "symfony/config": "",
+                "symfony/yaml": ""
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "4.1-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-05-30 07:26:09"
+        }
+    ],
+    "packages-dev": [],
+    "aliases": [],
+    "minimum-stability": "stable",
+    "stability-flags": [],
+    "prefer-stable": false,
+    "prefer-lowest": false,
+    "platform": [],
+    "platform-dev": []
+}
diff --git a/wp-content/mu-plugins/cube/src/Common/Setup.php b/wp-content/mu-plugins/cube/src/Common/Setup.php
new file mode 100644 (file)
index 0000000..d077775
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+
+namespace Cube\Common;
+
+use Carbon_Fields\Carbon_Fields;
+
+class Setup {
+
+    /**
+     * Common setup, will be automatically triggered by Init class if included
+     */
+    public function register() {
+
+         // Initialise Carbon Fields library (used for custom fields in CPTs)
+         add_action('after_setup_theme', function() {
+             Carbon_Fields::boot();
+         });
+
+    }
+
+}
diff --git a/wp-content/mu-plugins/cube/src/Elementor/Setup.php b/wp-content/mu-plugins/cube/src/Elementor/Setup.php
new file mode 100644 (file)
index 0000000..0bf74ed
--- /dev/null
@@ -0,0 +1,155 @@
+<?php
+
+namespace Cube\Elementor;
+
+use Elementor\Element_Base;
+use Elementor\Controls_Manager;
+use Elementor\Plugin;
+
+class Setup {
+
+    public function register() {
+
+        // Customise Elementor "section" element to allow layout options (via CSS classes applied to main section element)
+        $this->register_customisations();
+
+        // Register widgets with Elementor
+        add_action('elementor/widgets/widgets_registered', [$this, 'register_widgets']);
+    }
+
+
+    public function register_customisations() {
+
+        $this->_customise_sections();
+        $this->_customise_image_widget();
+
+    }
+
+
+    public function register_widgets() {
+
+        $elementor = Plugin::$instance;
+
+        $elementor->widgets_manager->register_widget_type( new Widgets\PageHeading() );
+        $elementor->widgets_manager->register_widget_type( new Widgets\HeroBlock() );
+        $elementor->widgets_manager->register_widget_type( new Widgets\TextBlock() );
+    }
+
+    protected function _customise_sections() {
+
+        // Override the main Elementor section element to allow custom controls to be added to the editor
+        // This allows us to set specific CSS classes on the section wrapper, thereby centralising control
+        // of necessary settings for each section layout (column width, padding etc)
+        //
+        // References:
+        // https://www.ibenic.com/extending-elementor-custom-button-field-skin/
+        // https://blogs.devforum.ro/customizing-elementor-default-widgets/
+        // https://github.com/pojome/elementor/issues/3495
+
+        // Add controls to section element in editor
+        add_action( 'elementor/element/section/section_layout/after_section_start', function( $element, $args ) {
+            /** @var \Elementor\Element_Base $element */
+            $element->add_control(
+                'block_layout',
+                [
+                    'label' => __('Custom Layout', 'cube'),
+                    'type' => Controls_Manager::SELECT,
+                    'options' => [
+                        'layout-default' => __( 'Default', 'cube' ),
+                        'layout-overlap-above' => __( 'Overlap Above', 'cube' ),
+                        'layout-overlap-below' => __( 'Overlap Below', 'cube' ),
+                    ],
+                    'default' => 'layout-default',
+                    'prefix_class' => '', // Use the full value as the classname (too late to change values after many pages have been built)
+                ]
+            );
+
+            $element->add_control(
+                'layout_reversed',
+                [
+                    'label' => __('Reverse layout?', 'cube'),
+                    'type' => Controls_Manager::SWITCHER,
+                    'default' => '',
+                    'return_value' => 'layout-reversed',
+                    'prefix_class' => '',
+                ]
+            );
+
+            $element->add_control(
+                'padding_top',
+                [
+                    'label' => __('Disable padding top', 'cube'),
+                    'type' => Controls_Manager::SWITCHER,
+                    'default' => '',
+                    'return_value' => 'pt0',
+                    'prefix_class' => '',
+                ]
+            );
+
+            $element->add_control(
+                'padding_bottom',
+                [
+                    'label' => __('Disable padding bottom', 'cube'),
+                    'type' => Controls_Manager::SWITCHER,
+                    'default' => '',
+                    'return_value' => 'pb0',
+                    'prefix_class' => '',
+                ]
+            );
+
+        }, 10, 2 );
+
+
+        //--- Section shape divider
+        // Add a CSS class based on the shape divider type so we can style accordingly
+        // (extra padding needed when a divider is present)
+        add_action( 'elementor/element/section/section_shape_divider/before_section_end', function( $element, $args ) {
+            $elementor = Plugin::instance();
+
+            // Get the shape divider controls for updating
+            $divider_top = $elementor->controls_manager->get_control_from_stack( $element->get_name(), 'shape_divider_top' );
+            $divider_bottom = $elementor->controls_manager->get_control_from_stack( $element->get_name(), 'shape_divider_bottom' );
+
+            if (is_wp_error($divider_top) || is_wp_error($divider_top)) {
+                return;
+            }
+
+            // Add a prefix class so section will have a class that matches the divider type(s)
+            $divider_top['prefix_class'] = 'divider-top-';
+            $divider_top['render_type'] = 'template'; // Needed so class will be applied immediately in the editor
+            $element->update_control( 'shape_divider_top', $divider_top );
+            $divider_bottom['prefix_class'] = 'divider-bottom-';
+            $divider_bottom['render_type'] = 'template'; // Needed so class will be applied immediately in the editor
+            $element->update_control( 'shape_divider_bottom', $divider_bottom );
+        }, 10, 2);
+
+    }
+
+    protected function _customise_image_widget() {
+
+        // Add controls to image widget in editor
+        add_action( 'elementor/element/image/section_image/before_section_end', function( $element, $args ) {
+
+            /** @var \Elementor\Element_Base $element */
+            $element->add_control(
+                'link_icon',
+                [
+                    'label' => __( 'Link Icon', 'cube' ),
+                    'type' => Controls_Manager::SELECT,
+                    'options' => [
+                        '' => __( 'None', 'cube' ),
+                        'tour-360' => __( '360 Tour', 'cube' ),
+                        'enlarge' => __( 'Enlarge', 'cube' ),
+                    ],
+                    'default' => '',
+                    'prefix_class' => 'icon-',
+                    'condition' => [
+                        'link_to!' => 'none',
+                    ],
+                ]
+            );
+        }, 10, 2);
+
+    }
+
+}
diff --git a/wp-content/mu-plugins/cube/src/Elementor/Widgets/HeroBlock.php b/wp-content/mu-plugins/cube/src/Elementor/Widgets/HeroBlock.php
new file mode 100644 (file)
index 0000000..2f55f8b
--- /dev/null
@@ -0,0 +1,172 @@
+<?php
+
+namespace Cube\Elementor\Widgets;
+
+use Elementor\Widget_Base;
+use Elementor\Controls_Manager;
+use Elementor\Utils;
+
+
+class HeroBlock extends Widget_Base {
+
+    protected $_has_template_content = false; // Tell Elementor that content is all rendered dynamically
+
+    // Widget name / ID
+    public function get_name() {
+        return 'cube-hero';
+    }
+
+    // Elementor widget title
+    public function get_title() {
+        return __( 'Hero Block', 'cube' );
+    }
+
+    // Elementor interface icon
+    public function get_icon() {
+        return 'eicon-info-box';
+    }
+
+    // Where to display the widget in the Elementor interface
+    public function get_categories() {
+        return [ 'theme-elements' ];
+    }
+
+    /**
+     * List of scripts the widget depends on.
+     * Used to set scripts dependencies required to run the widget.
+     *
+     * @since 1.0.0
+     * @access public
+     * @return array Widget scripts dependencies.
+     */
+    public function get_script_depends() {
+        return [];
+    }
+    /**
+     * Register the widget controls.
+     * Adds different input fields to allow the user to change and customize the widget settings.
+     *
+     * @since 1.0.0
+     * @access protected
+     */
+    protected function _register_controls() {
+
+        $this->start_controls_section(
+            'section_image',
+            [
+                'label' => __( 'Hero Block', 'cube' ),
+            ]
+        );
+
+        $this->add_control(
+            'title',
+            [
+                'label' => __( 'Title', 'elementor' ),
+                'type' => Controls_Manager::TEXTAREA,
+                'placeholder' => __( 'Enter your title', 'elementor' ),
+                'default' => '',
+            ]
+        );
+
+        $this->add_control(
+            'body',
+            [
+                'label' => __('Body', 'cube'),
+                'type' => Controls_Manager::TEXTAREA,
+                'default' => '',
+            ]
+        );
+        
+        $this->add_control(
+                       'image',
+                       [
+                               'label' => __( 'Background Image', 'elementor' ),
+                               'type' => Controls_Manager::MEDIA,
+                               'default' => [
+                                       'url' => Utils::get_placeholder_image_src(),
+                               ],
+                       ]
+               );
+
+        $this->add_control(
+            'arrow_link',
+            [
+                'label' => __( 'Arrow link', 'cube' ),
+                'type' => Controls_Manager::TEXT,
+                'placeholder' => __( 'URL / anchor link', 'cube' ),
+                'default' => '#content',
+            ]
+        );
+        
+        $this->end_controls_section();
+    }
+    /**
+     * Render the widget output on the frontend.
+     * Written in PHP and used to generate the final HTML.
+     *
+     * @since 1.0.0
+     * @access protected
+     */
+    protected function render() {
+
+        $id = 'hero_' . $this->get_id();
+        $title = $this->get_settings('title');
+        $body = $this->parse_text_editor($this->get_settings('body'));
+        $image = $this->get_settings('image');
+        $arrow_link = $this->get_settings('arrow_link');
+
+        // When this element is present, add a class to the body so the header can be styled differently (inverted colours)
+        add_filter('body_class', function($classes) {
+            $classes[] = 'hero-header';
+            return $classes;
+        });
+
+
+        ?>
+
+        <div class="hero-block" id="<?= $id ?>">
+
+            <div class="hero-block-content">
+
+                <div class="hero-block-content-inner">
+                    <h1 class="hero-block-title"><?= $title ?><div class="hero-block-body"><?= $body ?></div></h1>
+                </div>
+
+            </div>
+
+
+            <div class="hero-block-background-container">
+                <div class="hero-block-background"></div>
+            </div>
+
+        </div>
+        
+        <style>
+            #<?= $id ?> .hero-block-background {
+                background-image: url(<?= wp_get_attachment_image_url($image['id'], 'large') ?>);
+            }
+
+            <?php
+
+            // ToDo: generate some other image sizes / crops for vertical oriented devices
+
+            ?>
+
+            /*
+            @media (min-width: 600px) {
+                #<?= $id ?> .hero-block-background {
+                    background-image: url(<?= wp_get_attachment_image_url($image['id'], 'large') ?>);
+                }
+            }
+            */
+
+            @media (min-width: 768px) {
+                #<?= $id ?> .hero-block-background {
+                    background-image: url(<?= wp_get_attachment_image_url($image['id'], 'full') ?>);
+                }
+            }
+        </style>
+
+        <?php
+    }
+}
diff --git a/wp-content/mu-plugins/cube/src/Elementor/Widgets/PageHeading.php b/wp-content/mu-plugins/cube/src/Elementor/Widgets/PageHeading.php
new file mode 100644 (file)
index 0000000..6f7c35d
--- /dev/null
@@ -0,0 +1,144 @@
+<?php
+
+namespace Cube\Elementor\Widgets;
+
+use Elementor\Widget_Base;
+use Elementor\Controls_Manager;
+use Elementor\Scheme_Color;
+
+
+class PageHeading extends Widget_Base {
+
+    protected $_has_template_content = false; // Tell Elementor that content is all rendered dynamically
+
+    // Widget name / ID
+    public function get_name() {
+        return 'cube-page-heading';
+    }
+
+    // Elementor widget title
+    public function get_title() {
+        return __( 'Page Heading', 'cube' );
+    }
+
+    // Elementor interface icon
+    public function get_icon() {
+        return 'eicon-site-title';
+    }
+
+    // Where to display the widget in the Elementor interface
+    public function get_categories() {
+        return [ 'theme-elements' ];
+    }
+
+    /**
+     * List of scripts the widget depends on.
+     * Used to set scripts dependencies required to run the widget.
+     *
+     * @since 1.0.0
+     * @access public
+     * @return array Widget scripts dependencies.
+     */
+    public function get_script_depends() {
+        return [];
+    }
+    /**
+     * Register the widget controls.
+     * Adds different input fields to allow the user to change and customize the widget settings.
+     *
+     * @since 1.0.0
+     * @access protected
+     */
+    protected function _register_controls() {
+
+        $this->start_controls_section(
+            'section_content',
+            [
+                'label' => __( 'Content', 'cube' ),
+            ]
+        );
+
+        $this->add_control(
+            'subtitle',
+            [
+                'label' => __('Subtitle', 'cube'),
+                'type' => Controls_Manager::TEXT,
+                'default' => ''
+            ]
+        );
+
+        $this->add_control(
+                       'title',
+                       [
+                               'label' => __( 'Title', 'elementor' ),
+                               'type' => Controls_Manager::TEXTAREA,
+                               'placeholder' => __( 'Enter your title', 'elementor' ),
+                               'default' => '',
+                       ]
+        );      
+
+       
+        $this->end_controls_section();
+
+    }
+    /**
+     * Render the widget output on the frontend.
+     * Written in PHP and used to generate the final HTML.
+     *
+     * @since 1.0.0
+     * @access protected
+     */
+    protected function render() {
+
+        $subtitle = $this->get_settings('subtitle');
+        $title = $this->get_settings('title');
+
+
+        // Inline Editing settings
+        $this->add_inline_editing_attributes('subtitle', 'none');
+        $this->add_inline_editing_attributes('title', 'none');
+
+        // CSS Classes for elements
+        $this->add_render_attribute('subtitle', 'class', ['page-heading-subtitle']);
+        $this->add_render_attribute('title', 'class', ['page-heading-title']);
+
+
+        // Rendered content
+        echo '<div class="page-heading">';
+        if (!empty($subtitle)) echo "<h3 {$this->get_render_attribute_string('subtitle')}>$subtitle</h3>";
+        if (!empty($title)) echo "<h1 {$this->get_render_attribute_string('title')}>$title</h1>";
+        echo '</div>';
+    }
+
+    /**
+        * Render text editor widget output in the editor.
+        *
+        * Written as a Backbone JavaScript template and used to generate the live preview.
+        *
+        * @since 1.0.0
+        * @access protected
+        */
+       protected function _content_template() {
+    ?>
+               <#
+               view.addRenderAttribute( 'subtitle', 'class', ['page-heading-subtitle']);
+               view.addRenderAttribute( 'title', 'class', ['page-heading-title']);
+
+        view.addInlineEditingAttributes( 'subtitle', 'none' );
+        view.addInlineEditingAttributes( 'title', 'none' );
+        #>
+        <div class="page-heading">
+
+            <# if ('' !== settings.subtitle) { #>
+                <h1 {{{ view.getRenderAttributeString( 'subtitle' ) }}}>{{{ settings.subtitle }}}</h1>
+            <# } #>
+
+            <# if ('' !== settings.title) { #>
+                <h1 {{{ view.getRenderAttributeString( 'title' ) }}}>{{{ settings.title }}}</h1>
+            <# } #>
+
+        </div>
+    <?php
+       }
+
+}
diff --git a/wp-content/mu-plugins/cube/src/Elementor/Widgets/TextBlock.php b/wp-content/mu-plugins/cube/src/Elementor/Widgets/TextBlock.php
new file mode 100644 (file)
index 0000000..6e62071
--- /dev/null
@@ -0,0 +1,347 @@
+<?php
+
+namespace Cube\Elementor\Widgets;
+
+use Elementor\Widget_Base;
+use Elementor\Controls_Manager;
+use Elementor\Scheme_Color;
+
+
+class TextBlock extends Widget_Base {
+
+    // Widget name / ID
+    public function get_name() {
+        return 'cube-text';
+    }
+
+    // Elementor widget title
+    public function get_title() {
+        return __( 'Formatted Text', 'cube' );
+    }
+
+    // Elementor interface icon
+    public function get_icon() {
+        return 'eicon-align-left';
+    }
+
+    // Where to display the widget in the Elementor interface
+    public function get_categories() {
+        return [ 'theme-elements' ];
+    }
+
+    /**
+     * List of scripts the widget depends on.
+     * Used to set scripts dependencies required to run the widget.
+     *
+     * @since 1.0.0
+     * @access public
+     * @return array Widget scripts dependencies.
+     */
+    public function get_script_depends() {
+        return [];
+    }
+    /**
+     * Register the widget controls.
+     * Adds different input fields to allow the user to change and customize the widget settings.
+     *
+     * @since 1.0.0
+     * @access protected
+     */
+    protected function _register_controls() {
+
+        $this->start_controls_section(
+            'section_content',
+            [
+                'label' => __( 'Content', 'cube' ),
+            ]
+        );
+
+
+        $this->add_control(
+                       'subtitle',
+                       [
+                               'label' => __( 'Subtitle', 'cube' ),
+                               'type' => Controls_Manager::TEXT,
+                               'default' => '',
+                       ]
+        );
+
+        $this->add_control(
+                       'title',
+                       [
+                               'label' => __( 'Title', 'elementor' ),
+                               'type' => Controls_Manager::TEXTAREA,
+                               'placeholder' => __( 'Enter your title', 'elementor' ),
+                               'default' => '',
+                       ]
+        );
+
+        $this->add_control(
+                       'title_decoration',
+                       [
+                               'label' => __( 'Hide title decoration?', 'cube' ),
+                               'type' => Controls_Manager::SWITCHER,
+                'selectors' => [
+                    "{{WRAPPER}} .text-block-title:after" => 'display: none',
+                ],
+                'condition' => [
+                    "title!" => '',
+                ],
+                       ]
+        );
+
+        $this->add_control(
+                       'body',
+                       [
+                               'label' => __('Body', 'cube'),
+                               'type' => Controls_Manager::WYSIWYG,
+                               'default' => '',
+                       ]
+        );
+
+        $this->add_control(
+            'cta_text',
+            [
+                'label' => __('Call to Action text', 'cube'),
+                'type' => Controls_Manager::TEXT,
+                'default' => ''
+            ]
+        );
+
+        $this->add_control(
+            'cta_link',
+            [
+                'label' => __('Call to Action link', 'cube'),
+                'type' => Controls_Manager::URL,
+                'default' => [
+                    'url' => '',
+                    'is_external' => false,
+                ],
+                   'show_external' => true
+            ]
+        );
+       
+        $this->end_controls_section();
+
+
+        $this->start_controls_section(
+            'section_formatting',
+            [
+                'label' => __( 'Colours & Formatting', 'cube' ),
+            ]
+        );
+
+                
+
+        $this->add_control(
+                       'title_size',
+                       [
+                               'label' => __( 'Title Size', 'cube' ),
+                'type' => Controls_Manager::SELECT,
+                'options' => [
+                    '' => __( 'Default', 'cube' ),
+                    'medium' => __( 'Medium', 'cube' ),
+                ],
+                'default' => '',
+                       ]
+        );
+
+        $this->add_control(
+                       'title_color',
+                       [
+                               'label' => __( 'Title Colour', 'cube' ),
+                               'type' => Controls_Manager::COLOR,
+                               'default' => '',
+                               'selectors' => [
+                                       '{{WRAPPER}} .text-block-title' => 'color: {{VALUE}};',
+                               ],
+                       ]
+        );
+
+
+        $this->add_control(
+                       'body_color',
+                       [
+                               'label' => __( 'Body Colour', 'cube' ),
+                               'type' => Controls_Manager::COLOR,
+                               'default' => '',
+                               'selectors' => [
+                                       '{{WRAPPER}} .text-block-body' => 'color: {{VALUE}};',
+                               ],
+                       ]
+        );
+
+
+        $this->add_control(
+                       'cta_color',
+                       [
+                               'label' => __( 'Call to Action Colour', 'cube' ),
+                               'type' => Controls_Manager::COLOR,
+                               'default' => '',
+                               'selectors' => [
+                                       '{{WRAPPER}} .text-block-cta' => 'color: {{VALUE}};',
+                               ],
+                       ]
+        );
+
+
+        $this->add_responsive_control(
+                       'align',
+                       [
+                               'label' => __( 'Alignment', 'elementor' ),
+                               'type' => Controls_Manager::CHOOSE,
+                               'options' => [
+                                       'left' => [
+                                               'title' => __( 'Left', 'elementor' ),
+                                               'icon' => 'fa fa-align-left',
+                                       ],
+                                       'center' => [
+                                               'title' => __( 'Center', 'elementor' ),
+                                               'icon' => 'fa fa-align-center',
+                                       ],
+                                       'right' => [
+                                               'title' => __( 'Right', 'elementor' ),
+                                               'icon' => 'fa fa-align-right',
+                                       ],
+                                       'justify' => [
+                                               'title' => __( 'Justified', 'elementor' ),
+                                               'icon' => 'fa fa-align-justify',
+                                       ],
+                               ],
+                               'default' => '',
+                               'selectors' => [
+                                       '{{WRAPPER}}' => 'text-align: {{VALUE}}; margin: 0 auto;',
+                               ],
+                       ]
+        );
+        
+        $this->add_control(
+                       'max_width',
+                       [
+                               'label' => __( 'Maximum Width', 'cube' ),
+                               'type' => Controls_Manager::SLIDER,
+                               // 'default' => [
+                               //      'size' => 400,
+                               // ],
+                               'range' => [
+                                       'px' => [
+                                               'min' => 400,
+                        'max' => 1600,
+                        'step' => 10,
+                                       ],
+                                       '%' => [
+                                               'min' => 0,
+                                               'max' => 100,
+                                       ],
+                               ],
+                               'selectors' => [
+                                       '{{WRAPPER}} .text-block' => 'max-width: {{SIZE}}{{UNIT}};',
+                               ],
+                       ]
+               );
+
+        $this->end_controls_section();
+    }
+    /**
+     * Render the widget output on the frontend.
+     * Written in PHP and used to generate the final HTML.
+     *
+     * @since 1.0.0
+     * @access protected
+     */
+    protected function render() {
+
+        $subtitle = $this->get_settings('subtitle');
+        $title = $this->get_settings('title');
+        $title_size = $this->get_settings('title_size');
+        $body = $this->parse_text_editor($this->get_settings('body'));
+        $cta_text = $this->get_settings('cta_text');
+        $cta_link = $this->get_settings('cta_link');
+
+        if ( ! empty( $cta_link['url'] ) ) {
+            $this->add_render_attribute( 'cta_text', 'href', $cta_link['url'] );
+
+            if ( $cta_link['is_external'] ) {
+                $this->add_render_attribute( 'cta_text', 'target', '_blank' );
+            }
+
+            if ( $cta_link['nofollow'] ) {
+                $this->add_render_attribute( 'cta_text', 'rel', 'nofollow' );
+            }
+        }
+
+        // Inline Editing settings
+        $this->add_inline_editing_attributes('subtitle', 'none');
+        $this->add_inline_editing_attributes('title', 'none');
+        $this->add_inline_editing_attributes('body', 'advanced');
+        $this->add_inline_editing_attributes('cta_text', 'none');
+
+        // CSS Classes for elements
+        $this->add_render_attribute('subtitle', 'class', ['text-block-subtitle']);
+        $this->add_render_attribute('title', 'class', ['text-block-title']);
+        $this->add_render_attribute('body', 'class', ['text-block-body']);
+        $this->add_render_attribute('cta_text', 'class', ['text-block-cta arrow-link']);
+
+        if (!empty($title_size)) {
+            $this->add_render_attribute('title', 'class', ["text-block-title-size-{$title_size}"]);
+        }
+
+        // Rendered content
+        echo '<div class="text-block">';
+        if (!empty($subtitle)) echo "<h3 {$this->get_render_attribute_string('subtitle')}>$subtitle</h3>";
+        if (!empty($title)) echo "<h2 {$this->get_render_attribute_string('title')}>$title</h2>";
+        if (!empty($body)) echo "<div {$this->get_render_attribute_string('body')}>$body</div>";
+        if (!empty($cta_text)) {
+            echo "<a {$this->get_render_attribute_string('cta_text')}>". \BladeSvgSage\svg_image('arrow')->toHtml() ." $cta_text</a>";
+        }
+        echo '</div>';
+    }
+
+    /**
+        * Render text editor widget output in the editor.
+        *
+        * Written as a Backbone JavaScript template and used to generate the live preview.
+        *
+        * @since 1.0.0
+        * @access protected
+        */
+       protected function _content_template() {
+    ?>
+               <#
+               view.addRenderAttribute( 'subtitle', 'class', ['text-block-subtitle']);
+               view.addRenderAttribute( 'title', 'class', ['text-block-title']);
+               view.addRenderAttribute( 'body', 'class', ['text-block-body']);
+               view.addRenderAttribute( 'cta_text', 'class', ['text-block-cta arrow-link']);
+
+        if ('' !== settings.title_size) {
+            view.addRenderAttribute('title', 'class', ['text-block-title-size-' + settings.title_size]);
+        }
+
+        view.addInlineEditingAttributes( 'subtitle', 'none' );
+        view.addInlineEditingAttributes( 'title', 'none' );
+               view.addInlineEditingAttributes( 'body', 'advanced' );
+               view.addInlineEditingAttributes( 'cta_text', 'none' );
+        #>
+        <div class="text-block">
+
+            <# if ('' !== settings.subtitle) { #>
+                <h3 {{{ view.getRenderAttributeString( 'subtitle' ) }}}>{{{ settings.subtitle }}}</h3>
+            <# } #>
+
+            <# if ('' !== settings.title) { #>
+                <h2 {{{ view.getRenderAttributeString( 'title' ) }}}>{{{ settings.title }}}</h2>
+            <# } #>
+
+            <# if ('' !== settings.body) { #>
+                <div {{{ view.getRenderAttributeString( 'body' ) }}}>{{{ settings.body }}}</div>
+            <# } #>
+
+            <# if ('' !== settings.cta_text) { #>
+                <a {{{ view.getRenderAttributeString( 'cta_text' ) }}}><?= \BladeSvgSage\svg_image('arrow')->toHtml() ?> {{{ settings.cta_text }}}</a>
+            <# } #>
+
+        </div>
+    <?php
+       }
+
+}
diff --git a/wp-content/mu-plugins/cube/src/Init.php b/wp-content/mu-plugins/cube/src/Init.php
new file mode 100644 (file)
index 0000000..e93ae26
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+
+// Setup reference: https://www.youtube.com/watch?v=NdDRNiIfYDw
+
+namespace Cube;
+
+
+final class Init { // Marked as final because this class should never be extended (single init only!)
+
+    /**
+     * List of service classes to be used
+     * @return array Array of classes to be instantiated
+     */
+    public static function classes() {
+        return [
+            Common\Setup::class,
+            Elementor\Setup::class,
+        ];
+    }
+
+    /**
+     * Register all services (custom post types, custom fields, shortcodes etc)
+     */
+    public static function register_classes() {
+        foreach (self::classes() as $class) {
+            $service = self::instantiate($class);
+
+            // If the class has a register method, call it.
+            if (method_exists($service, 'register')) {
+                $service->register();
+            }
+        }
+    }
+
+    /**
+     * @param class $class Class from the services array
+     * @return class instance New instance of the class
+     */
+    private static function instantiate($class) {
+        return new $class();
+    }
+}
index 704a8ed1928b337954c41cb9c288ed0fdc273851..e01ccc28c3758fef60d8589147b38794ea02b89c 100644 (file)
@@ -53,10 +53,11 @@ inline-list()
 // Inspired by: https://davidwalsh.name/stylus-rem
 font-size(value, arguments...)
 
-  // Handle special case of setting base font size on html element
-  // In this case, we don't want pixel value converted to a REM
-  // Also bail out if 'inherit' is the value
-  if (selector() is 'html' || value is 'inherit') {
+  // Handle special cases first:
+  // 1) Allow disabling of this conversion by including the word "fixed" after the value
+  // 2) Don't do any conversion when setting on the html selector (because it is the root!)
+  // 3) Leave alone if 'inherit' is the value
+  if (arguments is 'fixed' || selector() is 'html' || value is 'inherit') {
     font-size: value
   } else {
     // Only px values are converted to rem but we still want to use the px value as a fallback
index fa56466130277dade0233da16ef371fe6bcea8c5..45e6352635f64ed36ff8a8c46a1474dccf188daa 100644 (file)
@@ -10,7 +10,7 @@ $vertical-gutter   = 2.5vw
 $font = 'Muli', sans-serif
 
 // Font sizing
-$font-size-base         = 20px // Size of 1rem
+$font-size-base         = 16px // Size of 1rem
 $font-size-extra-large  = 81px
 $font-size-large        = 54px
 $font-size-medium       = 45px
index 5afd86242560d5f043a987b92d0a309ae1417554..0daeb9430adb11ec73c048a40ff8961541be884b 100644 (file)
@@ -61,8 +61,8 @@
       color: $colors.orange
 
   &-cta
-    //font-smoothing()
-    font-size: 12px
+    font-smoothing()
+    font-size: 12px fixed // Won't be converted to rems
     font-weight: 800
     text-transform: uppercase
     display: inline-block