addListener('civi.setupui.boot', function (\Civi\Setup\UI\Event\UIBootEvent $e) { \Civi\Setup::log()->info(sprintf('[%s] Register blocks', basename(__FILE__))); /** * @var \Civi\Setup\UI\SetupController $ctrl */ $ctrl = $e->getCtrl(); $ctrl->blocks['sample-data'] = array( 'is_active' => TRUE, 'file' => __DIR__ . DIRECTORY_SEPARATOR . 'sample-data.tpl.php', 'class' => 'if-no-errors', 'weight' => 40, ); if ($e->getMethod() === 'POST') { $e->getModel()->loadGenerated = !empty($e->getField('loadGenerated')); } }, \Civi\Setup::PRIORITY_PREPARE);