popup_onload.install in Popup On Load 8
Same filename and directory in other branches
Install, update and uninstall functions for the Popup onload module.
File
popup_onload.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the Popup onload module.
*/
use Drupal\Core\Field\BaseFieldDefinition;
/**
* Implements hook_update_N().
*
* Add new baseField for path.
*/
function popup_onload_update_8001() {
$field_storage_definition = BaseFieldDefinition::create('string')
->setLabel(t('Display only at specified path'))
->setDescription(t('Specify page by using their path start with /. Leave empty to include all pages.'))
->setDefaultValue('')
->setDisplayOptions('form', array(
'type' => 'string_textfield',
'weight' => 12,
));
\Drupal::entityDefinitionUpdateManager()
->installFieldStorageDefinition('path', 'popup_onload', 'popup_onload', $field_storage_definition);
}
Functions
Name | Description |
---|---|
popup_onload_update_8001 | Implements hook_update_N(). |