HEX
Server: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips
System: Linux WORDPRESS 3.10.0-1160.118.1.el7.x86_64 #1 SMP Thu Apr 4 03:33:23 EDT 2024 x86_64
User: digital (1020)
PHP: 7.2.24
Disabled: NONE
Upload Files
File: /datos/www/fabricas.colombiatrade.com.co/web_https/modules/contrib/panels/panels.install
<?php

/**
 * @file
 * Contains update functions for Page Manager.
 */

/**
 * Implements hook_requirements().
 *
 * @todo: Remove this when https://www.drupal.org/node/2641658 is fixed.
 */
function panels_requirements($phase) {
  $requirements = [];

  // Check that core actually is >= 8.3.0
  if (!version_compare(\Drupal::VERSION, '8.3', '>=')) {
    $requirements['panels_core_version'] = [
      'title' => t('Panels Drupal core version'),
      'value' => \Drupal::VERSION,
      'description' => t('Panels requires at least Drupal core 8.3.'),
      'severity' => REQUIREMENT_ERROR,
    ];
  }

  return $requirements;
}

/**
 * Helper function for updating panels created layouts to layout discovery
 */
function panels_convert_plugin_ids_to_layout_discovery($layout_id) {
  // For layouts we know about, return what the new ID should be.
  // If we don't recognize the layout ID, return false to not update the config.
  switch($layout_id) {
    case 'onecol':
      return 'layout_onecol';
    case 'threecol_25_50_25':
      return 'layout_threecol_25_50_25';
    case 'threecol_25_50_25_stacked':
      return 'layout_threecol_25_50_25';
    case 'threecol_33_34_33':
      return 'layout_threecol_33_34_33';
    case 'threecol_33_34_33_stacked':
      return 'layout_threecol_33_34_33';
    case 'twocol':
      return 'layout_twocol';
    case 'twocol_bricks':
      return 'layout_twocol_bricks';
    case 'twocol_stacked':
      return 'layout_twocol';
    default:
      return FALSE;
  }
}

/**
 * Uninstalls Layout plugin, then enables Layout Discovery.
 */
function panels_update_8401() {
  if (\Drupal::moduleHandler()->moduleExists('layout_plugin')) {
    \Drupal::service('module_installer')->uninstall(['layout_plugin'], FALSE);
    \Drupal::service('module_installer')->install(['layout_discovery'], FALSE);
  }
}