Common strings for descriptions of DATE, TIME, DATETIME and VARCHAR2
[phpmyadmin.git] / setup / frames / index.inc.php
blobf4116969a616ef7b6db92eb1dad2e7ff39dc37e4
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Overview (main page)
6 * @package PhpMyAdmin-Setup
7 */
9 if (!defined('PHPMYADMIN')) {
10 exit;
13 /**
14 * Core libraries.
16 require_once './libraries/display_select_lang.lib.php';
17 require_once './libraries/config/FormDisplay.class.php';
18 require_once './setup/lib/index.lib.php';
20 // prepare unfiltered language list
21 $all_languages = PMA_langList();
22 uasort($all_languages, 'PMA_language_cmp');
24 $cf = ConfigFile::getInstance();
25 $separator = PMA_get_arg_separator('html');
27 // message handling
28 messages_begin();
31 // Check phpMyAdmin version
33 if (isset($_GET['version_check'])) {
34 PMA_version_check();
38 // Perform various security, compatibility and consistency checks
40 perform_config_checks();
43 // Check whether we can read/write configuration
45 $config_readable = false;
46 $config_writable = false;
47 $config_exists = false;
48 check_config_rw($config_readable, $config_writable, $config_exists);
49 if (!$config_writable || !$config_readable) {
50 messages_set(
51 'error', 'config_rw', __('Cannot load or save configuration'),
52 PMA_lang(__('Please create web server writable folder [em]config[/em] in phpMyAdmin top level directory as described in [a@Documentation.html#setup_script]documentation[/a]. Otherwise you will be only able to download or display it.'))
56 // Check https connection
58 $is_https = !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on';
59 if (!$is_https) {
60 $text = __('You are not using a secure connection; all data (including potentially sensitive information, like passwords) is transferred unencrypted!');
62 if (!empty($_SERVER['REQUEST_URI']) && !empty($_SERVER['HTTP_HOST'])) {
63 $link = 'https://' . htmlspecialchars($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
64 $strInsecureConnectionMsg2 = __('If your server is also configured to accept HTTPS requests follow [a@%s]this link[/a] to use a secure connection.');
65 $strInsecureConnectionMsg2 = sprintf($strInsecureConnectionMsg2, $link);
66 $text .= ' ' . PMA_lang($strInsecureConnectionMsg2);
68 messages_set('notice', 'no_https', __('Insecure connection'), $text);
72 <form id="select_lang" method="post" action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']) ?>">
73 <?php echo PMA_generate_common_hidden_inputs() ?>
74 <bdo lang="en" dir="ltr"><label for="lang">
75 <?php echo __('Language') . (__('Language') != 'Language' ? ' - Language' : '') ?>
76 </label></bdo><br />
77 <select id="lang" name="lang" class="autosubmit" lang="en" dir="ltr">
78 <?php
79 // create language list
80 $lang_list = array();
81 foreach ($all_languages as $each_lang_key => $each_lang) {
82 $lang_name = PMA_langName($each_lang);
83 //Is current one active?
84 $selected = ($GLOBALS['lang'] == $each_lang_key) ? ' selected="selected"' : '';
85 echo '<option value="' . $each_lang_key . '"' . $selected . '>' . $lang_name
86 . '</option>' . "\n";
89 </select>
90 </form>
92 <?php
93 // Check for done action info and set notice message if present
94 switch ($action_done) {
95 case 'config_saved':
96 /* Use uniqid to display this message every time configuration is saved */
97 messages_set(
98 'notice', uniqid('config_saved'), __('Configuration saved.'),
99 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.'))
101 break;
102 default:
103 break;
107 <h2><?php echo __('Overview') ?></h2>
109 <?php
110 // message handling
111 messages_end();
112 messages_show_html();
115 <a href="#" id="show_hidden_messages" style="display:none"><?php echo __('Show hidden messages (#MSG_COUNT)') ?></a>
117 <h3><?php echo __('Servers') ?></h3>
118 <?php
120 // Display server list
122 display_form_top(
123 'index.php', 'get',
124 array(
125 'page' => 'servers',
126 'mode' => 'add'
130 <div class="form">
131 <?php if ($cf->getServerCount() > 0) { ?>
132 <table cellspacing="0" class="datatable" style="table-layout: fixed">
133 <tr>
134 <th>#</th>
135 <th><?php echo __('Name') ?></th>
136 <th><?php echo __('Authentication type') ?></th>
137 <th colspan="2">DSN</th>
138 </tr>
139 <?php foreach ($cf->getServers() as $id => $server) { ?>
140 <tr>
141 <td><?php echo $id ?></td>
142 <td><?php echo htmlspecialchars($cf->getServerName($id)) ?></td>
143 <td><?php echo htmlspecialchars($cf->getValue("Servers/$id/auth_type")) ?></td>
144 <td><?php echo htmlspecialchars($cf->getServerDSN($id)) ?></td>
145 <td style="white-space: nowrap">
146 <small>
147 <a href="<?php echo "?page=servers{$separator}mode=edit{$separator}id=$id" ?>"><?php echo __('Edit') ?></a>
148 | <a href="<?php echo "?page=servers{$separator}mode=remove{$separator}id=$id" ?>"><?php echo __('Delete') ?></a>
149 </small>
150 </td>
151 </tr>
152 <?php } ?>
153 </table>
154 <?php } ?>
155 <table width="100%">
156 <tr>
157 <td>
158 <i><?php echo __('There are no configured servers') ?></i>
159 </td>
160 </tr>
161 </table>
162 <?php endif; ?>
163 <table width="100%">
164 <tr>
165 <td class="lastrow" style="text-align: left">
166 <input type="submit" name="submit" value="<?php echo __('New server') ?>" />
167 </td>
168 </tr>
169 </table>
170 </div>
171 <?php
172 display_form_bottom();
175 <h3><?php echo __('Configuration file') ?></h3>
176 <?php
178 // Display config file settings and load/save form
180 $form_display = new FormDisplay();
182 display_form_top('config.php');
183 display_fieldset_top('', '', null, array('class' => 'simple'));
185 // Display language list
186 $opts = array(
187 'doc' => $form_display->getDocLink('DefaultLang'),
188 'wiki' => $form_display->getWikiLink('DefaultLang'),
189 'values' => array(),
190 'values_escaped' => true);
191 foreach ($all_languages as $each_lang_key => $each_lang) {
192 $lang_name = PMA_langName($each_lang);
193 $opts['values'][$each_lang_key] = $lang_name;
195 display_input(
196 'DefaultLang', __('Default language'), '', 'select',
197 $cf->getValue('DefaultLang'), true, $opts
200 // Display server list
201 $opts = array(
202 'doc' => $form_display->getDocLink('ServerDefault'),
203 'wiki' => $form_display->getWikiLink('ServerDefault'),
204 'values' => array(),
205 'values_disabled' => array());
206 if ($cf->getServerCount() > 0) {
207 $opts['values']['0'] = __('let the user choose');
208 $opts['values']['-'] = '------------------------------';
209 if ($cf->getServerCount() == 1) {
210 $opts['values_disabled'][] = '0';
212 $opts['values_disabled'][] = '-';
214 foreach ($cf->getServers() as $id => $server) {
215 $opts['values'][(string)$id] = $cf->getServerName($id) . " [$id]";
217 } else {
218 $opts['values']['1'] = __('- none -');
219 $opts['values_escaped'] = true;
221 display_input(
222 'ServerDefault', __('Default server'), '', 'select',
223 $cf->getValue('ServerDefault'), true, $opts
226 // Display EOL list
227 $opts = array(
228 'values' => array(
229 'unix' => 'UNIX / Linux (\n)',
230 'win' => 'Windows (\r\n)'),
231 'values_escaped' => true);
232 $eol = PMA_ifSetOr($_SESSION['eol'], (PMA_IS_WINDOWS ? 'win' : 'unix'));
233 display_input(
234 'eol', __('End of line'), '', 'select',
235 $eol, true, $opts
238 <tr>
239 <td colspan="2" class="lastrow" style="text-align: left">
240 <input type="submit" name="submit_display" value="<?php echo __('Display') ?>" />
241 <input type="submit" name="submit_download" value="<?php echo __('Download') ?>" />
242 &nbsp; &nbsp;
243 <input type="submit" name="submit_save" value="<?php echo __('Save') ?>"<?php if (!$config_writable) echo ' disabled="disabled"' ?> />
244 <input type="submit" name="submit_load" value="<?php echo __('Load') ?>"<?php if (!$config_exists) echo ' disabled="disabled"' ?> />
245 <input type="submit" name="submit_delete" value="<?php echo __('Delete') ?>"<?php if (!$config_exists || !$config_writable) echo ' disabled="disabled"' ?> />
246 &nbsp; &nbsp;
247 <input type="submit" name="submit_clear" value="<?php echo __('Clear') ?>" class="red" />
248 </td>
249 </tr>
250 <?php
251 display_fieldset_bottom_simple();
252 display_form_bottom();
254 <div id="footer">
255 <a href="http://phpmyadmin.net"><?php echo __('phpMyAdmin homepage') ?></a>
256 <a href="http://sourceforge.net/donate/index.php?group_id=23067"><?php echo __('Donate') ?></a>
257 <a href="?version_check=1<?php echo "{$separator}token=" . $_SESSION[' PMA_token '] ?>"><?php echo __('Check for latest version') ?></a>
258 </div>