diff options
Diffstat (limited to 'engine/classes')
-rw-r--r-- | engine/classes/ElggEntity.php | 18 | ||||
-rw-r--r-- | engine/classes/ElggMenuItem.php | 6 | ||||
-rw-r--r-- | engine/classes/ElggPluginManifest.php | 38 | ||||
-rw-r--r-- | engine/classes/ElggPluginPackage.php | 6 |
4 files changed, 24 insertions, 44 deletions
diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php index 6edc99dd4..2fa0d7b02 100644 --- a/engine/classes/ElggEntity.php +++ b/engine/classes/ElggEntity.php @@ -371,13 +371,18 @@ abstract class ElggEntity extends ElggData implements * Deletes all metadata on this object (metadata.entity_guid = $this->guid). * If you pass a name, only metadata matching that name will be deleted. * - * @warning Calling this with no or empty arguments will clear all metadata on the entity. + * @warning Calling this with no $name will clear all metadata on the entity. * - * @param null|string $name The metadata name to remove. + * @param null|string $name The name of the metadata to remove. * @return bool * @since 1.8 */ public function deleteMetadata($name = null) { + + if (!$this->guid) { + return false; + } + $options = array( 'guid' => $this->guid, 'limit' => 0 @@ -1432,11 +1437,7 @@ abstract class ElggEntity extends ElggData implements * @return true */ public function setLocation($location) { - $location = sanitise_string($location); - - $this->location = $location; - - return true; + return $this->location = $location; } /** @@ -1449,9 +1450,6 @@ abstract class ElggEntity extends ElggData implements * @todo Unimplemented */ public function setLatLong($lat, $long) { - $lat = sanitise_string($lat); - $long = sanitise_string($long); - $this->set('geo:lat', $lat); $this->set('geo:long', $long); diff --git a/engine/classes/ElggMenuItem.php b/engine/classes/ElggMenuItem.php index cfdc2f5fa..b9c81fd78 100644 --- a/engine/classes/ElggMenuItem.php +++ b/engine/classes/ElggMenuItem.php @@ -59,7 +59,7 @@ class ElggMenuItem { /** * @var string Tooltip */ - protected $title = ''; + protected $title = false; /** * @var string The string to display if link is clicked @@ -543,7 +543,7 @@ class ElggMenuItem { if ($this->data['linkClass']) { if (isset($vars['class'])) { - $vars['class'] += $this->getLinkClass(); + $vars['class'] = $vars['class'] . ' ' . $this->getLinkClass(); } else { $vars['class'] = $this->getLinkClass(); } @@ -552,6 +552,8 @@ class ElggMenuItem { if ($this->confirm) { $vars['confirm'] = $this->confirm; return elgg_view('output/confirmlink', $vars); + } else { + unset($vars['confirm']); } return elgg_view('output/url', $vars); 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/engine/classes/ElggPluginPackage.php b/engine/classes/ElggPluginPackage.php index 977b72d76..02b985285 100644 --- a/engine/classes/ElggPluginPackage.php +++ b/engine/classes/ElggPluginPackage.php @@ -334,7 +334,11 @@ class ElggPluginPackage { // first, check if any active plugin conflicts with us. foreach ($enabled_plugins as $plugin) { - $temp_conflicts = $plugin->getManifest()->getConflicts(); + $temp_conflicts = array(); + $temp_manifest = $plugin->getManifest(); + if ($temp_manifest instanceof ElggPluginManifest) { + $temp_conflicts = $plugin->getManifest()->getConflicts(); + } foreach ($temp_conflicts as $conflict) { if ($conflict['type'] == 'plugin' && $conflict['name'] == $this_id) { $result = $this->checkDepPlugin($conflict, $enabled_plugins, false); |