From 217e79eaeb51587943376f0a1bfc68c3586af46e Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Sat, 25 Feb 2012 13:45:15 -0800 Subject: Fixes #3312, #3632. Added class elgg-plugin-category- to the plugin div. Exposed plugin categories under more. Changed border color and size for bundled categories. --- engine/classes/ElggPluginManifest.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'engine/classes/ElggPluginManifest.php') diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php index 7592eb667..7aa702d47 100644 --- a/engine/classes/ElggPluginManifest.php +++ b/engine/classes/ElggPluginManifest.php @@ -592,4 +592,23 @@ class ElggPluginManifest { return $return; } + + /** + * Returns a category's friendly name. This can be localized by + * defining the string 'admin:plugins:category:'. If no + * localization is found, returns the category with _ and - converted to ' ' + * and then ucwords()'d. + * + * @param str $category The category as defined in the manifest. + * @return str A human-readable category + */ + static public function getFriendlyCategory($category) { + $cat_raw_string = "admin:plugins:category:$category"; + $cat_display_string = elgg_echo($cat_raw_string); + if ($cat_display_string == $cat_raw_string) { + $category = str_replace(array('-', '_'), ' ', $category); + $cat_display_string = ucwords($category); + } + return $cat_display_string; + } } -- cgit v1.2.3