You are here

function modal_page_update_8211 in Modal 8.2

Insert new Modal with Release Information.

File

./modal_page.install, line 17
Install, update and uninstall functions for the Modal Page.

Code

function modal_page_update_8211() {
  $title = t('Thank you for use Modal Page');
  $body = '<h2>' . t('Modals 4 is available with:') . '</h2>';
  $body .= '<ul>';
  $body .= '<li>' . t('Modal Page with config Entity;') . '</li>';
  $body .= '<li>' . t('Export / Import Modals;') . '</li>';
  $body .= '<li>' . t('drush config:export and drush config:import;') . '</li>';
  $body .= '<li>' . t('Multiple Modals in the same page;') . '</li>';
  $body .= '<li>' . t('Manage Modal Header and footer;') . '</li>';
  $body .= '<li>' . t('Modals 4.x is 100% retro-compatible with 8.x-2.x;') . '</li>';
  $body .= '<li>' . t('Just run update.php and enjoy.') . '</li>';
  $body .= '</ul><br>';

  // @codingStandardsIgnoreLine
  $body .= '<p>' . t('Upgrade and join us! If liked, please give us a') . ' <a href="https://www.drupal.org/project/modal_page" target="blank">' . t('star') . '</a> :)</p>';
  $type = 'page';
  $pages = '/admin/*';
  $modal = Modal::create([
    'title' => $title,
    'body' => $body,
    'type' => $type,
    'pages' => $pages,
    'roles' => [
      'administrator',
      'authenticated',
    ],
  ]);
  $modal
    ->save();
  \Drupal::service('cache.render')
    ->invalidateAll();
}