| 1 |
<?php |
<?php |
| 2 |
// $Id: switchtheme.module,v 1.14 2008/11/02 12:44:30 sun Exp $ |
// $Id: switchtheme.module,v 1.15 2008/11/02 13:32:46 sun Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 135 |
shuffle($themes); |
shuffle($themes); |
| 136 |
foreach ($themes as $key => $theme) { |
foreach ($themes as $key => $theme) { |
| 137 |
$theme->screenshot = dirname($theme->filename) .'/screenshot.png'; |
$theme->screenshot = dirname($theme->filename) .'/screenshot.png'; |
| 138 |
if (file_exists($theme->screenshot)) { |
if ($theme->status && file_exists($theme->screenshot)) { |
| 139 |
// Return the first theme with a screenshot. |
// Return the first theme with a screenshot. |
| 140 |
$output = l("<img src=\"". base_path() ."$theme->screenshot\" alt=\"preview of $theme->name\"/>", $_GET['q'], array('query' => 'theme='. $theme->name, 'html' => TRUE)); |
$output = l("<img src=\"". base_path() ."$theme->screenshot\" alt=\"preview of $theme->name\"/>", $_GET['q'], array('query' => 'theme='. $theme->name, 'html' => TRUE)); |
| 141 |
return $output; |
return $output; |