add types passwd and select-lang

This commit is contained in:
Cornelius Weiß 2006-12-06 20:09:22 +00:00
parent 343d5a6eac
commit be0bce8b40
3 changed files with 11 additions and 3 deletions

View File

@ -48,7 +48,8 @@
'groupbox' => 'GroupBox', // a box with a label containing other elements to group them (html: fieldset) 'groupbox' => 'GroupBox', // a box with a label containing other elements to group them (html: fieldset)
'box' => 'Box', // just a container for widgets (html: div) 'box' => 'Box', // just a container for widgets (html: div)
'grid' => 'Grid', // tabular widget containing rows with columns of widgets 'grid' => 'Grid', // tabular widget containing rows with columns of widgets
'deck' => 'Deck' // a container of elements where only one is visible, size = # of elem. 'deck' => 'Deck', // a container of elements where only one is visible, size = # of elem.
'passwd' => 'Password' // a text of type password
); );
var $garbage_collection_done; var $garbage_collection_done;

View File

@ -49,7 +49,8 @@
'select-dow' => 'Select Day of week', 'select-dow' => 'Select Day of week',
'select-hour' => 'Select Hour', // either 0-23 or 12am,1am-11am,12pm,1pm-11pm 'select-hour' => 'Select Hour', // either 0-23 or 12am,1am-11am,12pm,1pm-11pm
'select-number' => 'Select Number', 'select-number' => 'Select Number',
'select-app' => 'Select Application' 'select-app' => 'Select Application',
'select-lang' => 'Select Language',
); );
/** /**
* @var array * @var array
@ -434,6 +435,10 @@
$cell['sel_options'][$app] = $apps[$app]; $cell['sel_options'][$app] = $apps[$app];
} }
break; break;
case 'select-lang':
$cell['sel_options'] = $GLOBALS['egw']->translation->list_langs();
$cell['no_lang'] = True;
break;
} }
if ($rows > 1) if ($rows > 1)
{ {

View File

@ -950,6 +950,7 @@
} }
$cell_options .= ',,'.($cell['type'] == 'int' ? '/^-?[0-9]*$/' : '/^-?[0-9]*[,.]?[0-9]*$/'); $cell_options .= ',,'.($cell['type'] == 'int' ? '/^-?[0-9]*$/' : '/^-?[0-9]*[,.]?[0-9]*$/');
// fall-through // fall-through
case 'passwd' :
case 'text': // size: [length][,maxLength[,preg]] case 'text': // size: [length][,maxLength[,preg]]
if ($readonly) if ($readonly)
{ {
@ -957,7 +958,7 @@
} }
else else
{ {
$html .= $this->html->input($form_name,$value,'', $html .= $this->html->input($form_name,$value,$type == 'passwd' ? 'password' : '',
$options.$this->html->formatOptions($cell_options,'SIZE,MAXLENGTH')); $options.$this->html->formatOptions($cell_options,'SIZE,MAXLENGTH'));
$cell_options = explode(',',$cell_options,3); $cell_options = explode(',',$cell_options,3);
$GLOBALS['egw_info']['etemplate']['to_process'][$form_name] = array( $GLOBALS['egw_info']['etemplate']['to_process'][$form_name] = array(
@ -1713,6 +1714,7 @@
break; break;
case 'int': case 'int':
case 'float': case 'float':
case 'passwd':
case 'text': case 'text':
case 'textarea': case 'textarea':
if ($value === '' && $attr['needed'] && !$attr['blur']) if ($value === '' && $attr['needed'] && !$attr['blur'])