diff --git a/CHANGES.txt b/CHANGES.txt
index da5cc41b..a5608ef8 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,7 @@
+New in 3.4.1.1
+==============
+- NEW: Privacy API support. Requires Moodle 2017111302.00 3.4.2 (Build: 20180319)+. Analytics removed until such a time as their use with GDPR is clearer.
+
New in 3.4.1.0
==============
- FIX: Issue #850: Flip main content and blocks, RTL mode.
diff --git a/README.txt b/README.txt
index 2b0752b7..c2b7f673 100644
--- a/README.txt
+++ b/README.txt
@@ -104,7 +104,7 @@ above to discuss your requirements.
Required version of Moodle
==========================
-This version works with Moodle 3.4 version 2017111300.00 (Build: 20171113) and above within the 3.4 branch until the
+This version works with Moodle 3.4.2 version 2017111302.00 (Build: 20180319) and above within the 3.4 branch until the
next release.
Please ensure that your hardware and software complies with 'Requirements' in 'Installing Moodle' on
diff --git a/layout/tiles/analytics.php b/classes/privacy/provider.php
similarity index 62%
rename from layout/tiles/analytics.php
rename to classes/privacy/provider.php
index 2f50306c..347cf359 100644
--- a/layout/tiles/analytics.php
+++ b/classes/privacy/provider.php
@@ -18,19 +18,26 @@
* Essential is a clean and customizable theme.
*
* @package theme_essential
- * @copyright 2016 Gareth J Barnard
- * @copyright 2014 Gareth J Barnard, David Bezemer
- * @copyright 2013 Julian Ridden
+ * @copyright 2018 Gareth J Barnard
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-defined('MOODLE_INTERNAL') || die;
+namespace theme_essential\privacy;
-if (\theme_essential\toolbox::get_setting('analyticsenabled')) {
- $analytics = \theme_essential\toolbox::get_setting('analytics');
- if ($analytics === "piwik") {
- require_once(\theme_essential\toolbox::get_tile_file('piwik'));
- } else if ($analytics === "guniversal") {
- require_once(\theme_essential\toolbox::get_tile_file('guniversal'));
+defined('MOODLE_INTERNAL') || die();
+
+/**
+ * The Essential theme does not store any user data.
+ */
+class provider implements \core_privacy\local\metadata\null_provider {
+
+ /**
+ * Get the language string identifier with the component's language
+ * file to explain why this plugin stores no data.
+ *
+ * @return string
+ */
+ public static function get_reason() : string {
+ return 'privacy:nop';
}
-}
\ No newline at end of file
+}
diff --git a/db/upgrade.php b/db/upgrade.php
new file mode 100644
index 00000000..a20c59c6
--- /dev/null
+++ b/db/upgrade.php
@@ -0,0 +1,55 @@
+.
+
+/**
+ * Essential is a clean and customizable theme.
+ *
+ * @package theme_essential
+ * @copyright 2018 Gareth J Barnard
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+function xmldb_theme_essential_upgrade($oldversion = 0) {
+
+ global $DB;
+ $dbman = $DB->get_manager();
+ $result = true;
+
+ if ($oldversion < 2017102903) {
+
+ $table = new xmldb_table('config_plugins');
+ if ($dbman->table_exists($table) == true) {
+ $conditions = array('plugin' => 'theme_essential', 'name' => 'populateme');
+ $settings = array('analyticsenabled', 'analytics', 'analyticssiteid', 'analyticsimagetrack', 'analyticssiteurl',
+ 'analyticsuseuserid', 'analyticstrackingid', 'analyticstrackadmin', 'analyticscleanurl');
+ foreach ($settings as $setting) {
+ $conditions['name'] = $setting;
+ $DB->delete_records('config_plugins', $conditions);
+ }
+ }
+
+ upgrade_plugin_savepoint(true, 2017102903, 'theme', 'essential');
+ }
+
+ // Automatic 'Purge all caches'....
+ if ($oldversion < 2118041000) {
+ purge_all_caches();
+ }
+
+ return $result;
+}
\ No newline at end of file
diff --git a/lang/en/theme_essential.php b/lang/en/theme_essential.php
index 26a4e2a0..4bc6159d 100644
--- a/lang/en/theme_essential.php
+++ b/lang/en/theme_essential.php
@@ -865,29 +865,6 @@
$string['ipadretinaicon'] = 'iPad Icon (Retina)';
$string['ipadretinaicondesc'] = 'Icon should be a PNG files sized 144px by 144px.';
-// Analytics.
-$string['analytics'] = 'Analytics';
-$string['analyticsheadingsub'] = 'Powerful analytics for Moodle';
-$string['analyticsdesc'] = 'Choose the type of analytics you want to insert and save to enable the other options.';
-$string['analyticssiteid'] = 'Site ID';
-$string['analyticssiteiddesc'] = 'Enter your Site ID';
-$string['analyticstrackingid'] = 'Site ID';
-$string['analyticstrackingiddesc'] = 'Enter your Tracking ID';
-$string['analyticssiteurl'] = 'Analytics URL';
-$string['analyticssiteurldesc'] = 'Enter your "Piwik Analytics" URL without http(s) or a trailing slash. For example "mysite.com/analytics".';
-$string['analyticsenabled'] = 'Enabled';
-$string['analyticsenableddesc'] = 'Enable analytics for Moodle';
-$string['analyticsimagetrack'] = 'Image tracking';
-$string['analyticscleanurl'] = 'Clean URLs';
-$string['analyticscleanurldesc'] = 'Generate clean URL for in advanced tracking';
-$string['analyticsimagetrackdesc'] = 'Enable Image Tracking for browsers with JavaScript disabled.';
-$string['analyticstrackadmin'] = 'Tracking Admins';
-$string['analyticstrackadmindesc'] = 'Enable tracking of Admin users (not recommended)';
-$string['analyticsuseuserid'] = 'User ID';
-$string['analyticsuseuseriddesc'] = 'Enable use of User ID in tracking.';
-$string['analyticspiwik'] = 'Piwik';
-$string['analyticsguniversal'] = 'Google Universal Analytics';
-
// Properties.
$string['properties'] = 'Properties';
$string['propertiessub'] = 'The properties';
@@ -963,3 +940,6 @@
$string['asconfigintlower'] = '{$a->value} is less than the lower range limit of {$a->lower}';
$string['asconfigintupper'] = '{$a->value} is greater than the upper range limit of {$a->upper}';
$string['asconfigintnan'] = '{$a->value} is not a number';
+
+// Privacy.
+$string['privacy:nop'] = 'The Essential theme stores lots of settings that pertain to its configuration. None of the settings are related to a specific user. It is your responsibilty to ensure that no user data is entered in any of the free text fields. Setting a setting will result in that action being logged within the core Moodle logging system against the user whom changed it, this is outside of the themes control, please see the core logging system for privacy compliance for this. The analytics settings and associated data in the database have been removed until this area is more understood from a legal perspective, as it was possible to request that userid\'s were recorded. Please examine the code carefully to be sure that it complies with your interpretation of your privacy laws. I am not a lawyer and my analysis is based on my interpretation. If you have any doubt then remove the theme forthwith.';
diff --git a/layout/embedded.php b/layout/embedded.php
index 90faf220..eebadbc4 100644
--- a/layout/embedded.php
+++ b/layout/embedded.php
@@ -40,9 +40,6 @@
-
-
-