Use preference to set size of description lines

This commit is contained in:
Nathan Gray 2010-04-27 19:12:42 +00:00
parent 792d922743
commit d57893988e
3 changed files with 19 additions and 8 deletions

View File

@ -386,6 +386,15 @@ class calendar_hooks
'admin' => False,
'forced' => 'user',
),
'limit_des_lines' => array(
'type' => 'input',
'size' => 5,
'label' => 'Limit number of description lines in list view (default 5, 0 for no limit)',
'name' => 'limit_des_lines',
'help' => 'How many describtion lines should be directly visible. Further lines are available via a scrollbar.',
'xmlrpc' => True,
'admin' => False
),
'default_private' => array(
'type' => 'check',
'label' => 'Set new events to private',

View File

@ -176,6 +176,13 @@ class calendar_uilist extends calendar_ui
if($key == 'G') continue;
$sel_options['action'][lang('Change your participant status')]['status-'.$key] = $value;
}
// add scrollbar to long describtion, if user choose so in his prefs
if ($this->prefs['limit_des_lines'] > 0 || (string)$this->prefs['limit_des_lines'] == '')
{
$content['css'] .= '<style type="text/css">@media screen { .listDescription { max-height: '.
(($this->prefs['limit_des_lines'] ? $this->prefs['limit_des_lines'] : 5) * 1.35). // dono why em is not real lines
'em; overflow: auto; }}</style>';
}
unset($sel_options['action'][lang('Change your participant status')]['G']);
$GLOBALS['egw_info']['flags']['java_script'] .= $this->get_javascript();

File diff suppressed because one or more lines are too long