Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Čihař <michal@cihar.com>2004-08-12 21:38:43 +0400
committerMichal Čihař <michal@cihar.com>2004-08-12 21:38:43 +0400
commitae85313a36a37775332e09fdeeb03ea2d1656530 (patch)
tree009ed6f508f993ce7b61df2877ffdbccb7bb2a52 /themes.php
parent4af60bec2cb2f7cdfdae16733a955a15118d16f8 (diff)
Impleneted versioning and naming for themes (RFEs #991642 and #991645).
Diffstat (limited to 'themes.php')
-rw-r--r--themes.php23
1 files changed, 18 insertions, 5 deletions
diff --git a/themes.php b/themes.php
index c848a65951..be2b32915c 100644
--- a/themes.php
+++ b/themes.php
@@ -86,14 +86,27 @@ echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">";
<?php
if ($handleThemes = opendir($path_to_themes)) { // open themes
while (false !== ($PMA_Theme = readdir($handleThemes))) { // get screens
- if ($PMA_Theme != "." && $PMA_Theme != "..") { // && !strstr($PMA_Theme,'original')) { // but not the original
+ if ($PMA_Theme != "." && $PMA_Theme != "..") {
$screen_directory = $path_to_themes . $PMA_Theme;
+
+ // check for theme requires/name
+ unset($theme_name, $theme_version);
+ @include($path_to_themes . $PMA_Theme . '/info.inc.php');
+
+ // did it set correctly?
+ if (!isset($theme_name, $theme_version))
+ continue; // invalid theme
+
+ if ($theme_version < PMA_THEME_VERSION)
+ continue; // too old version
+
+
if (is_dir($screen_directory) && @file_exists($screen_directory.'/screen.png')) { // if screen exists then output
?>
<tr>
<th align="left">
<?php
- echo '<b>' . strtoupper(preg_replace("/_/"," ",$PMA_Theme)) . '</b>';
+ echo '<b>' . $theme_name . '</b>';
?>
</th>
</tr>
@@ -106,8 +119,8 @@ if ($handleThemes = opendir($path_to_themes)) { // open themes
if (document.getElementById) {
document.write('style="border: 1px solid #000000;" ');
}
- document.write('alt="<?php echo strtoupper(preg_replace("/_/"," ",$PMA_Theme)); ?> - Theme" ');
- document.write('title="<?php echo strtoupper(preg_replace("/_/"," ",$PMA_Theme)); ?> - Theme" />');
+ document.write('alt="<?php echo $theme_name; ?> - Theme" ');
+ document.write('title="<?php echo $theme_name; ?> - Theme" />');
document.write('</a><br />');
document.write('[ <b><a href="#top" onclick="takeThis(\'<?php echo $PMA_Theme; ?>\'); return false;">');
document.write('<?php echo (isset($strTakeIt) ? addslashes($strTakeIt) : 'take it'); ?>');
@@ -116,7 +129,7 @@ if ($handleThemes = opendir($path_to_themes)) { // open themes
</script>
<noscript>
<?php
- echo '<img src="' . $screen_directory . '/screen.png" border="1" alt="' . strtoupper(preg_replace("/_/"," ",$PMA_Theme)) . ' - Theme" />';
+ echo '<img src="' . $screen_directory . '/screen.png" border="1" alt="' . $theme_name . ' - Theme" />';
?>
</noscript>
</td>