/**
  * @ticket 41635
  */
 public function testGetDefaultThemeObjectWhenDefaultThemeIsNotSet()
 {
     unset($GLOBALS['sugar_config']['default_theme']);
     $themename = array_pop(array_keys(SugarThemeRegistry::availableThemes()));
     $object = SugarThemeRegistry::getDefault();
     $this->assertInstanceOf('SugarTheme', $object);
     $this->assertEquals($object->__toString(), $themename);
 }
Пример #2
0
 protected function action_saveuserwizard()
 {
     global $current_user, $sugar_config;
     // set all of these default parameters since the Users save action will undo the defaults otherwise
     $_POST['record'] = $current_user->id;
     $_POST['is_admin'] = $current_user->is_admin ? 'on' : '';
     $_POST['use_real_names'] = true;
     $_POST['should_remind'] = '1';
     $_POST['reminder_time'] = 1800;
     $_POST['mailmerge_on'] = 'on';
     $_POST['user_theme'] = (string) SugarThemeRegistry::getDefault();
     // save and redirect to new view
     $_REQUEST['return_module'] = 'Home';
     $_REQUEST['return_action'] = 'index';
     require 'modules/Users/Save.php';
 }
Пример #3
0
 public function testLoadDisplaySettingsUserTheme()
 {
     $this->_loadUser();
     $_REQUEST['usertheme'] = (string) SugarThemeRegistry::getDefault();
     $this->_app->loadDisplaySettings();
     $this->assertEquals($GLOBALS['theme'], $_REQUEST['usertheme']);
     $this->_removeUser();
 }
Пример #4
0
//$_POST[''] = $_REQUEST['setup_site_session_path'];
//$_POST[''] = $_REQUEST['setup_site_log_dir'];
//$_POST[''] = $_REQUEST['setup_site_guid'];
//$_POST[''] = $_REQUEST['default_email_charset'];
//$_POST[''] = $_REQUEST['default_export_charset'];
//$_POST[''] = $_REQUEST['export_delimiter'];
$_POST['record'] = $current_user->id;
$_POST['is_admin'] = $current_user->is_admin ? 'on' : '';
$_POST['use_real_names'] = true;
$_POST['reminder_checked'] = '1';
$_POST['reminder_time'] = 1800;
$_POST['email_reminder_time'] = 3600;
$_POST['mailmerge_on'] = 'on';
$_POST['receive_notifications'] = $current_user->receive_notifications;
installLog('DBG: SugarThemeRegistry::getDefault');
$_POST['user_theme'] = (string) SugarThemeRegistry::getDefault();
// save and redirect to new view
$_REQUEST['return_module'] = 'Home';
$_REQUEST['return_action'] = 'index';
installLog('DBG: require modules/Users/Save.php');
require 'modules/Users/Save.php';
// restore superglobals and vars
$GLOBALS = $varStack['GLOBALS'];
foreach ($varStack['defined_vars'] as $__key => $__value) {
    ${$__key} = $__value;
}
$endTime = microtime(true);
$deltaTime = $endTime - $startTime;
if (count($bottle) > 0) {
    foreach ($bottle as $bottle_message) {
        $bottleMsg .= "{$bottle_message}\n";