aboutsummaryrefslogtreecommitdiff
path: root/views/default/admin/plugins.php
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2011-09-29 18:16:03 -0700
committerBrett Profitt <brett.profitt@gmail.com>2011-09-29 18:16:03 -0700
commitbfdb9bb8a87a29038ba1ae25355684ae19678fdd (patch)
treea074e2d6bfa19c17b284c3950b4555cf584eabe2 /views/default/admin/plugins.php
parent7be23080f34a8f92ca1f8d49c3aa0e6ce3472f4c (diff)
parenta458ae4e0f8e5b19884860fead6e5f901b95eca4 (diff)
downloadelgg-bfdb9bb8a87a29038ba1ae25355684ae19678fdd.tar.gz
elgg-bfdb9bb8a87a29038ba1ae25355684ae19678fdd.tar.bz2
Merge branch 'master' of github.com:brettp/Elgg
Diffstat (limited to 'views/default/admin/plugins.php')
-rw-r--r--views/default/admin/plugins.php24
1 files changed, 23 insertions, 1 deletions
diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php
index 1aa899fcc..451936335 100644
--- a/views/default/admin/plugins.php
+++ b/views/default/admin/plugins.php
@@ -20,6 +20,11 @@ $categories = array();
foreach ($installed_plugins as $id => $plugin) {
if (!$plugin->isValid()) {
+ if ($plugin->isActive()) {
+ // force disable and warn
+ register_error(elgg_echo('ElggPlugin:InvalidAndDeactivated', array($plugin->getId())));
+ $plugin->deactivate();
+ }
continue;
}
@@ -40,6 +45,11 @@ foreach ($installed_plugins as $id => $plugin) {
unset($installed_plugins[$id]);
}
break;
+ case 'nonbundled':
+ if (in_array('bundled', $plugin_categories)) {
+ unset($installed_plugins[$id]);
+ }
+ break;
default:
if (!in_array($show_category, $plugin_categories)) {
unset($installed_plugins[$id]);
@@ -50,7 +60,13 @@ foreach ($installed_plugins as $id => $plugin) {
if (isset($plugin_categories)) {
foreach ($plugin_categories as $category) {
if (!array_key_exists($category, $categories)) {
- $categories[$category] = elgg_echo("admin:plugins:category:$category");
+ // if localization string not defined, fall back to original category string
+ $cat_raw_string = "admin:plugins:category:$category";
+ $cat_display_string = elgg_echo($cat_raw_string);
+ if ($cat_display_string == $cat_raw_string) {
+ $cat_display_string = ucwords($category);
+ }
+ $categories[$category] = $cat_display_string;
}
}
}
@@ -91,10 +107,16 @@ switch ($sort) {
asort($categories);
+// we want bundled/nonbundled pulled to be at the top of the list
+unset($categories['bundled']);
+unset($categories['nonbundled']);
+
$common_categories = array(
'all' => elgg_echo('admin:plugins:category:all'),
'active' => elgg_echo('admin:plugins:category:active'),
'inactive' => elgg_echo('admin:plugins:category:inactive'),
+ 'bundled' => elgg_echo('admin:plugins:category:bundled'),
+ 'nonbundled' => elgg_echo('admin:plugins:category:nonbundled'),
);
$categories = array_merge($common_categories, $categories);