From fa636e181935abbb20afc05310693d0844ad2e58 Mon Sep 17 00:00:00 2001 From: catch Date: Sun, 21 Aug 2022 10:22:37 +0900 Subject: [PATCH] Issue #3270899 by Spokje, quietone, q0rban, longwave, ravi.shankar, dww, andypost, bbrala, Wim Leers: Remove Color module from core --- core/.cspell.json | 3 - core/MAINTAINERS.txt | 3 - core/misc/cspell/dictionary.txt | 2 - core/modules/color/color.es6.js | 338 - core/modules/color/color.info.yml | 7 - core/modules/color/color.install | 39 - core/modules/color/color.js | 192 - core/modules/color/color.libraries.yml | 26 - core/modules/color/color.module | 852 - core/modules/color/color.services.yml | 6 - .../color/config/schema/color.schema.yml | 20 - core/modules/color/css/color.admin.css | 153 - .../help_topics/color.changing.html.twig | 20 - core/modules/color/migrations/d7_color.yml | 54 - .../migrations/state/color.migrate_drupal.yml | 3 - core/modules/color/preview.es6.js | 93 - core/modules/color/preview.html | 7 - core/modules/color/preview.js | 42 - .../src/ColorSystemBrandingBlockAlter.php | 34 - .../ColorConfigCacheInvalidator.php | 56 - .../src/Plugin/migrate/destination/Color.php | 90 - .../src/Plugin/migrate/source/d7/Color.php | 103 - .../templates/color-scheme-form.html.twig | 26 - core/modules/color/tests/fixtures/drupal7.php | 26061 ---------------- .../modules/color_test/color_test.info.yml | 5 - .../color/tests/modules/color_test/logo.svg | 1 - .../themes/color_test_theme/color/color.inc | 44 - .../color_test_theme/color/preview.html | 8 - .../color_test_theme.info.yml | 7 - .../color_test_theme.libraries.yml | 12 - .../config/schema/color_test_theme.schema.yml | 5 - .../themes/color_test_theme/css/colors.css | 7 - .../js/color_test_theme-fontsize.es6.js | 7 - .../js/color_test_theme-fontsize.js | 10 - .../src/Functional/ColorConfigSchemaTest.php | 57 - .../src/Functional/ColorSafePreviewTest.php | 63 - .../color/tests/src/Functional/ColorTest.php | 204 - .../Migrate/NoMultilingualReviewPageTest.php | 75 - .../Kernel/Migrate/d7/MigrateColorTest.php | 69 - .../Plugin/migrate/source/d7/ColorTest.php | 131 - .../state/migrate_drupal.migrate_drupal.yml | 1 - .../migrate/DestinationCategoryTest.php | 2 - .../tests/src/Kernel/StateFileExistsTest.php | 2 - .../d6/MultilingualReviewPageTest.php | 3 +- .../d6/NoMultilingualReviewPageTest.php | 3 +- .../d7/MultilingualReviewPageTest.php | 1 - .../d7/NoMultilingualReviewPageTest.php | 1 - .../tests/src/Functional/d7/Upgrade7Test.php | 1 - .../update/drupal-9.4.0.bare.standard.php.gz | Bin 122473 -> 122467 bytes .../drupal-9.4.0.filled.standard.php.gz | Bin 534615 -> 534598 bytes .../UpdatePathTestBaseFilledTest.php | 1 - core/phpstan-baseline.neon | 5 - core/themes/stable9/css/color/color.admin.css | 6 +- .../stable9/images/color}/hook-rtl.png | Bin .../stable9/images/color}/hook.png | Bin .../stable9/images/color}/lock.png | Bin 56 files changed, 5 insertions(+), 28956 deletions(-) delete mode 100644 core/modules/color/color.es6.js delete mode 100644 core/modules/color/color.info.yml delete mode 100644 core/modules/color/color.install delete mode 100644 core/modules/color/color.js delete mode 100644 core/modules/color/color.libraries.yml delete mode 100644 core/modules/color/color.module delete mode 100644 core/modules/color/color.services.yml delete mode 100644 core/modules/color/config/schema/color.schema.yml delete mode 100644 core/modules/color/css/color.admin.css delete mode 100644 core/modules/color/help_topics/color.changing.html.twig delete mode 100644 core/modules/color/migrations/d7_color.yml delete mode 100644 core/modules/color/migrations/state/color.migrate_drupal.yml delete mode 100644 core/modules/color/preview.es6.js delete mode 100644 core/modules/color/preview.html delete mode 100644 core/modules/color/preview.js delete mode 100644 core/modules/color/src/ColorSystemBrandingBlockAlter.php delete mode 100644 core/modules/color/src/EventSubscriber/ColorConfigCacheInvalidator.php delete mode 100644 core/modules/color/src/Plugin/migrate/destination/Color.php delete mode 100644 core/modules/color/src/Plugin/migrate/source/d7/Color.php delete mode 100644 core/modules/color/templates/color-scheme-form.html.twig delete mode 100644 core/modules/color/tests/fixtures/drupal7.php delete mode 100644 core/modules/color/tests/modules/color_test/color_test.info.yml delete mode 100644 core/modules/color/tests/modules/color_test/logo.svg delete mode 100644 core/modules/color/tests/modules/color_test/themes/color_test_theme/color/color.inc delete mode 100644 core/modules/color/tests/modules/color_test/themes/color_test_theme/color/preview.html delete mode 100644 core/modules/color/tests/modules/color_test/themes/color_test_theme/color_test_theme.info.yml delete mode 100644 core/modules/color/tests/modules/color_test/themes/color_test_theme/color_test_theme.libraries.yml delete mode 100644 core/modules/color/tests/modules/color_test/themes/color_test_theme/config/schema/color_test_theme.schema.yml delete mode 100644 core/modules/color/tests/modules/color_test/themes/color_test_theme/css/colors.css delete mode 100644 core/modules/color/tests/modules/color_test/themes/color_test_theme/js/color_test_theme-fontsize.es6.js delete mode 100644 core/modules/color/tests/modules/color_test/themes/color_test_theme/js/color_test_theme-fontsize.js delete mode 100644 core/modules/color/tests/src/Functional/ColorConfigSchemaTest.php delete mode 100644 core/modules/color/tests/src/Functional/ColorSafePreviewTest.php delete mode 100644 core/modules/color/tests/src/Functional/ColorTest.php delete mode 100644 core/modules/color/tests/src/Functional/Migrate/NoMultilingualReviewPageTest.php delete mode 100644 core/modules/color/tests/src/Kernel/Migrate/d7/MigrateColorTest.php delete mode 100644 core/modules/color/tests/src/Kernel/Plugin/migrate/source/d7/ColorTest.php rename core/{modules/color/images => themes/stable9/images/color}/hook-rtl.png (100%) rename core/{modules/color/images => themes/stable9/images/color}/hook.png (100%) rename core/{modules/color/images => themes/stable9/images/color}/lock.png (100%) diff --git a/core/.cspell.json b/core/.cspell.json index 9d4b91b2924..27ae0c56567 100644 --- a/core/.cspell.json +++ b/core/.cspell.json @@ -14,9 +14,6 @@ "../**/LICENSE.txt", "modules/**/Migrate*Test.php", "modules/ckeditor5/js/build/*", - "modules/color/preview.html", - "modules/color/tests/fixtures/drupal7.php", - "modules/color/tests/modules/color_test/themes/color_test_theme/color/preview.html", "modules/media/tests/fixtures/oembed/*", "modules/migrate_drupal/tests/fixtures/drupal6.php", "modules/migrate_drupal/tests/fixtures/drupal7.php", diff --git a/core/MAINTAINERS.txt b/core/MAINTAINERS.txt index e6e254fdfc5..5726e4bf8ae 100644 --- a/core/MAINTAINERS.txt +++ b/core/MAINTAINERS.txt @@ -129,9 +129,6 @@ Claro Classy - David Hernandez 'davidhernandez' https://www.drupal.org/u/davidhernandez -Color -- ? - Comment - Lee Rowlands 'larowlan' https://www.drupal.org/u/larowlan - Andrey Postnikov 'andypost' https://www.drupal.org/u/andypost diff --git a/core/misc/cspell/dictionary.txt b/core/misc/cspell/dictionary.txt index b141ad61b60..c90fab2548f 100644 --- a/core/misc/cspell/dictionary.txt +++ b/core/misc/cspell/dictionary.txt @@ -446,7 +446,6 @@ fakepath falsey falsish fapi -farb farbtastic fatals favourite @@ -491,7 +490,6 @@ fodg fodp fods fodt -fontsizer fooalert foobarbaz foobargorilla diff --git a/core/modules/color/color.es6.js b/core/modules/color/color.es6.js deleted file mode 100644 index b0c766aea2d..00000000000 --- a/core/modules/color/color.es6.js +++ /dev/null @@ -1,338 +0,0 @@ -/** - * @file - * Attaches the behaviors for the Color module. - */ - -(function ($, Drupal) { - /** - * Displays farbtastic color selector and initialize color administration UI. - * - * @type {Drupal~behavior} - * - * @prop {Drupal~behaviorAttach} attach - * Attach color selection behavior to relevant context. - */ - Drupal.behaviors.color = { - attach(context, settings) { - let i; - let j; - let colors; - // This behavior attaches by ID, so is only valid once on a page. - const form = $( - once('color', '#system-theme-settings .color-form', context), - ); - if (form.length === 0) { - return; - } - const inputs = []; - const hooks = []; - const locks = []; - let focused = null; - - // Add Farbtastic. - $(once('color', $('
'))).prependTo( - form, - ); - const farb = $.farbtastic('.color-placeholder'); - - // Decode reference colors to HSL. - const reference = settings.color.reference; - Object.keys(reference || {}).forEach((color) => { - reference[color] = farb.RGBToHSL(farb.unpack(reference[color])); - }); - - // Build a preview. - const height = []; - const width = []; - - /** - * Renders the preview. - */ - function preview() { - Drupal.color.callback(context, settings, form, farb, height, width); - } - - /** - * Resets the color scheme selector. - */ - function resetScheme() { - form.find('#edit-scheme').each(function () { - this.selectedIndex = this.options.length - 1; - }); - } - - /** - * Shifts a given color, using a reference pair (ref in HSL). - * - * This algorithm ensures relative ordering on the saturation and - * luminance axes is preserved, and performs a simple hue shift. - * - * It is also symmetrical. If: shiftColor(c, a, b) === d, then - * shiftColor(d, b, a) === c. - * - * @function Drupal.color~shiftColor - * - * @param {string} given - * A hex color code to shift. - * @param {Array.} ref1 - * First HSL color reference. - * @param {Array.} ref2 - * Second HSL color reference. - * - * @return {string} - * A hex color, shifted. - */ - function shiftColor(given, ref1, ref2) { - let d; - // Convert to HSL. - given = farb.RGBToHSL(farb.unpack(given)); - - // Hue: apply delta. - given[0] += ref2[0] - ref1[0]; - - // Saturation: interpolate. - if (ref1[1] === 0 || ref2[1] === 0) { - given[1] = ref2[1]; - } else { - d = ref1[1] / ref2[1]; - if (d > 1) { - given[1] /= d; - } else { - given[1] = 1 - (1 - given[1]) * d; - } - } - - // Luminance: interpolate. - if (ref1[2] === 0 || ref2[2] === 0) { - given[2] = ref2[2]; - } else { - d = ref1[2] / ref2[2]; - if (d > 1) { - given[2] /= d; - } else { - given[2] = 1 - (1 - given[2]) * d; - } - } - - return farb.pack(farb.HSLToRGB(given)); - } - - /** - * Callback for Farbtastic when a new color is chosen. - * - * @param {HTMLElement} input - * The input element where the color is chosen. - * @param {string} color - * The color that was chosen through the input. - * @param {bool} propagate - * Whether or not to propagate the color to a locked pair value - * @param {bool} colorScheme - * Flag to indicate if the user is using a color scheme when changing - * the color. - */ - function callback(input, color, propagate, colorScheme) { - let matched; - // Set background/foreground colors. - $(input).css({ - backgroundColor: color, - color: farb.RGBToHSL(farb.unpack(color))[2] > 0.5 ? '#000' : '#fff', - }); - - // Change input value. - if (input.value && input.value !== color) { - input.value = color; - - // Update locked values. - if (propagate) { - i = input.i; - for (j = i + 1; ; ++j) { - if (!locks[j - 1] || $(locks[j - 1]).is('.is-unlocked')) { - break; - } - matched = shiftColor( - color, - reference[input.key], - reference[inputs[j].key], - ); - callback(inputs[j], matched, false); - } - for (j = i - 1; ; --j) { - if (!locks[j] || $(locks[j]).is('.is-unlocked')) { - break; - } - matched = shiftColor( - color, - reference[input.key], - reference[inputs[j].key], - ); - callback(inputs[j], matched, false); - } - - // Update preview. - preview(); - } - - // Reset colorScheme selector. - if (!colorScheme) { - resetScheme(); - } - } - } - - // Loop through all defined gradients. - Object.keys(settings.gradients || {}).forEach((i) => { - // Add element to display the gradient. - $(once('color', '.color-preview')).append( - `
`, - ); - const gradient = $(`.color-preview #gradient-${i}`); - // Add height of current gradient to the list (divided by 10). - height.push(parseInt(gradient.css('height'), 10) / 10); - // Add width of current gradient to the list (divided by 10). - width.push(parseInt(gradient.css('width'), 10) / 10); - // Add rows (or columns for horizontal gradients). - // Each gradient line should have a height (or width for horizontal - // gradients) of 10px (because we divided the height/width by 10 - // above). - for ( - j = 0; - j < - (settings.gradients[i].direction === 'vertical' - ? height[i] - : width[i]); - ++j - ) { - gradient.append('
'); - } - }); - - // Set up colorScheme selector. - form.find('#edit-scheme').on('change', function () { - const schemes = settings.color.schemes; - const colorScheme = this.options[this.selectedIndex].value; - if (colorScheme !== '' && schemes[colorScheme]) { - // Get colors of active scheme. - colors = schemes[colorScheme]; - Object.keys(colors || {}).forEach((fieldName) => { - callback( - $(`#edit-palette-${fieldName}`), - colors[fieldName], - false, - true, - ); - }); - preview(); - } - }); - - /** - * Focuses Farbtastic on a particular field. - * - * @param {jQuery.Event} e - * The focus event on the field. - */ - function focus(e) { - const input = e.target; - // Remove old bindings. - if (focused) { - $(focused) - .off('keyup', farb.updateValue) - .off('keyup', preview) - .off('keyup', resetScheme) - .parent() - .removeClass('item-selected'); - } - - // Add new bindings. - focused = input; - farb.linkTo((color) => { - callback(input, color, true, false); - }); - farb.setColor(input.value); - $(focused) - .on('keyup', farb.updateValue) - .on('keyup', preview) - .on('keyup', resetScheme) - .parent() - .addClass('item-selected'); - } - - // Initialize color fields. - form - .find('.js-color-palette input.form-text') - .each(function () { - // Extract palette field name. - this.key = this.id.substring(13); - - // Link to color picker temporarily to initialize. - farb - .linkTo(() => {}) - .setColor('#000') - .linkTo(this); - - // Add lock. - const i = inputs.length; - if (inputs.length) { - let toggleClick = true; - const lock = $( - ``, - ).on('click', function (e) { - e.preventDefault(); - if (toggleClick) { - $(this).addClass('is-unlocked').html(Drupal.t('Lock')); - $(hooks[i - 1]).attr( - 'class', - locks[i - 2] && $(locks[i - 2]).is(':not(.is-unlocked)') - ? 'color-palette__hook is-up' - : 'color-palette__hook', - ); - $(hooks[i]).attr( - 'class', - locks[i] && $(locks[i]).is(':not(.is-unlocked)') - ? 'color-palette__hook is-down' - : 'color-palette__hook', - ); - } else { - $(this).removeClass('is-unlocked').html(Drupal.t('Unlock')); - $(hooks[i - 1]).attr( - 'class', - locks[i - 2] && $(locks[i - 2]).is(':not(.is-unlocked)') - ? 'color-palette__hook is-both' - : 'color-palette__hook is-down', - ); - $(hooks[i]).attr( - 'class', - locks[i] && $(locks[i]).is(':not(.is-unlocked)') - ? 'color-palette__hook is-both' - : 'color-palette__hook is-up', - ); - } - toggleClick = !toggleClick; - }); - $(this).after(lock); - locks.push(lock); - } - - // Add hook. - const hook = $('
'); - $(this).after(hook); - hooks.push(hook); - - $(this).parent().find('.color-palette__lock').trigger('click'); - this.i = i; - inputs.push(this); - }) - .on('focus', focus); - - form.find('.js-color-palette label'); - - // Focus first color. - inputs[0].focus(); - - // Render preview. - preview(); - }, - }; -})(jQuery, Drupal); diff --git a/core/modules/color/color.info.yml b/core/modules/color/color.info.yml deleted file mode 100644 index 80f65f8aee1..00000000000 --- a/core/modules/color/color.info.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: Color -type: module -description: 'Allows users to change the color scheme of compatible themes.' -lifecycle: deprecated -lifecycle_link: https://www.drupal.org/node/3223395#s-color -package: Core -version: VERSION diff --git a/core/modules/color/color.install b/core/modules/color/color.install deleted file mode 100644 index 3cc098caa05..00000000000 --- a/core/modules/color/color.install +++ /dev/null @@ -1,39 +0,0 @@ - $info['GD Version'], - ]; - - // Check for PNG support. - if (!function_exists('imagecreatefrompng')) { - $requirements['color_gd']['severity'] = REQUIREMENT_WARNING; - $requirements['color_gd']['description'] = t('The GD library for PHP is enabled, but was compiled without PNG support. Check the PHP image documentation for information on how to correct this.'); - } - } - else { - $requirements['color_gd'] = [ - 'value' => t('Not installed'), - 'severity' => REQUIREMENT_ERROR, - 'description' => t('The GD library for PHP is missing or outdated. Check the PHP image documentation for information on how to correct this.'), - ]; - } - $requirements['color_gd']['title'] = t('GD library PNG support'); - } - - return $requirements; -} diff --git a/core/modules/color/color.js b/core/modules/color/color.js deleted file mode 100644 index cb1ce2535d6..00000000000 --- a/core/modules/color/color.js +++ /dev/null @@ -1,192 +0,0 @@ -/** -* DO NOT EDIT THIS FILE. -* See the following change record for more information, -* https://www.drupal.org/node/2815083 -* @preserve -**/ - -(function ($, Drupal) { - Drupal.behaviors.color = { - attach(context, settings) { - let i; - let j; - let colors; - const form = $(once('color', '#system-theme-settings .color-form', context)); - - if (form.length === 0) { - return; - } - - const inputs = []; - const hooks = []; - const locks = []; - let focused = null; - $(once('color', $('
'))).prependTo(form); - const farb = $.farbtastic('.color-placeholder'); - const reference = settings.color.reference; - Object.keys(reference || {}).forEach(color => { - reference[color] = farb.RGBToHSL(farb.unpack(reference[color])); - }); - const height = []; - const width = []; - - function preview() { - Drupal.color.callback(context, settings, form, farb, height, width); - } - - function resetScheme() { - form.find('#edit-scheme').each(function () { - this.selectedIndex = this.options.length - 1; - }); - } - - function shiftColor(given, ref1, ref2) { - let d; - given = farb.RGBToHSL(farb.unpack(given)); - given[0] += ref2[0] - ref1[0]; - - if (ref1[1] === 0 || ref2[1] === 0) { - given[1] = ref2[1]; - } else { - d = ref1[1] / ref2[1]; - - if (d > 1) { - given[1] /= d; - } else { - given[1] = 1 - (1 - given[1]) * d; - } - } - - if (ref1[2] === 0 || ref2[2] === 0) { - given[2] = ref2[2]; - } else { - d = ref1[2] / ref2[2]; - - if (d > 1) { - given[2] /= d; - } else { - given[2] = 1 - (1 - given[2]) * d; - } - } - - return farb.pack(farb.HSLToRGB(given)); - } - - function callback(input, color, propagate, colorScheme) { - let matched; - $(input).css({ - backgroundColor: color, - color: farb.RGBToHSL(farb.unpack(color))[2] > 0.5 ? '#000' : '#fff' - }); - - if (input.value && input.value !== color) { - input.value = color; - - if (propagate) { - i = input.i; - - for (j = i + 1;; ++j) { - if (!locks[j - 1] || $(locks[j - 1]).is('.is-unlocked')) { - break; - } - - matched = shiftColor(color, reference[input.key], reference[inputs[j].key]); - callback(inputs[j], matched, false); - } - - for (j = i - 1;; --j) { - if (!locks[j] || $(locks[j]).is('.is-unlocked')) { - break; - } - - matched = shiftColor(color, reference[input.key], reference[inputs[j].key]); - callback(inputs[j], matched, false); - } - - preview(); - } - - if (!colorScheme) { - resetScheme(); - } - } - } - - Object.keys(settings.gradients || {}).forEach(i => { - $(once('color', '.color-preview')).append(`
`); - const gradient = $(`.color-preview #gradient-${i}`); - height.push(parseInt(gradient.css('height'), 10) / 10); - width.push(parseInt(gradient.css('width'), 10) / 10); - - for (j = 0; j < (settings.gradients[i].direction === 'vertical' ? height[i] : width[i]); ++j) { - gradient.append('
'); - } - }); - form.find('#edit-scheme').on('change', function () { - const schemes = settings.color.schemes; - const colorScheme = this.options[this.selectedIndex].value; - - if (colorScheme !== '' && schemes[colorScheme]) { - colors = schemes[colorScheme]; - Object.keys(colors || {}).forEach(fieldName => { - callback($(`#edit-palette-${fieldName}`), colors[fieldName], false, true); - }); - preview(); - } - }); - - function focus(e) { - const input = e.target; - - if (focused) { - $(focused).off('keyup', farb.updateValue).off('keyup', preview).off('keyup', resetScheme).parent().removeClass('item-selected'); - } - - focused = input; - farb.linkTo(color => { - callback(input, color, true, false); - }); - farb.setColor(input.value); - $(focused).on('keyup', farb.updateValue).on('keyup', preview).on('keyup', resetScheme).parent().addClass('item-selected'); - } - - form.find('.js-color-palette input.form-text').each(function () { - this.key = this.id.substring(13); - farb.linkTo(() => {}).setColor('#000').linkTo(this); - const i = inputs.length; - - if (inputs.length) { - let toggleClick = true; - const lock = $(``).on('click', function (e) { - e.preventDefault(); - - if (toggleClick) { - $(this).addClass('is-unlocked').html(Drupal.t('Lock')); - $(hooks[i - 1]).attr('class', locks[i - 2] && $(locks[i - 2]).is(':not(.is-unlocked)') ? 'color-palette__hook is-up' : 'color-palette__hook'); - $(hooks[i]).attr('class', locks[i] && $(locks[i]).is(':not(.is-unlocked)') ? 'color-palette__hook is-down' : 'color-palette__hook'); - } else { - $(this).removeClass('is-unlocked').html(Drupal.t('Unlock')); - $(hooks[i - 1]).attr('class', locks[i - 2] && $(locks[i - 2]).is(':not(.is-unlocked)') ? 'color-palette__hook is-both' : 'color-palette__hook is-down'); - $(hooks[i]).attr('class', locks[i] && $(locks[i]).is(':not(.is-unlocked)') ? 'color-palette__hook is-both' : 'color-palette__hook is-up'); - } - - toggleClick = !toggleClick; - }); - $(this).after(lock); - locks.push(lock); - } - - const hook = $('
'); - $(this).after(hook); - hooks.push(hook); - $(this).parent().find('.color-palette__lock').trigger('click'); - this.i = i; - inputs.push(this); - }).on('focus', focus); - form.find('.js-color-palette label'); - inputs[0].focus(); - preview(); - } - - }; -})(jQuery, Drupal); \ No newline at end of file diff --git a/core/modules/color/color.libraries.yml b/core/modules/color/color.libraries.yml deleted file mode 100644 index 860c0c16525..00000000000 --- a/core/modules/color/color.libraries.yml +++ /dev/null @@ -1,26 +0,0 @@ -drupal.color: - version: VERSION - js: - color.js: {} - dependencies: - - core/jquery - - core/drupal - - core/once - - core/jquery.farbtastic - - color/drupal.color.preview - -drupal.color.preview: - version: VERSION - js: - preview.js: {} - dependencies: - - core/jquery - - core/drupal - - core/drupalSettings - - core/once - -admin: - version: VERSION - css: - theme: - css/color.admin.css: {} diff --git a/core/modules/color/color.module b/core/modules/color/color.module deleted file mode 100644 index 6d854eeff9e..00000000000 --- a/core/modules/color/color.module +++ /dev/null @@ -1,852 +0,0 @@ -' . t('About') . ''; - $output .= '

