]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Running plugins' blurb, description, name, and screenshot->description through elgg_e...
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 8 Feb 2011 04:49:25 +0000 (04:49 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 8 Feb 2011 04:49:25 +0000 (04:49 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8069 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/classes/ElggPluginManifest.php

index 34af6cd215cbfeadf106d8df518928c5da2fbb28..7a261a75541d8c71496592df5950d0b3ad25a640 100644 (file)
@@ -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;