本文整理汇总了PHP中CRM_Admin_Form_Setting::commonProcess方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Admin_Form_Setting::commonProcess方法的具体用法?PHP CRM_Admin_Form_Setting::commonProcess怎么用?PHP CRM_Admin_Form_Setting::commonProcess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Admin_Form_Setting
的用法示例。
在下文中一共展示了CRM_Admin_Form_Setting::commonProcess方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postProcess
public function postProcess()
{
$values = $this->exportValues();
//cache contact fields retaining localized titles
//though we changed localization, so reseting cache.
CRM_Core_BAO_Cache::deleteGroup('contact fields');
//CRM-8559, cache navigation do not respect locale if it is changed, so reseting cache.
CRM_Core_BAO_Cache::deleteGroup('navigation');
// we do this only to initialize monetary decimal point and thousand separator
$config = CRM_Core_Config::singleton();
// save enabled currencies and defaul currency in option group 'currencies_enabled'
// CRM-1496
if (empty($values['currencyLimit'])) {
$values['currencyLimit'] = array($values['defaultCurrency']);
} elseif (!in_array($values['defaultCurrency'], $values['currencyLimit'])) {
$values['currencyLimit'][] = $values['defaultCurrency'];
}
// sort so that when we display drop down, weights have right value
sort($values['currencyLimit']);
// get labels for all the currencies
$options = array();
$currencySymbols = self::getCurrencySymbols();
for ($i = 0; $i < count($values['currencyLimit']); $i++) {
$options[] = array('label' => $currencySymbols[$values['currencyLimit'][$i]], 'value' => $values['currencyLimit'][$i], 'weight' => $i + 1, 'is_active' => 1, 'is_default' => $values['currencyLimit'][$i] == $values['defaultCurrency']);
}
$dontCare = NULL;
CRM_Core_OptionGroup::createAssoc('currencies_enabled', $options, $dontCare);
// unset currencyLimit so we dont store there
unset($values['currencyLimit']);
// make the site multi-lang if requested
if (!empty($values['makeMultilingual'])) {
CRM_Core_I18n_Schema::makeMultilingual($values['lcMessages']);
$values['languageLimit'][$values['lcMessages']] = 1;
// make the site single-lang if requested
} elseif (!empty($values['makeSinglelingual'])) {
CRM_Core_I18n_Schema::makeSinglelingual($values['lcMessages']);
$values['languageLimit'] = '';
}
// add a new db locale if the requested language is not yet supported by the db
if (!CRM_Utils_Array::value('makeSinglelingual', $values) and CRM_Utils_Array::value('addLanguage', $values)) {
$domain = new CRM_Core_DAO_Domain();
$domain->find(TRUE);
if (!substr_count($domain->locales, $values['addLanguage'])) {
CRM_Core_I18n_Schema::addLocale($values['addLanguage'], $values['lcMessages']);
}
$values['languageLimit'][$values['addLanguage']] = 1;
}
// if we manipulated the language list, return to the localization admin screen
$return = (bool) (CRM_Utils_Array::value('makeMultilingual', $values) or CRM_Utils_Array::value('addLanguage', $values));
$filteredValues = $values;
unset($filteredValues['makeMultilingual']);
unset($filteredValues['makeSinglelingual']);
unset($filteredValues['addLanguage']);
unset($filteredValues['languageLimit']);
Civi::settings()->set('languageLimit', CRM_Utils_Array::value('languageLimit', $values));
// save all the settings
parent::commonProcess($filteredValues);
if ($return) {
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/setting/localization', 'reset=1'));
}
}
示例2: postProcess
public function postProcess()
{
$params = $this->controller->exportValues($this->_name);
parent::commonProcess($params);
// reset navigation when components are enabled / disabled
CRM_Core_BAO_Navigation::resetNavigation();
}
示例3: postProcess
public function postProcess()
{
$params = $this->controller->exportValues($this->_name);
$params['enableComponentIDs'] = array();
foreach ($params['enableComponents'] as $name) {
$params['enableComponentIDs'][] = $this->_components[$name]->componentID;
}
parent::commonProcess($params);
// reset navigation when components are enabled / disabled
require_once 'CRM/Core/BAO/Navigation.php';
CRM_Core_BAO_Navigation::resetNavigation();
}
示例4: postProcess
function postProcess()
{
// redirect to admin page after saving
$session =& CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url('civicrm/admin'));
$params = $this->controller->exportValues($this->_name);
//CRM-5679
foreach ($params as $name => &$val) {
if ($val && in_array($name, array('newBaseURL', 'newBaseDir', 'newSiteName'))) {
$val = CRM_Utils_File::addTrailingSlash($val);
}
}
$from = array($this->_oldBaseURL, $this->_oldBaseDir);
$to = array(trim($params['newBaseURL']), trim($params['newBaseDir']));
if ($this->_oldSiteName && $params['newSiteName']) {
$from[] = $this->_oldSiteName;
$to[] = $params['newSiteName'];
}
$newValues = str_replace($from, $to, $this->_defaults);
parent::commonProcess($newValues);
parent::rebuildMenu();
}
示例5: postProcess
public function postProcess()
{
$params = $this->controller->exportValues($this->_name);
CRM_Case_Info::onToggleComponents($this->_defaults['enableComponents'], $params['enableComponents'], NULL);
parent::commonProcess($params);
// reset navigation when components are enabled / disabled
CRM_Core_BAO_Navigation::resetNavigation();
}
示例6: postProcess
function postProcess()
{
if (!empty($_POST['_qf_UpdateConfigBackend_next_cleanup'])) {
$config = CRM_Core_Config::singleton();
// cleanup templates_c directory
$config->cleanup(1, FALSE);
// clear db caching
CRM_Core_Config::clearDBCache();
parent::rebuildMenu();
CRM_Core_BAO_WordReplacement::rebuild();
CRM_Core_Session::setStatus(ts('Cache has been cleared and menu has been rebuilt successfully.'), ts("Success"), "success");
return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/setting/updateConfigBackend', 'reset=1'));
}
// redirect to admin page after saving
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url('civicrm/admin'));
$params = $this->controller->exportValues($this->_name);
//CRM-5679
foreach ($params as $name => &$val) {
if ($val && in_array($name, array('newBaseURL', 'newBaseDir', 'newSiteName'))) {
$val = CRM_Utils_File::addTrailingSlash($val);
}
}
$from = array($this->_oldBaseURL, $this->_oldBaseDir);
$to = array(trim($params['newBaseURL']), trim($params['newBaseDir']));
if ($this->_oldSiteName && $params['newSiteName']) {
$from[] = $this->_oldSiteName;
$to[] = $params['newSiteName'];
}
$newValues = str_replace($from, $to, $this->_defaults);
parent::commonProcess($newValues);
parent::rebuildMenu();
}
示例7: postProcess
public function postProcess()
{
$values = $this->exportValues();
// make the site multi-lang if requested
if (CRM_Utils_Array::value('makeMultilingual', $values)) {
require_once 'CRM/Core/I18n/Schema.php';
CRM_Core_I18n_Schema::makeMultilingual($values['lcMessages']);
$values['languageLimit'][$values['lcMessages']] = 1;
// make the site single-lang if requested
} elseif (CRM_Utils_Array::value('makeSinglelingual', $values)) {
require_once 'CRM/Core/I18n/Schema.php';
CRM_Core_I18n_Schema::makeSinglelingual($values['lcMessages']);
}
// add a new db locale if the requested language is not yet supported by the db
if (!CRM_Utils_Array::value('makeSinglelingual', $values) and CRM_Utils_Array::value('addLanguage', $values)) {
require_once 'CRM/Core/DAO/Domain.php';
$domain =& new CRM_Core_DAO_Domain();
$domain->find(true);
if (!substr_count($domain->locales, $values['addLanguage'])) {
require_once 'CRM/Core/I18n/Schema.php';
CRM_Core_I18n_Schema::addLocale($values['addLanguage'], $values['lcMessages']);
}
$values['languageLimit'][$values['addLanguage']] = 1;
}
// if we manipulated the language list, return to the localization admin screen
$return = (bool) (CRM_Utils_Array::value('makeMultilingual', $values) or CRM_Utils_Array::value('addLanguage', $values) or CRM_Utils_Array::value('makeSinglelingual', $values));
//cache contact fields retaining localized titles
//though we changed localization, so reseting cache.
require_once 'CRM/Core/BAO/Cache.php';
CRM_Core_BAO_Cache::deleteGroup('contact fields');
// we do this only to initialize monetary decimal point and thousand separator
$config =& CRM_Core_Config::singleton();
if ($monetaryPointSeparator = $config->defaultMonetaryPointSeparator($values['lcMonetary'])) {
$values['monetaryDecimalPoint'] = CRM_Utils_Array::value('decimal_point', $monetaryPointSeparator);
$values['monetaryThousandSeparator'] = CRM_Utils_Array::value('thousands_sep', $monetaryPointSeparator);
}
// save all the settings
parent::commonProcess($values);
if ($return) {
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/setting/localization', 'reset=1'));
}
}
示例8: postProcess
function postProcess()
{
// redirect to admin page after saving
$session =& CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url('civicrm/admin'));
$params = $this->controller->exportValues($this->_name);
$newValues = str_replace(array($this->_oldBaseURL, $this->_oldBaseDir), array(trim($params['newBaseURL']), trim($params['newBaseDir'])), $this->_defaults);
parent::commonProcess($newValues);
parent::rebuildMenu();
}
示例9: postProcess
public function postProcess()
{
$params = $this->controller->exportValues($this->_name);
$params['enableComponentIDs'] = array();
foreach ($params['enableComponents'] as $name) {
$params['enableComponentIDs'][] = $this->_components[$name]->componentID;
}
// if CiviCase is being enabled,
// load the case related sample data
if (in_array('CiviCase', $params['enableComponents']) && !in_array('CiviCase', $this->_defaults['enableComponents'])) {
$config = CRM_Core_Config::singleton();
CRM_Admin_Form_Setting_Component::loadCaseSampleData($config->dsn, $config->sqlDir . 'case_sample.mysql');
CRM_Admin_Form_Setting_Component::loadCaseSampleData($config->dsn, $config->sqlDir . 'case_sample1.mysql');
if (!CRM_Case_BAO_Case::createCaseViews()) {
CRM_Core_Error::fatal('Could not create Case views.');
}
}
parent::commonProcess($params);
// reset navigation when components are enabled / disabled
CRM_Core_BAO_Navigation::resetNavigation();
}