public function Display(WebPage $oPage) { $sDefaultLanguage = $this->oWizard->GetParameter('default_language', $this->oWizard->GetParameter('admin_language')); $sApplicationURL = $this->oWizard->GetParameter('application_url', utils::GetDefaultUrlAppRoot()); $sSampleData = $this->oWizard->GetParameter('sample_data', 'yes'); $oPage->add('<h2>Additional parameters</h2>'); $oPage->add('<fieldset>'); $oPage->add('<legend>Default Language</legend>'); $oPage->add('<table>'); $sSourceDir = APPROOT . 'dictionaries/'; $aLanguages = SetupUtils::GetAvailableLanguages($sSourceDir); $oPage->add('<tr><td>Default Language: </td><td>'); $oPage->add(SetupUtils::GetLanguageSelect($sSourceDir, 'default_language', $sDefaultLanguage)); $oPage->add('</td></tr>'); $oPage->add('</table>'); $oPage->add('</fieldset>'); $oPage->add('<fieldset>'); $oPage->add('<legend>Application URL</legend>'); $oPage->add('<table>'); $oPage->add('<tr><td>URL: </td><td><input id="application_url" name="application_url" type="text" size="35" maxlength="1024" value="' . htmlentities($sApplicationURL, ENT_QUOTES, 'UTF-8') . '"><span id="v_application_url"/></td><tr>'); $oPage->add('<tr><td colspan="2">Change the value above if the end-users will be accessing the application by another path due to a specific configuration of the web server.</td><tr>'); $oPage->add('</table>'); $oPage->add('</fieldset>'); $oPage->add('<fieldset>'); $oPage->add('<legend>Sample Data</legend>'); $sChecked = $sSampleData == 'yes' ? ' checked ' : ''; $oPage->p('<input id="sample_data_yes" name="sample_data" type="radio" value="yes"' . $sChecked . '><label for="sample_data_yes"> I am installing a <b>demo or test</b> instance, populate the database with some demo data.'); $sChecked = $sSampleData == 'no' ? ' checked ' : ''; $oPage->p('<input id="sample_data_no" name="sample_data" type="radio" value="no"' . $sChecked . '><label for="sample_data_no"> I am installing a <b>production</b> instance, create an empty database to start from.'); $oPage->add('</fieldset>'); $oPage->add_ready_script(<<<EOF \t\t\$('#application_url').bind('change keyup', function() { WizardUpdateButtons(); } ); EOF ); }
public function Display(WebPage $oPage) { $sDefaultLanguage = $this->oWizard->GetParameter('default_language', $this->oWizard->GetParameter('admin_language')); $sApplicationURL = $this->oWizard->GetParameter('application_url', utils::GetDefaultUrlAppRoot()); $sDefaultGraphvizPath = strtolower(substr(PHP_OS, 0, 3)) === 'win' ? 'C:\\Program Files\\Graphviz\\bin\\dot.exe' : '/usr/bin/dot'; $sGraphvizPath = $this->oWizard->GetParameter('graphviz_path', $sDefaultGraphvizPath); $sSampleData = $this->oWizard->GetParameter('sample_data', 'yes'); $oPage->add('<h2>Additional parameters</h2>'); $oPage->add('<fieldset>'); $oPage->add('<legend>Default Language</legend>'); $oPage->add('<table>'); $sSourceDir = APPROOT . 'dictionaries/'; $aLanguages = SetupUtils::GetAvailableLanguages($sSourceDir); $oPage->add('<tr><td>Default Language: </td><td>'); $oPage->add(SetupUtils::GetLanguageSelect($sSourceDir, 'default_language', $sDefaultLanguage)); $oPage->add('</td></tr>'); $oPage->add('</table>'); $oPage->add('</fieldset>'); $oPage->add('<fieldset>'); $oPage->add('<legend>Application URL</legend>'); $oPage->add('<table>'); $oPage->add('<tr><td>URL: </td><td><input id="application_url" name="application_url" type="text" size="35" maxlength="1024" value="' . htmlentities($sApplicationURL, ENT_QUOTES, 'UTF-8') . '"><span id="v_application_url"/></td><tr>'); $oPage->add('<tr><td colspan="2">Change the value above if the end-users will be accessing the application by another path due to a specific configuration of the web server.</td><tr>'); $oPage->add('</table>'); $oPage->add('</fieldset>'); $oPage->add('<fieldset>'); $oPage->add('<legend>Path to Graphviz\' dot application</legend>'); $oPage->add('<table>'); $oPage->add('<tr><td>Path: </td><td><input id="graphviz_path" name="graphviz_path" type="text" size="35" maxlength="1024" value="' . htmlentities($sGraphvizPath, ENT_QUOTES, 'UTF-8') . '"><span id="v_graphviz_path"/></td><tr>'); $oPage->add('<tr><td colspan="2"><a href="http://www.graphviz.org" target="_blank">Graphviz</a> is required to display the impact analysis graph (i.e. impacts / depends on).</td><tr>'); $oPage->add('<tr><td colspan="2"><span id="graphviz_status"></span></td><tr>'); $oPage->add('</table>'); $oPage->add('</fieldset>'); $oPage->add('<fieldset>'); $oPage->add('<legend>Sample Data</legend>'); $sChecked = $sSampleData == 'yes' ? ' checked ' : ''; $oPage->p('<input id="sample_data_yes" name="sample_data" type="radio" value="yes"' . $sChecked . '><label for="sample_data_yes"> I am installing a <b>demo or test</b> instance, populate the database with some demo data.'); $sChecked = $sSampleData == 'no' ? ' checked ' : ''; $oPage->p('<input id="sample_data_no" name="sample_data" type="radio" value="no"' . $sChecked . '><label for="sample_data_no"> I am installing a <b>production</b> instance, create an empty database to start from.'); $oPage->add('</fieldset>'); $oPage->add_ready_script(<<<EOF \t\t\$('#application_url').bind('change keyup', function() { WizardUpdateButtons(); } ); \t\t\$('#graphviz_path').bind('change keyup init', function() { WizardUpdateButtons(); WizardAsyncAction('check_graphviz', { graphviz_path: \$('#graphviz_path').val() }); } ).trigger('init'); \t\t\$('#btn_next').click(function() { \t\t\tbRet = true; \t\t\tif (\$(this).attr('data-graphviz') != 'ok') \t\t\t{ \t\t\t\tbRet = confirm('The impact analysis will not be displayed properly. Are you sure you want to continue?'); \t\t\t} \t\t\treturn bRet; \t\t}); EOF ); }