make font size user configurable
This commit is contained in:
10
ChangeLog
10
ChangeLog
@@ -5,6 +5,10 @@ phpMyAdmin - ChangeLog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
|
2006-07-31 Sebastian Mendel <cybot_tm@users.sourceforge.net>
|
||||||
|
* css\phpmyadmin.css.php, libraries\Config.class.php, main.php,
|
||||||
|
themes\*: make font size user configurable
|
||||||
|
|
||||||
2006-07-30 Marc Delisle <lem9@users.sourceforge.net>
|
2006-07-30 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* libraries/sqlparser.lib.php: bug #1526000, copy table on MySQL 5.0.23+,
|
* libraries/sqlparser.lib.php: bug #1526000, copy table on MySQL 5.0.23+,
|
||||||
thanks to Rapsys Phoenix - rapsys
|
thanks to Rapsys Phoenix - rapsys
|
||||||
@@ -21,9 +25,9 @@ $Source$
|
|||||||
bug #1521910, with selected ... print view
|
bug #1521910, with selected ... print view
|
||||||
|
|
||||||
2006-07-26 Marc Delisle <lem9@users.sourceforge.net>
|
2006-07-26 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* server_privileges.php: bug #1526557, display error when admin
|
* server_privileges.php: bug #1526557, display error when admin
|
||||||
lacks some privileges and tries to do a privilege change
|
lacks some privileges and tries to do a privilege change
|
||||||
* libraries/common.lib.php: bug #1523784, blank page after Edit
|
* libraries/common.lib.php: bug #1523784, blank page after Edit
|
||||||
in IE6 via IIS
|
in IE6 via IIS
|
||||||
|
|
||||||
2006-07-22 Marc Delisle <lem9@users.sourceforge.net>
|
2006-07-22 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
@@ -37,7 +41,7 @@ $Source$
|
|||||||
* scripts/setup.php: Implement own var_export.
|
* scripts/setup.php: Implement own var_export.
|
||||||
|
|
||||||
2006-07-19 Marc Delisle <lem9@users.sourceforge.net>
|
2006-07-19 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* browse_foreigners.php: bug #1525393, no page selector in foreign key
|
* browse_foreigners.php: bug #1525393, no page selector in foreign key
|
||||||
browse page
|
browse page
|
||||||
|
|
||||||
2006-07-19 Michal Čihař <michal@cihar.com>
|
2006-07-19 Michal Čihař <michal@cihar.com>
|
||||||
|
@@ -19,6 +19,14 @@ if ($GLOBALS['text_dir'] === 'ltr') {
|
|||||||
header('Content-Type: text/css; charset=ISO-8859-1');
|
header('Content-Type: text/css; charset=ISO-8859-1');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
html {
|
||||||
|
font-size: <?php echo $_SESSION['PMA_Config']->get('fontsize'); ?>;
|
||||||
|
}
|
||||||
|
|
||||||
|
input, select, textarea {
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
/* @deprecated */
|
/* @deprecated */
|
||||||
.nowrap {
|
.nowrap {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
@@ -309,6 +309,7 @@ class PMA_Config
|
|||||||
$this->checkIsHttps();
|
$this->checkIsHttps();
|
||||||
|
|
||||||
$this->checkCollationConnection();
|
$this->checkCollationConnection();
|
||||||
|
$this->checkFontsize();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -394,6 +395,7 @@ class PMA_Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->checkCollationConnection();
|
$this->checkCollationConnection();
|
||||||
|
$this->checkFontsize();
|
||||||
//$this->checkPmaAbsoluteUri();
|
//$this->checkPmaAbsoluteUri();
|
||||||
$this->settings = PMA_array_merge_recursive($this->settings, $cfg);
|
$this->settings = PMA_array_merge_recursive($this->settings, $cfg);
|
||||||
return true;
|
return true;
|
||||||
@@ -667,6 +669,29 @@ class PMA_Config
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkFontsize()
|
||||||
|
{
|
||||||
|
$new_fontsize = '';
|
||||||
|
|
||||||
|
if (isset($_GET['fontsize'])) {
|
||||||
|
$new_fontsize = $_GET['fontsize'];
|
||||||
|
} elseif (isset($_POST['fontsize'])) {
|
||||||
|
$new_fontsize = $_POST['fontsize'];
|
||||||
|
} elseif (isset($_COOKIE['pma_fontsize'])) {
|
||||||
|
$new_fontsize = $_COOKIE['pma_fontsize'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (preg_match('/^[0-9.]+(px|em|pt|\%)$/', $new_fontsize)) {
|
||||||
|
$this->set('fontsize', $new_fontsize);
|
||||||
|
} elseif (! $this->get('fontsize')) {
|
||||||
|
$this->set('fontsize', '100%');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (function_exists('PMA_setCookie')) {
|
||||||
|
PMA_setCookie('pma_fontsize', $this->get('fontsize'), '100%');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* checks if upload is enabled
|
* checks if upload is enabled
|
||||||
*
|
*
|
||||||
@@ -835,5 +860,107 @@ class PMA_Config
|
|||||||
* @todo finish
|
* @todo finish
|
||||||
*/
|
*/
|
||||||
function save() {}
|
function save() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns options for font size selection
|
||||||
|
*
|
||||||
|
* @param string $current_size current selected font size with unit
|
||||||
|
* @return array selectable font sizes
|
||||||
|
*/
|
||||||
|
function getFontsizeOptions($current_size = '100%')
|
||||||
|
{
|
||||||
|
$unit = preg_replace('/[0-9.]*/', '', $current_size);
|
||||||
|
$value = preg_replace('/[^0-9.]*/', '', $current_size);
|
||||||
|
|
||||||
|
$factors = array();
|
||||||
|
$options = array();
|
||||||
|
$options["$value"] = $value . $unit;
|
||||||
|
|
||||||
|
if ($unit === '%') {
|
||||||
|
$factors[] = 1;
|
||||||
|
$factors[] = 5;
|
||||||
|
$factors[] = 10;
|
||||||
|
} elseif ($unit === 'em') {
|
||||||
|
$factors[] = 0.05;
|
||||||
|
$factors[] = 0.2;
|
||||||
|
$factors[] = 1;
|
||||||
|
} elseif ($unit === 'pt') {
|
||||||
|
$factors[] = 0.5;
|
||||||
|
$factors[] = 2;
|
||||||
|
} elseif ($unit === 'px') {
|
||||||
|
$factors[] = 1;
|
||||||
|
$factors[] = 5;
|
||||||
|
$factors[] = 10;
|
||||||
|
} else {
|
||||||
|
//unknown font size unit
|
||||||
|
$factors[] = 0.05;
|
||||||
|
$factors[] = 0.2;
|
||||||
|
$factors[] = 1;
|
||||||
|
$factors[] = 5;
|
||||||
|
$factors[] = 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($factors as $key => $factor) {
|
||||||
|
$option_inc = $value + $factor;
|
||||||
|
$option_dec = $value - $factor;
|
||||||
|
while (count($options) < 21) {
|
||||||
|
$options["$option_inc"] = $option_inc . $unit;
|
||||||
|
if ($option_dec > $factors[0]) {
|
||||||
|
$options["$option_dec"] = $option_dec . $unit;
|
||||||
|
}
|
||||||
|
$option_inc += $factor;
|
||||||
|
$option_dec -= $factor;
|
||||||
|
if (isset($factors[$key + 1])
|
||||||
|
&& $option_inc >= $value + $factors[$key + 1]) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ksort($options);
|
||||||
|
return $options;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns html selectbox for font sizes
|
||||||
|
*
|
||||||
|
* @param string $current_size currently slected font size with unit
|
||||||
|
* @return string html selectbox
|
||||||
|
*/
|
||||||
|
function getFontsizeSelection()
|
||||||
|
{
|
||||||
|
$current_size = $_SESSION['PMA_Config']->get('fontsize');
|
||||||
|
$options = PMA_Config::getFontsizeOptions($current_size);
|
||||||
|
|
||||||
|
$return = '<label for="select_fontsize">' . $GLOBALS['strFont_size'] . ':</label>' . "\n";
|
||||||
|
$return .= '<select name="fontsize" id="select_fontsize" onchange="this.form.submit();">' . "\n";
|
||||||
|
foreach ($options as $option) {
|
||||||
|
$return .= '<option value="' . $option . '"';
|
||||||
|
if ($option == $current_size) {
|
||||||
|
$return .= ' selected="selected"';
|
||||||
|
}
|
||||||
|
$return .= '>' . $option . '</option>' . "\n";
|
||||||
|
}
|
||||||
|
$return .= '</select>';
|
||||||
|
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return complete font size selection form
|
||||||
|
*
|
||||||
|
* @param string $current_size currently slected font size with unit
|
||||||
|
* @return string html selectbox
|
||||||
|
*/
|
||||||
|
function getFontsizeForm()
|
||||||
|
{
|
||||||
|
return '<form name="form_fontsize_selection" id="form_fontsize_selection"'
|
||||||
|
. ' method="post" action="index.php" target="_parent">' . "\n"
|
||||||
|
. PMA_generate_common_hidden_inputs() . "\n"
|
||||||
|
. PMA_Config::getFontsizeSelection() . "\n"
|
||||||
|
. '<noscript>' . "\n"
|
||||||
|
. '<input type="submit" value="' . $GLOBALS['strGo'] . '" />' . "\n"
|
||||||
|
. '</noscript>' . "\n"
|
||||||
|
. '</form>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
3
main.php
3
main.php
@@ -282,6 +282,9 @@ if ($GLOBALS['cfg']['ThemeManager']) {
|
|||||||
echo $_SESSION['PMA_Theme_Manager']->getHtmlSelectBox();
|
echo $_SESSION['PMA_Theme_Manager']->getHtmlSelectBox();
|
||||||
echo '</li>';
|
echo '</li>';
|
||||||
}
|
}
|
||||||
|
echo '<li id="li_select_fontsize">';
|
||||||
|
echo PMA_Config::getFontsizeForm();
|
||||||
|
echo '</li>';
|
||||||
PMA_printListItem($strPmaDocumentation, 'li_pma_docs', 'Documentation.html');
|
PMA_printListItem($strPmaDocumentation, 'li_pma_docs', 'Documentation.html');
|
||||||
|
|
||||||
if ($cfg['ShowPhpInfo']) {
|
if ($cfg['ShowPhpInfo']) {
|
||||||
|
@@ -6,30 +6,22 @@
|
|||||||
?>
|
?>
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* general tags */
|
/* general tags */
|
||||||
<?php if (! empty($GLOBALS['cfg']['FontFamily'])) { ?>
|
|
||||||
* {
|
|
||||||
font-family: <?php echo $GLOBALS['cfg']['FontFamily']; ?>;
|
|
||||||
}
|
|
||||||
<?php } if (! empty($GLOBALS['cfg']['FontFamilyFixed'])) { ?>
|
|
||||||
textarea {
|
|
||||||
font-family: <?php echo $GLOBALS['cfg']['FontFamilyFixed']; ?>;
|
|
||||||
}
|
|
||||||
<?php } if (! empty($GLOBALS['cfg']['FontSize'])) { ?>
|
|
||||||
body, table, tbody, tr, td {
|
|
||||||
font-size: <?php echo $GLOBALS['cfg']['FontSize']; ?>;
|
|
||||||
}
|
|
||||||
select, input, textarea {
|
|
||||||
font-size: 0.7em;
|
|
||||||
}
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
body {
|
body {
|
||||||
|
<?php if (! empty($GLOBALS['cfg']['FontFamily'])) { ?>
|
||||||
|
font-family: <?php echo $GLOBALS['cfg']['FontFamily']; ?>;
|
||||||
|
<?php } ?>
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0.5em;
|
margin: 0.5em;
|
||||||
color: <?php echo $GLOBALS['cfg']['MainColor']; ?>;
|
color: <?php echo $GLOBALS['cfg']['MainColor']; ?>;
|
||||||
background: <?php echo $GLOBALS['cfg']['MainBackground']; ?>;
|
background: <?php echo $GLOBALS['cfg']['MainBackground']; ?>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<?php if (! empty($GLOBALS['cfg']['FontFamilyFixed'])) { ?>
|
||||||
|
textarea, tt, pre, code {
|
||||||
|
font-family: <?php echo $GLOBALS['cfg']['FontFamilyFixed']; ?>;
|
||||||
|
}
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 180%;
|
font-size: 180%;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
@@ -53,7 +53,7 @@ $GLOBALS['cfg']['FontFamilyFixed'] = 'monospace';
|
|||||||
* if not set the browser default will be used
|
* if not set the browser default will be used
|
||||||
* (depending on browser, DTD and system settings)
|
* (depending on browser, DTD and system settings)
|
||||||
*/
|
*/
|
||||||
$GLOBALS['cfg']['FontSize'] = '8pt';
|
$GLOBALS['cfg']['FontSize'] = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tables
|
* tables
|
||||||
|
@@ -6,20 +6,11 @@ if (!defined('PMA_MINIMUM_COMMON')) {
|
|||||||
?>
|
?>
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* general tags */
|
/* general tags */
|
||||||
<?php if (! empty($GLOBALS['cfg']['FontFamily'])) { ?>
|
|
||||||
* {
|
|
||||||
font-family: <?php echo $GLOBALS['cfg']['FontFamily']; ?>;
|
|
||||||
}
|
|
||||||
<?php } if (! empty($GLOBALS['cfg']['FontSize'])) { ?>
|
|
||||||
body, table, tbody, tr, td {
|
|
||||||
font-size: <?php echo $GLOBALS['cfg']['FontSize']; ?>;
|
|
||||||
}
|
|
||||||
select, input, textarea {
|
|
||||||
font-size: 0.7em;
|
|
||||||
}
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
body {
|
body {
|
||||||
|
<?php if (! empty($GLOBALS['cfg']['FontFamily'])) { ?>
|
||||||
|
font-family: <?php echo $GLOBALS['cfg']['FontFamily']; ?>;
|
||||||
|
<?php } ?>
|
||||||
background: <?php echo $GLOBALS['cfg']['NaviBackground']; ?>;
|
background: <?php echo $GLOBALS['cfg']['NaviBackground']; ?>;
|
||||||
color: <?php echo $GLOBALS['cfg']['NaviColor']; ?>;
|
color: <?php echo $GLOBALS['cfg']['NaviColor']; ?>;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
@@ -6,30 +6,22 @@
|
|||||||
?>
|
?>
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* general tags */
|
/* general tags */
|
||||||
<?php if (! empty($GLOBALS['cfg']['FontFamily'])) { ?>
|
|
||||||
* {
|
|
||||||
font-family: <?php echo $GLOBALS['cfg']['FontFamily']; ?>;
|
|
||||||
}
|
|
||||||
<?php } if (! empty($GLOBALS['cfg']['FontFamilyFixed'])) { ?>
|
|
||||||
textarea {
|
|
||||||
font-family: <?php echo $GLOBALS['cfg']['FontFamilyFixed']; ?>;
|
|
||||||
}
|
|
||||||
<?php } if (! empty($GLOBALS['cfg']['FontSize'])) { ?>
|
|
||||||
body, table, tbody, tr, td {
|
|
||||||
font-size: <?php echo $GLOBALS['cfg']['FontSize']; ?>;
|
|
||||||
}
|
|
||||||
select, input, textarea {
|
|
||||||
font-size: 0.7em;
|
|
||||||
}
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
body {
|
body {
|
||||||
|
<?php if (! empty($GLOBALS['cfg']['FontFamily'])) { ?>
|
||||||
|
font-family: <?php echo $GLOBALS['cfg']['FontFamily']; ?>;
|
||||||
|
<?php } ?>
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0.5em;
|
margin: 0.5em;
|
||||||
color: <?php echo $GLOBALS['cfg']['MainColor']; ?>;
|
color: <?php echo $GLOBALS['cfg']['MainColor']; ?>;
|
||||||
background: <?php echo $GLOBALS['cfg']['MainBackground']; ?>;
|
background: <?php echo $GLOBALS['cfg']['MainBackground']; ?>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<?php if (! empty($GLOBALS['cfg']['FontFamilyFixed'])) { ?>
|
||||||
|
textarea, tt, pre, code {
|
||||||
|
font-family: <?php echo $GLOBALS['cfg']['FontFamilyFixed']; ?>;
|
||||||
|
}
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 140%;
|
font-size: 140%;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
Reference in New Issue
Block a user