aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/classes/ElggPluginManifest.php40
1 files changed, 32 insertions, 8 deletions
diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php
index 34af6cd21..7a261a755 100644
--- a/engine/classes/ElggPluginManifest.php
+++ b/engine/classes/ElggPluginManifest.php
@@ -215,15 +215,20 @@ class ElggPluginManifest {
/**
* Returns the plugin name
*
+ * @param bool $elgg_echo Run the name through elgg_echo.
* @return string
*/
- public function getName() {
+ public function getName($elgg_echo = true) {
$name = $this->parser->getAttribute('name');
if (!$name && $this->pluginID) {
$name = ucwords(str_replace('_', ' ', $this->pluginID));
}
+ if ($elgg_echo) {
+ $name = elgg_echo($name);
+ }
+
return $name;
}
@@ -231,21 +236,33 @@ class ElggPluginManifest {
/**
* Return the description
*
+ * @param bool $elgg_echo Run the description through elgg_echo.
* @return string
*/
- public function getDescription() {
- return elgg_echo($this->parser->getAttribute('description'));
+ public function getDescription($elgg_echo = true) {
+ $desc = $this->parser->getAttribute('description');
+
+ if ($elgg_echo) {
+ return elgg_echo($desc);
+ } else {
+ return $desc;
+ }
}
/**
* Return the short description
*
+ * @param bool $elgg_echo Run the blurb through elgg_echo.
* @return string
*/
- public function getBlurb() {
- $blurb = elgg_echo($this->parser->getAttribute('blurb'));
+ public function getBlurb($elgg_echo = true) {
+ $blurb = $this->parser->getAttribute('blurb');
- if (!$blurb) {
+ if ($blurb) {
+ if ($elgg_echo) {
+ $blurb = elgg_echo($blurb);
+ }
+ } else {
$blurb = elgg_get_excerpt($this->getDescription());
}
@@ -322,9 +339,10 @@ class ElggPluginManifest {
/**
* Return the screenshots listed.
*
+ * @param bool $elgg_echo Run the screenshot's description through elgg_echo.
* @return array
*/
- public function getScreenshots() {
+ public function getScreenshots($elgg_echo = true) {
$ss = $this->parser->getAttribute('screenshot');
if (!$ss) {
@@ -333,7 +351,13 @@ class ElggPluginManifest {
$normalized = array();
foreach ($ss as $s) {
- $normalized[] = $this->buildStruct($this->screenshotStruct, $s);
+ $normalized_s = $this->buildStruct($this->screenshotStruct, $s);
+
+ if ($elgg_echo) {
+ $normalized_s['description'] = elgg_echo($normalized_s['description']);
+ }
+
+ $normalized[] = $normalized_s;
}
return $normalized;