From 0179e8c68b0827d77c61a31c8c0d6bf4a277c785 Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Sat, 27 Aug 2011 10:41:35 -0700 Subject: Fixes #3434. Manifests are checked more carefully on anything that checks deps. Disabling plugins with invalid manifests from admin page. --- views/default/admin/plugins.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'views/default/admin') diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php index 1aa899fcc..cd0b83c00 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; } -- cgit v1.2.3 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 --- languages/en.php | 1 + views/default/admin/plugins.php | 11 +++++++++++ 2 files changed, 12 insertions(+) (limited to 'views/default/admin') diff --git a/languages/en.php b/languages/en.php index ab3c523de..6e07b256b 100644 --- a/languages/en.php +++ b/languages/en.php @@ -601,6 +601,7 @@ $english = array( 'admin:plugins:category:inactive' => 'Inactive plugins', 'admin:plugins:category:admin' => 'Admin', 'admin:plugins:category:bundled' => 'Bundled', + 'admin:plugins:category:nonbundled' => 'Non-bundled', 'admin:plugins:category:content' => 'Content', 'admin:plugins:category:development' => 'Development', 'admin:plugins:category:enhancement' => 'Enhancements', 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') 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 61ad84e217b0a1bae8d607a1504c4b477d976ac5 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 24 Sep 2011 16:08:04 -0400 Subject: Refs #3864 updated the two form bodies for edit profile fields --- views/default/admin/appearance/profile_fields.php | 4 +--- views/default/forms/profile/fields/add.php | 8 +++----- views/default/forms/profile/fields/reset.php | 2 ++ 3 files changed, 6 insertions(+), 8 deletions(-) (limited to 'views/default/admin') diff --git a/views/default/admin/appearance/profile_fields.php b/views/default/admin/appearance/profile_fields.php index 7077687cc..8371ce83c 100644 --- a/views/default/admin/appearance/profile_fields.php +++ b/views/default/admin/appearance/profile_fields.php @@ -10,9 +10,7 @@ $reset = elgg_view_form('profile/fields/reset', array(), array()); $body = <<<__HTML $add $list -
- $reset -
+$reset __HTML; echo $body; diff --git a/views/default/forms/profile/fields/add.php b/views/default/forms/profile/fields/add.php index 7961037e6..c1d07d2ce 100644 --- a/views/default/forms/profile/fields/add.php +++ b/views/default/forms/profile/fields/add.php @@ -1,8 +1,6 @@ 'type', 'options_val $submit_control = elgg_view('input/submit', array('name' => elgg_echo('add'), 'value' => elgg_echo('add'))); $formbody = <<< END -

$label_text: $label_control +

$label_text: $label_control $type_text: $type_control - $submit_control

+ $submit_control
END; echo autop(elgg_echo('profile:explainchangefields')); diff --git a/views/default/forms/profile/fields/reset.php b/views/default/forms/profile/fields/reset.php index 4e0f51dc6..c0bb1b7f4 100644 --- a/views/default/forms/profile/fields/reset.php +++ b/views/default/forms/profile/fields/reset.php @@ -3,8 +3,10 @@ * Reset profile fields form */ +echo '
'; $params = array( 'value' => elgg_echo('profile:resetdefault'), 'class' => 'elgg-button-cancel', ); echo elgg_view('input/submit', $params); +echo '
'; -- cgit v1.2.3