Skip to content

Commit

Permalink
Remove layout.inc.php and svg_gradient.php
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
  • Loading branch information
MauricioFauth committed Nov 15, 2018
1 parent 9c1af03 commit 557b34a
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 463 deletions.
45 changes: 0 additions & 45 deletions libraries/classes/Theme.php
Expand Up @@ -217,17 +217,6 @@ public function getPath()
return $this->path;
}

/**
* returns layout file
*
* @access public
* @return string layout file
*/
public function getLayoutFile()
{
return $this->getPath() . '/layout.inc.php';
}

/**
* set path to theme
*
Expand Down Expand Up @@ -416,38 +405,4 @@ public function getPrintPreview()
'screen' => $screen,
]);
}

/**
* Generates code for CSS gradient using various browser extensions.
*
* @param string $start_color Color of gradient start, hex value without #
* @param string $end_color Color of gradient end, hex value without #
*
* @return string CSS code.
*/
public function getCssGradient($start_color, $end_color)
{
$result = [];
// Opera 9.5+, IE 9
$result[] = 'background-image: url(./themes/svg_gradient.php?from='
. $start_color . '&to=' . $end_color . ');';
$result[] = 'background-size: 100% 100%;';
// Safari 4-5, Chrome 1-9
$result[] = 'background: '
. '-webkit-gradient(linear, left top, left bottom, from(#'
. $start_color . '), to(#' . $end_color . '));';
// Safari 5.1, Chrome 10+
$result[] = 'background: -webkit-linear-gradient(top, #'
. $start_color . ', #' . $end_color . ');';
// Firefox 3.6+
$result[] = 'background: -moz-linear-gradient(top, #'
. $start_color . ', #' . $end_color . ');';
// IE 10
$result[] = 'background: -ms-linear-gradient(top, #'
. $start_color . ', #' . $end_color . ');';
// Opera 11.10
$result[] = 'background: -o-linear-gradient(top, #'
. $start_color . ', #' . $end_color . ');';
return implode("\n", $result);
}
}
7 changes: 0 additions & 7 deletions libraries/classes/ThemeManager.php
Expand Up @@ -446,12 +446,5 @@ public static function initializeTheme()
* @global string $GLOBALS['pmaThemeImage']
*/
$GLOBALS['pmaThemeImage'] = $GLOBALS['PMA_Theme']->getImgPath();

/**
* load layout file if exists
*/
if (@file_exists($GLOBALS['PMA_Theme']->getLayoutFile())) {
include $GLOBALS['PMA_Theme']->getLayoutFile();
}
}
}
31 changes: 0 additions & 31 deletions test/classes/ThemeTest.php
Expand Up @@ -44,7 +44,6 @@ protected function setUp()
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();
$GLOBALS['text_dir'] = 'ltr';
include 'themes/pmahomme/layout.inc.php';
$GLOBALS['server'] = '99';
}

Expand Down Expand Up @@ -209,16 +208,6 @@ public function testGetSetPath()
$this->assertEquals('./themes/original', $this->object->getPath());
}

/**
* Test for Theme::loadInfo
*
* @return void
*/
public function testGetLayoutFile()
{
$this->assertContains('layout.inc.php', $this->object->getLayoutFile());
}

/**
* Test for Theme::checkVersion
*
Expand Down Expand Up @@ -304,26 +293,6 @@ public function testGetPrintPreview()
);
}

/**
* Test for getCssGradient
*
* @return void
*/
public function testgetCssGradient()
{
$this->assertEquals(
$this->object->getCssGradient('12345', '54321'),
'background-image: url(./themes/svg_gradient.php?from=12345&to=54321);'
. "\n" . 'background-size: 100% 100%;'
. "\n" . 'background: -webkit-gradient(linear, left top, left bottom, '
. 'from(#12345), to(#54321));'
. "\n" . 'background: -webkit-linear-gradient(top, #12345, #54321);'
. "\n" . 'background: -moz-linear-gradient(top, #12345, #54321);'
. "\n" . 'background: -ms-linear-gradient(top, #12345, #54321);'
. "\n" . 'background: -o-linear-gradient(top, #12345, #54321);'
);
}

/**
* Test for getImgPath
*
Expand Down
1 change: 0 additions & 1 deletion themes/.gitignore
@@ -1,7 +1,6 @@
/*
!/.gitignore
!/dot.gif
!/svg_gradient.php
!/original/
!/pmahomme/
!/metro/
169 changes: 0 additions & 169 deletions themes/metro/layout.inc.php

This file was deleted.

77 changes: 0 additions & 77 deletions themes/original/layout.inc.php

This file was deleted.

0 comments on commit 557b34a

Please sign in to comment.