- text Is a simple text: In the exaple you can see the text is selected by the type of text. All types are case sensitive. If you want a text as first element, give it the index 0.
$layout[0]['type']="text";
$layout[0]['text']="HalloText";
- line: A line is even simpler, because it has no attributes. It only draws a horizontal line. Lines are graphical objects to make your OptionPage look better ;)
$layout[1]['type']="line";
- inputline: An inputline is a editable text field with the height of one. The inputline has a lot of attributes:
- text: a text that is shown before the element. It is a good idea to put a name or a descriptive text here.
- value: is the text, that stands in the inputline. You should follow the example and use the PKG_OptionPageGetValue function to get the value. Otherwise the value can't be gotten after saving and will disappear.
- name: The name of the element, that's the same name the entered value will be stored under the params column in the packagejobs table. This name has to be the same as in the PKG_OptionPageGetValue function under value. Otherwise the values can't be stored!!!
- size: The width of the inputline in characters.
- maxlength: The maximum of characters that can be entered.
$layout[2]['type']="inputline";
$layout[2]['text']="documentRoot";
$layout[2]['value']=PKG_OptionPageGetValue('documentRoot',$params);
$layout[2]['name']="documentRoot";
$layout[2]['size']=10;
$layout[2]['maxlength']=100;
- selection: A selection gives the user a list with options to choose. As before the text attribute describes the element, name is the variable name to store it in the database, value the value to store. New is the option* attribute. The selectable options are stored under the attributes option0, option1, ... . It is important to start by 0 and to left no number out. Otherwise the renderer will stop by the first hole in the count.
$layout[3]['type']="selection";
$layout[3]['text']="Desktop";
$layout[3]['name']="desktop";
$layout[3]['value']=PKG_OptionPageGetValue('desktop',$params);
$layout[3]['option0']="gnome";
$layout[3]['option1']="kde3";
$layout[3]['option2']="kde2";
$layout[3]['option3']="kde4";
- textarea: A text area with multiple colums and rows. The attributes type, name and value as usual. Cols (colums) and rows are the size parameters of the text area in characters.
$layout[4]['type']="textarea";
$layout[4]['cols']=20;
$layout[4]['rows']=20;
$layout[4]['name']="textedit";
$layout[4]['value']=PKG_OptionPageGetValue('textedit',$params);