diff options
author | Michal Čihař <mcihar@suse.cz> | 2013-08-07 15:43:30 +0400 |
---|---|---|
committer | Michal Čihař <mcihar@suse.cz> | 2013-08-07 15:48:20 +0400 |
commit | 6ac552ac7cd3f8f2ad817fd3b4349a9105417be0 (patch) | |
tree | f5800207680cdef944dcbdffab93d5e450f6bc77 /setup | |
parent | cb5e1cb96663925ee862e891f531a9e73d6b6223 (diff) |
No more inline html
Diffstat (limited to 'setup')
-rw-r--r-- | setup/frames/config.inc.php | 44 | ||||
-rw-r--r-- | setup/frames/index.inc.php | 269 | ||||
-rw-r--r-- | setup/frames/menu.inc.php | 25 |
3 files changed, 192 insertions, 146 deletions
diff --git a/setup/frames/config.inc.php b/setup/frames/config.inc.php index c409c64756..40555463d4 100644 --- a/setup/frames/config.inc.php +++ b/setup/frames/config.inc.php @@ -21,28 +21,32 @@ $config_readable = false; $config_writable = false; $config_exists = false; check_config_rw($config_readable, $config_writable, $config_exists); -?> -<h2><?php echo __('Configuration file') ?></h2> -<?php PMA_displayFormTop('config.php'); ?> -<input type="hidden" name="eol" value="<?php echo htmlspecialchars(PMA_ifSetOr($_GET['eol'], 'unix')) ?>" /> -<?php PMA_displayFieldsetTop('', '', null, array('class' => 'simple')); ?> -<tr> - <td> - <textarea cols="50" rows="20" name="textconfig" id="textconfig" spellcheck="false"><?php - echo htmlspecialchars(ConfigGenerator::getConfigFile()) - ?></textarea> - </td> -</tr> -<tr> - <td class="lastrow" style="text-align: left"> - <input type="submit" name="submit_download" value="<?php echo __('Download') ?>" class="green" /> - <input type="submit" name="submit_save" value="<?php echo __('Save') ?>"<?php +echo '<h2>' . __('Configuration file') . '</h2>'; + +PMA_displayFormTop('config.php'); +echo '<input type="hidden" name="eol" value="' + . htmlspecialchars(PMA_ifSetOr($_GET['eol'], 'unix')) . '" />'; +PMA_displayFieldsetTop('', '', null, array('class' => 'simple')); +echo '<tr>'; +echo '<td>'; +echo '<textarea cols="50" rows="20" name="textconfig" ' + . 'id="textconfig" spellcheck="false">'; +echo htmlspecialchars(ConfigGenerator::getConfigFile()); +echo '</textarea>'; +echo '</td>'; +echo '</tr>'; +echo '<tr>'; +echo '<td class="lastrow" style="text-align: left">'; +echo '<input type="submit" name="submit_download" value="' + . __('Download') . '" class="green" />'; +echo '<input type="submit" name="submit_save" value="' . __('Save') . '"'; if (!$config_writable) { echo ' disabled="disabled"'; -} ?> /> - </td> -</tr> -<?php +} +echo '/>'; +echo '</td>'; +echo '</tr>'; + PMA_displayFieldsetBottomSimple(); PMA_displayFormBottom(); ?> diff --git a/setup/frames/index.inc.php b/setup/frames/index.inc.php index 8b5718628f..195df033fe 100644 --- a/setup/frames/index.inc.php +++ b/setup/frames/index.inc.php @@ -49,7 +49,14 @@ check_config_rw($config_readable, $config_writable, $config_exists); if (!$config_writable || !$config_readable) { messages_set( 'error', 'config_rw', __('Cannot load or save configuration'), - PMA_lang(__('Please create web server writable folder [em]config[/em] in phpMyAdmin top level directory as described in [doc@setup_script]documentation[/doc]. Otherwise you will be only able to download or display it.')) + PMA_sanitize( + __( + 'Please create web server writable folder [em]config[/em] in ' + . 'phpMyAdmin top level directory as described in ' + . '[doc@setup_script]documentation[/doc]. Otherwise you will be ' + . 'only able to download or display it.' + ) + ) ); } // @@ -57,65 +64,83 @@ if (!$config_writable || !$config_readable) { // $is_https = !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on'; if (!$is_https) { - $text = __('You are not using a secure connection; all data (including potentially sensitive information, like passwords) is transferred unencrypted!'); + $text = __( + 'You are not using a secure connection; all data (including potentially ' + . 'sensitive information, like passwords) is transferred unencrypted!' + ); if (!empty($_SERVER['REQUEST_URI']) && !empty($_SERVER['HTTP_HOST'])) { - $link = 'https://' . htmlspecialchars($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); - $strInsecureConnectionMsg2 = __('If your server is also configured to accept HTTPS requests follow [a@%s]this link[/a] to use a secure connection.'); - $strInsecureConnectionMsg2 = sprintf($strInsecureConnectionMsg2, $link); - $text .= ' ' . PMA_lang($strInsecureConnectionMsg2); + $link = htmlspecialchars( + 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] + ); + $text .= ' '; + $text .= PMA_sanitize( + sprintf( + __( + 'If your server is also configured to accept HTTPS requests ' + . 'follow [a@%s]this link[/a] to use a secure connection.' + ), + $link + ) + ); } messages_set('notice', 'no_https', __('Insecure connection'), $text); } -?> - -<form id="select_lang" method="post" action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']) ?>"> - <?php echo PMA_URL_getHiddenInputs() ?> - <bdo lang="en" dir="ltr"><label for="lang"> - <?php echo __('Language') . (__('Language') != 'Language' ? ' - Language' : '') ?> - </label></bdo><br /> - <select id="lang" name="lang" class="autosubmit" lang="en" dir="ltr"> - <?php - // create language list - $lang_list = array(); - foreach ($all_languages as $each_lang_key => $each_lang) { - $lang_name = PMA_languageName($each_lang); - //Is current one active? - $selected = ($GLOBALS['lang'] == $each_lang_key) ? ' selected="selected"' : ''; - echo '<option value="' . $each_lang_key . '"' . $selected . '>' . $lang_name - . '</option>' . "\n"; - } - ?> - </select> -</form> -<?php +echo '<form id="select_lang" method="post" action="' + . htmlspecialchars($_SERVER['REQUEST_URI']) . '">'; +echo PMA_URL_getHiddenInputs(); +echo '<bdo lang="en" dir="ltr"><label for="lang">'; +echo __('Language') . (__('Language') != 'Language' ? ' - Language' : ''); +echo '</label></bdo><br />'; +echo '<select id="lang" name="lang" class="autosubmit" lang="en" dir="ltr">'; + +// create language list +$lang_list = array(); +foreach ($all_languages as $each_lang_key => $each_lang) { + $lang_name = PMA_languageName($each_lang); + //Is current one active? + $selected = ($GLOBALS['lang'] == $each_lang_key) ? ' selected="selected"' : ''; + echo '<option value="' . $each_lang_key . '"' . $selected . '>' . $lang_name + . '</option>' . "\n"; +} + +echo '</select>'; +echo '</form>'; + // Check for done action info and set notice message if present switch ($action_done) { case 'config_saved': /* Use uniqid to display this message every time configuration is saved */ messages_set( 'notice', uniqid('config_saved'), __('Configuration saved.'), - PMA_lang(__('Configuration saved to file config/config.inc.php in phpMyAdmin top level directory, copy it to top level one and delete directory config to use it.')) + PMA_sanitize( + __( + 'Configuration saved to file config/config.inc.php in phpMyAdmin ' + . 'top level directory, copy it to top level one and delete ' + . 'directory config to use it.' + ) + ) ); break; default: break; } -?> -<h2><?php echo __('Overview') ?></h2> +echo '<h2>' . __('Overview') . '</h2>'; -<?php // message handling messages_end(); messages_show_html(); -?> -<a href="#" id="show_hidden_messages" style="display:none"><?php echo __('Show hidden messages (#MSG_COUNT)') ?></a> +echo '<a href="#" id="show_hidden_messages" style="display:none">'; +echo __('Show hidden messages (#MSG_COUNT)'); +echo '</a>'; + +echo '<fieldset class="simple"><legend>'; +echo __('Servers'); +echo '</legend>'; -<fieldset class="simple"><legend><?php echo __('Servers') ?></legend> -<?php // // Display server list // @@ -126,64 +151,70 @@ PMA_displayFormTop( 'mode' => 'add' ) ); -?> -<div class="form"> -<?php if ($cf->getServerCount() > 0) { ?> -<table cellspacing="0" class="datatable" style="table-layout: fixed"> -<tr> - <th>#</th> - <th><?php echo __('Name') ?></th> - <th><?php echo __('Authentication type') ?></th> - <th colspan="2">DSN</th> -</tr> -<?php foreach ($cf->getServers() as $id => $server) { ?> -<tr> - <td><?php echo $id ?></td> - <td><?php echo htmlspecialchars($cf->getServerName($id)) ?></td> - <td><?php echo htmlspecialchars($cf->getValue("Servers/$id/auth_type")) ?></td> - <td><?php echo htmlspecialchars($cf->getServerDSN($id)) ?></td> - <td style="white-space: nowrap"> - <small> - <a href="<?php echo "?page=servers{$separator}mode=edit{$separator}id=$id" ?>"><?php echo __('Edit') ?></a> - | <a href="<?php echo "?page=servers{$separator}mode=remove{$separator}id=$id" ?>"><?php echo __('Delete') ?></a> - </small> - </td> -</tr> -<?php } ?> -</table> -<?php } else { ?> -<table width="100%"> -<tr> - <td> - <i><?php echo __('There are no configured servers') ?></i> - </td> -</tr> -</table> -<?php } ?> -<table width="100%"> -<tr> - <td class="lastrow" style="text-align: left"> - <input type="submit" name="submit" value="<?php echo __('New server') ?>" /> - </td> -</tr> -</table> -</div> -<?php +echo '<div class="form">'; +if ($cf->getServerCount() > 0) { + echo '<table cellspacing="0" class="datatable" style="table-layout: fixed">'; + echo '<tr>'; + echo '<th>#</th>'; + echo '<th>' . __('Name') . '</th>'; + echo '<th>' . __('Authentication type') . '</th>'; + echo '<th colspan="2">DSN</th>'; + echo '</tr>'; + + foreach ($cf->getServers() as $id => $server) { + echo '<tr>'; + echo '<td>' . $id . '</td>'; + echo '<td>' . htmlspecialchars($cf->getServerName($id)) . '</td>'; + echo '<td>' + . htmlspecialchars($cf->getValue("Servers/$id/auth_type")) + . '</td>'; + echo '<td>' . htmlspecialchars($cf->getServerDSN($id)) . '</td>'; + echo '<td style="white-space: nowrap">'; + echo '<small>'; + echo '<a href="?page=servers' . $separator + . 'mode=edit' . $separator . 'id=' . $id . '">' + . __('Edit') . '</a>'; + echo ' | '; + echo '<a href="?page=servers' . $separator + . 'mode=remove' . $separator . 'id=' . $id . '">' + . __('Delete') . '</a>'; + echo '</small>'; + echo '</td>'; + echo '</tr>'; + } + echo '</table>'; +} else { + echo '<table width="100%">'; + echo '<tr>'; + echo '<td>'; + echo '<i>' . __('There are no configured servers') . '</i>'; + echo '</td>'; + echo '</tr>'; + echo '</table>'; +} + +echo '<table width="100%">'; +echo '<tr>'; +echo '<td class="lastrow" style="text-align: left">'; +echo '<input type="submit" name="submit" value="' . __('New server') . '" />'; +echo '</td>'; +echo '</tr>'; +echo '</table>'; +echo '</div>'; + PMA_displayFormBottom(); -?> -</fieldset> -<fieldset class="simple"><legend><?php echo __('Configuration file') ?></legend> -<?php +echo '</fieldset>'; + +echo '<fieldset class="simple"><legend>' . __('Configuration file') . '</legend>'; + // // Display config file settings and load/save form // $form_display = new FormDisplay(); PMA_displayFormTop('config.php'); -?> -<table width="100%" cellspacing="0"> -<?php +echo '<table width="100%" cellspacing="0">'; // Display language list $opts = array( @@ -237,40 +268,46 @@ PMA_displayInput( 'eol', __('End of line'), 'select', $eol, '', true, $opts ); -?> -<tr> - <td colspan="2" class="lastrow" style="text-align: left"> - <input type="submit" name="submit_display" value="<?php echo __('Display') ?>" /> - <input type="submit" name="submit_download" value="<?php echo __('Download') ?>" /> - - <input type="submit" name="submit_save" value="<?php echo __('Save') ?>"<?php + +echo '<tr>'; +echo '<td colspan="2" class="lastrow" style="text-align: left">'; +echo '<input type="submit" name="submit_display" value="' . __('Display') . '" />'; +echo '<input type="submit" name="submit_download" value="' . __('Download') . '" />'; +echo ' '; + +echo '<input type="submit" name="submit_save" value="' . __('Save') . '"'; if (!$config_writable) { echo ' disabled="disabled"'; -} ?> /> - <input type="submit" name="submit_load" value="<?php echo __('Load') ?>"<?php +} +echo '/>'; + +echo '<input type="submit" name="submit_load" value="' . __('Load') . '"'; if (!$config_exists) { echo ' disabled="disabled"'; -} ?> /> - <input type="submit" name="submit_delete" value="<?php echo __('Delete') - ?>"<?php +} +echo '/>'; + +echo '<input type="submit" name="submit_delete" value="' . __('Delete') . '"'; if (!$config_exists || !$config_writable) { echo ' disabled="disabled"'; -} ?> /> - - <input type="submit" name="submit_clear" value="<?php echo __('Clear') - ?>" class="red" /> - </td> -</tr> -</table> -<?php +} +echo '/>'; + +echo ' '; +echo '<input type="submit" name="submit_clear" value="' . __('Clear') + . '" class="red" />'; +echo '</td>'; +echo '</tr>'; +echo '</table>'; + PMA_displayFormBottom(); -?> -</fieldset> -<div id="footer"> - <a href="http://phpmyadmin.net"><?php echo __('phpMyAdmin homepage') ?></a> - <a href="http://sourceforge.net/donate/index.php?group_id=23067"><?php - echo __('Donate') ?></a> - <a href="?version_check=1<?php - echo "{$separator}token=" - . $_SESSION[' PMA_token '] ?>"><?php echo __('Check for latest version') ?></a> -</div> + +echo '</fieldset>'; +echo '<div id="footer">'; +echo '<a href="http://www.phpmyadmin.net/">' . __('phpMyAdmin homepage') . '</a>'; +echo '<a href="http://sourceforge.net/donate/index.php?group_id=23067">' + . __('Donate') . '</a>'; +echo '<a href="?version_check=1' . $separator + . 'token=' . $_SESSION[' PMA_token '] . '">' + . __('Check for latest version') . '</a>'; +echo '</div>'; diff --git a/setup/frames/menu.inc.php b/setup/frames/menu.inc.php index 35011d4807..0ca99109a9 100644 --- a/setup/frames/menu.inc.php +++ b/setup/frames/menu.inc.php @@ -11,13 +11,18 @@ if (!defined('PHPMYADMIN')) { } $separator = PMA_URL_getArgSeparator('html'); -?> -<ul> - <li><a href="index.php"><?php echo __('Overview') ?></a></li> - <li><a href="?page=form<?php echo $separator ?>formset=Features"><?php echo __('Features') ?></a></li> - <li><a href="?page=form<?php echo $separator ?>formset=Sql_queries"><?php echo __('SQL queries') ?></a></li> - <li><a href="?page=form<?php echo $separator ?>formset=Navi_panel"><?php echo __('Navigation panel') ?></a></li> - <li><a href="?page=form<?php echo $separator ?>formset=Main_panel"><?php echo __('Main panel') ?></a></li> - <li><a href="?page=form<?php echo $separator ?>formset=Import"><?php echo __('Import') ?></a></li> - <li><a href="?page=form<?php echo $separator ?>formset=Export"><?php echo __('Export') ?></a></li> -</ul> +echo '<ul>'; +echo '<li><a href="index.php">' . __('Overview') . '</a></li>'; +echo '<li><a href="?page=form' . $separator . 'formset=Features">' + . __('Features') . '</a></li>'; +echo '<li><a href="?page=form' . $separator . 'formset=Sql_queries">' + . __('SQL queries') . '</a></li>'; +echo '<li><a href="?page=form' . $separator . 'formset=Navi_panel">' + . __('Navigation panel') . '</a></li>'; +echo '<li><a href="?page=form' . $separator . 'formset=Main_panel">' + . __('Main panel') . '</a></li>'; +echo '<li><a href="?page=form' . $separator . 'formset=Import">' + . __('Import') . '</a></li>'; +echo '<li><a href="?page=form' . $separator . 'formset=Export">' + . __('Export') . '</a></li>'; +echo '</ul>'; |