Пример #1
0
$netInterfaces = network_get_interfaces();
// temporary variable to check later if static ip address is changed
$oldIpaddr = $netInterfaces[$cfgPtr['if']]['ipaddr'];
// instantiate the config form object
$form = new cfgForm('sys_network.php', 'method=post|name=iform|id=iform');
// initialize form
$form->startWrapper('tab-1');
$form->startFieldset('fset_lanport', _('Port') . " {$cfgPtr['if']} ({$netInterfaces[$cfgPtr['if']]['mac']})");
// if address mode selector
$form->startBlock('rw_usedhcp');
$form->setLabel(null, _('Settings'), 'dhcp', 'class=labelcol');
$form->startBlock('rw_usedhcp', 'right');
$form->setField('dhcp', 'select', 'name=dhcp', false, 'yes');
$selectOpts['yes'] = _('configured via DHCP client');
$selectOpts['no'] = _('configured manually');
$form->setSelectOptFill('dhcp', $selectOpts);
$form->setFieldOptionsState('dhcp', $cfgPtr['dhcp']);
unset($selectOpts);
//
$form->exitBlock();
// static ip address and netmask
$form->startBlock('rw_ipaddr');
$form->setLabel(null, _('IP Address'), 'ipaddr', 'class=labelcol');
$form->startBlock('rw_ipaddr', 'right');
$form->setField('ipaddr', 'text', 'size=15|maxlength=15', false, '192.168.1.222');
$form->setInputText('ipaddr', $cfgPtr['ipaddr']);
$form->setValidationFunc('ipaddr', 'validIpAddr');
// netmask selector
$form->setLabel(null, _('Subnet') . ' /', 'subnet');
$form->setField('subnet', 'select', 'name=subnet', false, '24');
$form->setSelectOptFill('subnet', $netmask);
Пример #2
0
            $retval |= restartSyslog($config);
            config_unlock();
        }
        $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();
Пример #3
0
            }
        }
    }
}
$form = new cfgForm('maint_backup.php', 'enctype=multipart/form-data|method=post|name=iform|id=iform');
// initialize form
$form->startWrapper('tab-1');
// let user choose the task
$form->startFieldset('fset_task', _('Task selection'));
$form->startBlock('rw_task');
$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'));