' . t('The Color module allows users with the Administer site configuration permission to change the color scheme (color of links, backgrounds, text, and other theme elements) of compatible themes. For more information, see the online documentation for the Color module.', [':color_do' => 'https://www.drupal.org/documentation/modules/color']) . '

'; - $output .= '

' . t('Uses') . '

'; - $output .= '
'; - $output .= '
' . t('Changing colors') . '
'; - $output .= '

' . t('To change the color settings, select the Settings link for your theme on the Appearance page. If the color picker does not appear then the theme is not compatible with the Color module.', [':appearance' => Url::fromRoute('system.themes_page')->toString()]) . '

'; - $output .= '

' . t("The Color module saves a modified copy of the theme's specified stylesheets in the files directory. If you make any manual changes to your theme's stylesheet, you must save your color settings again, even if you haven't changed the colors. This step is required because the module stylesheets in the files directory need to be recreated to reflect your changes.") . '

'; - $output .= '
'; - return $output; - } -} - -/** - * Implements hook_theme(). - */ -function color_theme() { - return [ - 'color_scheme_form' => [ - 'render element' => 'form', - ], - ]; -} - -/** - * Implements hook_form_FORM_ID_alter(). - */ -function color_form_system_theme_settings_alter(&$form, FormStateInterface $form_state) { - $build_info = $form_state->getBuildInfo(); - if (isset($build_info['args'][0]) && ($theme = $build_info['args'][0]) && color_get_info($theme) && function_exists('gd_info')) { - $form['color'] = [ - '#type' => 'details', - '#title' => t('Color scheme'), - '#open' => TRUE, - '#weight' => -1, - '#attributes' => ['id' => 'color_scheme_form'], - '#theme' => 'color_scheme_form', - ]; - $form['color'] += color_scheme_form($form, $form_state, $theme); - $form['#validate'][] = 'color_scheme_form_validate'; - // Ensure color submission happens first so we can unset extra values. - array_unshift($form['#submit'], 'color_scheme_form_submit'); - } -} - -/** - * Implements hook_library_info_alter(). - * - * Replaces style sheets declared in libraries with color-altered style sheets. - */ -function color_library_info_alter(&$libraries, $extension) { - $themes = array_keys(\Drupal::service('theme_handler')->listInfo()); - if (in_array($extension, $themes)) { - $color_paths = \Drupal::config('color.theme.' . $extension)->get('stylesheets'); - if (!empty($color_paths)) { - foreach (array_keys($libraries) as $name) { - if (isset($libraries[$name]['css'])) { - // Override stylesheets. - foreach ($libraries[$name]['css'] as $category => $css_assets) { - foreach ($css_assets as $path => $metadata) { - // Loop over the path array with recolored CSS files to find matching - // paths which could replace the non-recolored paths. - foreach ($color_paths as $color_path) { - // Color module currently requires unique file names to be used, - // which allows us to compare different file paths. - /** @var \Drupal\Core\File\FileSystemInterface $file_system */ - $file_system = \Drupal::service('file_system'); - if ($file_system->basename($path) == $file_system->basename($color_path)) { - // Replace the path to the new css file. - // This keeps the order of the stylesheets intact. - $index = array_search($path, array_keys($libraries[$name]['css'][$category])); - $preceding_css_assets = array_slice($libraries[$name]['css'][$category], 0, $index); - $succeeding_css_assets = array_slice($libraries[$name]['css'][$category], $index + 1); - $libraries[$name]['css'][$category] = array_merge( - $preceding_css_assets, - [$color_path => $metadata], - $succeeding_css_assets - ); - } - } - } - } - } - } - } - } -} - -/** - * Implements hook_block_view_BASE_BLOCK_ID_alter(). - */ -function color_block_view_system_branding_block_alter(array &$build, BlockPluginInterface $block) { - $build['#pre_render'][] = [ColorSystemBrandingBlockAlter::class, 'preRender']; -} - -/** - * Retrieves the Color module information for a particular theme. - */ -function color_get_info($theme) { - static $theme_info = []; - - if (isset($theme_info[$theme])) { - return $theme_info[$theme]; - } - - $path = \Drupal::service('extension.list.theme')->getPath($theme); - $file = \Drupal::root() . '/' . $path . '/color/color.inc'; - if ($path && file_exists($file)) { - $info = []; - include $file; - // Add in default values. - $info += [ - // CSS files (excluding @import) to rewrite with new color scheme. - 'css' => [], - // Files to copy. - 'copy' => [], - // Gradient definitions. - 'gradients' => [], - // Color areas to fill (x, y, width, height). - 'fill' => [], - // Coordinates of all the theme slices (x, y, width, height) with their - // filename as used in the stylesheet. - 'slices' => [], - // Reference color used for blending. - 'blend_target' => '#ffffff', - ]; - $theme_info[$theme] = $info; - return $info; - } -} - -/** - * Retrieves the color palette for a particular theme. - */ -function color_get_palette($theme, $default = FALSE) { - // Fetch and expand default palette. - $info = color_get_info($theme); - $palette = $info['schemes']['default']['colors']; - - if ($default) { - return $palette; - } - - // Load variable. - // @todo Default color config should be moved to yaml in the theme. - // Getting a mutable override-free object because this function is only used - // in forms. Color configuration is used to write CSS to the file system - // making configuration overrides pointless. - return \Drupal::configFactory()->getEditable('color.theme.' . $theme)->get('palette') ?: $palette; -} - -/** - * Form constructor for the color configuration form for a particular theme. - * - * @param $theme - * The machine name of the theme whose color settings are being configured. - * - * @see color_scheme_form_validate() - * @see color_scheme_form_submit() - */ -function color_scheme_form($complete_form, FormStateInterface $form_state, $theme) { - $info = color_get_info($theme); - - $info['schemes'][''] = ['title' => t('Custom'), 'colors' => []]; - $color_sets = []; - $schemes = []; - foreach ($info['schemes'] as $key => $scheme) { - $color_sets[$key] = $scheme['title']; - $schemes[$key] = $scheme['colors']; - $schemes[$key] += $info['schemes']['default']['colors']; - } - - // See if we're using a predefined scheme. - // Note: we use the original theme when the default scheme is chosen. - // Note: we use configuration without overrides since this information is used - // in a form and therefore without doing this would bleed overrides into - // active configuration. Furthermore, color configuration is used to write - // CSS to the file system making configuration overrides pointless. - $current_scheme = \Drupal::configFactory()->getEditable('color.theme.' . $theme)->get('palette'); - foreach ($schemes as $key => $scheme) { - if ($current_scheme == $scheme) { - $scheme_name = $key; - break; - } - } - if (empty($scheme_name)) { - if (empty($current_scheme)) { - $scheme_name = 'default'; - } - else { - $scheme_name = ''; - } - } - - // Add scheme selector. - $default_palette = color_get_palette($theme, TRUE); - $form['scheme'] = [ - '#type' => 'select', - '#title' => t('Color set'), - '#options' => $color_sets, - '#default_value' => $scheme_name, - '#attached' => [ - 'library' => [ - 'color/drupal.color', - 'color/admin', - ], - // Add custom JavaScript. - 'drupalSettings' => [ - 'color' => [ - 'reference' => $default_palette, - 'schemes' => $schemes, - ], - 'gradients' => $info['gradients'], - ], - ], - ]; - - // Add palette fields. Use the configuration if available. - $palette = $current_scheme ?: $default_palette; - $names = $info['fields']; - $form['palette']['#tree'] = TRUE; - foreach ($palette as $name => $value) { - if (isset($names[$name])) { - $form['palette'][$name] = [ - '#type' => 'textfield', - '#title' => $names[$name], - '#value_callback' => 'color_palette_color_value', - '#default_value' => $value, - '#size' => 8, - '#attributes' => ['dir' => LanguageInterface::DIRECTION_LTR], - ]; - } - } - $form['theme'] = ['#type' => 'value', '#value' => $theme]; - if (isset($info['#attached'])) { - $form['#attached'] = $info['#attached']; - unset($info['#attached']); - } - $form['info'] = ['#type' => 'value', '#value' => $info]; - - return $form; -} - -/** - * Prepares variables for color scheme form templates. - * - * Default template: color-scheme-form.html.twig. - * - * @param array $variables - * An associative array containing: - * - form: A render element representing the form. - */ -function template_preprocess_color_scheme_form(&$variables) { - $form = &$variables['form']; - - $theme = $form['theme']['#value']; - $info = $form['info']['#value']; - - if (isset($info['preview_library'])) { - $form['scheme']['#attached']['library'][] = $info['preview_library']; - } - - // Attempt to load preview HTML if the theme provides it. - $preview_html_path = \Drupal::root() . '/'; - if (isset($info['preview_html'])) { - $preview_html_path .= \Drupal::service('extension.list.theme')->getPath($theme) . '/' . $info['preview_html']; - } - else { - $preview_html_path .= \Drupal::service('extension.list.module')->getPath('color') . '/preview.html'; - } - $variables['html_preview']['#markup'] = file_get_contents($preview_html_path); -} - -/** - * Determines the value for a palette color field. - * - * @param array $element - * The form element whose value is being populated. - * @param string|bool $input - * The incoming input to populate the form element. If this is FALSE, - * the element's default value should be returned. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current state of the form. - * - * @return string - * The data that will appear in the $form_state->getValues() collection for this - * element. Return nothing to use the default. - */ -function color_palette_color_value($element, $input, FormStateInterface $form_state) { - // If we suspect a possible cross-site request forgery attack, only accept - // hexadecimal CSS color strings from user input, to avoid problems when this - // value is used in the JavaScript preview. - if ($input !== FALSE) { - // Start with the provided value for this textfield, and validate that if - // necessary, falling back on the default value. - $value = Textfield::valueCallback($element, $input, $form_state); - $complete_form = $form_state->getCompleteForm(); - if (!$value || !isset($complete_form['#token']) || color_valid_hexadecimal_string($value) || \Drupal::csrfToken()->validate($form_state->getValue('form_token'), $complete_form['#token'])) { - return $value; - } - else { - return $element['#default_value']; - } - } -} - -/** - * Determines if a hexadecimal CSS color string is valid. - * - * @param string $color - * The string to check. - * - * @return bool - * TRUE if the string is a valid hexadecimal CSS color string, or FALSE if it - * isn't. - */ -function color_valid_hexadecimal_string($color) { - return (bool) preg_match('/^#([a-f0-9]{3}){1,2}$/iD', $color); -} - -/** - * Form validation handler for color_scheme_form(). - * - * @see color_scheme_form_submit() - */ -function color_scheme_form_validate($form, FormStateInterface $form_state) { - // Only accept hexadecimal CSS color strings to avoid XSS upon use. - foreach ($form_state->getValue('palette') as $key => $color) { - if (!color_valid_hexadecimal_string($color)) { - $form_state->setErrorByName('palette][' . $key, t('You must enter a valid hexadecimal color value for %name.', ['%name' => $form['color']['palette'][$key]['#title']])); - } - } -} - -/** - * Form submission handler for color_scheme_form(). - * - * @see color_scheme_form_validate() - */ -function color_scheme_form_submit($form, FormStateInterface $form_state) { - - // Avoid color settings spilling over to theme settings. - $color_settings = ['theme', 'palette', 'scheme']; - if ($form_state->hasValue('info')) { - $color_settings[] = 'info'; - } - foreach ($color_settings as $setting_name) { - ${$setting_name} = $form_state->getValue($setting_name); - $form_state->unsetValue($setting_name); - } - if (!isset($info)) { - return; - } - - $config = \Drupal::configFactory()->getEditable('color.theme.' . $theme); - - // Resolve palette. - if ($scheme != '') { - foreach ($palette as $key => $color) { - if (isset($info['schemes'][$scheme]['colors'][$key])) { - $palette[$key] = $info['schemes'][$scheme]['colors'][$key]; - } - } - $palette += $info['schemes']['default']['colors']; - } - - // Make sure enough memory is available. - if (isset($info['base_image'])) { - // Fetch source image dimensions. - $source = \Drupal::service('extension.list.theme')->getPath($theme) . '/' . $info['base_image']; - [$width, $height] = getimagesize($source); - - // We need at least a copy of the source and a target buffer of the same - // size (both at 32bpp). - $required = $width * $height * 8; - // We intend to prevent color scheme changes if there isn't enough memory - // available. memory_get_usage(TRUE) returns a more accurate number than - // memory_get_usage(), therefore we won't inadvertently reject a color - // scheme change based on a faulty memory calculation. - $usage = memory_get_usage(TRUE); - $memory_limit = ini_get('memory_limit'); - $size = Bytes::toNumber($memory_limit); - if (!Environment::checkMemoryLimit($usage + $required, $memory_limit)) { - \Drupal::messenger()->addError(t('There is not enough memory available to PHP to change this theme\'s color scheme. You need at least %size more. Check the PHP documentation for more information.', ['%size' => format_size($usage + $required - $size)])); - return; - } - } - - $file_system = \Drupal::service('file_system'); - // Delete old files. - $files = $config->get('files'); - if (isset($files)) { - foreach ($files as $file) { - @$file_system->unlink($file); - } - } - if (isset($file) && $file = dirname($file)) { - @\Drupal::service('file_system')->rmdir($file); - } - - // No change in color config, use the standard theme from color.inc. - if (implode(',', color_get_palette($theme, TRUE)) == implode(',', $palette)) { - $config->delete(); - return; - } - - // Prepare target locations for generated files. - $id = $theme . '-' . substr(hash('sha256', serialize($palette) . microtime()), 0, 8); - $paths['color'] = 'public://color'; - $paths['target'] = $paths['color'] . '/' . $id; - /** @var \Drupal\Core\File\FileSystemInterface $file_system */ - $file_system = \Drupal::service('file_system'); - foreach ($paths as $path) { - $file_system->prepareDirectory($path, FileSystemInterface::CREATE_DIRECTORY); - } - $paths['target'] = $paths['target'] . '/'; - $paths['id'] = $id; - $paths['source'] = \Drupal::service('extension.list.theme')->getPath($theme) . '/'; - $paths['files'] = $paths['map'] = []; - - // Save palette and logo location. - $config - ->set('palette', $palette) - ->set('logo', $paths['target'] . 'logo.svg') - ->save(); - - // Copy over neutral images. - /** @var \Drupal\Core\File\FileSystemInterface $file_system */ - $file_system = \Drupal::service('file_system'); - foreach ($info['copy'] as $file) { - $base = $file_system->basename($file); - $source = $paths['source'] . $file; - try { - $filepath = $file_system->copy($source, $paths['target'] . $base); - } - catch (FileException $e) { - $filepath = FALSE; - } - $paths['map'][$file] = $base; - $paths['files'][] = $filepath; - } - - // Render new images, if image has been provided. - if (isset($info['base_image'])) { - _color_render_images($theme, $info, $paths, $palette); - } - - // Rewrite theme stylesheets. - $css = []; - foreach ($info['css'] as $stylesheet) { - // Build a temporary array with CSS files. - $files = []; - if (file_exists($paths['source'] . $stylesheet)) { - $files[] = $stylesheet; - } - - foreach ($files as $file) { - $css_optimizer = new CssOptimizer(\Drupal::service('file_url_generator')); - // Aggregate @imports recursively for each configured top level CSS file - // without optimization. Aggregation and optimization will be - // handled by drupal_build_css_cache() only. - $style = $css_optimizer->loadFile($paths['source'] . $file, FALSE); - - // Return the path to where this CSS file originated from, stripping - // off the name of the file at the end of the path. - $css_optimizer->rewriteFileURIBasePath = base_path() . dirname($paths['source'] . $file) . '/'; - - // Prefix all paths within this CSS file, ignoring absolute paths. - $style = preg_replace_callback('/url\([\'"]?(?![a-z]+:|\/+)([^\'")]+)[\'"]?\)/i', [$css_optimizer, 'rewriteFileURI'], $style); - - // Rewrite stylesheet with new colors. - $style = _color_rewrite_stylesheet($theme, $info, $paths, $palette, $style); - $base_file = $file_system->basename($file); - $css[] = $paths['target'] . $base_file; - _color_save_stylesheet($paths['target'] . $base_file, $style, $paths); - } - } - - // Maintain list of files. - $config - ->set('stylesheets', $css) - ->set('files', $paths['files']) - ->save(); -} - -/** - * Rewrites the stylesheet to match the colors in the palette. - */ -function _color_rewrite_stylesheet($theme, &$info, &$paths, $palette, $style) { - // Prepare color conversion table. - $conversion = $palette; - foreach ($conversion as $k => $v) { - $v = mb_strtolower($v); - $conversion[$k] = Color::normalizeHexLength($v); - } - $default = color_get_palette($theme, TRUE); - - // Split off the "Don't touch" section of the stylesheet. - $split = "Color Module: Don't touch"; - if (strpos($style, $split) !== FALSE) { - [$style, $fixed] = explode($split, $style); - } - - // Find all colors in the stylesheet and the chunks in between. - $style = preg_split('/(#[0-9a-f]{6}|#[0-9a-f]{3})/i', $style, -1, PREG_SPLIT_DELIM_CAPTURE); - $is_color = FALSE; - $output = ''; - $base = 'base'; - - // Iterate over all the parts. - foreach ($style as $chunk) { - if ($is_color) { - $chunk = mb_strtolower($chunk); - $chunk = Color::normalizeHexLength($chunk); - // Check if this is one of the colors in the default palette. - if ($key = array_search($chunk, $default)) { - $chunk = $conversion[$key]; - } - // Not a pre-set color. Extrapolate from the base. - else { - $chunk = _color_shift($palette[$base], $default[$base], $chunk, $info['blend_target']); - } - } - else { - // Determine the most suitable base color for the next color. - - // 'a' declarations. Use link. - if (preg_match('@[^a-z0-9_-](a)[^a-z0-9_-][^/{]*{[^{]+$@i', $chunk)) { - $base = 'link'; - } - // 'color:' styles. Use text. - elseif (preg_match('/(? $after) { - $before = base_path() . $paths['source'] . $before; - $before = preg_replace('`(^|/)(?!../)([^/]+)/../`', '$1', $before); - $output = str_replace($before, $after, $output); - } - - return $output; -} - -/** - * Saves the rewritten stylesheet to disk. - */ -function _color_save_stylesheet($file, $style, &$paths) { - $filepath = \Drupal::service('file_system')->saveData($style, $file, FileSystemInterface::EXISTS_REPLACE); - $paths['files'][] = $filepath; - - // Set standard file permissions for webserver-generated files. - \Drupal::service('file_system')->chmod($file); -} - -/** - * Renders images that match a given palette. - */ -function _color_render_images($theme, &$info, &$paths, $palette) { - // Prepare template image. - $source = $paths['source'] . '/' . $info['base_image']; - $source = imagecreatefrompng($source); - $width = imagesx($source); - $height = imagesy($source); - - // Prepare target buffer. - $target = imagecreatetruecolor($width, $height); - imagealphablending($target, TRUE); - - // Fill regions of solid color. - foreach ($info['fill'] as $color => $fill) { - imagefilledrectangle($target, $fill[0], $fill[1], $fill[0] + $fill[2], $fill[1] + $fill[3], _color_gd($target, $palette[$color])); - } - - // Render gradients. - foreach ($info['gradients'] as $gradient) { - // Get direction of the gradient. - if (isset($gradient['direction']) && $gradient['direction'] == 'horizontal') { - // Horizontal gradient. - for ($x = 0; $x < $gradient['dimension'][2]; $x++) { - $color = _color_blend($target, $palette[$gradient['colors'][0]], $palette[$gradient['colors'][1]], $x / ($gradient['dimension'][2] - 1)); - imagefilledrectangle($target, ($gradient['dimension'][0] + $x), $gradient['dimension'][1], ($gradient['dimension'][0] + $x + 1), ($gradient['dimension'][1] + $gradient['dimension'][3]), $color); - } - } - else { - // Vertical gradient. - for ($y = 0; $y < $gradient['dimension'][3]; $y++) { - $color = _color_blend($target, $palette[$gradient['colors'][0]], $palette[$gradient['colors'][1]], $y / ($gradient['dimension'][3] - 1)); - imagefilledrectangle($target, $gradient['dimension'][0], $gradient['dimension'][1] + $y, $gradient['dimension'][0] + $gradient['dimension'][2], $gradient['dimension'][1] + $y + 1, $color); - } - } - } - - // Blend over template. - imagecopy($target, $source, 0, 0, 0, 0, $width, $height); - - // Clean up template image. - imagedestroy($source); - - // Cut out slices. - foreach ($info['slices'] as $file => $coord) { - [$x, $y, $width, $height] = $coord; - /** @var \Drupal\Core\File\FileSystemInterface $file_system */ - $file_system = \Drupal::service('file_system'); - $base = $file_system->basename($file); - $image = $file_system->realpath($paths['target'] . $base); - - // Cut out slice. - if ($file == 'screenshot.png') { - $slice = imagecreatetruecolor(150, 90); - imagecopyresampled($slice, $target, 0, 0, $x, $y, 150, 90, $width, $height); - \Drupal::configFactory()->getEditable('color.theme.' . $theme) - ->set('screenshot', $image) - ->save(); - } - else { - $slice = imagecreatetruecolor($width, $height); - imagecopy($slice, $target, 0, 0, $x, $y, $width, $height); - } - - // Save image. - imagepng($slice, $image); - imagedestroy($slice); - $paths['files'][] = $image; - - // Set standard file permissions for webserver-generated files. - $file_system->chmod($image); - - // Build before/after map of image paths. - $paths['map'][$file] = $base; - } - - // Clean up target buffer. - imagedestroy($target); -} - -/** - * Shifts a given color, using a reference pair and a target blend color. - * - * Note: this function is significantly different from the JS version, as it - * is written to match the blended images perfectly. - * - * Constraint: if (ref2 == target + (ref1 - target) * delta) for some fraction - * delta then (return == target + (given - target) * delta). - * - * Loose constraint: Preserve relative positions in saturation and luminance - * space. - */ -function _color_shift($given, $ref1, $ref2, $target) { - // We assume that ref2 is a blend of ref1 and target and find - // delta based on the length of the difference vectors. - - // delta = 1 - |ref2 - ref1| / |white - ref1| - $target = _color_unpack($target, TRUE); - $ref1 = _color_unpack($ref1, TRUE); - $ref2 = _color_unpack($ref2, TRUE); - $numerator = 0; - $denominator = 0; - for ($i = 0; $i < 3; ++$i) { - $numerator += ($ref2[$i] - $ref1[$i]) * ($ref2[$i] - $ref1[$i]); - $denominator += ($target[$i] - $ref1[$i]) * ($target[$i] - $ref1[$i]); - } - $delta = ($denominator > 0) ? (1 - sqrt($numerator / $denominator)) : 0; - - // Calculate the color that ref2 would be if the assumption was true. - for ($i = 0; $i < 3; ++$i) { - $ref3[$i] = $target[$i] + ($ref1[$i] - $target[$i]) * $delta; - } - - // If the assumption is not true, there is a difference between ref2 and ref3. - // We measure this in HSL space. Notation: x' = hsl(x). - $ref2 = _color_rgb2hsl($ref2); - $ref3 = _color_rgb2hsl($ref3); - for ($i = 0; $i < 3; ++$i) { - $shift[$i] = $ref2[$i] - $ref3[$i]; - } - - // Take the given color, and blend it towards the target. - $given = _color_unpack($given, TRUE); - for ($i = 0; $i < 3; ++$i) { - $result[$i] = $target[$i] + ($given[$i] - $target[$i]) * $delta; - } - - // Finally, we apply the extra shift in HSL space. - // Note: if ref2 is a pure blend of ref1 and target, then |shift| = 0. - $result = _color_rgb2hsl($result); - for ($i = 0; $i < 3; ++$i) { - $result[$i] = min(1, max(0, $result[$i] + $shift[$i])); - } - $result = _color_hsl2rgb($result); - - // Return hex color. - return _color_pack($result, TRUE); -} - -/** - * Converts a hex triplet into a GD color. - */ -function _color_gd($img, $hex) { - $c = array_merge([$img], _color_unpack($hex)); - return call_user_func_array('imagecolorallocate', $c); -} - -/** - * Blends two hex colors and returns the GD color. - */ -function _color_blend($img, $hex1, $hex2, $alpha) { - $in1 = _color_unpack($hex1); - $in2 = _color_unpack($hex2); - $out = [$img]; - for ($i = 0; $i < 3; ++$i) { - $out[] = $in1[$i] + ($in2[$i] - $in1[$i]) * $alpha; - } - - return call_user_func_array('imagecolorallocate', $out); -} - -/** - * Converts a hex color into an RGB triplet. - */ -function _color_unpack($hex, $normalize = FALSE) { - $hex = substr($hex, 1); - if (strlen($hex) == 3) { - $hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2]; - } - $c = hexdec($hex); - for ($i = 16; $i >= 0; $i -= 8) { - $out[] = (($c >> $i) & 0xFF) / ($normalize ? 255 : 1); - } - - return $out; -} - -/** - * Converts an RGB triplet to a hex color. - */ -function _color_pack($rgb, $normalize = FALSE) { - $out = 0; - foreach ($rgb as $k => $v) { - $out |= ((int) ($v * ($normalize ? 255 : 1)) << (16 - $k * 8)); - } - - return '#' . str_pad(dechex($out), 6, 0, STR_PAD_LEFT); -} - -/** - * Converts an HSL triplet into RGB. - */ -function _color_hsl2rgb($hsl) { - $h = $hsl[0]; - $s = $hsl[1]; - $l = $hsl[2]; - $m2 = ($l <= 0.5) ? $l * ($s + 1) : $l + $s - $l * $s; - $m1 = $l * 2 - $m2; - - return [ - _color_hue2rgb($m1, $m2, $h + 0.33333), - _color_hue2rgb($m1, $m2, $h), - _color_hue2rgb($m1, $m2, $h - 0.33333), - ]; -} - -/** - * Helper function for _color_hsl2rgb(). - */ -function _color_hue2rgb($m1, $m2, $h) { - $h = ($h < 0) ? $h + 1 : (($h > 1) ? $h - 1 : $h); - if ($h * 6 < 1) { - return $m1 + ($m2 - $m1) * $h * 6; - } - if ($h * 2 < 1) { - return $m2; - } - if ($h * 3 < 2) { - return $m1 + ($m2 - $m1) * (0.66666 - $h) * 6; - } - - return $m1; -} - -/** - * Converts an RGB triplet to HSL. - */ -function _color_rgb2hsl($rgb) { - $r = $rgb[0]; - $g = $rgb[1]; - $b = $rgb[2]; - $min = min($r, min($g, $b)); - $max = max($r, max($g, $b)); - $delta = $max - $min; - $l = ($min + $max) / 2; - $s = 0; - - if ($l > 0 && $l < 1) { - $s = $delta / ($l < 0.5 ? (2 * $l) : (2 - 2 * $l)); - } - - $h = 0; - if ($delta > 0) { - if ($max == $r && $max != $g) { - $h += ($g - $b) / $delta; - } - if ($max == $g && $max != $b) { - $h += (2 + ($b - $r) / $delta); - } - if ($max == $b && $max != $r) { - $h += (4 + ($r - $g) / $delta); - } - $h /= 6; - } - - return [$h, $s, $l]; -} diff --git a/core/modules/color/color.services.yml b/core/modules/color/color.services.yml deleted file mode 100644 index 9575785b6bb..00000000000 --- a/core/modules/color/color.services.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - color.config_cache_invalidator: - class: Drupal\color\EventSubscriber\ColorConfigCacheInvalidator - arguments: ['@cache_tags.invalidator'] - tags: - - { name: event_subscriber } diff --git a/core/modules/color/config/schema/color.schema.yml b/core/modules/color/config/schema/color.schema.yml deleted file mode 100644 index 07ae1cccebf..00000000000 --- a/core/modules/color/config/schema/color.schema.yml +++ /dev/null @@ -1,20 +0,0 @@ -color.theme.*: - type: config_object - label: 'Color theme settings' - mapping: - palette: - type: sequence - label: 'Palette settings' - sequence: - type: color_hex - logo: - type: path - label: 'Logo path' - stylesheets: - type: sequence - sequence: - type: path - files: - type: sequence - sequence: - type: path diff --git a/core/modules/color/css/color.admin.css b/core/modules/color/css/color.admin.css deleted file mode 100644 index cddc4c79835..00000000000 --- a/core/modules/color/css/color.admin.css +++ /dev/null @@ -1,153 +0,0 @@ -/** - * @file - * Stylesheet for the administration pages of the Color module. - */ -.color-form { - max-width: 50em; -} -.farbtastic { - margin: 0 auto; -} -.color-form .form-item { - height: 2em; - margin: 0.5em 0; - padding: 0.5em; -} -.color-form label { - clear: left; /* LTR */ -} -[dir="rtl"] .color-form label { - clear: right; -} -.color-form .form-text { - float: left; /* LTR */ - width: 86%; - cursor: pointer; - text-align: center; -} -[dir="rtl"] .color-form .form-text { - float: right; -} -.color-palette__hook { - float: left; /* LTR */ - width: 16px; - height: 16px; -} -[dir="rtl"] .color-palette__hook { - float: right; -} -.color-palette__hook.is-down, -.color-palette__hook.is-up, -.color-palette__hook.is-both { - background: url(../images/hook.png) no-repeat 100% 0; /* LTR */ -} -[dir="rtl"] .color-palette__hook.is-down, -[dir="rtl"] .color-palette__hook.is-up, -[dir="rtl"] .color-palette__hook.is-both { - background: url(../images/hook-rtl.png) no-repeat 0 0; -} -.color-palette__hook.is-up { - background-position: 100% -27px; /* LTR */ -} -[dir="rtl"] .color-palette__hook.is-up { - background-position: 0 -27px; -} -.color-palette__hook.is-both { - background-position: 100% -54px; /* LTR */ -} -[dir="rtl"] .color-palette__hook.is-both { - background-position: 0 -54px; -} -/** - * The button also inherits from .link, which hides the background. Use a more - * specific selector to overwrite. - */ -button.color-palette__lock, -.color-palette__lock { - position: relative; - top: -1.7em; - left: -10px; - float: left; /* LTR */ - width: 20px; - height: 19px; - cursor: pointer; - text-indent: -9999px; - direction: ltr; - border: 0; - outline: 0; - background: url(../images/lock.png) no-repeat 50% 0; -} -[dir="rtl"] button.color-palette__lock, -[dir="rtl"] .color-palette__lock { - float: right; -} -/* Same as above .color-palette__lock rule. */ -button.is-unlocked, -.is-unlocked { - background-position: 50% -22px; -} - -/* wide viewport. */ -@media screen and (min-width: 37.5625em) { /* 601px */ - .color-placeholder { - float: right; /* LTR */ - } - [dir="rtl"] .color-placeholder { - float: left; - } - .color-form .form-item { - margin: 0.5em 195px 0.5em 0; /* LTR */ - } - [dir="rtl"] .color-form .form-item { - margin: 0.5em 0 0.5em 195px; - } - .color-form label { - float: left; /* LTR */ - clear: left; /* LTR */ - width: 15em; - } - [dir="rtl"] .color-form label { - float: right; - clear: right; - } - .color-form .form-text, - .color-form .form-select { - float: left; /* LTR */ - width: auto; - } - [dir="rtl"] .color-form .form-text, - [dir="rtl"] .color-form .form-select { - float: right; - } - .color-palette__hook { - float: left; /* LTR */ - margin-top: 3px; - } - [dir="rtl"] .color-palette__hook { - float: right; - } -} -.item-selected { - background: #eee; -} - -/* Preview */ -.color-preview { - display: none; -} -.js .color-preview { - position: relative; - display: block; - float: left; /* LTR */ -} -.js[dir="rtl"] .color-preview { - float: right; -} - -@media screen and (max-width: 30em) { /* 480px */ - .color-form .color-preview-sidebar, - .color-form .color-preview-content { - width: auto; - margin: 0; - } -} diff --git a/core/modules/color/help_topics/color.changing.html.twig b/core/modules/color/help_topics/color.changing.html.twig deleted file mode 100644 index 49cf90d7adb..00000000000 --- a/core/modules/color/help_topics/color.changing.html.twig +++ /dev/null @@ -1,20 +0,0 @@ ---- -label: 'Changing the color palette of a theme' -related: - - core.appearance ---- -{% set appearance = render_var(url('system.themes_page')) %} -

