Navigation Menu

Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
weblate committed May 29, 2012
2 parents 6a55fd6 + 1ec4659 commit a34cee6
Show file tree
Hide file tree
Showing 4 changed files with 2,629 additions and 2,640 deletions.
57 changes: 56 additions & 1 deletion libraries/Theme.class.php
Expand Up @@ -310,6 +310,61 @@ public function getImgPath()
return $this->img_path;
}

/**
* Builds a CSS rule used for html formatted SQL queries
*
* @param string $classname The class name
* @param string $property The property name
* @param string $value The property value
*
* @return string The CSS rule
*
* @access public
*
* @see PMA_SQP_buildCssData()
*/
public function SQP_buildCssRule($classname, $property, $value)
{
$str = '.' . $classname . ' {';
if ($value != '') {
$str .= $property . ': ' . $value . ';';
}
$str .= '}' . "\n";

return $str;
} // end of the "PMA_SQP_buildCssRule()" function


/**
* Builds CSS rules used for html formatted SQL queries
*
* @return string The CSS rules set
*
* @access public
*
* @global array The current PMA configuration
*
* @see PMA_SQP_buildCssRule()
*/
public function SQP_buildCssData()
{
global $cfg;

$css_string = '';
foreach ($cfg['SQP']['fmtColor'] AS $key => $col) {
$css_string .= $this->SQP_buildCssRule('syntax_' . $key, 'color', $col);
}

for ($i = 0; $i < 8; $i++) {
$css_string .= $this->SQP_buildCssRule(
'syntax_indent' . $i, 'margin-left',
($i * $cfg['SQP']['fmtInd']) . $cfg['SQP']['fmtIndUnit']
);
}

return $css_string;
} // end of the "PMA_SQP_buildCssData()" function

/**
* load css (send to stdout, normally the browser)
*
Expand All @@ -320,7 +375,7 @@ public function loadCss()
{
$success = true;

echo PMA_SQP_buildCssData();
echo $this->SQP_buildCssData();

if ($GLOBALS['text_dir'] === 'ltr') {
$right = 'right';
Expand Down

0 comments on commit a34cee6

Please sign in to comment.