} $savemsg = get_std_save_message($retval); } } else { // prepare the configuration form $form->startFieldSet('fset_local', _('Local log')); if (($logPath = getSvcState($config, 'systemlog')) == !false) { $form->startBlock('rw_localmode'); $form->setLabel(null, _('Mode'), 'mode', 'class=labelcol'); $form->startBlock('rw_localmode', 'right'); $form->setField('mode', 'select', 'name=mode'); // $modeOptions = array('membuffer' => _('Shared memory circular buffer'), 'disk' => _('Disk') . " ({$logPath}/messages)"); $form->setSelectOptFill('mode', $modeOptions); $form->setFieldOptionsState('mode', $cfgPtr['mode'], 'membuffer'); $form->setBlockHint('hint-syslogmode', _('Choose where log application writes the log messages it receives.') . '<br>' . _('Messages written to shared memory will not survive across reboots.')); // $form->exitBlock(); } $form->startBlock('rw_buffer'); $form->setLabel(null, _('Buffer size'), 'buffer', 'class=labelcol'); $form->startBlock('rw_buffer', 'right'); $form->setField('buffer', 'select', 'name=buffer'); // $modeOptions = array('16' => '16 KB', '32' => '32 KB', '64' => '64 KB', '128' => '128 KB', '256' => '256 KB', '512' => '512 KB', '1024' => '1024 KB', '2048' => '2048 KB', '4096' => '4096 KB'); $form->setSelectOptFill('buffer', $modeOptions); $form->setFieldOptionsState('buffer', $cfgPtr['buffer'], '512'); // $form->exitBlock(); $form->exitFieldSet(); //
// gateway $form->startBlock('rw_gateway'); $form->setLabel(null, _('Gateway'), 'gateway', 'class=labelcol'); $form->startBlock('rw_gateway', 'right'); $form->setField('gateway', 'text', 'size=15|maxlength=15', false, '192.168.1.1'); $form->setInputText('gateway', $cfgPtr['gateway']); $form->setValidationFunc('gateway', 'validIpAddr'); // $form->exitBlock(); // mac spoofing $form->startBlock('rw_spoofmac'); $form->setLabel(null, _('MAC Address'), 'spoofmac', 'class=labelcol'); $form->startBlock('rw_spoofmac', 'right'); $form->setField('spoofmac', 'text', 'size=17|maxlength=17'); $form->setInputText('spoofmac', $cfgPtr['spoofmac']); $form->setBlockHint('hint-spoofmac', _('This field can be used to modify ("spoof") the MAC address of the network interface<br>Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx or leave blank')); // $form->exitBlock(); $form->exitFieldSet(); $form->startFieldset('fset_dns', _('DNS Servers')); // dns servers $form->startBlock('rw_dnsserver'); $form->setLabel(null, _('IP Addresses'), 'dnsserver', 'class=labelcol'); $form->startBlock('rw_dnsserver', 'right'); $form->startWrapper('rw_dnsopts', 'controls'); $form->startWrapper('dnstpl', 'cloneable', 'class=cloneable'); $form->setField('dnsremove', 'button', 'class=dnsremove removeitem|value=', false); $form->setField('dnsserver', 'text', 'disabled=disabled|size=15|maxlength=15', false); $form->setValidationFunc('dnsserver', 'validIpAddr'); $form->exitWrapper(); $form->clonePrevWrapper('dnsserver', $cfgPtr['dnsserver'], 'class=dnsclone');
$confForm = new cfgForm('sys_services_set.php', 'method=post|name=confform|id=confform'); $cfgSvcName = 'frmSvcCfg'; // label for the device fieldset $fsetLabel = $_POST['dev']; $devModel = getDevModel($_POST['dev']); if ($devModel !== false) { $fsetLabel .= " ({$devModel})"; } // inizialization UI $initForm->startFieldset('fset_init', _('Disk Device') . ": {$fsetLabel}"); $initForm->startBlock('rw_label'); $initForm->setLabel(null, _('Partition label'), 'label', 'class=labelcol'); $initForm->startBlock('rw_label', 'right'); $initForm->setField('part_label', 'text', 'size=11|maxlength=11|class=required', false, ''); $initForm->setInputText('part_label', $partLabel); $initForm->setBlockHint('part_label', _('Enter the label for this disk partition.') . '<br>' . _('Only letters A-z, numbers and underscore allowed.')); $initForm->setValidationFunc('part_label', 'validMountPoint'); $initForm->exitBlock(); $initForm->startBlock('rw_part_desc'); $initForm->setLabel(null, _('Comment'), 'part_desc', 'class=labelcol'); $initForm->startBlock('rw_part_desc', 'right'); $initForm->setField('part_desc', 'text', 'size=40|maxlength=40', false, ''); $initForm->setInputText('part_desc', $partComment); $initForm->setBlockHint('part_desc', _('Enter a descriptive comment about this partition.')); $initForm->exitBlock(); $newMount = "{$cfgPtr['mountroot']}/{$mntDir}"; $initForm->startBlock('rw_mountpoint'); $initForm->setLabel(null, _('Mount Point'), 'mountpoint', 'class=labelcol'); $initForm->startBlock('rw_mountpoint', 'right'); $initForm->setField('mountpoint', 'text', 'disabled=disabled|size=40|maxlength=40', false, ''); $initForm->setInputText('mountpoint', $newMount);
$form->setLabel(null, _('Task'), 'bck_task', 'class=labelcol'); $form->startBlock('rw_task', 'right'); $form->setField('bck_task', 'select', 'name=task'); $taskOpts['backup'] = _('Backup'); $taskOpts['restore'] = _('Restore'); $form->setSelectOptFill('bck_task', $taskOpts); $form->setFieldOptionsState('bck_task', 'backup'); // $form->exitBlock(); $form->startBlock('rw_file'); $form->setLabel(null, _('Backup file'), 'restore_file', 'class=labelcol'); $form->startBlock('rw_file', 'right'); $form->startWrapper('loadfile'); $form->setField('restore_file', 'file', 'name=restore_file'); $form->setField('doload', 'button', 'class=startjob|disabled=disabled|value=' . _('Load'), false); $form->setBlockHint('hint-file', _('Select a backup file, then click the above Load button to check the file content.')); $form->exitWrapper(); // $form->exitBlock(); $form->exitFieldSet(); $form->startFieldset('fset_what', _('Backup subsets')); // core system configuration $form->startBlock('rw_what'); $form->setLabel(null, _('System'), 'bck_system', 'class=labelcol'); $form->startBlock('rw_what', 'right'); $form->setField('bck_system', 'checkbox', 'name=bck_system'); $form->setCbItems('bck_system', 'system=' . _('System core configuration'), true); $form->setCbState('bck_system', 'system', 1); // $form->exitBlock(); // appliance specific configuration sets