{% trans %}Goal{% endtrans %}

-

{% trans %}Change the colors for links, backgrounds, and text in a theme that supports the Color module. Color-specific stylesheets will be generated and saved; you will need to follow these steps again to regenerate the stylesheets if you make any changes to the base stylesheets of your theme.{% endtrans %}

-

{% trans %}Steps{% endtrans %}

-
    -
  1. {% trans %}In the Manage administrative menu, navigate to Appearance.{% endtrans %}
  2. -
  3. {% trans %}Click the Settings link for the theme you want to change the colors of.{% endtrans %}
  4. -
  5. {% trans %}In the Color scheme section, choose new colors for the backgrounds, text, and links that your theme defines colors for. However, if you do not see color settings, then your theme does not support the Color module.{% endtrans %}
  6. -
  7. {% trans %}Click Save configuration. Color-specific stylesheets will be generated and saved in the file system.{% endtrans %}
  8. -
- -

{% trans %}Additional resources{% endtrans %}

- diff --git a/core/modules/color/migrations/d7_color.yml b/core/modules/color/migrations/d7_color.yml deleted file mode 100644 index 9bc7af6c6d7..00000000000 --- a/core/modules/color/migrations/d7_color.yml +++ /dev/null @@ -1,54 +0,0 @@ -id: d7_color -label: Color -migration_tags: - - Drupal 7 - - Configuration -source: - plugin: d7_color - constants: - config_prefix: 'color.theme.' -process: - # Skip if theme not installed on destination. - theme_installed: - plugin: skip_on_empty - source: theme_installed - method: row - element_name: - - - plugin: explode - source: name - delimiter: _ - - - plugin: extract - index: - - 2 - # Skip if the variable name ends in 'screenshot'. - screenshot: - - - plugin: static_map - source: '@element_name' - bypass: true - map: - screenshot: false - - - plugin: skip_on_empty - method: row - # Build the configuration name from the variable name, i.e. - # 'color_themename_element' becomes 'color.theme.themename' - theme_name: - - - plugin: explode - source: name - delimiter: _ - - - plugin: extract - index: - - 1 - configuration_name: - plugin: concat - source: - - constants/config_prefix - - '@theme_name' - value: value -destination: - plugin: color diff --git a/core/modules/color/migrations/state/color.migrate_drupal.yml b/core/modules/color/migrations/state/color.migrate_drupal.yml deleted file mode 100644 index 60e95b99eb6..00000000000 --- a/core/modules/color/migrations/state/color.migrate_drupal.yml +++ /dev/null @@ -1,3 +0,0 @@ -finished: - 7: - color: color diff --git a/core/modules/color/preview.es6.js b/core/modules/color/preview.es6.js deleted file mode 100644 index a4bbccd7b9c..00000000000 --- a/core/modules/color/preview.es6.js +++ /dev/null @@ -1,93 +0,0 @@ -/** - * @file - * Attaches preview-related behavior for the Color module. - */ - -(function ($, Drupal) { - /** - * Namespace for color-related functionality for Drupal. - * - * @namespace - */ - Drupal.color = { - /** - * The callback for when the color preview has been attached. - * - * @param {Element} context - * The context to initiate the color behavior. - * @param {object} settings - * Settings for the color functionality. - * @param {HTMLFormElement} form - * The form to initiate the color behavior on. - * @param {object} farb - * The farbtastic object. - * @param {number} height - * Height of gradient. - * @param {number} width - * Width of gradient. - */ - callback(context, settings, form, farb, height, width) { - let accum; - let delta; - // Solid background. - form - .find('.color-preview') - .css( - 'backgroundColor', - form.find('.color-palette input[name="palette[base]"]').val(), - ); - - // Text preview. - form - .find('#text') - .css( - 'color', - form.find('.color-palette input[name="palette[text]"]').val(), - ); - form - .find('#text a, #text h2') - .css( - 'color', - form.find('.color-palette input[name="palette[link]"]').val(), - ); - - function gradientLineColor(i, element) { - Object.keys(accum || {}).forEach((k) => { - accum[k] += delta[k]; - }); - element.style.backgroundColor = farb.pack(accum); - } - - // Set up gradients if there are some. - let colorStart; - let colorEnd; - Object.keys(settings.gradients || {}).forEach((i) => { - colorStart = farb.unpack( - form - .find( - `.color-palette input[name="palette[${settings.gradients[i].colors[0]}]"]`, - ) - .val(), - ); - colorEnd = farb.unpack( - form - .find( - `.color-palette input[name="palette[${settings.gradients[i].colors[1]}]"]`, - ) - .val(), - ); - if (colorStart && colorEnd) { - delta = []; - Object.keys(colorStart || {}).forEach((colorStartKey) => { - delta[colorStartKey] = - (colorEnd[colorStartKey] - colorStart[colorStartKey]) / - (settings.gradients[i].vertical ? height[i] : width[i]); - }); - accum = colorStart; - // Render gradient lines. - form.find(`#gradient-${i} > div`).each(gradientLineColor); - } - }); - }, - }; -})(jQuery, Drupal); diff --git a/core/modules/color/preview.html b/core/modules/color/preview.html deleted file mode 100644 index d89edcb0d05..00000000000 --- a/core/modules/color/preview.html +++ /dev/null @@ -1,7 +0,0 @@ -
-
-

