Exemplo n.º 1
0
 private function get_print_inputline($dlayer, $disp, $attr)
 {
     if ($attr->IsFlagOn(DAttr::BM_NOEDIT)) {
         return '';
     }
     if ($attr->_type == 'sel1') {
         $attr->SetDerivedSelOptions($disp->GetDerivedSelOptions($this->_id, $attr->_minVal, $dlayer));
     }
     $is_blocked = $attr->blockedVersion();
     $helppop = '';
     if (($dhelp_item = DMsg::GetAttrTip($attr->_helpKey)) != NULL) {
         $helppop = '<span class="lst-tooltip">' . $dhelp_item->Render($is_blocked ? $attr->_version : 0) . '</span>';
     }
     $buf = $attr->toInputGroup($dlayer, $is_blocked, $helppop);
     return $buf;
 }
Exemplo n.º 2
0
 function print_step_2()
 {
     $options = NULL;
     $saved_options = NULL;
     $default_options = NULL;
     $cur_step = $this->check->GetCurrentStep();
     $pass_val = $this->check->pass_val;
     if ($cur_step == 1) {
         $php_version = $pass_val['php_version'];
         $options = new BuildOptions($php_version);
         $options->setDefaultOptions();
         $default_options = $options;
         $supported = $this->check->GetModuleSupport($php_version);
     } elseif ($cur_step == 2) {
         $options = $pass_val['input_options'];
         $php_version = $options->GetValue('PHPVersion');
         $default_options = new BuildOptions($php_version);
         $default_options->setDefaultOptions();
     } elseif ($cur_step == 3) {
         $php_version = $pass_val['php_version'];
         $options = new BuildOptions($php_version);
         $default_options = new BuildOptions($php_version);
         $default_options->setDefaultOptions();
     }
     if ($options == NULL) {
         return "NULL options\n";
     }
     $saved_options = $options->getSavedOptions();
     if ($saved_options != NULL && $cur_step == 3) {
         $options = $saved_options;
     }
     $buf = $this->form_start();
     if (isset($pass_val['err'])) {
         $buf .= UIBase::error_divmesg(DMsg::ALbl('note_inputerr'));
     }
     $input = '<input type="button" class="btn btn-default btn-sm" value="' . DMsg::ALbl('buildphp_useprevconf') . '" ' . ($saved_options ? $saved_options->gen_loadconf_onclick('IMPORT') : 'disabled') . '> &nbsp;&nbsp;<input type="button" class="btn btn-default btn-sm" value="' . DMsg::ALbl('buildphp_restoredefault') . '" ' . $default_options->gen_loadconf_onclick('DEFAULT') . '>';
     $buf .= $this->form_group(DMsg::ALbl('buildphp_loadconf'), false, $input);
     $input = $this->input_text('path_env', $options->GetValue('ExtraPathEnv'));
     $err = isset($pass_val['err']['path_env']) ? $pass_val['err']['path_env'] : '';
     $tip = DMsg::GetAttrTip('extrapathenv')->Render();
     $buf .= $this->form_group(DMsg::ALbl('buildphp_extrapathenv'), false, $input, $tip, '', $err);
     $input = $this->input_text('installPath', $options->GetValue('InstallPath'));
     $err = isset($pass_val['err']['installPath']) ? $pass_val['err']['installPath'] : '';
     $tip = DMsg::GetAttrTip('installpathprefix')->Render();
     $buf .= $this->form_group(DMsg::ALbl('buildphp_installpathprefix'), true, $input, $tip, '', $err);
     $input = $this->input_text('compilerFlags', $options->GetValue('CompilerFlags'));
     $err = isset($pass_val['err']['compilerFlags']) ? $pass_val['err']['compilerFlags'] : '';
     $tip = DMsg::GetAttrTip('compilerflags')->Render();
     $buf .= $this->form_group(DMsg::ALbl('buildphp_compilerflags'), false, $input, $tip, '', $err);
     $input = $this->input_textarea('configureParams', $options->GetValue('ConfigParam'), 6, 'soft');
     $err = isset($pass_val['err']['configureParams']) ? $pass_val['err']['configureParams'] : '';
     $tip = DMsg::GetAttrTip('configureparams')->Render();
     $buf .= $this->form_group(DMsg::ALbl('buildphp_confparam'), true, $input, $tip, '', $err);
     $input = '';
     if ($supported['mailheader']) {
         $input = $this->input_checkbox('addonMailHeader', $options->GetValue('AddOnMailHeader'), '<a href="http://choon.net/php-mail-header.php" target="_blank">' . DMsg::ALbl('buildphp_mailheader1') . '</a> (' . DMsg::ALbl('buildphp_mailheader2') . ')');
     }
     if ($supported['suhosin']) {
         $input .= $this->input_checkbox('addonSuhosin', $options->GetValue('AddOnSuhosin'), '<a href="http://suhosin.org" target="_blank">Suhosin</a> ' . DMsg::ALbl('buildphp_suhosin'));
     }
     $label_opcode = DMsg::ALbl('buildphp_opcodecache');
     if ($supported['apc']) {
         $input .= $this->input_checkbox('addonAPC', $options->GetValue('AddOnAPC'), '<a href="http://pecl.php.net/package/APC" target="_blank">APC</a> (' . $label_opcode . ') V' . BuildConfig::GetVersion(BuildConfig::APC_VERSION));
     }
     $input .= $this->input_checkbox('addonXCache', $options->GetValue('AddOnXCache'), '<a href="http://xcache.lighttpd.net/" target="_blank">XCache</a> (' . $label_opcode . ') V' . BuildConfig::GetVersion(BuildConfig::XCACHE_VERSION));
     $input .= $this->input_checkbox('addonMemCache', $options->GetValue('AddOnMemCache'), '<a href="http://pecl.php.net/package/memcache" target="_blank">memcache</a> (memcached extension) V' . BuildConfig::GetVersion(BuildConfig::MEMCACHE_VERSION));
     if ($supported['opcache']) {
         $input .= $this->input_checkbox('addonOPcache', $options->GetValue('AddOnOPcache'), '<a href="http://pecl.php.net/package/ZendOpcache" target="_blank">Zend OPcache</a> (' . $label_opcode . ') V' . BuildConfig::GetVersion(BuildConfig::OPCACHE_VERSION));
     }
     $note = DMsg::ALbl('buildphp_updatever') . ' /usr/local/lsws/admin/html/lib/util/build_php/BuildConfig.php';
     $buf .= $this->form_group(DMsg::ALbl('buildphp_addonmodules'), false, $input, '', $note);
     $buf .= $this->form_end();
     echo $buf;
 }