short comments for inputs:
- information whether SQL validator is enabled for Validate link - information about required extensions (SOAP, compression) - information for constrained values (eg. MaxDbList)
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
restore cache'ing in phpmyadmin.css.php
|
restore cache'ing in phpmyadmin.css.php
|
||||||
remove debug from user preferences header
|
remove debug from user preferences header
|
||||||
|
|
||||||
marker for extension dependent options (SOAP for sql validation)
|
|
||||||
|
|
||||||
info about setup script in prefs manage, it seems many people still don't know it exists
|
info about setup script in prefs manage, it seems many people still don't know it exists
|
||||||
(and maybe some description in docs on making it work with live configuration?)
|
(and maybe some description in docs on making it work with live configuration?)
|
||||||
|
|
||||||
info for constrained values (eg. MaxDbList)?
|
|
||||||
|
show blacklist (and debug?) on prefs manage page
|
||||||
|
@@ -109,6 +109,7 @@ class Form
|
|||||||
$value = array_combine($keys, $value);
|
$value = array_combine($keys, $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// $value has keys and value names, return it
|
// $value has keys and value names, return it
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
@@ -374,6 +374,7 @@ class FormDisplay
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$this->_setComments($system_path, $opts);
|
||||||
|
|
||||||
// send default value to form's JS
|
// send default value to form's JS
|
||||||
$js_line = '\'' . $translated_path . '\': ';
|
$js_line = '\'' . $translated_path . '\': ';
|
||||||
@@ -705,5 +706,67 @@ class FormDisplay
|
|||||||
$this->userprefs_disallow = array_flip($userprefs_disallow);
|
$this->userprefs_disallow = array_flip($userprefs_disallow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets field comments and warnings based on current environment
|
||||||
|
*
|
||||||
|
* @param string $system_path
|
||||||
|
* @param array $opts
|
||||||
|
*/
|
||||||
|
private function _setComments($system_path, array &$opts)
|
||||||
|
{
|
||||||
|
// RecodingEngine - mark unavailable types
|
||||||
|
if ($system_path == 'RecodingEngine') {
|
||||||
|
$comment = '';
|
||||||
|
if (!function_exists('iconv')) {
|
||||||
|
$opts['values']['iconv'] .= ' (' . __('unavailable') . ')';
|
||||||
|
$comment = sprintf(__('"%s" requires %s extension'), 'iconv', 'iconv');
|
||||||
|
}
|
||||||
|
if (!function_exists('recode_string')) {
|
||||||
|
$opts['values']['recode'] .= ' (' . __('unavailable') . ')';
|
||||||
|
$comment .= ($comment ? ", " : '') . sprintf(__('"%s" requires %s extension'),
|
||||||
|
'recode', 'recode');
|
||||||
|
}
|
||||||
|
$opts['comment'] = $comment;
|
||||||
|
$opts['comment_warning'] = true;
|
||||||
|
}
|
||||||
|
// ZipDump, GZipDump, BZipDump - check function availability
|
||||||
|
if ($system_path == 'ZipDump' || $system_path == 'GZipDump' || $system_path == 'BZipDump') {
|
||||||
|
$comment = '';
|
||||||
|
$funcs = array(
|
||||||
|
'ZipDump' => array('zip_open', 'gzcompress'),
|
||||||
|
'GZipDump' => array('gzopen', 'gzencode'),
|
||||||
|
'BZipDump' => array('bzopen', 'bzcompress'));
|
||||||
|
if (!function_exists($funcs[$system_path][0])) {
|
||||||
|
$comment = sprintf(__('import will not work, missing function (%s)'),
|
||||||
|
$funcs[$system_path][0]);
|
||||||
|
}
|
||||||
|
if (!function_exists($funcs[$system_path][1])) {
|
||||||
|
$comment .= ($comment ? '; ' : '') . sprintf(__('export will not work, missing function (%s)'),
|
||||||
|
$funcs[$system_path][1]);
|
||||||
|
}
|
||||||
|
$opts['comment'] = $comment;
|
||||||
|
$opts['comment_warning'] = true;
|
||||||
|
}
|
||||||
|
if ($system_path == 'SQLQuery/Validate' && !$GLOBALS['cfg']['SQLValidator']['use']) {
|
||||||
|
$opts['comment'] = __('SQL Validator is disabled');
|
||||||
|
$opts['comment_warning'] = true;
|
||||||
|
}
|
||||||
|
if ($system_path == 'SQLValidator/use') {
|
||||||
|
if (!class_exists('SOAPClient')) {
|
||||||
|
@include_once 'SOAP/Client.php';
|
||||||
|
if (!class_exists('SOAP_Client')) {
|
||||||
|
$opts['comment'] = __('SOAP extension not found');
|
||||||
|
$opts['comment_warning'] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!defined('PMA_SETUP') || !PMA_SETUP) {
|
||||||
|
if (($system_path == 'MaxDbList' || $system_path == 'MaxTableList'
|
||||||
|
|| $system_path == 'QueryHistoryMax')) {
|
||||||
|
$opts['comment'] = sprintf(__('maximum %s'), $GLOBALS['cfg'][$system_path]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
@@ -111,6 +111,8 @@ function display_fieldset_top($title = '', $description = '', $errors = null, $a
|
|||||||
* o values - key - value paris for <select> fields
|
* o values - key - value paris for <select> fields
|
||||||
* o values_escaped - (boolean) tells whether values array is already escaped (defaults to false)
|
* o values_escaped - (boolean) tells whether values array is already escaped (defaults to false)
|
||||||
* o values_disabled - (array)list of disabled values (keys from values)
|
* o values_disabled - (array)list of disabled values (keys from values)
|
||||||
|
* o comment - (string) tooltip comment
|
||||||
|
* o comment_warning - (bool) whether this comments warns about something
|
||||||
* o wiki - (string) wiki link
|
* o wiki - (string) wiki link
|
||||||
*
|
*
|
||||||
* @uses $GLOBALS['_FormDisplayGroup']
|
* @uses $GLOBALS['_FormDisplayGroup']
|
||||||
@@ -229,6 +231,15 @@ function display_input($path, $name, $description = '', $type, $value, $value_is
|
|||||||
. '</textarea>';
|
. '</textarea>';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (isset($opts['comment']) && $opts['comment']) {
|
||||||
|
$class = 'field-comment-mark';
|
||||||
|
if (isset($opts['comment_warning']) && $opts['comment_warning']) {
|
||||||
|
$class .= ' field-comment-warning';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<span class="<?php echo $class ?>" title="<?php echo htmlspecialchars($opts['comment']) ?>">i</span>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
if ($is_setup_script && isset($opts['userprefs_comment']) && $opts['userprefs_comment']) {
|
if ($is_setup_script && isset($opts['userprefs_comment']) && $opts['userprefs_comment']) {
|
||||||
?>
|
?>
|
||||||
<a class="userprefs-comment" title="<?php echo htmlspecialchars($opts['userprefs_comment']) ?>"><img alt="comment" src="<?php echo $img_path ?>b_tblops.png" width="16" height="16" /></a>
|
<a class="userprefs-comment" title="<?php echo htmlspecialchars($opts['userprefs_comment']) ?>"><img alt="comment" src="<?php echo $img_path ?>b_tblops.png" width="16" height="16" /></a>
|
||||||
|
@@ -363,6 +363,22 @@ input[type="text"]:focus, select:focus, textarea:focus {
|
|||||||
background: #F7FBFF;
|
background: #F7FBFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.field-comment {
|
||||||
|
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.field-comment-mark {
|
||||||
|
cursor: help;
|
||||||
|
padding: 0 0.2em;
|
||||||
|
font-weight: bold;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.field-comment-warning {
|
||||||
|
color: #A00;
|
||||||
|
}
|
||||||
|
|
||||||
.green { /* default form button */
|
.green { /* default form button */
|
||||||
color: #080;
|
color: #080;
|
||||||
}
|
}
|
||||||
|
@@ -1550,6 +1550,19 @@ fieldset .disabled-field td {
|
|||||||
background: #F7FBFF;
|
background: #F7FBFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.config-form .field-comment-mark {
|
||||||
|
font-family: serif;
|
||||||
|
color: #00A;
|
||||||
|
cursor: help;
|
||||||
|
padding: 0 0.2em;
|
||||||
|
font-weight: bold;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.config-form .field-comment-warning {
|
||||||
|
color: #A00;
|
||||||
|
}
|
||||||
|
|
||||||
/* error list */
|
/* error list */
|
||||||
.config-form dd {
|
.config-form dd {
|
||||||
margin-left: 0.5em;
|
margin-left: 0.5em;
|
||||||
|
@@ -1482,6 +1482,19 @@ fieldset .disabled-field td {
|
|||||||
background: #F7FBFF;
|
background: #F7FBFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.config-form .field-comment-mark {
|
||||||
|
font-family: serif;
|
||||||
|
color: #007;
|
||||||
|
cursor: help;
|
||||||
|
padding: 0 0.2em;
|
||||||
|
font-weight: bold;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.config-form .field-comment-warning {
|
||||||
|
color: #A00;
|
||||||
|
}
|
||||||
|
|
||||||
/* error list */
|
/* error list */
|
||||||
.config-form dd {
|
.config-form dd {
|
||||||
margin-left: 0.5em;
|
margin-left: 0.5em;
|
||||||
|
Reference in New Issue
Block a user