From 3161a7b0b27508066f26b8cd920b1817f23beeef Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 13 Sep 2011 21:14:11 -0400 Subject: Fixes #3623 added non-bundled filter option for plugins --- views/default/admin/plugins.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'views/default/admin/plugins.php') diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php index cd0b83c00..62e6f556a 100644 --- a/views/default/admin/plugins.php +++ b/views/default/admin/plugins.php @@ -45,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]); @@ -96,10 +101,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); -- cgit v1.2.3 From 9858bd526fce9016dc82d1f21b35e6ceb969c140 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 22 Sep 2011 21:32:49 -0400 Subject: Fixes #3808 not translating manifest fields through elgg_echo() --- engine/classes/ElggPluginManifest.php | 38 +++++++---------------------------- languages/en.php | 1 + views/default/admin/plugins.php | 8 +++++++- 3 files changed, 15 insertions(+), 32 deletions(-) (limited to 'views/default/admin/plugins.php') diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php index 0f3b1d7a8..0e47f388d 100644 --- a/engine/classes/ElggPluginManifest.php +++ b/engine/classes/ElggPluginManifest.php @@ -224,20 +224,15 @@ class ElggPluginManifest { /** * Returns the plugin name * - * @param bool $elgg_echo Run the name through elgg_echo. * @return string */ - public function getName($elgg_echo = true) { + public function getName() { $name = $this->parser->getAttribute('name'); if (!$name && $this->pluginID) { $name = ucwords(str_replace('_', ' ', $this->pluginID)); } - if ($elgg_echo) { - $name = elgg_echo($name); - } - return $name; } @@ -245,33 +240,21 @@ class ElggPluginManifest { /** * Return the description * - * @param bool $elgg_echo Run the description through elgg_echo. * @return string */ - public function getDescription($elgg_echo = true) { - $desc = $this->parser->getAttribute('description'); - - if ($elgg_echo) { - return elgg_echo($desc); - } else { - return $desc; - } + public function getDescription() { + return $this->parser->getAttribute('description'); } /** * Return the short description * - * @param bool $elgg_echo Run the blurb through elgg_echo. * @return string */ - public function getBlurb($elgg_echo = true) { + public function getBlurb() { $blurb = $this->parser->getAttribute('blurb'); - if ($blurb) { - if ($elgg_echo) { - $blurb = elgg_echo($blurb); - } - } else { + if (!$blurb) { $blurb = elgg_get_excerpt($this->getDescription()); } @@ -348,10 +331,9 @@ class ElggPluginManifest { /** * Return the screenshots listed. * - * @param bool $elgg_echo Run the screenshot's description through elgg_echo. * @return array */ - public function getScreenshots($elgg_echo = true) { + public function getScreenshots() { $ss = $this->parser->getAttribute('screenshot'); if (!$ss) { @@ -360,13 +342,7 @@ class ElggPluginManifest { $normalized = array(); foreach ($ss as $s) { - $normalized_s = $this->buildStruct($this->screenshotStruct, $s); - - if ($elgg_echo) { - $normalized_s['description'] = elgg_echo($normalized_s['description']); - } - - $normalized[] = $normalized_s; + $normalized[] = $this->buildStruct($this->screenshotStruct, $s); } return $normalized; diff --git a/languages/en.php b/languages/en.php index 6c3c041cd..d83d4773b 100644 --- a/languages/en.php +++ b/languages/en.php @@ -613,6 +613,7 @@ $english = array( 'admin:plugins:category:multimedia' => 'Multimedia', 'admin:plugins:category:theme' => 'Themes', 'admin:plugins:category:widget' => 'Widgets', + 'admin:plugins:category:utility' => 'Utilities', 'admin:plugins:sort:priority' => 'Priority', 'admin:plugins:sort:alpha' => 'Alphabetical', diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php index 62e6f556a..451936335 100644 --- a/views/default/admin/plugins.php +++ b/views/default/admin/plugins.php @@ -60,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; } } } -- cgit v1.2.3 From bd08504b16ee636eda1b30676799efc22a915613 Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Thu, 20 Oct 2011 20:22:01 -0700 Subject: Fixes #3990 Using ElggPlugin->getFriendlyName() for sorting alphabetically to avoid WSODs with invalid plugins. --- views/default/admin/plugins.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'views/default/admin/plugins.php') diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php index 451936335..5bd0dd55d 100644 --- a/views/default/admin/plugins.php +++ b/views/default/admin/plugins.php @@ -93,7 +93,7 @@ switch ($sort) { case 'alpha': $plugin_list = array(); foreach ($installed_plugins as $plugin) { - $plugin_list[$plugin->getManifest()->getName()] = $plugin; + $plugin_list[$plugin->getFriendlyName()] = $plugin; } ksort($plugin_list); break; -- cgit v1.2.3 From 3f9abf384029bf3fc899be2eead4e3121d20e331 Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Sun, 30 Oct 2011 12:00:12 -0700 Subject: Fixes #2821. Plugins that are active and cannot be started emit an admin notice. --- engine/lib/plugins.php | 2 +- languages/en.php | 8 ++++---- views/default/admin/plugins.php | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'views/default/admin/plugins.php') diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php index 86070a2aa..fac52b152 100644 --- a/engine/lib/plugins.php +++ b/engine/lib/plugins.php @@ -324,7 +324,7 @@ function elgg_load_plugins() { $plugin->deactivate(); $msg = elgg_echo('PluginException:CannotStart', array($plugin->getID(), $plugin->guid, $e->getMessage())); - register_error($msg); + elgg_add_admin_notice('cannot_start' . $plugin->getID(), $msg); $return = false; continue; diff --git a/languages/en.php b/languages/en.php index 5af005814..6aa292e5a 100644 --- a/languages/en.php +++ b/languages/en.php @@ -63,7 +63,7 @@ $english = array( 'InvalidClassException:NotValidElggStar' => "GUID:%d is not a valid %s", 'PluginException:MisconfiguredPlugin' => "%s (guid: %s) is a misconfigured plugin. It has been disabled. Please search the Elgg wiki for possible causes (http://docs.elgg.org/wiki/).", - 'PluginException:CannotStart' => '%s (guid: %s) cannot start. Reason: %s', + 'PluginException:CannotStart' => '%s (guid: %s) cannot start and has been deactivated. Reason: %s', 'PluginException:InvalidID' => "%s is an invalid plugin ID.", 'PluginException:InvalidPath' => "%s is an invalid plugin path.", 'PluginException:InvalidManifest' => 'Invalid manifest file for plugin %s', @@ -79,9 +79,9 @@ $english = array( 'ElggPluginPackage:InvalidPlugin:InvalidProvides' => 'Invalid provides type "%s"', 'ElggPluginPackage:InvalidPlugin:CircularDep' => 'Invalid %s dependency "%s" in plugin %s. Plugins cannot conflict with or require something they provide!', - 'ElggPlugin:Exception:CannotIncludeFile' => 'Cannot include %s for plugin %s (guid: %s) at %s. Check permissions!', - 'ElggPlugin:Exception:CannotRegisterViews' => 'Cannot open views dir for plugin %s (guid: %s) at %s. Check permissions!', - 'ElggPlugin:Exception:CannotRegisterLanguages' => 'Cannot register languages for plugin %s (guid: %s) at %s. Check permissions!', + 'ElggPlugin:Exception:CannotIncludeFile' => 'Cannot include %s for plugin %s (guid: %s) at %s.', + 'ElggPlugin:Exception:CannotRegisterViews' => 'Cannot open views dir for plugin %s (guid: %s) at %s.', + 'ElggPlugin:Exception:CannotRegisterLanguages' => 'Cannot register languages for plugin %s (guid: %s) at %s.', 'ElggPlugin:Exception:NoID' => 'No ID for plugin guid %s!', 'PluginException:ParserError' => 'Error parsing manifest with API version %s in plugin %s.', diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php index 5bd0dd55d..c3e7e3ab0 100644 --- a/views/default/admin/plugins.php +++ b/views/default/admin/plugins.php @@ -22,7 +22,8 @@ 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()))); + elgg_add_admin_notice('invalid_and_deactivated_' . $plugin->getID(), + elgg_echo('ElggPlugin:InvalidAndDeactivated', array($plugin->getId()))); $plugin->deactivate(); } continue; -- cgit v1.2.3