Lorem ipsum dolor

-

Sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

-
-
-
diff --git a/core/modules/color/preview.js b/core/modules/color/preview.js deleted file mode 100644 index 358c4ba7079..00000000000 --- a/core/modules/color/preview.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* DO NOT EDIT THIS FILE. -* See the following change record for more information, -* https://www.drupal.org/node/2815083 -* @preserve -**/ - -(function ($, Drupal) { - Drupal.color = { - callback(context, settings, form, farb, height, width) { - let accum; - let delta; - form.find('.color-preview').css('backgroundColor', form.find('.color-palette input[name="palette[base]"]').val()); - form.find('#text').css('color', form.find('.color-palette input[name="palette[text]"]').val()); - form.find('#text a, #text h2').css('color', form.find('.color-palette input[name="palette[link]"]').val()); - - function gradientLineColor(i, element) { - Object.keys(accum || {}).forEach(k => { - accum[k] += delta[k]; - }); - element.style.backgroundColor = farb.pack(accum); - } - - let colorStart; - let colorEnd; - Object.keys(settings.gradients || {}).forEach(i => { - colorStart = farb.unpack(form.find(`.color-palette input[name="palette[${settings.gradients[i].colors[0]}]"]`).val()); - colorEnd = farb.unpack(form.find(`.color-palette input[name="palette[${settings.gradients[i].colors[1]}]"]`).val()); - - if (colorStart && colorEnd) { - delta = []; - Object.keys(colorStart || {}).forEach(colorStartKey => { - delta[colorStartKey] = (colorEnd[colorStartKey] - colorStart[colorStartKey]) / (settings.gradients[i].vertical ? height[i] : width[i]); - }); - accum = colorStart; - form.find(`#gradient-${i} > div`).each(gradientLineColor); - } - }); - } - - }; -})(jQuery, Drupal); \ No newline at end of file diff --git a/core/modules/color/src/ColorSystemBrandingBlockAlter.php b/core/modules/color/src/ColorSystemBrandingBlockAlter.php deleted file mode 100644 index 337c6bc9d7f..00000000000 --- a/core/modules/color/src/ColorSystemBrandingBlockAlter.php +++ /dev/null @@ -1,34 +0,0 @@ -getActiveTheme()->getName(); - $config = \Drupal::config('color.theme.' . $theme_key); - CacheableMetadata::createFromRenderArray($build) - ->addCacheableDependency($config) - ->applyTo($build); - - // Override logo. - $logo = $config->get('logo'); - if ($logo && $build['content']['site_logo'] && preg_match('!' . $theme_key . '/logo.svg$!', $build['content']['site_logo']['#uri'])) { - $build['content']['site_logo']['#uri'] = \Drupal::service('file_url_generator')->generateString($logo); - } - - return $build; - } - -} diff --git a/core/modules/color/src/EventSubscriber/ColorConfigCacheInvalidator.php b/core/modules/color/src/EventSubscriber/ColorConfigCacheInvalidator.php deleted file mode 100644 index b39af35e9dd..00000000000 --- a/core/modules/color/src/EventSubscriber/ColorConfigCacheInvalidator.php +++ /dev/null @@ -1,56 +0,0 @@ -cacheTagsInvalidator = $cache_tags_invalidator; - } - - /** - * Invalidate cache tags when a color theme config object changes. - * - * @param \Drupal\Core\Config\ConfigCrudEvent $event - * The Event to process. - */ - public function onChange(ConfigCrudEvent $event) { - // Changing a theme's color settings causes the theme's asset library - // containing the color CSS file to be altered to use a different file. - if (strpos($event->getConfig()->getName(), 'color.theme.') === 0) { - $this->cacheTagsInvalidator->invalidateTags(['library_info']); - } - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents(): array { - $events[ConfigEvents::SAVE][] = ['onChange']; - $events[ConfigEvents::DELETE][] = ['onChange']; - - return $events; - } - -} diff --git a/core/modules/color/src/Plugin/migrate/destination/Color.php b/core/modules/color/src/Plugin/migrate/destination/Color.php deleted file mode 100644 index a828667e740..00000000000 --- a/core/modules/color/src/Plugin/migrate/destination/Color.php +++ /dev/null @@ -1,90 +0,0 @@ -configFactory = $config_factory; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $migration, - $container->get('config.factory') - ); - } - - /** - * {@inheritdoc} - */ - public function import(Row $row, array $old_destination_id_values = []) { - $imported = FALSE; - $value = $row->getDestinationProperty('value'); - if (isset($value)) { - $this->configFactory->getEditable($row->getDestinationProperty('configuration_name')) - ->set($row->getDestinationProperty('element_name'), $row->getDestinationProperty('value')) - ->save(); - $imported = TRUE; - } - return $imported; - } - - /** - * {@inheritdoc} - */ - public function getIds() { - $ids['name']['type'] = 'string'; - return $ids; - } - - /** - * {@inheritdoc} - */ - public function fields() { - return []; - } - -} diff --git a/core/modules/color/src/Plugin/migrate/source/d7/Color.php b/core/modules/color/src/Plugin/migrate/source/d7/Color.php deleted file mode 100644 index 7ae8edcd47f..00000000000 --- a/core/modules/color/src/Plugin/migrate/source/d7/Color.php +++ /dev/null @@ -1,103 +0,0 @@ -themeHandler = $theme_handler; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $migration, - $container->get('state'), - $container->get('entity_type.manager'), - $container->get('theme_handler') - ); - } - - /** - * {@inheritdoc} - */ - public function query() { - // Get color data for all themes. - $query = $this->select('variable', 'v') - ->fields('v', ['name', 'value']) - ->condition('name', 'color_%', 'LIKE'); - return $query; - } - - /** - * {@inheritdoc} - */ - public function prepareRow(Row $row) { - $themes = $this->themeHandler->listInfo(); - $themes_installed = []; - /** @var \Drupal\Core\Extension\Extension $theme */ - foreach ($themes as $theme) { - if ($theme->status) { - $themes_installed[] = $theme->getName(); - } - } - - // The name is of the form 'color_theme_variable'. - $name = explode('_', $row->getSourceProperty('name')); - - // Set theme_installed if this source theme is installed. - if (in_array($name[1], $themes_installed)) { - $row->setSourceProperty('theme_installed', TRUE); - } - - return parent::prepareRow($row); - } - - /** - * {@inheritdoc} - */ - public function fields() { - return [ - 'name' => $this->t('A color variable for a theme.'), - 'value' => $this->t('The value of a color variable.'), - ]; - } - -} diff --git a/core/modules/color/templates/color-scheme-form.html.twig b/core/modules/color/templates/color-scheme-form.html.twig deleted file mode 100644 index 3c6fdd09365..00000000000 --- a/core/modules/color/templates/color-scheme-form.html.twig +++ /dev/null @@ -1,26 +0,0 @@ -{# -/** - * @file - * Default theme implementation for a theme's color form. - * - * Available variables: - * - form: Form elements for the color scheme form, including: - * - scheme: A color scheme form element. For example: a select element with - * color theme presets, or a color picker widget. - * - palette: Color fields that can be changed by entering in a new hex value. - * - html_preview: A HTML preview of the theme's current color scheme. - * - * @see template_preprocess_color_scheme_form() - * - * @ingroup themeable - */ -#} -
- {{ form.scheme }} -
- {{ form.palette }} -
- {{ form|without('scheme', 'palette') }} -

