diff --git a/e107_handlers/theme_handler.php b/e107_handlers/theme_handler.php index 8eaea5958..9a9a28574 100644 --- a/e107_handlers/theme_handler.php +++ b/e107_handlers/theme_handler.php @@ -9,8 +9,8 @@ * e107 Admin Theme Handler * * $Source: /cvs_backup/e107_0.8/e107_handlers/theme_handler.php,v $ - * $Revision: 1.50 $ - * $Date: 2009-08-31 14:37:24 $ + * $Revision: 1.51 $ + * $Date: 2009-09-02 02:38:50 $ * $Author: e107coders $ */ @@ -33,6 +33,21 @@ class themeHandler{ var $frm; var $fl; var $themeConfigObj = null; + public $allowedCategories = array( + 'generic', + 'adult', + 'blog', + 'clan', + 'children', + 'corporate', + 'forum', + 'gaming', + 'gallery', + 'news', + 'social', + 'video', + 'multimedia' + ); /* constructor */ @@ -247,7 +262,31 @@ class themeHandler{ } - + /** + * Validate and return the name of the category + * @param object $categoryfromXML + * @return + */ + function getThemeCategory($categoryfromXML) + { + $tmp = explode(",",$categoryfromXML); + $category = array(); + foreach($tmp as $cat) + { + $cat = trim($cat); + if(in_array($cat,$this->allowedCategories)) + { + $category[] = $cat; + } + else + { + $category[] = '(invalid category)'; + } + } + + return implode(', ',$category); + + } @@ -634,7 +673,7 @@ class themeHandler{