\n"
. "
\n";
echo __('
Themes are made of a set of template files which specify how your Gregarius installation looks.
More themes can be downloaded from the Themes Repository.
');
foreach ($themes as $entry => $theme) {
extract($theme);
if (!$name) {
$name = $entry;
}
if ($url) {
$author = "
$author";
}
$active = ($entry == $active_theme);
$updateAvailable = isset($theme['updateVersion']);
if ($screenshot) {
$screenshotURL = "

";
} else {
$screenshotURL = "

";
}
$h4="$name";
$h5="By $author | Version: $version";
if ($updateAvailable) {
$h5 .= ' |
Update to version ' .$theme['updateVersion'] .'';
}
if ($htmltheme) {
$seturl = "index.php?view=themes&theme=$entry";
} else {
$seturl = "";
}
echo "
";
if (!$active && $htmltheme) {
echo "".__('Use this Theme')."";
} elseif($active) {
echo "".__('Active Theme')."
";
}
echo "$h4
\n";
if( file_exists( "../" . RSS_THEME_DIR . "/$fsname/config.php" ) )
echo "" . __('Configure') . "";
echo "$h5
\n"
."$screenshotURL
"
."$description
"
." \n";
}
echo "
\n";
}
function getThemes() {
$d = dir('../'. RSS_THEME_DIR);
$files = array();
$ret = array();
$activeIdx = "0";
while (false !== ($theme = $d->read())) {
if ($theme != "CVS" && !is_file("../".RSS_THEME_DIR."/$theme") && substr($theme,0,1) != ".") {
$ret[$theme]=getThemeInfo($theme);
}
}
$d->close();
return $ret;
}
function theme_options_admin() {
return CST_ADMIN_DOMAIN_THEME_OPTIONS;
}
function theme_options() {
if (!array_key_exists('theme',$_REQUEST) ||
array_key_exists('admin_theme_options_cancel_changes', $_REQUEST)) {
themes();
return;
}
$theme = $_REQUEST['theme'];
$theme_output = "";
if (preg_match('/([a-zA-Z0-9_\/\-]+)/',$theme,$matches)) {
$theme = $matches[1]; // sanitize input
$theme_info = getThemeInfo($theme);
extract($theme_info);
if( file_exists( "../" . RSS_THEME_DIR . "/$fsname/config.php" ) ) {
ob_start();
rss_theme_options_rendered_buttons( false );
rss_require( RSS_THEME_DIR . "/$fsname/config.php" );
$theme_output = ob_get_contents();
ob_end_clean();
rss_invalidate_cache();
}
if ($theme_output) { // Let us set up a form
echo "