?? setup.php
字號:
* @param string title of configuration * @param string help string for this configuration * @param array optional first level defaults * @param string optional title for save button * @param string optional prefix for documentation links * * @return nothing */function show_config_form($list, $legend, $help, $defaults = array(), $save = '', $prefix = '') { global $PMA_Config_Setup; if (empty($save)) { $save = 'Update'; } echo '<fieldset class="optbox">' . "\n"; echo '<legend>' . $legend . '</legend>' . "\n"; echo '<p>' . $help . '</p>' . "\n"; foreach ($list as $val) { echo '<div class="opts">'; $type = 'text'; if (isset($val[3])) { if (is_array($val[3])) { $type = 'select'; } elseif (is_bool($val[3])) { $type = 'check'; } elseif ($val[3] == 'password') { $type = 'password'; } } switch ($type) { case 'text': case 'password': echo '<label for="text_' . $val[1] . '" class="desc" title="' . $val[2] . '">' . $val[0] . get_cfg_doc($prefix . $val[1]) . '</label>'; echo '<input type="' . $type . '" name="' . $val[1] . '" id="text_' . $val[1] . '" title="' . $val[2] . '" size="50"'; if (isset($defaults[$val[1]])) { echo ' value="' . htmlspecialchars($defaults[$val[1]]) . '"'; } else { echo ' value="' . htmlspecialchars($PMA_Config_Setup->get($val[1])) . '"'; } echo ' />'; break; case 'check': echo '<input type="checkbox" name="' . $val[1] . '" value="something" id="checkbox_' . $val[1] . '" title="' . $val[2] . '"'; if (isset($defaults[$val[1]])) { if ($defaults[$val[1]]) { echo ' checked="checked"'; } } else { if ($PMA_Config_Setup->get($val[1])) { echo ' checked="checked"'; } } echo ' />'; echo '<label for="checkbox_' . $val[1] . '" title="' . $val[2] . '">' . $val[0] . get_cfg_doc($prefix . $val[1]) . '</label>'; break; case 'select': echo '<label for="select_' . $val[1] . '" class="desc" title="' . $val[2] . '">' . $val[0] . get_cfg_doc($prefix . $val[1]) . '</label>'; echo '<select name="' . $val[1] . '" id="select_' . $val[1] . '" ' . ' title="' . $val[2] . '">'; foreach ($val[3] as $opt) { echo '<option value="' . $opt . '"'; if (isset($defaults[$val[1]])) { if (is_bool($defaults[$val[1]])) { if (($defaults[$val[1]] && $opt == 'TRUE') || (!$defaults[$val[1]] && $opt == 'FALSE')) { echo ' selected="selected"'; } } else { if ($defaults[$val[1]] == $opt) { echo ' selected="selected"'; } } } else { $def_val = $PMA_Config_Setup->get($val[1]); if (is_bool($val)) { if (($def_val && $opt == 'TRUE') || (!$def_val && $opt == 'FALSE')) { echo ' selected="selected"'; } } else { if ($def_val == $opt) { echo ' selected="selected"'; } } unset($def_val); } echo '>' . $opt . '</option>'; } echo '</select>'; break; } echo '</div>' . "\n"; } echo '<div class="buttons">'; echo '<div class="desc">Actions:</div>'; echo '<input type="submit" name="submit_save" value="' . $save .'" class="save" />'; echo '<input type="submit" name="submit_ignore" value="Cancel" class="cancel" />'; echo '</div>' . "\n"; echo '</fieldset>' . "\n"; echo "\n";}/** * Shows security options configuration form * * @param array optional defaults * * @return nothing */function show_security_form($defaults = array()) { ?><form method="post" action=""> <?php echo get_hidden_inputs();?> <input type="hidden" name="action" value="feat_security_real" /> <?php echo get_hidden_cfg(); show_config_form(array( array('Blowfish secret', 'blowfish_secret', 'Secret passphrase used for encrypting cookies'), array('Force SSL connection', 'ForceSSL', 'Whether to force using secured connection while using phpMyAdmin', FALSE), array('Show phpinfo output', 'ShowPhpInfo', 'Whether to allow users to see phpinfo() output', FALSE), array('Show password change form', 'ShowChgPassword', 'Whether to show form for changing password, this does not limit ability to execute the same command directly', FALSE), array('Allow login to any MySQL server', 'AllowArbitraryServer', 'If enabled user can enter any MySQL server in login form for cookie auth.', FALSE), array('Recall user name', 'LoginCookieRecall', 'Whether to recall user name on log in prompt while using cookie auth.', TRUE), array('Login cookie validity', 'LoginCookieValidity', 'How long is login valid without performing any action.'), ), 'Configure security features', 'Please note that phpMyAdmin is just a user interface and it\'s features do not limit MySQL.', $defaults); ?></form> <?php}/** * Shows MySQL manual configuration form * * @param array optional defaults * * @return nothing */function show_manual_form($defaults = array()) { ?><form method="post" action=""> <?php echo get_hidden_inputs();?> <input type="hidden" name="action" value="feat_manual_real" /> <?php echo get_hidden_cfg(); show_config_form(array( array('Type of MySQL documentation', 'MySQLManualType', 'These types are same as listed on MySQL download page', array('viewable', 'chapters', 'big', 'none')), array('Base URL of MySQL documentation', 'MySQLManualBase', 'Where is MySQL documentation placed, this is usually top level directory.'), ), 'Configure MySQL manual links', 'If you have local copy of MySQL documentation, you might want to use it in documentation links. Otherwise use <code>viewable</code> type and <code>http://dev.mysql.com/doc/refman</code> as manual base URL.', $defaults); ?></form> <?php}/** * Shows charset options configuration form * * @param array optional defaults * * @return nothing */function show_charset_form($defaults = array()) { global $PMA_Config_Setup; ?><form method="post" action=""> <?php echo get_hidden_inputs();?> <input type="hidden" name="action" value="feat_charset_real" /> <?php echo get_hidden_cfg(); show_config_form(array( array('Allow charset conversion', 'AllowAnywhereRecoding', 'If you want to use such functions.', FALSE), array('Default charset', 'DefaultCharset', 'Default charset for conversion.', $PMA_Config_Setup->get('AvailableCharsets')), array('Recoding engine', 'RecodingEngine', 'PHP can contain iconv and/or recode, select which one to use or keep autodetection.', array('auto', 'iconv', 'recode')), array('Extra params for iconv', 'IconvExtraParams', 'Iconv can get some extra parameters for conversion see man iconv_open.'), ), 'Configure charset conversions', 'phpMyAdmin can perform charset conversions so that you can import and export in any charset you want.', $defaults); ?></form> <?php}/** * Shows PHP extensions configuration form * * @param array optional defaults * * @return nothing */function show_extensions_form($defaults = array()) { ?><form method="post" action=""> <?php echo get_hidden_inputs();?> <input type="hidden" name="action" value="feat_extensions_real" /> <?php echo get_hidden_cfg(); show_config_form(array( array('GD 2 is available', 'GD2Available', 'Whether you have GD 2 or newer installed', array('auto', 'yes', 'no')), ), 'Configure extensions', 'phpMyAdmin can use several extensions, however here are configured only those that didn\'t fit elsewhere. MySQL extension is configured within server, charset conversion one on separate charsets page.', $defaults); ?></form> <?php}/** * Shows MIME/relation/history configuration form * * @param array optional defaults * * @return nothing */function show_relation_form($defaults = array()) { global $PMA_Config_Setup; ?><form method="post" action=""> <?php echo get_hidden_inputs();?> <input type="hidden" name="action" value="feat_relation_real" /> <?php echo get_hidden_cfg(); show_config_form(array( array('Permanent query history', 'QueryHistoryDB', 'Store history into database.', FALSE), array('Maximal history size', 'QueryHistoryMax', 'How many queries are kept in history.'), array('Use MIME transformations', 'BrowseMIME', 'Use MIME transformations while browsing.', TRUE), array('PDF default page size', 'PDFDefaultPageSize', 'Default page size for PDF, you can change this while creating page.', $PMA_Config_Setup->get('PDFPageSizes')), ), 'Configure MIME/relation/history', 'phpMyAdmin can provide additional features like MIME transformation, internal relations, permanent history and PDF pages generation. You have to configure the database and tables that will store this information on the server page. Behaviour of those functions is configured here.', $defaults); ?></form> <?php}/** * Shows upload/save configuration form * * @param array optional defaults * * @return nothing */function show_upload_form($defaults = array()) { ?><form method="post" action=""> <?php echo get_hidden_inputs();?> <input type="hidden" name="action" value="feat_upload_real" /> <?php echo get_hidden_cfg(); show_config_form(array( array('Upload directory', 'UploadDir', 'Directory on server where you can upload files for import'), array('Save directory', 'SaveDir', 'Directory where exports can be saved on server'), ), 'Configure upload/save directories', 'Enter directories, either absolute path or relative to phpMyAdmin top level directory.', $defaults); ?></form> <?php}/** * Shows server configuration form * * @param array optional defaults * * @return nothing */function show_server_form($defaults = array(), $number = FALSE) { ?><form method="post" action=""> <?php echo get_hidden_inputs();?> <input type="hidden" name="action" value="addserver_real" /> <?php echo get_hidden_cfg(); if (!($number === FALSE)) { echo '<input type="hidden" name="server" value="' . $number . '" />'; } $hi = array ('bookmarktable', 'relation', 'table_info', 'table_coords', 'pdf_pages', 'column_info', 'designer_coords', 'history', 'AllowDeny'); foreach ($hi as $k) { if (isset($defaults[$k]) && (!is_string($defaults[$k]) || strlen($defaults[$k]) > 0)) { echo '<input type="hidden" name="' . $k . '" value="' . htmlspecialchars(serialize($defaults[$k])) . '" />'; } } show_config_form(array( array('Server hostname', 'host', 'Hostname where MySQL server is running'), array('Server port', 'port', 'Port on which MySQL server is listening, leave empty for default'), array('Server socket', 'socket', 'Socket on which MySQL server is listening, leave empty for default'), array('Connection type', 'connect_type', 'How to connect to server, keep tcp if unsure', array('tcp', 'socket')), array('PHP extension to use', 'extension', 'What PHP extension to use, use mysqli if supported', array('mysql', 'mysqli')), array('Compress connection', 'compress', 'Whether to compress connection to MySQL server', FALSE), array('Authentication type', 'auth_type', 'Authentication method to use', array('cookie', 'http', 'config', 'signon')), array('User for config auth', 'user', 'Leave empty if not using config auth'), array('Password for config auth', 'password', 'Leave empty if not using config auth', 'password'), array('Only database to show', 'only_db', 'Limit listing of databases in left frame to this one'), array('Verbose name of this server', 'verbose', 'Name to display in server selection'), array('phpMyAdmin control user', 'controluser', 'User which phpMyAdmin can use for various actions'), array('phpMyAdmin control user password', 'controlpass', 'Password for user which phpMyAdmin can use for various actions', 'password'), array('phpMyAdmin database for advanced features', 'pmadb', 'phpMyAdmin will allow much more when you enable this. Table names are filled in automatically.'), array('Session name for signon auth', 'SignonSession', 'Leave empty if not using signon auth'), array('Login URL for signon auth', 'SignonURL', 'Leave empty if not using signon auth'), array('Logout URL', 'LogoutURL', 'Where to redirect user after logout'), ), 'Configure server', ($number === FALSE) ? 'Enter new server connection parameters.' : 'Editing server ' . get_server_name($defaults, $number), $defaults, $number === FALSE ? 'Add' : '', 'Servers_'); ?></form> <?php}/** * Shows left frame configuration form * * @param array optional defaults * * @return nothing */function show_left_form($defaults = array()) { ?><form method="post" action=""> <?php echo get_hidden_inputs();?> <input type="hidden" name="action" value="lay_navigation_real" /> <?php echo get_hidden_cfg(); show_config_form(array( array('Use light version', 'LeftFrameLight', 'Disable this if you want to see all databases at one time.', TRUE), array('Display databases in tree', 'LeftFrameDBTree', 'Whether to display databases in tree (determined by separator defined lower)', TRUE), array('Databases tree separator', 'LeftFrameDBSeparator', 'String that separates databases into different tree level'), array('Table tree separator', 'LeftFrameTableSeparator', 'String that separates tables into different tree level'), array('Maximum table tree nesting', 'LeftFrameTableLevel', 'Maximum number of children in table tree'), array('Show logo', 'LeftDisplayLogo', 'Whether to show logo in left frame', TRUE), array('Display servers selection', 'LeftDisplayServers', 'Whether to show server selection in left frame', FALSE), array('Display servers as list', 'DisplayServersList', 'Whether to show server listing as list instead of drop down', FALSE), array('Display databases as list', 'DisplayDatabasesList', 'Whether to show database listing in navigation as list instead of drop down', FALSE), array('Enable pointer highlighting', 'LeftPointerEnable', 'Whether you want to highlight server under mouse', TRUE), ), 'Configure navigation frame', 'Customize the appears of the navigation frame.', $defaults); ?></form> <?php}/** * Shows tabs configuration form *
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -