当前位置: 首页>>代码示例>>PHP>>正文


PHP Configurator::populateFromPost方法代码示例

本文整理汇总了PHP中Configurator::populateFromPost方法的典型用法代码示例。如果您正苦于以下问题:PHP Configurator::populateFromPost方法的具体用法?PHP Configurator::populateFromPost怎么用?PHP Configurator::populateFromPost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Configurator的用法示例。


在下文中一共展示了Configurator::populateFromPost方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testPopulateFromPostConvertsBoolValuesFromStrings

 public function testPopulateFromPostConvertsBoolValuesFromStrings()
 {
     $_POST = array('disable_export' => 'true', 'admin_export_only' => 'false', 'upload_dir' => 'yummy');
     $cfg = new Configurator();
     $cfg->populateFromPost();
     $this->assertEquals($cfg->config['disable_export'], true);
     $this->assertEquals($cfg->config['admin_export_only'], false);
     $this->assertEquals($cfg->config['upload_dir'], 'yummy');
     $_POST = array();
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:10,代码来源:ConfiguratorTest.php

示例2: Administration

 function action_saveadminwizard()
 {
     global $current_user;
     if (!is_admin($current_user)) {
         sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
     }
     $focus = new Administration();
     $focus->retrieveSettings();
     $focus->saveConfig();
     $configurator = new Configurator();
     $configurator->populateFromPost();
     $configurator->handleOverride();
     $configurator->parseLoggerSettings();
     $configurator->saveConfig();
     // Bug 37310 - Delete any existing currency that matches the one we've just set the default to during the admin wizard
     $currency = new Currency();
     $currency->retrieve($currency->retrieve_id_by_name($_REQUEST['default_currency_name']));
     if (!empty($currency->id) && $currency->symbol == $_REQUEST['default_currency_symbol'] && $currency->iso4217 == $_REQUEST['default_currency_iso4217']) {
         $currency->deleted = 1;
         $currency->save();
     }
     SugarApplication::redirect('index.php?module=Users&action=Wizard&skipwelcome=1');
 }
开发者ID:butschster,项目名称:sugarcrm_dev,代码行数:23,代码来源:controller.php

示例3: get_module_title

 ********************************************************************************/
/*********************************************************************************
 * Description:
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. All Rights
 * Reserved. Contributor(s): ______________________________________..
 * *******************************************************************************/
require_once 'modules/Configurator/Configurator.php';
require_once 'include/Sugar_Smarty.php';
echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_LOCALE_TITLE'] . ": ", true);
$cfg = new Configurator();
$sugar_smarty = new Sugar_Smarty();
$errors = '';
///////////////////////////////////////////////////////////////////////////////
////	HANDLE CHANGES
if (isset($_REQUEST['process']) && $_REQUEST['process'] == 'true') {
    $cfg->populateFromPost();
    $cfg->handleOverride();
}
///////////////////////////////////////////////////////////////////////////////
////	PAGE OUTPUT
$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', $sugar_config);
$sugar_smarty->assign('error', $errors);
//$sugar_smarty->assign('salutation', 'Mr.');
//$sugar_smarty->assign('first_name', 'John');
//$sugar_smarty->assign('last_name', 'Doe');
$sugar_smarty->assign('getNameJs', $locale->getNameJs());
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:Locale.php

示例4: Administration

//          ---------------------------------------------------------->
installLog('save locale');
//global $current_user;
installLog('new Administration');
$focus = new Administration();
installLog('retrieveSettings');
//$focus->retrieveSettings();
// switch off the adminwizard (mark that we have got past this point)
installLog('AdminWizard OFF');
$focus->saveSetting('system', 'adminwizard', 1);
installLog('saveConfig');
$focus->saveConfig();
installLog('new Configurator');
$configurator = new Configurator();
installLog('populateFromPost');
$configurator->populateFromPost();
installLog('handleOverride');
// add local settings to config overrides
if (!empty($_SESSION['default_date_format'])) {
    $sugar_config['default_date_format'] = $_SESSION['default_date_format'];
}
if (!empty($_SESSION['default_time_format'])) {
    $sugar_config['default_date_format'] = $_SESSION['default_time_format'];
}
if (!empty($_SESSION['default_language'])) {
    $sugar_config['default_language'] = $_SESSION['default_language'];
}
if (!empty($_SESSION['default_locale_name_format'])) {
    $sugar_config['default_locale_name_format'] = $_SESSION['default_locale_name_format'];
}
//$configurator->handleOverride();
开发者ID:switcode,项目名称:SuiteCRM,代码行数:31,代码来源:performSetup.php

示例5: Administration

 function action_saveadminwizard()
 {
     global $current_user;
     if (!is_admin($current_user)) {
         sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
     }
     $focus = new Administration();
     $focus->retrieveSettings();
     $focus->saveConfig();
     $configurator = new Configurator();
     $configurator->populateFromPost();
     $configurator->handleOverride();
     $configurator->parseLoggerSettings();
     $configurator->saveConfig();
     //The save of the admin wizard stops the post silent install from re-showing the admin wizard on each login
     $postSilentInstallAdminWizardCompleted = $current_user->getPreference('postSilentInstallAdminWizardCompleted');
     if (isset($postSilentInstallAdminWizardCompleted) && !$postSilentInstallAdminWizardCompleted) {
         $current_user->setPreference('postSilentInstallAdminWizardCompleted', true);
     }
     // Bug 37310 - Delete any existing currency that matches the one we've just set the default to during the admin wizard
     $currency = new Currency();
     $currency->retrieve($currency->retrieve_id_by_name($_REQUEST['default_currency_name']));
     if (!empty($currency->id) && $currency->symbol == $_REQUEST['default_currency_symbol'] && $currency->iso4217 == $_REQUEST['default_currency_iso4217']) {
         $currency->deleted = 1;
         $currency->save();
     }
     //Only process the scenario item for admin users!
     if ($current_user->isAdmin()) {
         //Process the scenarios selected in the wizard
         require_once 'install/suite_install/enabledTabs.php';
         //We need to load the tabs so that we can remove those which are scenario based and un-selected
         //Remove the custom tabConfig as this overwrites the complete list containined in the include/tabConfig.php
         if (file_exists('custom/include/tabConfig.php')) {
             unlink('custom/include/tabConfig.php');
         }
         require_once 'include/tabConfig.php';
         //Remove the custom dashlet so that we can use the complete list of defaults to filter by category
         if (file_exists('custom/modules/Home/dashlets.php')) {
             unlink('custom/modules/Home/dashlets.php');
         }
         //Check if the folder is in place
         if (!file_exists('custom/modules/Home')) {
             sugar_mkdir('custom/modules/Home', 0775);
         }
         //Check if the folder is in place
         if (!file_exists('custom/include')) {
             sugar_mkdir('custom/include', 0775);
         }
         require_once 'modules/Home/dashlets.php';
         require_once 'install/suite_install/scenarios.php';
         foreach ($installation_scenarios as $scenario) {
             //If the item is not in $_SESSION['scenarios'], then unset them as they are not required
             if (!in_array($scenario['key'], $_REQUEST['scenarios'])) {
                 foreach ($scenario['modules'] as $module) {
                     if (($removeKey = array_search($module, $enabled_tabs)) !== false) {
                         unset($enabled_tabs[$removeKey]);
                     }
                 }
                 //Loop through the dashlets to remove from the default home page based on this scenario
                 foreach ($scenario['dashlets'] as $dashlet) {
                     //if (($removeKey = array_search($dashlet, $defaultDashlets)) !== false) {
                     //    unset($defaultDashlets[$removeKey]);
                     // }
                     if (isset($defaultDashlets[$dashlet])) {
                         unset($defaultDashlets[$dashlet]);
                     }
                 }
                 //If the scenario has an associated group tab, remove accordingly (by not adding to the custom tabconfig.php
                 if (isset($scenario['groupedTabs'])) {
                     unset($GLOBALS['tabStructure'][$scenario['groupedTabs']]);
                 }
             }
         }
         //Have a 'core' options, with accounts / contacts if no other scenario is selected
         if (!is_null($_SESSION['scenarios'])) {
             unset($GLOBALS['tabStructure']['LBL_TABGROUP_DEFAULT']);
         }
         //Write the tabstructure to custom so that the grouping are not shown for the un-selected scenarios
         $fp = sugar_fopen('custom/include/tabConfig.php', 'w');
         $fileContents = "<?php \n" . '$GLOBALS["tabStructure"] =' . var_export($GLOBALS['tabStructure'], true) . ';';
         fwrite($fp, $fileContents);
         fclose($fp);
         //Write the dashlets to custom so that the dashlets are not shown for the un-selected scenarios
         $fp = sugar_fopen('custom/modules/Home/dashlets.php', 'w');
         $fileContents = "<?php \n" . '$defaultDashlets =' . var_export($defaultDashlets, true) . ';';
         fwrite($fp, $fileContents);
         fclose($fp);
         // End of the scenario implementations
     }
     SugarApplication::redirect('index.php?module=Users&action=Wizard&skipwelcome=1');
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:91,代码来源:controller.php

示例6: Administration

 function action_saveadminwizard()
 {
     $focus = new Administration();
     $focus->retrieveSettings();
     $focus->saveConfig();
     $configurator = new Configurator();
     $configurator->populateFromPost();
     $configurator->handleOverride();
     $configurator->parseLoggerSettings();
     $configurator->saveConfig();
     SugarApplication::redirect('index.php?module=Users&action=Wizard&skipwelcome=1');
 }
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:12,代码来源:controller.php


注:本文中的Configurator::populateFromPost方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。