public function BlazyAdminExtended::closingForm in Blazy 7
Returns shared ending form elements across field formatter and Views.
Overrides BlazyAdminBase::closingForm
File
- src/
Form/ BlazyAdminExtended.php, line 139
Class
- BlazyAdminExtended
- Provides re-usable admin functions, or form elements.
Namespace
Drupal\blazy\FormCode
public function closingForm(array &$form, $definition = []) {
if (!empty($definition['caches'])) {
$form['cache'] = [
'#type' => 'select',
'#title' => t('Cache'),
'#options' => $this
->getCacheOptions(),
'#weight' => 98,
'#enforced' => TRUE,
'#description' => t('Ditch all the logic to cached bare HTML. <ol><li><strong>Permanent</strong>: cached contents will persist (be displayed) till the next cron runs.</li><li><strong>Any number</strong>: expired by the selected expiration time, and fresh contents are fetched till the next cache rebuilt.</li></ol>A working cron job is required to clear stale cache. At any rate, cached contents will be refreshed regardless of the expiration time after the cron hits. <br />Leave it empty to disable caching.<br /><strong>Warning!</strong> Be sure no useless/ sensitive data such as Edit links as they are rendered as is regardless permissions. No permissions are changed, just ugly. Only enable it when all is done, otherwise cached options will be displayed while changing them.'),
];
if (!empty($definition['_views'])) {
$form['cache']['#description'] .= ' ' . t('Also disable Views cache (<strong>Advanced > Caching</strong>) temporarily _only if trouble to see updated settings.');
}
}
parent::closingForm($form, $definition);
}