diff --git a/phpgwapi/inc/class.egw_ckeditor_config.inc.php b/phpgwapi/inc/class.egw_ckeditor_config.inc.php index d525271345..2f8f7c2aac 100644 --- a/phpgwapi/inc/class.egw_ckeditor_config.inc.php +++ b/phpgwapi/inc/class.egw_ckeditor_config.inc.php @@ -18,6 +18,38 @@ class egw_ckeditor_config private static $enterMode = null; private static $skin = null; + // Defaults, defined in phpgwapi/js/ckeditor3/_source/plugins/font/plugin.js + public static $font_options = array( + 'arial, helvetica, sans-serif' => 'Arial', + 'Comic Sans MS, cursive' => 'Comic Sans MS', + 'Courier New, Courier, monospace' => 'Courier New', + 'Georgia, serif' => 'Georgia', + 'Lucida Sans Unicode, Lucida Grande, sans-serif' => 'Lucida Sans Unicode', + 'Tahoma, Geneva, sans-serif' => 'Tahoma', + 'times new roman, times, serif' => 'Times New Roman', + 'Trebuchet MS, Helvetica, sans-serif' => 'Trebuchet MS', + 'Verdana, Geneva, sans-serif' => 'Verdana' + ); + public static $font_size_options = array( + '8px' => '8', + '9px' => '9', + '10px' => '10', + '11px' => '11', + '12px' => '12', + '14px' => '14', + '16px' => '16', + '18px' => '18', + '20px' => '20', + '22px' => '22', + '24px' => '24', + '26px' => '26', + '28px' => '28', + '36px' => '36', + '48px' => '48', + '72px' => '72' + ); + + /** * Read language and country settings for the ckeditor and store them in static * variables diff --git a/phpgwapi/inc/class.html.inc.php b/phpgwapi/inc/class.html.inc.php index 95fa513942..8b76a68efb 100644 --- a/phpgwapi/inc/class.html.inc.php +++ b/phpgwapi/inc/class.html.inc.php @@ -295,7 +295,7 @@ class html if($enhanced) { egw_framework::validate_file('/phpgwapi/js/jquery/chosen/chosen.jquery.js'); egw_framework::includeCSS('/phpgwapi/js/jquery/chosen/chosen.css',null,false); - $out .= "\n"; + $out .= "\n"; } return $out; } @@ -333,7 +333,7 @@ class html } $base_name = substr($name,0,-2); - if($enhanced) return self::select($name, $key, $arr,$no_lang,$options,$multiple,$enhanced); + if($enhanced) return self::select($name, $key, $arr,$no_lang,$options." style=\"$style\" ",$multiple,$enhanced); if (!is_array($key)) { @@ -544,6 +544,10 @@ class html $pxheight = (strpos('px', $_height) === false) ? (empty($_height) ? 400 : $_height) : str_replace('px', '', $_height); + // User preferences + $font = $GLOBALS['egw_info']['user']['preferences']['common']['rte_font']; ++ $font_size = $GLOBALS['egw_info']['user']['preferences']['common']['rte_font_size']; + // we need to enable double encoding here, as ckEditor has to undo one level of encoding // otherwise < and > chars eg. from html markup entered in regular (not source) input, will turn into html! return self::textarea($_name,$_content,'id="'.htmlspecialchars($_name).'"',true). // true = double encoding @@ -558,7 +562,8 @@ class html { ev.editor.resize("100%", '.str_replace('px', '', $pxheight).'); } - ); + );'. + (trim($_content) == '' ? 'CKEDITOR.instances["'.$_name.'"].setData("");' : '').' '; } diff --git a/preferences/inc/class.preferences_hooks.inc.php b/preferences/inc/class.preferences_hooks.inc.php index 11450781f0..ab7b1c74ca 100644 --- a/preferences/inc/class.preferences_hooks.inc.php +++ b/preferences/inc/class.preferences_hooks.inc.php @@ -108,6 +108,10 @@ class preferences_hooks } // Settings array for this app $settings = array( + array( + 'type' => 'section', + 'title' => 'Look & feel' + ), 'maxmatchs' => array( 'type' => 'input', 'label' => 'Max matches per page', @@ -184,6 +188,89 @@ class preferences_hooks 'admin' => False, 'default' => 'EGW_SELECTMODE_DEFAULT', ), + 'account_selection' => array( + 'type' => 'select', + 'label' => 'How do you like to select accounts', + 'name' => 'account_selection', + 'values' => $account_sels, + 'help' => lang('The selectbox shows all available users (can be very slow on big installs with many users). The popup can search users by name or group.').' '. + lang('The two last options limit the visibility of other users. Therefore they should be forced and apply NOT to administrators.'), + 'run_lang' => false, + 'xmlrpc' => True, + 'admin' => False, + 'default'=> 'primary_group' + ), + 'account_display' => array( + 'type' => 'select', + 'label' => 'How do you like to display accounts', + 'name' => 'account_display', + 'values' => $account_display, + 'help' => 'Set this to your convenience. For security reasons, you might not want to show your Loginname in public.', + 'xmlrpc' => True, + 'admin' => False, + 'default'=> 'lastname', + ), + 'show_currentusers' => array( + 'type' => 'check', + 'label' => 'Show number of current users', + 'name' => 'show_currentusers', + 'help' => 'Should the number of active sessions be displayed for you all the time.', + 'xmlrpc' => False, + 'admin' => True, + 'forced' => true, + ), + 'show_help' => array( + 'type' => 'check', + 'label' => 'Show helpmessages by default', + 'name' => 'show_help', + 'help' => 'Should this help messages shown up always, when you enter the preferences or only on request.', + 'xmlrpc' => False, + 'admin' => False, + 'default'=> True, + ), + 'enable_dragdrop' => array( + 'type' => 'check', + 'label' => 'Enable drag and drop functionality (experimental)', + 'name' => 'enable_dragdrop', + 'help' => 'Enables or disables drag and drop functions in all applications. If the browser does not support '. + 'drag and drop, it will be disabled automatically. This feature is experimental at the moment.', + 'xmlrpc' => False, + 'admin' => False, + 'forced' => true, + ), + 'enable_ie_dropdownmenuhack' => array( + 'type' => 'check', + 'label' => 'Enable selectbox dropdown resizing for IE (experimental)', + 'name' => 'enable_ie_dropdownmenuhack', + 'help' => 'Enables or disables selectbox dropdown resizing for IE in all applications. If the browser is not an IE, the option will not apply. This feature is experimental at the moment.', + 'xmlrpc' => False, + 'admin' => False, + 'forced' => false, + ), + array( + 'type' => 'section', + 'title' => 'Formatting & general settings' + ), + 'lang' => array( + 'type' => 'select', + 'label' => 'Language', + 'name' => 'lang', + 'values' => $langs, + 'help' => 'Select the language of texts and messages within eGroupWare.
Some languages may not contain all messages, in that case you will see an english message.', + 'xmlrpc' => True, + 'admin' => False, + 'default'=> $lang, + ), + 'country' => array( + 'type' => 'select', + 'label' => 'Country', + 'name' => 'country', + 'values' => ExecMethod('phpgwapi.country.countries'), + 'help' => 'In which country are you. This is used to set certain defaults for you.', + 'xmlrpc' => True, + 'admin' => False, + 'default'=> strtoupper($country), + ), 'tz' => array( 'type' => 'select', 'label' => 'Time zone', @@ -224,25 +311,63 @@ class preferences_hooks 'admin' => False, 'default'=> 24, ), - 'country' => array( + 'number_format' => array( 'type' => 'select', - 'label' => 'Country', - 'name' => 'country', - 'values' => ExecMethod('phpgwapi.country.countries'), - 'help' => 'In which country are you. This is used to set certain defaults for you.', + 'label' => 'Number format', + 'name' => 'number_format', + 'values' => array( + '.' => '1234.56', + ',' => '1234,56', + '.,' => '1,234.56', + ',.' => '1.234,56', + '. ' => '1 234.56', + ', ' => '1 234,56', + ), + 'help' => 'Thousands separator is only used for displaying and not for editing numbers.', 'xmlrpc' => True, - 'admin' => False, - 'default'=> strtoupper($country), + 'admin' => false, + 'default'=> '.', ), - 'lang' => array( - 'type' => 'select', - 'label' => 'Language', - 'name' => 'lang', - 'values' => $langs, - 'help' => 'Select the language of texts and messages within eGroupWare.
Some languages may not contain all messages, in that case you will see an english message.', + 'currency' => array( + 'type' => 'input', + 'label' => 'Currency', + 'name' => 'currency', + 'help' => 'Which currency symbol or name should be used in eGroupWare.', 'xmlrpc' => True, 'admin' => False, - 'default'=> $lang, + 'default'=> $lang == 'en' ? '$' : 'EUR', + ), + 'csv_charset' => array( + 'type' => 'select', + 'label' => 'Charset for the CSV export/import', + 'name' => 'csv_charset', + 'values' => translation::get_installed_charsets(), + 'help' => 'Which charset should be used for the CSV export. The system default is the charset of this eGroupWare installation.', + 'xmlrpc' => True, + 'admin' => false, + 'default'=> 'iso-8859-1', + ), + array( + 'type' => 'section', + 'title' => 'Text editor settings' + ), + 'rte_font' => array( + 'type' => 'select', + 'label' => 'Default font', + 'name' => 'rte_font', + 'values' => egw_ckeditor_config::$font_options, + 'help' => 'Automatically start with this font', + 'xmlrpc' => True, + 'admin' => false + ), + 'rte_font_size' => array( + 'type' => 'select', + 'label' => 'Default font size', + 'name' => 'rte_font_size', + 'values' => egw_ckeditor_config::$font_size_options, + 'help' => 'Automatically start with this font size', + 'xmlrpc' => True, + 'admin' => false ), 'spellchecker_lang' => array( 'type' => 'select', @@ -274,14 +399,14 @@ class preferences_hooks 'admin' => False, 'forced' => 'office2003', ), - 'show_currentusers' => array( - 'type' => 'check', - 'label' => 'Show number of current users', - 'name' => 'show_currentusers', - 'help' => 'Should the number of active sessions be displayed for you all the time.', - 'xmlrpc' => False, - 'admin' => True, - 'forced' => true, + 'rte_features' => array( + 'type' => 'select', + 'label' => 'Features of the editor', + 'name' => 'rte_features', + 'values' => array('simple'=>'simple','extended'=>'regular','advanced'=>'everything'), + 'help' => '', + 'admin' => false, + 'default'=> 'simple' ), 'default_app' => array( 'type' => 'select', @@ -293,93 +418,6 @@ class preferences_hooks 'admin' => False, 'default'=> '', ), - 'currency' => array( - 'type' => 'input', - 'label' => 'Currency', - 'name' => 'currency', - 'help' => 'Which currency symbol or name should be used in eGroupWare.', - 'xmlrpc' => True, - 'admin' => False, - 'default'=> $lang == 'en' ? '$' : 'EUR', - ), - 'account_selection' => array( - 'type' => 'select', - 'label' => 'How do you like to select accounts', - 'name' => 'account_selection', - 'values' => $account_sels, - 'help' => lang('The selectbox shows all available users (can be very slow on big installs with many users). The popup can search users by name or group.').' '. - lang('The two last options limit the visibility of other users. Therefore they should be forced and apply NOT to administrators.'), - 'run_lang' => false, - 'xmlrpc' => True, - 'admin' => False, - 'default'=> 'primary_group' - ), - 'account_display' => array( - 'type' => 'select', - 'label' => 'How do you like to display accounts', - 'name' => 'account_display', - 'values' => $account_display, - 'help' => 'Set this to your convenience. For security reasons, you might not want to show your Loginname in public.', - 'xmlrpc' => True, - 'admin' => False, - 'default'=> 'lastname', - ), - 'show_help' => array( - 'type' => 'check', - 'label' => 'Show helpmessages by default', - 'name' => 'show_help', - 'help' => 'Should this help messages shown up always, when you enter the preferences or only on request.', - 'xmlrpc' => False, - 'admin' => False, - 'default'=> True, - ), - 'enable_dragdrop' => array( - 'type' => 'check', - 'label' => 'Enable drag and drop functionality (experimental)', - 'name' => 'enable_dragdrop', - 'help' => 'Enables or disables drag and drop functions in all applications. If the browser does not support '. - 'drag and drop, it will be disabled automatically. This feature is experimental at the moment.', - 'xmlrpc' => False, - 'admin' => False, - 'forced' => true, - ), - 'enable_ie_dropdownmenuhack' => array( - 'type' => 'check', - 'label' => 'Enable selectbox dropdown resizing for IE (experimental)', - 'name' => 'enable_ie_dropdownmenuhack', - 'help' => 'Enables or disables selectbox dropdown resizing for IE in all applications. If the browser is not an IE '. - ', the option will not apply. This feature is experimental at the moment.', - 'xmlrpc' => False, - 'admin' => False, - 'forced' => false, - ), - 'csv_charset' => array( - 'type' => 'select', - 'label' => 'Charset for the CSV export/import', - 'name' => 'csv_charset', - 'values' => translation::get_installed_charsets(), - 'help' => 'Which charset should be used for the CSV export. The system default is the charset of this eGroupWare installation.', - 'xmlrpc' => True, - 'admin' => false, - 'default'=> 'iso-8859-1', - ), - 'number_format' => array( - 'type' => 'select', - 'label' => 'Number format', - 'name' => 'number_format', - 'values' => array( - '.' => '1234.56', - ',' => '1234,56', - '.,' => '1,234.56', - ',.' => '1.234,56', - '. ' => '1 234.56', - ', ' => '1 234,56', - ), - 'help' => 'Thousands separator is only used for displaying and not for editing numbers.', - 'xmlrpc' => True, - 'admin' => false, - 'default'=> '.', - ), ); // disable thumbnails, if no size configured by admin if (!$GLOBALS['egw_info']['server']['link_list_thumbnail']) unset($settings['link_list_thumbnail']);