+// install and uninstall theme
+if (! function_exists('uninstall_theme')){
+function uninstall_theme($theme){
+ logger("Addons: uninstalling theme " . $theme);
+
+ @include_once("view/theme/$theme/theme.php");
+ if(function_exists("{$theme}_uninstall")) {
+ $func = "{$theme}_uninstall";
+ $func();
+ }
+}}
+
+if (! function_exists('install_theme')){
+function install_theme($theme) {
+ // silently fail if theme was removed
+
+ if(! file_exists("view/theme/$theme/theme.php"))
+ return false;
+
+ logger("Addons: installing theme $theme");
+
+ @include_once("view/theme/$theme/theme.php");
+
+ if(function_exists("{$theme}_install")) {
+ $func = "{$theme}_install";
+ $func();
+ return true;
+ }
+ else {
+ logger("Addons: FAILED installing theme $theme");
+ return false;
+ }
+
+}}
+
+