{{ 'Preview'|t }}

- {{ html_preview }} -
diff --git a/core/modules/color/tests/fixtures/drupal7.php b/core/modules/color/tests/fixtures/drupal7.php deleted file mode 100644 index 503d4b89dfe..00000000000 --- a/core/modules/color/tests/fixtures/drupal7.php +++ /dev/null @@ -1,26061 +0,0 @@ -databaseType() === 'mysql') { - $sql_mode = $connection->query("SELECT @@sql_mode;")->fetchField(); - $connection->query("SET sql_mode = '$sql_mode,NO_AUTO_VALUE_ON_ZERO'"); -} - -$connection->schema()->createTable('actions', array( - 'fields' => array( - 'aid' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '0', - ), - 'type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'callback' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'parameters' => array( - 'type' => 'blob', - 'not null' => TRUE, - 'size' => 'big', - ), - 'label' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '0', - ), - ), - 'primary key' => array( - 'aid', - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->insert('actions') -->fields(array( - 'aid', - 'type', - 'callback', - 'parameters', - 'label', -)) -->values(array( - 'aid' => 'comment_publish_action', - 'type' => 'comment', - 'callback' => 'comment_publish_action', - 'parameters' => '', - 'label' => 'Publish comment', -)) -->values(array( - 'aid' => 'comment_save_action', - 'type' => 'comment', - 'callback' => 'comment_save_action', - 'parameters' => '', - 'label' => 'Save comment', -)) -->values(array( - 'aid' => 'comment_unpublish_action', - 'type' => 'comment', - 'callback' => 'comment_unpublish_action', - 'parameters' => '', - 'label' => 'Unpublish comment', -)) -->values(array( - 'aid' => 'node_make_sticky_action', - 'type' => 'node', - 'callback' => 'node_make_sticky_action', - 'parameters' => '', - 'label' => 'Make content sticky', -)) -->values(array( - 'aid' => 'node_make_unsticky_action', - 'type' => 'node', - 'callback' => 'node_make_unsticky_action', - 'parameters' => '', - 'label' => 'Make content unsticky', -)) -->values(array( - 'aid' => 'node_promote_action', - 'type' => 'node', - 'callback' => 'node_promote_action', - 'parameters' => '', - 'label' => 'Promote content to front page', -)) -->values(array( - 'aid' => 'node_publish_action', - 'type' => 'node', - 'callback' => 'node_publish_action', - 'parameters' => '', - 'label' => 'Publish content', -)) -->values(array( - 'aid' => 'node_save_action', - 'type' => 'node', - 'callback' => 'node_save_action', - 'parameters' => '', - 'label' => 'Save content', -)) -->values(array( - 'aid' => 'node_unpromote_action', - 'type' => 'node', - 'callback' => 'node_unpromote_action', - 'parameters' => '', - 'label' => 'Remove content from front page', -)) -->values(array( - 'aid' => 'node_unpublish_action', - 'type' => 'node', - 'callback' => 'node_unpublish_action', - 'parameters' => '', - 'label' => 'Unpublish content', -)) -->values(array( - 'aid' => 'system_block_ip_action', - 'type' => 'user', - 'callback' => 'system_block_ip_action', - 'parameters' => '', - 'label' => 'Ban IP address of current user', -)) -->values(array( - 'aid' => 'user_block_user_action', - 'type' => 'user', - 'callback' => 'user_block_user_action', - 'parameters' => '', - 'label' => 'Block current user', -)) -->execute(); -$connection->schema()->createTable('authmap', array( - 'fields' => array( - 'aid' => array( - 'type' => 'serial', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'uid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'authname' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'module' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - ), - 'primary key' => array( - 'aid', - ), - 'unique keys' => array( - 'authname' => array( - 'authname', - ), - ), - 'indexes' => array( - 'uid_module' => array( - 'uid', - 'module', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('batch', array( - 'fields' => array( - 'bid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'token' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '64', - ), - 'timestamp' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - ), - 'batch' => array( - 'type' => 'blob', - 'not null' => FALSE, - 'size' => 'big', - ), - ), - 'primary key' => array( - 'bid', - ), - 'indexes' => array( - 'token' => array( - 'token', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('block', array( - 'fields' => array( - 'bid' => array( - 'type' => 'serial', - 'not null' => TRUE, - 'size' => 'normal', - ), - 'module' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '64', - 'default' => '', - ), - 'delta' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '32', - 'default' => '0', - ), - 'theme' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '64', - 'default' => '', - ), - 'status' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'weight' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'region' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '64', - 'default' => '', - ), - 'custom' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'visibility' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'pages' => array( - 'type' => 'text', - 'not null' => TRUE, - 'size' => 'normal', - ), - 'title' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'cache' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '1', - ), - ), - 'primary key' => array( - 'bid', - ), - 'unique keys' => array( - 'tmd' => array( - 'theme', - 'module', - 'delta', - ), - ), - 'indexes' => array( - 'list' => array( - 'theme', - 'status', - 'region', - 'weight', - 'module', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->insert('block') -->fields(array( - 'bid', - 'module', - 'delta', - 'theme', - 'status', - 'weight', - 'region', - 'custom', - 'visibility', - 'pages', - 'title', - 'cache', -)) -->values(array( - 'bid' => '1', - 'module' => 'system', - 'delta' => 'main', - 'theme' => 'bartik', - 'status' => '1', - 'weight' => '0', - 'region' => 'content', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '2', - 'module' => 'search', - 'delta' => 'form', - 'theme' => 'bartik', - 'status' => '1', - 'weight' => '-1', - 'region' => 'sidebar_first', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '3', - 'module' => 'node', - 'delta' => 'recent', - 'theme' => 'seven', - 'status' => '1', - 'weight' => '10', - 'region' => 'dashboard_main', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '4', - 'module' => 'user', - 'delta' => 'login', - 'theme' => 'bartik', - 'status' => '1', - 'weight' => '0', - 'region' => 'sidebar_first', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '5', - 'module' => 'system', - 'delta' => 'navigation', - 'theme' => 'bartik', - 'status' => '1', - 'weight' => '0', - 'region' => 'sidebar_first', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '6', - 'module' => 'system', - 'delta' => 'powered-by', - 'theme' => 'bartik', - 'status' => '1', - 'weight' => '10', - 'region' => 'footer', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '7', - 'module' => 'system', - 'delta' => 'help', - 'theme' => 'bartik', - 'status' => '1', - 'weight' => '0', - 'region' => 'help', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '8', - 'module' => 'system', - 'delta' => 'main', - 'theme' => 'seven', - 'status' => '1', - 'weight' => '0', - 'region' => 'content', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '9', - 'module' => 'system', - 'delta' => 'help', - 'theme' => 'seven', - 'status' => '1', - 'weight' => '0', - 'region' => 'help', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '10', - 'module' => 'user', - 'delta' => 'login', - 'theme' => 'seven', - 'status' => '1', - 'weight' => '10', - 'region' => 'content', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '11', - 'module' => 'user', - 'delta' => 'new', - 'theme' => 'seven', - 'status' => '1', - 'weight' => '0', - 'region' => 'dashboard_sidebar', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '12', - 'module' => 'search', - 'delta' => 'form', - 'theme' => 'seven', - 'status' => '1', - 'weight' => '-10', - 'region' => 'dashboard_sidebar', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '13', - 'module' => 'comment', - 'delta' => 'recent', - 'theme' => 'bartik', - 'status' => '0', - 'weight' => '0', - 'region' => '-1', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '1', -)) -->values(array( - 'bid' => '14', - 'module' => 'node', - 'delta' => 'syndicate', - 'theme' => 'bartik', - 'status' => '0', - 'weight' => '0', - 'region' => '-1', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '15', - 'module' => 'node', - 'delta' => 'recent', - 'theme' => 'bartik', - 'status' => '0', - 'weight' => '0', - 'region' => '-1', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '1', -)) -->values(array( - 'bid' => '16', - 'module' => 'shortcut', - 'delta' => 'shortcuts', - 'theme' => 'bartik', - 'status' => '0', - 'weight' => '0', - 'region' => '-1', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '17', - 'module' => 'system', - 'delta' => 'management', - 'theme' => 'bartik', - 'status' => '0', - 'weight' => '0', - 'region' => '-1', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '18', - 'module' => 'system', - 'delta' => 'user-menu', - 'theme' => 'bartik', - 'status' => '0', - 'weight' => '0', - 'region' => '-1', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '19', - 'module' => 'system', - 'delta' => 'main-menu', - 'theme' => 'bartik', - 'status' => '0', - 'weight' => '0', - 'region' => '-1', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '20', - 'module' => 'user', - 'delta' => 'new', - 'theme' => 'bartik', - 'status' => '0', - 'weight' => '0', - 'region' => '-1', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '1', -)) -->values(array( - 'bid' => '21', - 'module' => 'user', - 'delta' => 'online', - 'theme' => 'bartik', - 'status' => '0', - 'weight' => '0', - 'region' => '-1', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '22', - 'module' => 'comment', - 'delta' => 'recent', - 'theme' => 'seven', - 'status' => '1', - 'weight' => '0', - 'region' => 'dashboard_inactive', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '1', -)) -->values(array( - 'bid' => '23', - 'module' => 'node', - 'delta' => 'syndicate', - 'theme' => 'seven', - 'status' => '0', - 'weight' => '0', - 'region' => '-1', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '24', - 'module' => 'shortcut', - 'delta' => 'shortcuts', - 'theme' => 'seven', - 'status' => '0', - 'weight' => '0', - 'region' => '-1', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '25', - 'module' => 'system', - 'delta' => 'powered-by', - 'theme' => 'seven', - 'status' => '0', - 'weight' => '10', - 'region' => '-1', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '26', - 'module' => 'system', - 'delta' => 'navigation', - 'theme' => 'seven', - 'status' => '0', - 'weight' => '0', - 'region' => '-1', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '27', - 'module' => 'system', - 'delta' => 'management', - 'theme' => 'seven', - 'status' => '0', - 'weight' => '0', - 'region' => '-1', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '28', - 'module' => 'system', - 'delta' => 'user-menu', - 'theme' => 'seven', - 'status' => '0', - 'weight' => '0', - 'region' => '-1', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '29', - 'module' => 'system', - 'delta' => 'main-menu', - 'theme' => 'seven', - 'status' => '0', - 'weight' => '0', - 'region' => '-1', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '30', - 'module' => 'user', - 'delta' => 'online', - 'theme' => 'seven', - 'status' => '1', - 'weight' => '0', - 'region' => 'dashboard_inactive', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-1', -)) -->values(array( - 'bid' => '31', - 'module' => 'forum', - 'delta' => 'active', - 'theme' => 'bartik', - 'status' => '0', - 'weight' => '0', - 'region' => '-1', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-2', -)) -->values(array( - 'bid' => '32', - 'module' => 'forum', - 'delta' => 'new', - 'theme' => 'bartik', - 'status' => '0', - 'weight' => '0', - 'region' => '-1', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-2', -)) -->values(array( - 'bid' => '33', - 'module' => 'forum', - 'delta' => 'active', - 'theme' => 'seven', - 'status' => '1', - 'weight' => '0', - 'region' => 'dashboard_inactive', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-2', -)) -->values(array( - 'bid' => '34', - 'module' => 'forum', - 'delta' => 'new', - 'theme' => 'seven', - 'status' => '1', - 'weight' => '0', - 'region' => 'dashboard_inactive', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '-2', -)) -->values(array( - 'bid' => '35', - 'module' => 'blog', - 'delta' => 'recent', - 'theme' => 'bartik', - 'status' => '0', - 'weight' => '0', - 'region' => '-1', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '1', -)) -->values(array( - 'bid' => '36', - 'module' => 'blog', - 'delta' => 'recent', - 'theme' => 'seven', - 'status' => '1', - 'weight' => '0', - 'region' => 'dashboard_inactive', - 'custom' => '0', - 'visibility' => '0', - 'pages' => '', - 'title' => '', - 'cache' => '1', -)) -->execute(); -$connection->schema()->createTable('block_custom', array( - 'fields' => array( - 'bid' => array( - 'type' => 'serial', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'body' => array( - 'type' => 'text', - 'not null' => FALSE, - 'size' => 'big', - ), - 'info' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'format' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '255', - ), - ), - 'primary key' => array( - 'bid', - ), - 'unique keys' => array( - 'info' => array( - 'info', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('block_node_type', array( - 'fields' => array( - 'module' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '64', - ), - 'delta' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '32', - ), - 'type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '32', - ), - ), - 'primary key' => array( - 'module', - 'delta', - 'type', - ), - 'indexes' => array( - 'type' => array( - 'type', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('block_role', array( - 'fields' => array( - 'module' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '64', - ), - 'delta' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '32', - ), - 'rid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - ), - 'primary key' => array( - 'module', - 'delta', - 'rid', - ), - 'indexes' => array( - 'rid' => array( - 'rid', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('blocked_ips', array( - 'fields' => array( - 'iid' => array( - 'type' => 'serial', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'ip' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '40', - 'default' => '', - ), - ), - 'primary key' => array( - 'iid', - ), - 'indexes' => array( - 'blocked_ip' => array( - 'ip', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('cache', array( - 'fields' => array( - 'cid' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'data' => array( - 'type' => 'blob', - 'not null' => FALSE, - 'size' => 'big', - ), - 'expire' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'created' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'serialized' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'small', - 'default' => '0', - ), - ), - 'primary key' => array( - 'cid', - ), - 'indexes' => array( - 'expire' => array( - 'expire', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('cache_block', array( - 'fields' => array( - 'cid' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'data' => array( - 'type' => 'blob', - 'not null' => FALSE, - 'size' => 'big', - ), - 'expire' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'created' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'serialized' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'small', - 'default' => '0', - ), - ), - 'primary key' => array( - 'cid', - ), - 'indexes' => array( - 'expire' => array( - 'expire', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('cache_bootstrap', array( - 'fields' => array( - 'cid' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'data' => array( - 'type' => 'blob', - 'not null' => FALSE, - 'size' => 'big', - ), - 'expire' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'created' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'serialized' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'small', - 'default' => '0', - ), - ), - 'primary key' => array( - 'cid', - ), - 'indexes' => array( - 'expire' => array( - 'expire', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('cache_field', array( - 'fields' => array( - 'cid' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'data' => array( - 'type' => 'blob', - 'not null' => FALSE, - 'size' => 'big', - ), - 'expire' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'created' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'serialized' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'small', - 'default' => '0', - ), - ), - 'primary key' => array( - 'cid', - ), - 'indexes' => array( - 'expire' => array( - 'expire', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('cache_filter', array( - 'fields' => array( - 'cid' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'data' => array( - 'type' => 'blob', - 'not null' => FALSE, - 'size' => 'big', - ), - 'expire' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'created' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'serialized' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'small', - 'default' => '0', - ), - ), - 'primary key' => array( - 'cid', - ), - 'indexes' => array( - 'expire' => array( - 'expire', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('cache_form', array( - 'fields' => array( - 'cid' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'data' => array( - 'type' => 'blob', - 'not null' => FALSE, - 'size' => 'big', - ), - 'expire' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'created' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'serialized' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'small', - 'default' => '0', - ), - ), - 'primary key' => array( - 'cid', - ), - 'indexes' => array( - 'expire' => array( - 'expire', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('cache_image', array( - 'fields' => array( - 'cid' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'data' => array( - 'type' => 'blob', - 'not null' => FALSE, - 'size' => 'big', - ), - 'expire' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'created' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'serialized' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'small', - 'default' => '0', - ), - ), - 'primary key' => array( - 'cid', - ), - 'indexes' => array( - 'expire' => array( - 'expire', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('cache_menu', array( - 'fields' => array( - 'cid' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'data' => array( - 'type' => 'blob', - 'not null' => FALSE, - 'size' => 'big', - ), - 'expire' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'created' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'serialized' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'small', - 'default' => '0', - ), - ), - 'primary key' => array( - 'cid', - ), - 'indexes' => array( - 'expire' => array( - 'expire', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('cache_page', array( - 'fields' => array( - 'cid' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'data' => array( - 'type' => 'blob', - 'not null' => FALSE, - 'size' => 'big', - ), - 'expire' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'created' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'serialized' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'small', - 'default' => '0', - ), - ), - 'primary key' => array( - 'cid', - ), - 'indexes' => array( - 'expire' => array( - 'expire', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('cache_path', array( - 'fields' => array( - 'cid' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'data' => array( - 'type' => 'blob', - 'not null' => FALSE, - 'size' => 'big', - ), - 'expire' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'created' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'serialized' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'small', - 'default' => '0', - ), - ), - 'primary key' => array( - 'cid', - ), - 'indexes' => array( - 'expire' => array( - 'expire', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('comment', array( - 'fields' => array( - 'cid' => array( - 'type' => 'serial', - 'not null' => TRUE, - 'size' => 'normal', - ), - 'pid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'nid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'uid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'subject' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '64', - 'default' => '', - ), - 'hostname' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'created' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'changed' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'status' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '1', - 'unsigned' => TRUE, - ), - 'thread' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - ), - 'name' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '60', - ), - 'mail' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '64', - ), - 'homepage' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '255', - ), - 'language' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '12', - 'default' => '', - ), - ), - 'primary key' => array( - 'cid', - ), - 'indexes' => array( - 'comment_status_pid' => array( - 'pid', - 'status', - ), - 'comment_num_new' => array( - 'nid', - 'status', - 'created', - 'cid', - 'thread', - ), - 'comment_uid' => array( - 'uid', - ), - 'comment_nid_language' => array( - 'nid', - 'language', - ), - 'comment_created' => array( - 'created', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('date_format_locale', array( - 'fields' => array( - 'format' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '100', - 'binary' => TRUE, - ), - 'type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '64', - ), - 'language' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '12', - ), - ), - 'primary key' => array( - 'type', - 'language', - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('date_format_type', array( - 'fields' => array( - 'type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '64', - ), - 'title' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - ), - 'locked' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - ), - 'primary key' => array( - 'type', - ), - 'indexes' => array( - 'title' => array( - 'title', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->insert('date_format_type') -->fields(array( - 'type', - 'title', - 'locked', -)) -->values(array( - 'type' => 'long', - 'title' => 'Long', - 'locked' => '1', -)) -->values(array( - 'type' => 'medium', - 'title' => 'Medium', - 'locked' => '1', -)) -->values(array( - 'type' => 'short', - 'title' => 'Short', - 'locked' => '1', -)) -->execute(); -$connection->schema()->createTable('date_formats', array( - 'fields' => array( - 'dfid' => array( - 'type' => 'serial', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'format' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '100', - 'binary' => TRUE, - ), - 'type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '64', - ), - 'locked' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - ), - 'primary key' => array( - 'dfid', - ), - 'unique keys' => array( - 'formats' => array( - 'format', - 'type', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->insert('date_formats') -->fields(array( - 'dfid', - 'format', - 'type', - 'locked', -)) -->values(array( - 'dfid' => '1', - 'format' => 'm/d/Y - H:i', - 'type' => 'short', - 'locked' => '1', -)) -->values(array( - 'dfid' => '2', - 'format' => 'd/m/Y - H:i', - 'type' => 'short', - 'locked' => '1', -)) -->values(array( - 'dfid' => '3', - 'format' => 'Y/m/d - H:i', - 'type' => 'short', - 'locked' => '1', -)) -->values(array( - 'dfid' => '4', - 'format' => 'd.m.Y - H:i', - 'type' => 'short', - 'locked' => '1', -)) -->values(array( - 'dfid' => '5', - 'format' => 'Y-m-d H:i', - 'type' => 'short', - 'locked' => '1', -)) -->values(array( - 'dfid' => '6', - 'format' => 'm/d/Y - g:ia', - 'type' => 'short', - 'locked' => '1', -)) -->values(array( - 'dfid' => '7', - 'format' => 'd/m/Y - g:ia', - 'type' => 'short', - 'locked' => '1', -)) -->values(array( - 'dfid' => '8', - 'format' => 'Y/m/d - g:ia', - 'type' => 'short', - 'locked' => '1', -)) -->values(array( - 'dfid' => '9', - 'format' => 'M j Y - H:i', - 'type' => 'short', - 'locked' => '1', -)) -->values(array( - 'dfid' => '10', - 'format' => 'j M Y - H:i', - 'type' => 'short', - 'locked' => '1', -)) -->values(array( - 'dfid' => '11', - 'format' => 'Y M j - H:i', - 'type' => 'short', - 'locked' => '1', -)) -->values(array( - 'dfid' => '12', - 'format' => 'M j Y - g:ia', - 'type' => 'short', - 'locked' => '1', -)) -->values(array( - 'dfid' => '13', - 'format' => 'j M Y - g:ia', - 'type' => 'short', - 'locked' => '1', -)) -->values(array( - 'dfid' => '14', - 'format' => 'Y M j - g:ia', - 'type' => 'short', - 'locked' => '1', -)) -->values(array( - 'dfid' => '15', - 'format' => 'D, m/d/Y - H:i', - 'type' => 'medium', - 'locked' => '1', -)) -->values(array( - 'dfid' => '16', - 'format' => 'D, d/m/Y - H:i', - 'type' => 'medium', - 'locked' => '1', -)) -->values(array( - 'dfid' => '17', - 'format' => 'D, Y/m/d - H:i', - 'type' => 'medium', - 'locked' => '1', -)) -->values(array( - 'dfid' => '18', - 'format' => 'D, Y-m-d H:i', - 'type' => 'medium', - 'locked' => '1', -)) -->values(array( - 'dfid' => '19', - 'format' => 'F j, Y - H:i', - 'type' => 'medium', - 'locked' => '1', -)) -->values(array( - 'dfid' => '20', - 'format' => 'j F, Y - H:i', - 'type' => 'medium', - 'locked' => '1', -)) -->values(array( - 'dfid' => '21', - 'format' => 'Y, F j - H:i', - 'type' => 'medium', - 'locked' => '1', -)) -->values(array( - 'dfid' => '22', - 'format' => 'D, m/d/Y - g:ia', - 'type' => 'medium', - 'locked' => '1', -)) -->values(array( - 'dfid' => '23', - 'format' => 'D, d/m/Y - g:ia', - 'type' => 'medium', - 'locked' => '1', -)) -->values(array( - 'dfid' => '24', - 'format' => 'D, Y/m/d - g:ia', - 'type' => 'medium', - 'locked' => '1', -)) -->values(array( - 'dfid' => '25', - 'format' => 'F j, Y - g:ia', - 'type' => 'medium', - 'locked' => '1', -)) -->values(array( - 'dfid' => '26', - 'format' => 'j F Y - g:ia', - 'type' => 'medium', - 'locked' => '1', -)) -->values(array( - 'dfid' => '27', - 'format' => 'Y, F j - g:ia', - 'type' => 'medium', - 'locked' => '1', -)) -->values(array( - 'dfid' => '28', - 'format' => 'j. F Y - G:i', - 'type' => 'medium', - 'locked' => '1', -)) -->values(array( - 'dfid' => '29', - 'format' => 'l, F j, Y - H:i', - 'type' => 'long', - 'locked' => '1', -)) -->values(array( - 'dfid' => '30', - 'format' => 'l, j F, Y - H:i', - 'type' => 'long', - 'locked' => '1', -)) -->values(array( - 'dfid' => '31', - 'format' => 'l, Y, F j - H:i', - 'type' => 'long', - 'locked' => '1', -)) -->values(array( - 'dfid' => '32', - 'format' => 'l, F j, Y - g:ia', - 'type' => 'long', - 'locked' => '1', -)) -->values(array( - 'dfid' => '33', - 'format' => 'l, j F Y - g:ia', - 'type' => 'long', - 'locked' => '1', -)) -->values(array( - 'dfid' => '34', - 'format' => 'l, Y, F j - g:ia', - 'type' => 'long', - 'locked' => '1', -)) -->values(array( - 'dfid' => '35', - 'format' => 'l, j. F Y - G:i', - 'type' => 'long', - 'locked' => '1', -)) -->execute(); -$connection->schema()->createTable('field_config', array( - 'fields' => array( - 'id' => array( - 'type' => 'serial', - 'not null' => TRUE, - 'size' => 'normal', - ), - 'field_name' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '32', - ), - 'type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - ), - 'module' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'active' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'storage_type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - ), - 'storage_module' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'storage_active' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'locked' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'data' => array( - 'type' => 'blob', - 'not null' => TRUE, - 'size' => 'big', - ), - 'cardinality' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'translatable' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'deleted' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - ), - 'primary key' => array( - 'id', - ), - 'indexes' => array( - 'field_name' => array( - 'field_name', - ), - 'active' => array( - 'active', - ), - 'storage_active' => array( - 'storage_active', - ), - 'deleted' => array( - 'deleted', - ), - 'module' => array( - 'module', - ), - 'storage_module' => array( - 'storage_module', - ), - 'type' => array( - 'type', - ), - 'storage_type' => array( - 'storage_type', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->insert('field_config') -->fields(array( - 'id', - 'field_name', - 'type', - 'module', - 'active', - 'storage_type', - 'storage_module', - 'storage_active', - 'locked', - 'data', - 'cardinality', - 'translatable', - 'deleted', -)) -->values(array( - 'id' => '1', - 'field_name' => 'comment_body', - 'type' => 'text_long', - 'module' => 'text', - 'active' => '1', - 'storage_type' => 'field_sql_storage', - 'storage_module' => 'field_sql_storage', - 'storage_active' => '1', - 'locked' => '0', - 'data' => 'a:6:{s:12:"entity_types";a:1:{i:0;s:7:"comment";}s:12:"translatable";b:0;s:8:"settings";a:0:{}s:7:"storage";a:4:{s:4:"type";s:17:"field_sql_storage";s:8:"settings";a:0:{}s:6:"module";s:17:"field_sql_storage";s:6:"active";i:1;}s:12:"foreign keys";a:1:{s:6:"format";a:2:{s:5:"table";s:13:"filter_format";s:7:"columns";a:1:{s:6:"format";s:6:"format";}}}s:7:"indexes";a:1:{s:6:"format";a:1:{i:0;s:6:"format";}}}', - 'cardinality' => '1', - 'translatable' => '0', - 'deleted' => '0', -)) -->values(array( - 'id' => '2', - 'field_name' => 'body', - 'type' => 'text_with_summary', - 'module' => 'text', - 'active' => '1', - 'storage_type' => 'field_sql_storage', - 'storage_module' => 'field_sql_storage', - 'storage_active' => '1', - 'locked' => '0', - 'data' => 'a:6:{s:12:"entity_types";a:1:{i:0;s:4:"node";}s:12:"translatable";b:0;s:8:"settings";a:0:{}s:7:"storage";a:4:{s:4:"type";s:17:"field_sql_storage";s:8:"settings";a:0:{}s:6:"module";s:17:"field_sql_storage";s:6:"active";i:1;}s:12:"foreign keys";a:1:{s:6:"format";a:2:{s:5:"table";s:13:"filter_format";s:7:"columns";a:1:{s:6:"format";s:6:"format";}}}s:7:"indexes";a:1:{s:6:"format";a:1:{i:0;s:6:"format";}}}', - 'cardinality' => '1', - 'translatable' => '0', - 'deleted' => '0', -)) -->values(array( - 'id' => '3', - 'field_name' => 'field_tags', - 'type' => 'taxonomy_term_reference', - 'module' => 'taxonomy', - 'active' => '1', - 'storage_type' => 'field_sql_storage', - 'storage_module' => 'field_sql_storage', - 'storage_active' => '1', - 'locked' => '0', - 'data' => 'a:6:{s:8:"settings";a:1:{s:14:"allowed_values";a:1:{i:0;a:2:{s:10:"vocabulary";s:4:"tags";s:6:"parent";i:0;}}}s:12:"entity_types";a:0:{}s:12:"translatable";b:0;s:7:"storage";a:4:{s:4:"type";s:17:"field_sql_storage";s:8:"settings";a:0:{}s:6:"module";s:17:"field_sql_storage";s:6:"active";i:1;}s:12:"foreign keys";a:1:{s:3:"tid";a:2:{s:5:"table";s:18:"taxonomy_term_data";s:7:"columns";a:1:{s:3:"tid";s:3:"tid";}}}s:7:"indexes";a:1:{s:3:"tid";a:1:{i:0;s:3:"tid";}}}', - 'cardinality' => '-1', - 'translatable' => '0', - 'deleted' => '0', -)) -->values(array( - 'id' => '4', - 'field_name' => 'field_image', - 'type' => 'image', - 'module' => 'image', - 'active' => '1', - 'storage_type' => 'field_sql_storage', - 'storage_module' => 'field_sql_storage', - 'storage_active' => '1', - 'locked' => '0', - 'data' => 'a:6:{s:7:"indexes";a:1:{s:3:"fid";a:1:{i:0;s:3:"fid";}}s:8:"settings";a:2:{s:10:"uri_scheme";s:6:"public";s:13:"default_image";b:0;}s:7:"storage";a:4:{s:4:"type";s:17:"field_sql_storage";s:8:"settings";a:0:{}s:6:"module";s:17:"field_sql_storage";s:6:"active";i:1;}s:12:"entity_types";a:0:{}s:12:"translatable";b:0;s:12:"foreign keys";a:1:{s:3:"fid";a:2:{s:5:"table";s:12:"file_managed";s:7:"columns";a:1:{s:3:"fid";s:3:"fid";}}}}', - 'cardinality' => '1', - 'translatable' => '0', - 'deleted' => '0', -)) -->values(array( - 'id' => '5', - 'field_name' => 'taxonomy_forums', - 'type' => 'taxonomy_term_reference', - 'module' => 'taxonomy', - 'active' => '1', - 'storage_type' => 'field_sql_storage', - 'storage_module' => 'field_sql_storage', - 'storage_active' => '1', - 'locked' => '0', - 'data' => 'a:6:{s:8:"settings";a:1:{s:14:"allowed_values";a:1:{i:0;a:2:{s:10:"vocabulary";s:6:"forums";s:6:"parent";i:0;}}}s:12:"entity_types";a:0:{}s:12:"translatable";b:0;s:7:"storage";a:4:{s:4:"type";s:17:"field_sql_storage";s:8:"settings";a:0:{}s:6:"module";s:17:"field_sql_storage";s:6:"active";i:1;}s:12:"foreign keys";a:1:{s:3:"tid";a:2:{s:5:"table";s:18:"taxonomy_term_data";s:7:"columns";a:1:{s:3:"tid";s:3:"tid";}}}s:7:"indexes";a:1:{s:3:"tid";a:1:{i:0;s:3:"tid";}}}', - 'cardinality' => '1', - 'translatable' => '0', - 'deleted' => '0', -)) -->execute(); -$connection->schema()->createTable('field_config_instance', array( - 'fields' => array( - 'id' => array( - 'type' => 'serial', - 'not null' => TRUE, - 'size' => 'normal', - ), - 'field_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - ), - 'field_name' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'entity_type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'bundle' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'data' => array( - 'type' => 'blob', - 'not null' => TRUE, - 'size' => 'big', - ), - 'deleted' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - ), - 'primary key' => array( - 'id', - ), - 'indexes' => array( - 'field_name_bundle' => array( - 'field_name', - 'entity_type', - 'bundle', - ), - 'deleted' => array( - 'deleted', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->insert('field_config_instance') -->fields(array( - 'id', - 'field_id', - 'field_name', - 'entity_type', - 'bundle', - 'data', - 'deleted', -)) -->values(array( - 'id' => '1', - 'field_id' => '1', - 'field_name' => 'comment_body', - 'entity_type' => 'comment', - 'bundle' => 'comment_node_page', - 'data' => 'a:6:{s:5:"label";s:7:"Comment";s:8:"settings";a:2:{s:15:"text_processing";i:1;s:18:"user_register_form";b:0;}s:8:"required";b:1;s:7:"display";a:1:{s:7:"default";a:5:{s:5:"label";s:6:"hidden";s:4:"type";s:12:"text_default";s:6:"weight";i:0;s:8:"settings";a:0:{}s:6:"module";s:4:"text";}}s:6:"widget";a:4:{s:4:"type";s:13:"text_textarea";s:8:"settings";a:1:{s:4:"rows";i:5;}s:6:"weight";i:0;s:6:"module";s:4:"text";}s:11:"description";s:0:"";}', - 'deleted' => '0', -)) -->values(array( - 'id' => '2', - 'field_id' => '2', - 'field_name' => 'body', - 'entity_type' => 'node', - 'bundle' => 'page', - 'data' => 'a:6:{s:5:"label";s:4:"Body";s:6:"widget";a:4:{s:4:"type";s:26:"text_textarea_with_summary";s:8:"settings";a:2:{s:4:"rows";i:20;s:12:"summary_rows";i:5;}s:6:"weight";i:-4;s:6:"module";s:4:"text";}s:8:"settings";a:3:{s:15:"display_summary";b:1;s:15:"text_processing";i:1;s:18:"user_register_form";b:0;}s:7:"display";a:2:{s:7:"default";a:5:{s:5:"label";s:6:"hidden";s:4:"type";s:12:"text_default";s:8:"settings";a:0:{}s:6:"module";s:4:"text";s:6:"weight";i:0;}s:6:"teaser";a:5:{s:5:"label";s:6:"hidden";s:4:"type";s:23:"text_summary_or_trimmed";s:8:"settings";a:1:{s:11:"trim_length";i:600;}s:6:"module";s:4:"text";s:6:"weight";i:0;}}s:8:"required";b:0;s:11:"description";s:0:"";}', - 'deleted' => '0', -)) -->values(array( - 'id' => '3', - 'field_id' => '1', - 'field_name' => 'comment_body', - 'entity_type' => 'comment', - 'bundle' => 'comment_node_article', - 'data' => 'a:6:{s:5:"label";s:7:"Comment";s:8:"settings";a:2:{s:15:"text_processing";i:1;s:18:"user_register_form";b:0;}s:8:"required";b:1;s:7:"display";a:1:{s:7:"default";a:5:{s:5:"label";s:6:"hidden";s:4:"type";s:12:"text_default";s:6:"weight";i:0;s:8:"settings";a:0:{}s:6:"module";s:4:"text";}}s:6:"widget";a:4:{s:4:"type";s:13:"text_textarea";s:8:"settings";a:1:{s:4:"rows";i:5;}s:6:"weight";i:0;s:6:"module";s:4:"text";}s:11:"description";s:0:"";}', - 'deleted' => '0', -)) -->values(array( - 'id' => '4', - 'field_id' => '2', - 'field_name' => 'body', - 'entity_type' => 'node', - 'bundle' => 'article', - 'data' => 'a:6:{s:5:"label";s:4:"Body";s:6:"widget";a:4:{s:4:"type";s:26:"text_textarea_with_summary";s:8:"settings";a:2:{s:4:"rows";i:20;s:12:"summary_rows";i:5;}s:6:"weight";i:-4;s:6:"module";s:4:"text";}s:8:"settings";a:3:{s:15:"display_summary";b:1;s:15:"text_processing";i:1;s:18:"user_register_form";b:0;}s:7:"display";a:2:{s:7:"default";a:5:{s:5:"label";s:6:"hidden";s:4:"type";s:12:"text_default";s:8:"settings";a:0:{}s:6:"module";s:4:"text";s:6:"weight";i:0;}s:6:"teaser";a:5:{s:5:"label";s:6:"hidden";s:4:"type";s:23:"text_summary_or_trimmed";s:8:"settings";a:1:{s:11:"trim_length";i:600;}s:6:"module";s:4:"text";s:6:"weight";i:0;}}s:8:"required";b:0;s:11:"description";s:0:"";}', - 'deleted' => '0', -)) -->values(array( - 'id' => '5', - 'field_id' => '3', - 'field_name' => 'field_tags', - 'entity_type' => 'node', - 'bundle' => 'article', - 'data' => 'a:6:{s:5:"label";s:4:"Tags";s:11:"description";s:63:"Enter a comma-separated list of words to describe your content.";s:6:"widget";a:4:{s:4:"type";s:21:"taxonomy_autocomplete";s:6:"weight";i:-4;s:8:"settings";a:2:{s:4:"size";i:60;s:17:"autocomplete_path";s:21:"taxonomy/autocomplete";}s:6:"module";s:8:"taxonomy";}s:7:"display";a:2:{s:7:"default";a:5:{s:4:"type";s:28:"taxonomy_term_reference_link";s:6:"weight";i:10;s:5:"label";s:5:"above";s:8:"settings";a:0:{}s:6:"module";s:8:"taxonomy";}s:6:"teaser";a:5:{s:4:"type";s:28:"taxonomy_term_reference_link";s:6:"weight";i:10;s:5:"label";s:5:"above";s:8:"settings";a:0:{}s:6:"module";s:8:"taxonomy";}}s:8:"settings";a:1:{s:18:"user_register_form";b:0;}s:8:"required";b:0;}', - 'deleted' => '0', -)) -->values(array( - 'id' => '6', - 'field_id' => '4', - 'field_name' => 'field_image', - 'entity_type' => 'node', - 'bundle' => 'article', - 'data' => 'a:6:{s:5:"label";s:5:"Image";s:11:"description";s:40:"Upload an image to go with this article.";s:8:"required";b:0;s:8:"settings";a:9:{s:14:"file_directory";s:31:"[date:custom:Y]-[date:custom:m]";s:15:"file_extensions";s:16:"png gif jpg jpeg";s:12:"max_filesize";s:0:"";s:14:"max_resolution";s:0:"";s:14:"min_resolution";s:0:"";s:9:"alt_field";b:1;s:11:"title_field";s:0:"";s:13:"default_image";i:0;s:18:"user_register_form";b:0;}s:6:"widget";a:4:{s:4:"type";s:11:"image_image";s:8:"settings";a:2:{s:18:"progress_indicator";s:8:"throbber";s:19:"preview_image_style";s:9:"thumbnail";}s:6:"weight";i:-1;s:6:"module";s:5:"image";}s:7:"display";a:2:{s:7:"default";a:5:{s:5:"label";s:6:"hidden";s:4:"type";s:5:"image";s:8:"settings";a:2:{s:11:"image_style";s:5:"large";s:10:"image_link";s:0:"";}s:6:"weight";i:-1;s:6:"module";s:5:"image";}s:6:"teaser";a:5:{s:5:"label";s:6:"hidden";s:4:"type";s:5:"image";s:8:"settings";a:2:{s:11:"image_style";s:6:"medium";s:10:"image_link";s:7:"content";}s:6:"weight";i:-1;s:6:"module";s:5:"image";}}}', - 'deleted' => '0', -)) -->values(array( - 'id' => '7', - 'field_id' => '5', - 'field_name' => 'taxonomy_forums', - 'entity_type' => 'node', - 'bundle' => 'forum', - 'data' => 'a:6:{s:5:"label";s:6:"Forums";s:8:"required";b:1;s:6:"widget";a:4:{s:4:"type";s:14:"options_select";s:8:"settings";a:0:{}s:6:"weight";i:0;s:6:"module";s:7:"options";}s:7:"display";a:2:{s:7:"default";a:5:{s:4:"type";s:28:"taxonomy_term_reference_link";s:6:"weight";i:10;s:5:"label";s:5:"above";s:8:"settings";a:0:{}s:6:"module";s:8:"taxonomy";}s:6:"teaser";a:5:{s:4:"type";s:28:"taxonomy_term_reference_link";s:6:"weight";i:10;s:5:"label";s:5:"above";s:8:"settings";a:0:{}s:6:"module";s:8:"taxonomy";}}s:8:"settings";a:1:{s:18:"user_register_form";b:0;}s:11:"description";s:0:"";}', - 'deleted' => '0', -)) -->values(array( - 'id' => '8', - 'field_id' => '1', - 'field_name' => 'comment_body', - 'entity_type' => 'comment', - 'bundle' => 'comment_node_forum', - 'data' => 'a:6:{s:5:"label";s:7:"Comment";s:8:"settings";a:2:{s:15:"text_processing";i:1;s:18:"user_register_form";b:0;}s:8:"required";b:1;s:7:"display";a:1:{s:7:"default";a:5:{s:5:"label";s:6:"hidden";s:4:"type";s:12:"text_default";s:6:"weight";i:0;s:8:"settings";a:0:{}s:6:"module";s:4:"text";}}s:6:"widget";a:4:{s:4:"type";s:13:"text_textarea";s:8:"settings";a:1:{s:4:"rows";i:5;}s:6:"weight";i:0;s:6:"module";s:4:"text";}s:11:"description";s:0:"";}', - 'deleted' => '0', -)) -->values(array( - 'id' => '9', - 'field_id' => '2', - 'field_name' => 'body', - 'entity_type' => 'node', - 'bundle' => 'forum', - 'data' => 'a:6:{s:5:"label";s:4:"Body";s:6:"widget";a:4:{s:4:"type";s:26:"text_textarea_with_summary";s:8:"settings";a:2:{s:4:"rows";i:20;s:12:"summary_rows";i:5;}s:6:"weight";i:1;s:6:"module";s:4:"text";}s:8:"settings";a:3:{s:15:"display_summary";b:1;s:15:"text_processing";i:1;s:18:"user_register_form";b:0;}s:7:"display";a:2:{s:7:"default";a:5:{s:5:"label";s:6:"hidden";s:4:"type";s:12:"text_default";s:8:"settings";a:0:{}s:6:"module";s:4:"text";s:6:"weight";i:11;}s:6:"teaser";a:5:{s:5:"label";s:6:"hidden";s:4:"type";s:23:"text_summary_or_trimmed";s:8:"settings";a:1:{s:11:"trim_length";i:600;}s:6:"module";s:4:"text";s:6:"weight";i:11;}}s:8:"required";b:0;s:11:"description";s:0:"";}', - 'deleted' => '0', -)) -->values(array( - 'id' => '10', - 'field_id' => '1', - 'field_name' => 'comment_body', - 'entity_type' => 'comment', - 'bundle' => 'comment_node_blog', - 'data' => 'a:6:{s:5:"label";s:7:"Comment";s:8:"settings";a:2:{s:15:"text_processing";i:1;s:18:"user_register_form";b:0;}s:8:"required";b:1;s:7:"display";a:1:{s:7:"default";a:5:{s:5:"label";s:6:"hidden";s:4:"type";s:12:"text_default";s:6:"weight";i:0;s:8:"settings";a:0:{}s:6:"module";s:4:"text";}}s:6:"widget";a:4:{s:4:"type";s:13:"text_textarea";s:8:"settings";a:1:{s:4:"rows";i:5;}s:6:"weight";i:0;s:6:"module";s:4:"text";}s:11:"description";s:0:"";}', - 'deleted' => '0', -)) -->values(array( - 'id' => '11', - 'field_id' => '2', - 'field_name' => 'body', - 'entity_type' => 'node', - 'bundle' => 'blog', - 'data' => 'a:6:{s:5:"label";s:4:"Body";s:6:"widget";a:4:{s:4:"type";s:26:"text_textarea_with_summary";s:8:"settings";a:2:{s:4:"rows";i:20;s:12:"summary_rows";i:5;}s:6:"weight";i:-4;s:6:"module";s:4:"text";}s:8:"settings";a:3:{s:15:"display_summary";b:1;s:15:"text_processing";i:1;s:18:"user_register_form";b:0;}s:7:"display";a:2:{s:7:"default";a:5:{s:5:"label";s:6:"hidden";s:4:"type";s:12:"text_default";s:8:"settings";a:0:{}s:6:"module";s:4:"text";s:6:"weight";i:0;}s:6:"teaser";a:5:{s:5:"label";s:6:"hidden";s:4:"type";s:23:"text_summary_or_trimmed";s:8:"settings";a:1:{s:11:"trim_length";i:600;}s:6:"module";s:4:"text";s:6:"weight";i:0;}}s:8:"required";b:0;s:11:"description";s:0:"";}', - 'deleted' => '0', -)) -->execute(); -$connection->schema()->createTable('field_data_body', array( - 'fields' => array( - 'entity_type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'bundle' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'deleted' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'entity_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'language' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'delta' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'body_value' => array( - 'type' => 'text', - 'not null' => FALSE, - 'size' => 'big', - ), - 'body_summary' => array( - 'type' => 'text', - 'not null' => FALSE, - 'size' => 'big', - ), - 'body_format' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '255', - ), - ), - 'primary key' => array( - 'entity_type', - 'entity_id', - 'deleted', - 'delta', - 'language', - ), - 'indexes' => array( - 'entity_type' => array( - 'entity_type', - ), - 'bundle' => array( - 'bundle', - ), - 'deleted' => array( - 'deleted', - ), - 'entity_id' => array( - 'entity_id', - ), - 'revision_id' => array( - 'revision_id', - ), - 'language' => array( - 'language', - ), - 'body_format' => array( - 'body_format', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('field_data_comment_body', array( - 'fields' => array( - 'entity_type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'bundle' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'deleted' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'entity_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'language' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'delta' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'comment_body_value' => array( - 'type' => 'text', - 'not null' => FALSE, - 'size' => 'big', - ), - 'comment_body_format' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '255', - ), - ), - 'primary key' => array( - 'entity_type', - 'entity_id', - 'deleted', - 'delta', - 'language', - ), - 'indexes' => array( - 'entity_type' => array( - 'entity_type', - ), - 'bundle' => array( - 'bundle', - ), - 'deleted' => array( - 'deleted', - ), - 'entity_id' => array( - 'entity_id', - ), - 'revision_id' => array( - 'revision_id', - ), - 'language' => array( - 'language', - ), - 'comment_body_format' => array( - 'comment_body_format', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('field_data_field_image', array( - 'fields' => array( - 'entity_type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'bundle' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'deleted' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'entity_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'language' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'delta' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_image_fid' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_image_alt' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '512', - ), - 'field_image_title' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '1024', - ), - 'field_image_width' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_image_height' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - ), - 'primary key' => array( - 'entity_type', - 'entity_id', - 'deleted', - 'delta', - 'language', - ), - 'indexes' => array( - 'entity_type' => array( - 'entity_type', - ), - 'bundle' => array( - 'bundle', - ), - 'deleted' => array( - 'deleted', - ), - 'entity_id' => array( - 'entity_id', - ), - 'revision_id' => array( - 'revision_id', - ), - 'language' => array( - 'language', - ), - 'field_image_fid' => array( - 'field_image_fid', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('field_data_field_tags', array( - 'fields' => array( - 'entity_type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'bundle' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'deleted' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'entity_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'language' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'delta' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_tags_tid' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - ), - 'primary key' => array( - 'entity_type', - 'entity_id', - 'deleted', - 'delta', - 'language', - ), - 'indexes' => array( - 'entity_type' => array( - 'entity_type', - ), - 'bundle' => array( - 'bundle', - ), - 'deleted' => array( - 'deleted', - ), - 'entity_id' => array( - 'entity_id', - ), - 'revision_id' => array( - 'revision_id', - ), - 'language' => array( - 'language', - ), - 'field_tags_tid' => array( - 'field_tags_tid', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('field_data_taxonomy_forums', array( - 'fields' => array( - 'entity_type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'bundle' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'deleted' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'entity_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'language' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'delta' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'taxonomy_forums_tid' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - ), - 'primary key' => array( - 'entity_type', - 'entity_id', - 'deleted', - 'delta', - 'language', - ), - 'indexes' => array( - 'entity_type' => array( - 'entity_type', - ), - 'bundle' => array( - 'bundle', - ), - 'deleted' => array( - 'deleted', - ), - 'entity_id' => array( - 'entity_id', - ), - 'revision_id' => array( - 'revision_id', - ), - 'language' => array( - 'language', - ), - 'taxonomy_forums_tid' => array( - 'taxonomy_forums_tid', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('field_revision_body', array( - 'fields' => array( - 'entity_type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'bundle' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'deleted' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'entity_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'language' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'delta' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'body_value' => array( - 'type' => 'text', - 'not null' => FALSE, - 'size' => 'big', - ), - 'body_summary' => array( - 'type' => 'text', - 'not null' => FALSE, - 'size' => 'big', - ), - 'body_format' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '255', - ), - ), - 'primary key' => array( - 'entity_type', - 'entity_id', - 'revision_id', - 'deleted', - 'delta', - 'language', - ), - 'indexes' => array( - 'entity_type' => array( - 'entity_type', - ), - 'bundle' => array( - 'bundle', - ), - 'deleted' => array( - 'deleted', - ), - 'entity_id' => array( - 'entity_id', - ), - 'revision_id' => array( - 'revision_id', - ), - 'language' => array( - 'language', - ), - 'body_format' => array( - 'body_format', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('field_revision_comment_body', array( - 'fields' => array( - 'entity_type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'bundle' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'deleted' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'entity_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'language' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'delta' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'comment_body_value' => array( - 'type' => 'text', - 'not null' => FALSE, - 'size' => 'big', - ), - 'comment_body_format' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '255', - ), - ), - 'primary key' => array( - 'entity_type', - 'entity_id', - 'revision_id', - 'deleted', - 'delta', - 'language', - ), - 'indexes' => array( - 'entity_type' => array( - 'entity_type', - ), - 'bundle' => array( - 'bundle', - ), - 'deleted' => array( - 'deleted', - ), - 'entity_id' => array( - 'entity_id', - ), - 'revision_id' => array( - 'revision_id', - ), - 'language' => array( - 'language', - ), - 'comment_body_format' => array( - 'comment_body_format', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('field_revision_field_image', array( - 'fields' => array( - 'entity_type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'bundle' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'deleted' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'entity_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'language' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'delta' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_image_fid' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_image_alt' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '512', - ), - 'field_image_title' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '1024', - ), - 'field_image_width' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_image_height' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - ), - 'primary key' => array( - 'entity_type', - 'entity_id', - 'revision_id', - 'deleted', - 'delta', - 'language', - ), - 'indexes' => array( - 'entity_type' => array( - 'entity_type', - ), - 'bundle' => array( - 'bundle', - ), - 'deleted' => array( - 'deleted', - ), - 'entity_id' => array( - 'entity_id', - ), - 'revision_id' => array( - 'revision_id', - ), - 'language' => array( - 'language', - ), - 'field_image_fid' => array( - 'field_image_fid', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('field_revision_field_tags', array( - 'fields' => array( - 'entity_type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'bundle' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'deleted' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'entity_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'language' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'delta' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_tags_tid' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - ), - 'primary key' => array( - 'entity_type', - 'entity_id', - 'revision_id', - 'deleted', - 'delta', - 'language', - ), - 'indexes' => array( - 'entity_type' => array( - 'entity_type', - ), - 'bundle' => array( - 'bundle', - ), - 'deleted' => array( - 'deleted', - ), - 'entity_id' => array( - 'entity_id', - ), - 'revision_id' => array( - 'revision_id', - ), - 'language' => array( - 'language', - ), - 'field_tags_tid' => array( - 'field_tags_tid', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('field_revision_taxonomy_forums', array( - 'fields' => array( - 'entity_type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'bundle' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'deleted' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'entity_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'language' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'delta' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'taxonomy_forums_tid' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - ), - 'primary key' => array( - 'entity_type', - 'entity_id', - 'revision_id', - 'deleted', - 'delta', - 'language', - ), - 'indexes' => array( - 'entity_type' => array( - 'entity_type', - ), - 'bundle' => array( - 'bundle', - ), - 'deleted' => array( - 'deleted', - ), - 'entity_id' => array( - 'entity_id', - ), - 'revision_id' => array( - 'revision_id', - ), - 'language' => array( - 'language', - ), - 'taxonomy_forums_tid' => array( - 'taxonomy_forums_tid', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('file_managed', array( - 'fields' => array( - 'fid' => array( - 'type' => 'serial', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'uid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - 'unsigned' => TRUE, - ), - 'filename' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'uri' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - 'binary' => TRUE, - ), - 'filemime' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'filesize' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'big', - 'default' => '0', - 'unsigned' => TRUE, - ), - 'status' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'timestamp' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - 'unsigned' => TRUE, - ), - ), - 'primary key' => array( - 'fid', - ), - 'unique keys' => array( - 'uri' => array( - 'uri', - ), - ), - 'indexes' => array( - 'uid' => array( - 'uid', - ), - 'status' => array( - 'status', - ), - 'timestamp' => array( - 'timestamp', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('file_usage', array( - 'fields' => array( - 'fid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'module' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '64', - 'default' => '', - ), - 'id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - 'unsigned' => TRUE, - ), - 'count' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - 'unsigned' => TRUE, - ), - ), - 'primary key' => array( - 'fid', - 'type', - 'id', - 'module', - ), - 'indexes' => array( - 'type_id' => array( - 'type', - 'id', - ), - 'fid_count' => array( - 'fid', - 'count', - ), - 'fid_module' => array( - 'fid', - 'module', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('filter', array( - 'fields' => array( - 'format' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - ), - 'module' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '64', - 'default' => '', - ), - 'name' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'weight' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'status' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'settings' => array( - 'type' => 'blob', - 'not null' => FALSE, - 'size' => 'big', - ), - ), - 'primary key' => array( - 'format', - 'name', - ), - 'indexes' => array( - 'list' => array( - 'weight', - 'module', - 'name', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->insert('filter') -->fields(array( - 'format', - 'module', - 'name', - 'weight', - 'status', - 'settings', -)) -->values(array( - 'format' => 'filtered_html', - 'module' => 'filter', - 'name' => 'filter_autop', - 'weight' => '2', - 'status' => '1', - 'settings' => 'a:0:{}', -)) -->values(array( - 'format' => 'filtered_html', - 'module' => 'filter', - 'name' => 'filter_html', - 'weight' => '1', - 'status' => '1', - 'settings' => 'a:3:{s:12:"allowed_html";s:74:"