-
-
Notifications
You must be signed in to change notification settings - Fork 825
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16618 from totten/master-setup
dev/core#1615 - Import civicrm-setup
- Loading branch information
Showing
89 changed files
with
4,300 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
if (!defined('CIVI_SETUP')) { | ||
exit("Installation plugins must only be loaded by the installer.\n"); | ||
} | ||
|
||
\Civi\Setup::dispatcher() | ||
->addListener('civi.setupui.run', function (\Civi\Setup\UI\Event\UIBootEvent $e) { | ||
|
||
\Civi\Setup::log()->info(sprintf('[%s] Parse inputs', basename(__FILE__))); | ||
|
||
/** | ||
* @var \Civi\Setup\UI\SetupController $ctrl | ||
*/ | ||
$ctrl = $e->getCtrl(); | ||
$values = $e->getField('advanced', array()); | ||
|
||
$placeholderDb = 'mysql://USER:PASS@HOST/DB'; | ||
|
||
if (empty($values['db']) || $values['db'] === $placeholderDb) { | ||
$e->getModel()->extras['advanced']['db'] = $placeholderDb; | ||
} | ||
else { | ||
$e->getModel()->extras['advanced']['db'] = trim($values['db']); | ||
$e->getModel()->db = \Civi\Setup\DbUtil::parseDsn(trim($values['db'])); | ||
} | ||
|
||
}, \Civi\Setup::PRIORITY_LATE); | ||
|
||
\Civi\Setup::dispatcher() | ||
->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['advanced'] = array( | ||
'is_active' => TRUE, | ||
'file' => __DIR__ . DIRECTORY_SEPARATOR . 'advanced.tpl.php', | ||
'class' => '', | ||
'weight' => 60, | ||
); | ||
}, \Civi\Setup::PRIORITY_PREPARE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php if (!defined('CIVI_SETUP')): exit("Installation plugins must only be loaded by the installer.\n"); | ||
endif; ?> | ||
<h2 id="environment"><?php echo ts('Environment'); ?></h2> | ||
|
||
<p> | ||
<?php echo ts('The system settings were auto-detected. CiviCRM will be installed with:'); ?> | ||
</p> | ||
|
||
<div style=""> | ||
<table class="settingsTable"> | ||
<tbody> | ||
<tr> | ||
<th><?php echo ts('CMS Database'); ?></th> | ||
<td> | ||
<code><?php echo htmlentities('mysql://' . $model->cmsDb['username'] . ':HIDDEN@' . $model->cmsDb['server'] . '/' . $model->cmsDb['database']); ?></code> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th><?php echo ts('CiviCRM Database'); ?></th> | ||
<td class="advanced-db"> | ||
<div class="ro"> | ||
<code><?php echo htmlentities('mysql://' . $model->db['username'] . ':HIDDEN@' . $model->db['server'] . '/' . $model->db['database']); ?></code> | ||
<a href="" onclick="csj$('.advanced-db .ro').hide(); csj$('.advanced-db .rw').show(); return false;" title="<?php echo htmlentities(ts('Edit')) ?>"><i class="fa fa-pencil"></i></a> | ||
</div> | ||
<div class="rw" style="display: none;"> | ||
<div> | ||
|
||
<input type="text" name="civisetup[advanced][db]" value="<?php echo htmlentities($model->extras['advanced']['db']); ?>" data-original="<?php echo htmlentities($model->extras['advanced']['db']); ?>"> | ||
<input id="db_apply_button" type="submit" name="civisetup[action][Start]" value="<?php echo htmlentities(ts('Apply')); ?>" /> | ||
<a href="" onclick="civisetupAdvancedDbCancel(); return false;" title="<?php echo htmlentities(ts('Cancel')) ?>"><i class="fa fa-close"></i></a> | ||
<script type="text/javascript"> | ||
function civisetupAdvancedDbCancel() { | ||
csj$('.advanced-db .rw').hide(); | ||
csj$('.advanced-db .ro').show(); | ||
csj$('.advanced-db .rw input[type=text]').val(csj$('.advanced-db .rw input[type=text]').attr('data-original')); | ||
} | ||
</script> | ||
</div> | ||
<p><?php echo ts('By default, CiviCRM uses the same database as your website. You may install on a separate database if you need more fine-grained control over permissions, replication, hardware capacity, etc.'); ?></p> | ||
<p><?php echo ts('<strong>Example</strong>: <code>%1</code>', array(1 => 'mysql://admin:secret@localhost/civicrm')); ?></p> | ||
<p><?php echo ts('<strong>Example</strong>: <code>%1</code>', array(1 => 'mysql://admin:[email protected]:3306/otherdb')); ?></p> | ||
</div> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th><?php echo ts('CiviCRM Settings File'); ?></th> | ||
<td><code><?php echo htmlentities($model->settingsPath); ?></code></td> | ||
</tr> | ||
<tr> | ||
<th><?php echo ts('CiviCRM Source Code'); ?></th> | ||
<td><code><?php echo htmlentities($model->srcPath); ?></code></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<p class="tip"> | ||
<strong><?php echo ts('Tip'); ?></strong>: | ||
<?php echo ts('Need more advanced control? You may alternatively use the <a href="%1" target="%2">command-line installer</a>.', array(1 => 'https://github.com/civicrm/cv', 2 => '_blank')); ?> | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
if (!defined('CIVI_SETUP')) { | ||
exit("Installation plugins must only be loaded by the installer.\n"); | ||
} | ||
|
||
\Civi\Setup::dispatcher() | ||
->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['components'] = array( | ||
'is_active' => TRUE, | ||
'file' => __DIR__ . DIRECTORY_SEPARATOR . 'components.tpl.php', | ||
'class' => 'if-no-errors', | ||
'weight' => 50, | ||
'component_labels' => array( | ||
'CiviContribute' => ts('Accept donations and payments'), | ||
'CiviEvent' => ts('Accept event registrations'), | ||
'CiviMail' => ts('Send email blasts and newsletters'), | ||
'CiviMember' => ts('Manage recurring memberships'), | ||
'CiviCase' => ts('Track case histories'), | ||
'CiviPledge' => ts('Accept pledges'), | ||
'CiviReport' => ts('Generate reports'), | ||
'CiviCampaign' => ts('Organize campaigns, surveys, and petitions'), | ||
'CiviGrant' => ts('Receive grant applications'), | ||
), | ||
); | ||
|
||
if ($e->getMethod() === 'POST' || is_array($e->getField('components'))) { | ||
$e->getModel()->components = array_keys($e->getField('components')); | ||
} | ||
|
||
}, \Civi\Setup::PRIORITY_PREPARE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php if (!defined('CIVI_SETUP')): exit("Installation plugins must only be loaded by the installer.\n"); | ||
endif; ?> | ||
<h2 id="components"><?php echo ts('Components'); ?></h2> | ||
|
||
<div> | ||
<?php foreach ($model->getField('components', 'options') as $comp => $label): ?> | ||
<input class="comp-cb sr-only" style="display: none;" type="checkbox" name="civisetup[components][<?php echo $comp; ?>]" id="civisetup[components][<?php echo $comp; ?>]" <?php echo in_array($comp, $model->components) ? 'checked' : '' ?>> | ||
<label class="comp-box" for="civisetup[components][<?php echo $comp; ?>]"> | ||
<span class="comp-label"><?php echo $label; ?></span> | ||
<span class="comp-desc"><?php echo $_tpl_block['component_labels'][$comp] ?></span> | ||
</label> | ||
<?php endforeach; ?> | ||
</div> | ||
|
||
<p class="tip"> | ||
<strong><?php echo ts('Tip'); ?></strong>: | ||
<?php echo ts('Not sure? That\'s OK. After installing, you can enable and disable components at any time.'); ?> | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
if (!defined('CIVI_SETUP')) { | ||
exit("Installation plugins must only be loaded by the installer.\n"); | ||
} | ||
|
||
\Civi\Setup::dispatcher() | ||
->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['header'] = array( | ||
'is_active' => TRUE, | ||
'file' => __DIR__ . DIRECTORY_SEPARATOR . 'header.tpl.php', | ||
'class' => '', | ||
'weight' => 10, | ||
); | ||
}, \Civi\Setup::PRIORITY_PREPARE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php if (!defined('CIVI_SETUP')): exit("Installation plugins must only be loaded by the installer.\n"); | ||
endif; ?> | ||
<div class="civicrm-setup-header"> | ||
<div class="title"> | ||
<h1><?php echo ts("Thanks for choosing CiviCRM. You're nearly there!"); ?><hr></h1> | ||
</div> | ||
<div class="civicrm-logo"><strong><?php echo ts('Version %1', array(1 => "{$civicrm_version} {$model->cms}")); ?></strong> | ||
<span><img src=<?php echo $installURLPath . "updated-logo.jpg"?> /></span> | ||
</div> | ||
</div> | ||
<h2><?php echo ts("CiviCRM Installer"); ?></h2> | ||
|
||
<noscript> | ||
<p class="error"><?php echo ts("Error: Javascipt appears to be disabled. The CiviCRM web-based installer requires Javascript.");?></p> | ||
</noscript> | ||
|
||
<p><?php echo ts("Thanks for choosing CiviCRM! Please follow the instructions below to install CiviCRM."); ?></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
if (!defined('CIVI_SETUP')) { | ||
exit("Installation plugins must only be loaded by the installer.\n"); | ||
} | ||
|
||
\Civi\Setup::dispatcher() | ||
->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['install'] = array( | ||
'is_active' => TRUE, | ||
'file' => __DIR__ . DIRECTORY_SEPARATOR . 'install.tpl.php', | ||
'class' => 'if-no-errors', | ||
'weight' => 70, | ||
); | ||
}, \Civi\Setup::PRIORITY_PREPARE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php if (!defined('CIVI_SETUP')): exit("Installation plugins must only be loaded by the installer.\n"); | ||
endif; ?> | ||
<div class="action-box"> | ||
<input id="install_button" type="submit" name="civisetup[action][Install]" | ||
value="<?php echo htmlentities(ts('Install CiviCRM')); ?>" | ||
onclick="document.getElementById('saving_top').style.display = ''; this.value = '<?php echo ts('Installing CiviCRM...', array('escape' => 'js')); ?>'"/> | ||
<div id="saving_top" style="display: none;"> | ||
<img src="<?php echo htmlentities($installURLPath . "network-save.gif") ?>"/> | ||
<?php echo ts('(this will take a few minutes)'); ?> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
if (!defined('CIVI_SETUP')) { | ||
exit("Installation plugins must only be loaded by the installer.\n"); | ||
} | ||
|
||
\Civi\Setup::dispatcher() | ||
->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['l10n'] = array( | ||
'is_active' => TRUE, | ||
'file' => __DIR__ . DIRECTORY_SEPARATOR . 'l10n.tpl.php', | ||
'class' => 'if-no-errors', | ||
'weight' => 30, | ||
); | ||
}, \Civi\Setup::PRIORITY_PREPARE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php if (!defined('CIVI_SETUP')): exit("Installation plugins must only be loaded by the installer.\n"); | ||
endif; ?> | ||
<h2><?php echo ts('Localization'); ?></h2> | ||
|
||
<p><?php echo ts('CiviCRM has been translated to many languages, thanks to its community of translators. By selecting another language, the installer may be available in that language. The initial configuration of the basic data will also be set to that language (ex: individual prefixes, suffixes, activity types, etc.). <a href="%1" target="%2">Learn more about using CiviCRM in other languages.</a>', array(1 => 'http://wiki.civicrm.org/confluence/pages/viewpage.action?pageId=88408149', 2 => '_blank')); ?></p> | ||
|
||
<script> | ||
function civicrmInstallerSetLanguage(language) { | ||
var location = window.location.toString(); | ||
|
||
if (location.match(/lang=.._../)) { | ||
location = location.replace(/lang=.._../, 'lang=' + language); | ||
window.location = location; | ||
} | ||
else { | ||
window.location += (location.indexOf('?') < 0 ? '?' : '&') + 'lang=' + language; | ||
} | ||
} | ||
</script> | ||
|
||
<p style="margin-left: 2em" id="locale"> | ||
<label for="lang"><span><?php echo ts('Language of basic data:'); ?></span></label> | ||
<select id="lang" name="lang" onchange="civicrmInstallerSetLanguage(this.value);"> | ||
<?php | ||
foreach ($model->getField('lang', 'options') as $locale => $language): | ||
$selected = ($locale == $model->lang) ? 'selected="selected"' : ''; | ||
echo "<option value='$locale' $selected>$language</option>"; | ||
endforeach; | ||
?> | ||
</select> | ||
|
||
<span class="advancedTip"> | ||
<?php | ||
if (count($model->getField('lang', 'options')) < 2): | ||
echo "(download the civicrm-{$civicrm_version}-l10n.tar.gz file and unzip into CiviCRM’s directory to add languages here)"; | ||
endif; | ||
?> | ||
</span> | ||
</p> |
Oops, something went wrong.