2 if (!defined('CIVI_SETUP')) {
3 exit("Installation plugins must only be loaded by the installer.\n");
6 \Civi\Setup
::dispatcher()
7 ->addListener('civi.setupui.boot', function (\Civi\Setup\UI\Event\UIBootEvent
$e) {
8 \Civi\Setup
::log()->info(sprintf('[%s] Register blocks', basename(__FILE__
)));
11 * @var \Civi\Setup\UI\SetupController $ctrl
13 $ctrl = $e->getCtrl();
15 $ctrl->blocks
['components'] = array(
17 'file' => __DIR__
. DIRECTORY_SEPARATOR
. 'components.tpl.php',
18 'class' => 'if-no-errors',
20 'component_labels' => array(
21 'CiviContribute' => ts('Accept donations and payments'),
22 'CiviEvent' => ts('Accept event registrations'),
23 'CiviMail' => ts('Send email blasts and newsletters'),
24 'CiviMember' => ts('Manage recurring memberships'),
25 'CiviCase' => ts('Track case histories'),
26 'CiviPledge' => ts('Accept pledges'),
27 'CiviReport' => ts('Generate reports'),
28 'CiviCampaign' => ts('Organize campaigns, surveys, and petitions'),
29 'CiviGrant' => ts('Receive grant applications'),
33 if ($e->getMethod() === 'POST' ||
is_array($e->getField('components'))) {
34 $e->getModel()->components
= array_keys($e->getField('components'));
37 }, \Civi\Setup
::PRIORITY_PREPARE
);