aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggPluginManifest.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-08 04:49:25 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-08 04:49:25 +0000
commitb1d46a40d6e04fe14ac83e5d761cdb8db8bac7f1 (patch)
tree71ea79ff418c193d5fd427bf3c50b45f9a1cb93a /engine/classes/ElggPluginManifest.php
parent44b5bfdf1fb994d91757be63cf4d4b4e8cc8b63d (diff)
downloadelgg-b1d46a40d6e04fe14ac83e5d761cdb8db8bac7f1.tar.gz
elgg-b1d46a40d6e04fe14ac83e5d761cdb8db8bac7f1.tar.bz2
Running plugins' blurb, description, name, and screenshot->description through elgg_echo().
git-svn-id: http://code.elgg.org/elgg/trunk@8069 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/classes/ElggPluginManifest.php')
-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;