本文整理汇总了PHP中Configurator::saveConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Configurator::saveConfig方法的具体用法?PHP Configurator::saveConfig怎么用?PHP Configurator::saveConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configurator
的用法示例。
在下文中一共展示了Configurator::saveConfig方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setLastRobin
function setLastRobin($lastRobin)
{
require_once 'modules/Configurator/Configurator.php';
$cfg = new Configurator();
$cfg->config['aop']['last_robin'] = $lastRobin;
$cfg->saveConfig();
}
示例2: install_aod
function install_aod()
{
require_once 'modules/Configurator/Configurator.php';
$cfg = new Configurator();
if (empty($cfg->config['aod'])) {
$cfg->config['aod'] = array('enable_aod' => true);
}
$cfg->saveConfig();
addAODSchedulers();
}
示例3: display
/**
* @see SugarView::display()
*/
public function display()
{
global $mod_strings, $app_strings;
$admin = Administration::getSettings();
require 'modules/Trackers/config.php';
///////////////////////////////////////////////////////////////////////////////
//// HANDLE CHANGES
if (isset($_POST['process'])) {
if ($_POST['process'] == 'true') {
foreach ($tracker_config as $entry) {
if (isset($entry['bean'])) {
//If checkbox is unchecked, we add the entry into the config table; otherwise delete it
if (empty($_POST[$entry['name']])) {
$admin->saveSetting('tracker', $entry['name'], 1);
} else {
$db = DBManagerFactory::getInstance();
$db->query("DELETE FROM config WHERE category = 'tracker' and name = '" . $entry['name'] . "'");
}
}
}
//foreach
//save the tracker prune interval
if (!empty($_POST['tracker_prune_interval'])) {
$admin->saveSetting('tracker', 'prune_interval', $_POST['tracker_prune_interval']);
}
//save log slow queries and slow query interval
$configurator = new Configurator();
$configurator->saveConfig();
}
//if
header('Location: index.php?module=Administration&action=index');
}
echo getClassicModuleTitle("Administration", array("<a href='index.php?module=Administration&action=index'>" . translate('LBL_MODULE_NAME', 'Administration') . "</a>", translate('LBL_TRACKER_SETTINGS', 'Administration')), false);
$trackerManager = TrackerManager::getInstance();
$disabledMonitors = $trackerManager->getDisabledMonitors();
$trackerEntries = array();
foreach ($tracker_config as $entry) {
if (isset($entry['bean'])) {
$disabled = !empty($disabledMonitors[$entry['name']]);
$trackerEntries[$entry['name']] = array('label' => $mod_strings['LBL_' . strtoupper($entry['name']) . '_DESC'], 'helpLabel' => $mod_strings['LBL_' . strtoupper($entry['name']) . '_HELP'], 'disabled' => $disabled);
}
}
$configurator = new Configurator();
$this->ss->assign('config', $configurator->config);
$config_strings = return_module_language($GLOBALS['current_language'], 'Configurator');
$mod_strings['LOG_SLOW_QUERIES'] = $config_strings['LOG_SLOW_QUERIES'];
$mod_strings['SLOW_QUERY_TIME_MSEC'] = $config_strings['SLOW_QUERY_TIME_MSEC'];
$this->ss->assign('mod', $mod_strings);
$this->ss->assign('app', $app_strings);
$this->ss->assign('trackerEntries', $trackerEntries);
$this->ss->assign('tracker_prune_interval', !empty($admin->settings['tracker_prune_interval']) ? $admin->settings['tracker_prune_interval'] : 30);
$this->ss->display('modules/Trackers/tpls/TrackerSettings.tpl');
}
示例4: store_api_key
public function store_api_key($api, $args)
{
if (!isset($args['api_key'])) {
return array('success' => 0, 'error_code' => '200', 'error_message' => 'No API Key was sent.');
}
$api_key = $args['api_key'];
$configuratorObj = new Configurator();
//Load config
$configuratorObj->loadConfig();
//Update the API setting
$configuratorObj->config['ClockworkSMSApiKey'] = $api_key;
//Save the new setting
$configuratorObj->saveConfig();
return array('success' => 1);
}
示例5: action_updatewirelessenabledmodules
public function action_updatewirelessenabledmodules()
{
require_once 'modules/Administration/Forms.php';
global $app_strings, $current_user, $moduleList;
if (!is_admin($current_user)) {
sugar_die($app_strings['ERR_NOT_ADMIN']);
}
require_once 'modules/Configurator/Configurator.php';
$configurator = new Configurator();
$configurator->saveConfig();
if (isset($_REQUEST['enabled_modules']) && !empty($_REQUEST['enabled_modules'])) {
$updated_enabled_modules = array();
foreach (explode(',', $_REQUEST['enabled_modules']) as $e) {
$updated_enabled_modules[$e] = array();
}
// transfer across any pre-existing definitions for the enabled modules from the current module registry
if (file_exists('include/MVC/Controller/wireless_module_registry.php')) {
require 'include/MVC/Controller/wireless_module_registry.php';
if (!empty($wireless_module_registry)) {
foreach ($updated_enabled_modules as $e => $def) {
if (isset($wireless_module_registry[$e])) {
$updated_enabled_modules[$e] = $wireless_module_registry[$e];
}
}
}
}
$filename = 'custom/include/MVC/Controller/wireless_module_registry.php';
mkdir_recursive(dirname($filename));
write_array_to_file('wireless_module_registry', $updated_enabled_modules, $filename);
foreach ($moduleList as $mod) {
sugar_cache_clear("CONTROLLER_wireless_module_registry_{$mod}");
}
//Users doesn't appear in the normal module list, but its value is cached on login.
sugar_cache_clear("CONTROLLER_wireless_module_registry_Users");
sugar_cache_reset();
}
echo "true";
}
示例6: getClassicModuleTitle
global $app_strings;
global $theme;
if (!is_admin($current_user)) {
sugar_die("Unauthorized access to administration.");
}
require_once 'modules/Configurator/Configurator.php';
echo getClassicModuleTitle("Administration", array("<a href='index.php?module=Administration&action=index'>" . translate('LBL_MODULE_NAME', 'Administration') . "</a>", $mod_strings['LBL_AOD_ADMIN_MANAGE_AOD']), false);
$cfg = new Configurator();
$sugar_smarty = new Sugar_Smarty();
$errors = array();
if (!array_key_exists('aod', $cfg->config)) {
$cfg->config['aod'] = array('enable_aod' => '');
}
if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'save') {
$cfg->config['aod']['enable_aod'] = !empty($_REQUEST['enable_aod']);
$cfg->saveConfig();
header('Location: index.php?module=Administration&action=index');
exit;
}
$sugar_smarty->assign('MOD', $mod_strings);
$sugar_smarty->assign('APP', $app_strings);
$sugar_smarty->assign('APP_LIST', $app_list_strings);
$sugar_smarty->assign('LANGUAGES', get_languages());
$sugar_smarty->assign("JAVASCRIPT", get_set_focus_js());
$sugar_smarty->assign('config', $cfg->config['aod']);
$sugar_smarty->assign('error', $errors);
$buttons = <<<EOQ
<input title="{$app_strings['LBL_SAVE_BUTTON_TITLE']}"
accessKey="{$app_strings['LBL_SAVE_BUTTON_KEY']}"
class="button primary"
type="submit"
示例7: Configurator
function action_saveconfig()
{
global $current_user;
if (!is_admin($current_user)) {
sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
}
$configurator = new Configurator();
if ($configurator->saveConfig() === false) {
$this->errors = ['company_logo' => $configurator->getError()];
$this->view = 'edit';
return;
}
$focus = new Administration();
$focus->saveConfig();
// Clear the Contacts file b/c portal flag affects rendering
if (file_exists($cachedfile = sugar_cached('modules/Contacts/EditView.tpl'))) {
unlink($cachedfile);
}
SugarApplication::redirect('index.php?module=Administration&action=index');
}
示例8: Configurator
function action_saveconfig()
{
global $current_user;
if (!is_admin($current_user)) {
sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
}
$configurator = new Configurator();
$focus = BeanFactory::getBean('Administration');
$focus->saveConfig();
$configurator->saveConfig();
// Clear the Contacts file b/c portal flag affects rendering
if (file_exists($cachedfile = sugar_cached('modules/Contacts/EditView.tpl'))) {
unlink($cachedfile);
}
echo '<script type="text/javascript">';
echo 'parent && parent.SUGAR && parent.SUGAR.App && parent.SUGAR.App.sync();';
echo 'window.location.href = "index.php?module=Administration&action=index";';
echo '</script>';
exit;
}
示例9: Configurator
foreach ($asterisk_config as $key => $value) {
if (!isset($sugar_config[$key])) {
$sugar_config[$key] = '';
$GLOBALS['sugar_config'][$key] = '';
}
}
$configurator = new Configurator();
$focus = new Administration();
if (!empty($_POST['save'])) {
//set defaults for saving
foreach ($asterisk_config as $key => $value) {
if (isset($_REQUEST[$key]) && $_REQUEST[$key] == '') {
$_REQUEST[$key] = $value;
}
}
$configurator->saveConfig();
$focus->saveConfig();
header('Location: index.php?module=Administration&action=index');
}
$focus->retrieveSettings();
if (!empty($_POST['restore'])) {
$configurator->restoreConfig();
}
require_once 'include/Sugar_Smarty.php';
$sugar_smarty = new Sugar_Smarty();
$sugar_smarty->assign('MOD', $mod_strings);
$sugar_smarty->assign('APP', $app_strings);
$sugar_smarty->assign('APP_LIST', $app_list_strings);
$sugar_smarty->assign('config', $configurator->config);
$sugar_smarty->assign('asterisk_config', $asterisk_config);
$sugar_smarty->assign('error', $configurator->errors);
示例10: action_updatewirelessenabledmodules
public function action_updatewirelessenabledmodules()
{
require_once 'modules/Administration/Forms.php';
global $app_strings, $current_user, $moduleList;
if (!is_admin($current_user)) {
sugar_die($app_strings['ERR_NOT_ADMIN']);
}
require_once 'modules/Configurator/Configurator.php';
$configurator = new Configurator();
$configurator->saveConfig();
if (isset($_REQUEST['enabled_modules']) && !empty($_REQUEST['enabled_modules'])) {
$updated_enabled_modules = array();
$wireless_module_registry = array();
$file = 'include/MVC/Controller/wireless_module_registry.php';
if (SugarAutoLoader::fileExists($file)) {
require $file;
}
foreach (explode(',', $_REQUEST['enabled_modules']) as $moduleName) {
$moduleDef = array_key_exists($moduleName, $wireless_module_registry) ? $wireless_module_registry[$moduleName] : array();
$updated_enabled_modules[$moduleName] = $moduleDef;
}
$filename = create_custom_directory('include/MVC/Controller/wireless_module_registry.php');
mkdir_recursive(dirname($filename));
write_array_to_file('wireless_module_registry', $updated_enabled_modules, $filename);
foreach ($moduleList as $mod) {
sugar_cache_clear("CONTROLLER_wireless_module_registry_{$mod}");
}
//Users doesn't appear in the normal module list, but its value is cached on login.
sugar_cache_clear("CONTROLLER_wireless_module_registry_Users");
sugar_cache_reset();
// Bug 59121 - Clear the metadata cache for the mobile platform
MetaDataManager::refreshCache(array('mobile'));
}
echo "true";
}
示例11: Configurator
function action_saveconfig()
{
global $current_user;
if (!is_admin($current_user)) {
sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
}
$configurator = new Configurator();
$configurator->saveConfig();
$focus = new Administration();
$focus->saveConfig();
// Clear the Contacts file b/c portal flag affects rendering
if (file_exists($GLOBALS['sugar_config']['cache_dir'] . 'modules/Contacts/EditView.tpl')) {
unlink($GLOBALS['sugar_config']['cache_dir'] . 'modules/Contacts/EditView.tpl');
}
SugarApplication::redirect('index.php?module=Administration&action=index');
}
示例12: action_updatewirelessenabledmodules
public function action_updatewirelessenabledmodules()
{
require_once 'modules/Administration/Forms.php';
global $mod_strings;
global $app_list_strings;
global $app_strings;
global $current_user;
if (!is_admin($current_user)) {
sugar_die($app_strings['ERR_NOT_ADMIN']);
}
require_once 'modules/Configurator/Configurator.php';
$configurator = new Configurator();
$configurator->saveConfig();
if (isset($_REQUEST['enabled_modules']) && !empty($_REQUEST['enabled_modules'])) {
$updated_enabled_modules = array();
foreach (explode(',', $_REQUEST['enabled_modules']) as $e) {
$updated_enabled_modules[$e] = array();
}
// transfer across any pre-existing definitions for the enabled modules from the current module registry
if (file_exists('include/MVC/Controller/wireless_module_registry.php')) {
require 'include/MVC/Controller/wireless_module_registry.php';
if (!empty($wireless_module_registry)) {
foreach ($updated_enabled_modules as $e => $def) {
if (isset($wireless_module_registry[$e])) {
$updated_enabled_modules[$e] = $wireless_module_registry[$e];
}
}
}
}
$filename = 'custom/include/MVC/Controller/wireless_module_registry.php';
mkdir_recursive(dirname($filename));
write_array_to_file('wireless_module_registry', $updated_enabled_modules, $filename);
}
echo "true";
}
示例13: Configurator
function action_saveconfig()
{
$configurator = new Configurator();
$configurator->saveConfig();
$focus = new Administration();
$focus->saveConfig();
// Clear the Contacts file b/c portal flag affects rendering
if (file_exists($GLOBALS['sugar_config']['cache_dir'] . 'modules/Contacts/EditView.tpl')) {
unlink($GLOBALS['sugar_config']['cache_dir'] . 'modules/Contacts/EditView.tpl');
}
SugarApplication::redirect('index.php?module=Administration&action=index');
}