Merge remote-tracking branch 'origin/master'

This commit is contained in:
Pootle server
2011-05-05 10:40:18 +02:00
10 changed files with 168 additions and 72 deletions

View File

@@ -1118,25 +1118,32 @@ function changeMIMEType(db, table, reference, mime_type)
* Jquery Coding for inline editing SQL_QUERY * Jquery Coding for inline editing SQL_QUERY
*/ */
$(document).ready(function(){ $(document).ready(function(){
var oldText,db,table,token,sql_query; $(".inline_edit").click( function(){
oldText=$(".inner_sql").html(); var db = $(this).prev().find("input[name='db']").val();
$("#inline_edit").live('click',function(){ var table = $(this).prev().find("input[name='table']").val();
db=$("input[name='db']").val(); var token = $(this).prev().find("input[name='token']").val();
table=$("input[name='table']").val(); var sql_query = $(this).prev().find("input[name='sql_query']").val();
token=$("input[name='token']").val(); var $inner_sql = $(this).parent().prev().find('.inner_sql');
sql_query=$("input[name='sql_query']").val(); var old_text = $inner_sql.html();
$(".inner_sql").replaceWith("<textarea name=\"sql_query_edit\" id=\"sql_query_edit\">"+ sql_query +"</textarea><input type=\"button\" id=\"btnSave\" value=\"" + PMA_messages['strGo'] + "\"><input type=\"button\" id=\"btnDiscard\" value=\"" + PMA_messages['strCancel'] + "\">");
var new_content = "<textarea name=\"sql_query_edit\" id=\"sql_query_edit\">" + sql_query + "</textarea>\n";
new_content += "<input type=\"button\" class=\"btnSave\" value=\"" + PMA_messages['strGo'] + "\">\n";
new_content += "<input type=\"button\" class=\"btnDiscard\" value=\"" + PMA_messages['strCancel'] + "\">\n";
$inner_sql.replaceWith(new_content);
$(".btnSave").each(function(){
$(this).click(function(){
sql_query = $(this).prev().val();
window.location.replace("import.php?db=" + db +"&table=" + table + "&sql_query=" + sql_query + "&show_query=1&token=" + token);
});
});
$(".btnDiscard").each(function(){
$(this).click(function(){
$(this).closest(".sql").html("<span class=\"syntax\"><span class=\"inner_sql\">" + old_text + "</span></span>");
});
});
return false; return false;
}); });
$("#btnSave").live("click",function(){
window.location.replace("import.php?db=" + db +"&table=" + table + "&sql_query=" + $("#sql_query_edit").val()+"&show_query=1&token=" + token + "");
});
$("#btnDiscard").live("click",function(){
$(".sql").html("<span class=\"syntax\"><span class=\"inner_sql\">" + oldText + "</span></span>");
});
$('.sqlbutton').click(function(evt){ $('.sqlbutton').click(function(evt){
insertQuery(evt.target.id); insertQuery(evt.target.id);
return false; return false;

View File

@@ -70,20 +70,8 @@ abstract class PMA_pChart_chart extends PMA_chart
// as in CSS (top, right, bottom, left) // as in CSS (top, right, bottom, left)
$this->setAreaMargins(array(20, 20, 40, 60)); $this->setAreaMargins(array(20, 20, 40, 60));
// when graph area gradient is used, this is the color of the graph // Get color settings from theme
// area border $this->settings = array_merge($this->settings,$GLOBALS['cfg']['chartColor']);
$this->settings['graphAreaColor'] = '#D5D9DD';
// the background color of the graph area
$this->settings['graphAreaGradientColor'] = '#A3CBA7';
// the color of the grid lines in the graph area
$this->settings['gridColor'] = '#E6E6E6';
// the color of the scale and the labels
$this->settings['scaleColor'] = '#D5D9DD';
$this->settings['titleBgColor'] = '#000000';
} }
protected function init() protected function init()
@@ -149,8 +137,11 @@ abstract class PMA_pChart_chart extends PMA_chart
$this->getBgColor(RED), $this->getBgColor(RED),
$this->getBgColor(GREEN), $this->getBgColor(GREEN),
$this->getBgColor(BLUE), $this->getBgColor(BLUE),
50,TARGET_BACKGROUND); // With a gradientIntensity of 0 the background does't draw, oddly
$this->chart->addBorder(2); ($this->settings['gradientIntensity']==0)?1:$this->settings['gradientIntensity'],TARGET_BACKGROUND);
if(is_string($this->settings['border']))
$this->chart->addBorder(1,$this->getBorderColor(RED),$this->getBorderColor(GREEN),$this->getBorderColor(BLUE));
} }
/** /**
@@ -170,11 +161,10 @@ abstract class PMA_pChart_chart extends PMA_chart
$this->getTitleColor(GREEN), $this->getTitleColor(GREEN),
$this->getTitleColor(BLUE), $this->getTitleColor(BLUE),
ALIGN_CENTER, ALIGN_CENTER,
True, false,
$this->getTitleBgColor(RED), $this->getTitleBgColor(RED),
$this->getTitleBgColor(GREEN), $this->getTitleBgColor(GREEN),
$this->getTitleBgColor(BLUE), $this->getTitleBgColor(BLUE)
30
); );
} }
@@ -211,12 +201,21 @@ abstract class PMA_pChart_chart extends PMA_chart
$this->getScaleColor(BLUE), $this->getScaleColor(BLUE),
TRUE,0,2,TRUE TRUE,0,2,TRUE
); );
$this->chart->drawGraphAreaGradient(
$this->getGraphAreaGradientColor(RED), if($this->settings['gradientIntensity']>0)
$this->getGraphAreaGradientColor(GREEN), $this->chart->drawGraphAreaGradient(
$this->getGraphAreaGradientColor(BLUE), $this->getGraphAreaGradientColor(RED),
50 $this->getGraphAreaGradientColor(GREEN),
); $this->getGraphAreaGradientColor(BLUE),
$this->settings['gradientIntensity']
);
else
$this->chart->drawGraphArea(
$this->getGraphAreaGradientColor(RED),
$this->getGraphAreaGradientColor(GREEN),
$this->getGraphAreaGradientColor(BLUE)
);
$this->chart->drawGrid( $this->chart->drawGrid(
4, 4,
TRUE, TRUE,
@@ -393,6 +392,11 @@ abstract class PMA_pChart_chart extends PMA_chart
{ {
return $this->hexStrToDecComp($this->settings['titleBgColor'], $component); return $this->hexStrToDecComp($this->settings['titleBgColor'], $component);
} }
protected function getBorderColor($component)
{
return $this->hexStrToDecComp($this->settings['border'], $component);
}
} }
?> ?>

View File

@@ -57,12 +57,20 @@ class PMA_pChart_multi_radar extends PMA_pChart_multi
$this->getGraphAreaColor(BLUE), $this->getGraphAreaColor(BLUE),
FALSE FALSE
); );
$this->chart->drawGraphAreaGradient(
$this->getGraphAreaGradientColor(RED), if($this->settings['gradientIntensity']>0)
$this->getGraphAreaGradientColor(GREEN), $this->chart->drawGraphAreaGradient(
$this->getGraphAreaGradientColor(BLUE), $this->getGraphAreaGradientColor(RED),
50 $this->getGraphAreaGradientColor(GREEN),
); $this->getGraphAreaGradientColor(BLUE),
$this->settings['gradientIntensity']
);
else
$this->chart->drawGraphArea(
$this->getGraphAreaGradientColor(RED),
$this->getGraphAreaGradientColor(GREEN),
$this->getGraphAreaGradientColor(BLUE)
);
} }
/** /**

View File

@@ -47,12 +47,21 @@ class PMA_pChart_Pie extends PMA_pChart_multi
$this->getGraphAreaColor(BLUE), $this->getGraphAreaColor(BLUE),
FALSE FALSE
); );
$this->chart->drawGraphAreaGradient(
$this->getGraphAreaGradientColor(RED), if($this->settings['gradientIntensity']>0)
$this->getGraphAreaGradientColor(GREEN), $this->chart->drawGraphAreaGradient(
$this->getGraphAreaGradientColor(BLUE), $this->getGraphAreaGradientColor(RED),
50 $this->getGraphAreaGradientColor(GREEN),
); $this->getGraphAreaGradientColor(BLUE),
$this->settings['gradientIntensity']
);
else
$this->chart->drawGraphArea(
$this->getGraphAreaGradientColor(RED),
$this->getGraphAreaGradientColor(GREEN),
$this->getGraphAreaGradientColor(BLUE)
);
} }
/** /**

View File

@@ -48,12 +48,21 @@ class PMA_pChart_single_radar extends PMA_pChart_single
$this->getGraphAreaColor(BLUE), $this->getGraphAreaColor(BLUE),
FALSE FALSE
); );
$this->chart->drawGraphAreaGradient(
$this->getGraphAreaGradientColor(RED), if($this->settings['gradientIntensity']>0)
$this->getGraphAreaGradientColor(GREEN), $this->chart->drawGraphAreaGradient(
$this->getGraphAreaGradientColor(BLUE), $this->getGraphAreaGradientColor(RED),
50 $this->getGraphAreaGradientColor(GREEN),
); $this->getGraphAreaGradientColor(BLUE),
$this->settings['gradientIntensity']
);
else
$this->chart->drawGraphArea(
$this->getGraphAreaGradientColor(RED),
$this->getGraphAreaGradientColor(GREEN),
$this->getGraphAreaGradientColor(BLUE)
);
} }
/** /**

View File

@@ -1261,9 +1261,9 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
// document.write conflicts with jQuery, hence used $().append() // document.write conflicts with jQuery, hence used $().append()
echo "<script type=\"text/javascript\">\n" . echo "<script type=\"text/javascript\">\n" .
"//<![CDATA[\n" . "//<![CDATA[\n" .
"$('.tools form').after('[<a href=\"#\" title=\"" . "$('.tools form').last().after('[<a href=\"#\" title=\"" .
PMA_escapeJsString(__('Inline edit of this query')) . PMA_escapeJsString(__('Inline edit of this query')) .
"\" id=\"inline_edit\">" . "\" class=\"inline_edit\">" .
PMA_escapeJsString(__('Inline')) . PMA_escapeJsString(__('Inline')) .
"</a>]');\n" . "</a>]');\n" .
"//]]>\n" . "//]]>\n" .

View File

@@ -339,6 +339,11 @@ function PMA_langList()
/* We can always speak English */ /* We can always speak English */
$result = array('en' => PMA_langDetails('en')); $result = array('en' => PMA_langDetails('en'));
/* Check for existing directory */
if (!is_dir($GLOBALS['lang_path'])) {
return $result;
}
/* Open the directory */ /* Open the directory */
$handle = @opendir($GLOBALS['lang_path']); $handle = @opendir($GLOBALS['lang_path']);
/* This can happen if the kit is English-only */ /* This can happen if the kit is English-only */

View File

@@ -13,20 +13,21 @@ THRESHOLD=50
# #
# Generated output file # Generated output file
# #
TMPOUTPUTFILE=libraries/language_stats.inc.php.tmp
OUTPUTFILE=libraries/language_stats.inc.php OUTPUTFILE=libraries/language_stats.inc.php
if [ ! -z "$1" ] ; then if [ ! -z "$1" ] ; then
THRESHOLD=$1 THRESHOLD=$1
fi fi
echo '<?php' > $OUTPUTFILE echo '<?php' > $TMPOUTPUTFILE
echo '/* Automatically generated file, do not edit! */' >> $OUTPUTFILE echo '/* Automatically generated file, do not edit! */' >> $TMPOUTPUTFILE
echo '/* Generated by scripts/remove-incomplete-mo */' >> $OUTPUTFILE echo '/* Generated by scripts/remove-incomplete-mo */' >> $TMPOUTPUTFILE
echo '' >> $OUTPUTFILE echo '' >> $TMPOUTPUTFILE
echo '$GLOBALS["language_stats"] = array (' >> $OUTPUTFILE echo '$GLOBALS["language_stats"] = array (' >> $TMPOUTPUTFILE
check() { check() {
OUTPUTFILE=$2 TMPOUTPUTFILE=$2
lang=`echo $1 | sed 's@po/\(.*\)\.po@\1@'` lang=`echo $1 | sed 's@po/\(.*\)\.po@\1@'`
STATS=`LC_ALL=C msgfmt --statistics -o /dev/null $1 2>&1` STATS=`LC_ALL=C msgfmt --statistics -o /dev/null $1 2>&1`
if echo $STATS | grep -q ' translated ' ; then if echo $STATS | grep -q ' translated ' ; then
@@ -45,7 +46,7 @@ check() {
UNTRANSLATED=0 UNTRANSLATED=0
fi fi
PERCENT=`expr 100 \* $TRANSLATED / \( $TRANSLATED + $FUZZY + $UNTRANSLATED \) || true` PERCENT=`expr 100 \* $TRANSLATED / \( $TRANSLATED + $FUZZY + $UNTRANSLATED \) || true`
echo " '$lang' => $PERCENT," >> $OUTPUTFILE echo " '$lang' => $PERCENT," >> $TMPOUTPUTFILE
if [ $PERCENT -lt $THRESHOLD ] ; then if [ $PERCENT -lt $THRESHOLD ] ; then
echo "Removing $lang, only $PERCENT%" echo "Removing $lang, only $PERCENT%"
@@ -54,8 +55,10 @@ check() {
} }
for x in po/*.po ; do for x in po/*.po ; do
check $x $OUTPUTFILE check $x $TMPOUTPUTFILE
done done
echo ');' >> $OUTPUTFILE echo ');' >> $TMPOUTPUTFILE
echo '?>' >> $OUTPUTFILE echo '?>' >> $TMPOUTPUTFILE
mv $TMPOUTPUTFILE $OUTPUTFILE

View File

@@ -110,4 +110,29 @@ $GLOBALS['cfg']['SQP']['fmtColor'] = array(
'quote_single' => '', 'quote_single' => '',
'quote_backtick' => '' 'quote_backtick' => ''
); );
/**
* Chart colors
*/
$GLOBALS['cfg']['chartColor'] = array(
'gradientIntensity' => 0,
// The style of the chart title.
'titleColor' => '#000000',
'titleBgColor' => $GLOBALS['cfg']['ThBackground'],
// Chart border (0 for no border)
'border' => '#CCCCCC',
// Chart background color.
'bgColor' => $GLOBALS['cfg']['BgTwo'],
// when graph area gradient is used, this is the color of the graph
// area border
'graphAreaColor' => '#D5D9DD',
// the background color of the inner graph area
'graphAreaGradientColor' => $GLOBALS['cfg']['BgOne'],
// the color of the grid lines in the graph area
'gridColor' => '#E6E6E6',
// the color of the scale and the labels
'scaleColor' => '#D5D9DD',
);
?> ?>

View File

@@ -112,4 +112,30 @@ $GLOBALS['cfg']['SQP']['fmtColor'] = array(
'quote_single' => '', 'quote_single' => '',
'quote_backtick' => '' 'quote_backtick' => ''
); );
/**
* Chart colors
*/
$GLOBALS['cfg']['chartColor'] = array(
'gradientIntensity' => 50,
// The style of the chart title.
'titleColor' => '#000000',
'titleBgColor' => '#E5E5E5',
// Chart border (0 for no border)
'border' => '#CCCCCC',
// Chart background color.
'bgColor' => '#FBFBFB',
// when graph area gradient is used, this is the color of the graph
// area border
'graphAreaColor' => '#D5D9DD',
// the background color of the graph area
'graphAreaGradientColor' => $GLOBALS['cfg']['BgTwo'],
// the color of the grid lines in the graph area
'gridColor' => '#E6E6E6',
// the color of the scale and the labels
'scaleColor' => '#D5D9DD',
);
?> ?>