diff options
author | Brett Profitt <brett.profitt@gmail.com> | 2012-02-25 13:45:15 -0800 |
---|---|---|
committer | Brett Profitt <brett.profitt@gmail.com> | 2012-02-25 13:45:15 -0800 |
commit | 217e79eaeb51587943376f0a1bfc68c3586af46e (patch) | |
tree | f58b618a7fe791505c07963b144cbac56d6067ee /engine | |
parent | 6c94d823bbea21a5ab5672a3d7780ad598e1c665 (diff) | |
download | elgg-217e79eaeb51587943376f0a1bfc68c3586af46e.tar.gz elgg-217e79eaeb51587943376f0a1bfc68c3586af46e.tar.bz2 |
Fixes #3312, #3632. Added class elgg-plugin-category-<category> to the plugin div. Exposed plugin categories under more. Changed border color and size for bundled categories.
Diffstat (limited to 'engine')
-rw-r--r-- | engine/classes/ElggPluginManifest.php | 19 |
1 files changed, 19 insertions, 0 deletions
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:<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; + } } |