Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:Elgg/Elgg

  • Loading branch information...
commit 6971caddb2245bec34fd23927f6f093e5b28c1ea 2 parents 3e46415 + 9046723
@brettp brettp authored
Showing with 197 additions and 163 deletions.
  1. +1 −1  documentation/examples/plugins/{ → manifest_options}/manifest.xml
  2. +18 −0 documentation/examples/plugins/skeleton/manifest.xml
  3. 0  documentation/examples/plugins/skeleton/start.php
  4. +8 −7 engine/classes/ElggEntity.php
  5. +1 −1  engine/classes/Locatable.php
  6. +2 −0  languages/en.php
  7. +1 −1  mod/oauth_api/vendors/oauth/library/OAuthRequestLogger.php
  8. +1 −1  mod/oauth_api/vendors/oauth/library/OAuthRequestSigner.php
  9. +1 −1  mod/oauth_api/vendors/oauth/library/OAuthRequestVerifier.php
  10. +2 −2 mod/oauth_api/vendors/oauth/library/OAuthRequester.php
  11. +4 −4 mod/oauth_api/vendors/oauth/library/OAuthServer.php
  12. +2 −2 views/default/annotation/generic_comment.php
  13. +0 −34 views/rss/annotation/default.php
  14. +33 −0 views/rss/annotation/generic_comment.php
  15. +27 −27 views/rss/group/default.php
  16. +0 −8 views/rss/object/creator.php
  17. +7 −10 views/rss/object/default.php
  18. +0 −10 views/rss/object/georss.php
  19. +1 −1  views/rss/output/url.php
  20. +14 −0 views/rss/page/components/creator.php
  21. +15 −0 views/rss/page/components/georss.php
  22. +7 −10 views/rss/page/default.php
  23. +13 −0 views/rss/page/elements/comments.php
  24. +15 −12 views/rss/river/item.php
  25. +0 −12 views/rss/search/entity_list.php
  26. +24 −19 views/rss/user/default.php
View
2  documentation/examples/plugins/manifest.xml → ...les/plugins/manifest_options/manifest.xml
@@ -16,7 +16,7 @@
<requires>
<type>elgg_release</type>
- <version>1.8-svn</version>
+ <version>1.8</version>
</requires>
<screenshot>
View
18 documentation/examples/plugins/skeleton/manifest.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plugin_manifest xmlns="http://www.elgg.org/plugin_manifest/1.8">
+ <name>My Plugin</name>
+ <author>My Name</author>
+ <version>1.0</version>
+ <description>This is a description of my plugin and its features.</description>
+ <website>http://www.elgg.org/</website>
+ <copyright>(C) My Name or Company 2012</copyright>
+ <license>GNU Public License version 2</license>
+
+ <requires>
+ <type>elgg_release</type>
+ <version>1.8</version>
+ </requires>
+
+ <category>communication</category>
+
+</plugin_manifest>
View
0  documentation/examples/plugins/skeleton/start.php
No changes.
View
15 engine/classes/ElggEntity.php
@@ -1434,10 +1434,11 @@ public function getLocation() {
*
* @param string $location String representation of the location
*
- * @return true
+ * @return bool
*/
public function setLocation($location) {
- return $this->location = $location;
+ $this->location = $location;
+ return true;
}
/**
@@ -1446,7 +1447,7 @@ public function setLocation($location) {
* @param float $lat Latitude
* @param float $long Longitude
*
- * @return true
+ * @return bool
* @todo Unimplemented
*/
public function setLatLong($lat, $long) {
@@ -1459,20 +1460,20 @@ public function setLatLong($lat, $long) {
/**
* Return the entity's latitude.
*
- * @return int
+ * @return float
* @todo Unimplemented
*/
public function getLatitude() {
- return $this->get('geo:lat');
+ return (float)$this->get('geo:lat');
}
/**
* Return the entity's longitude
*
- * @return Int
+ * @return float
*/
public function getLongitude() {
- return $this->get('geo:long');
+ return (float)$this->get('geo:long');
}
/*
View
2  engine/classes/Locatable.php
@@ -13,7 +13,7 @@
* @param string $location Textual representation of location
*
* @return bool
- **/
+ */
public function setLocation($location);
/**
View
2  languages/en.php
@@ -425,6 +425,7 @@
'riveritem:plural:user' => 'some users',
'river:ingroup' => 'in the group %s',
'river:none' => 'No activity',
+ 'river:update' => 'Update for %s',
'river:widget:title' => "Activity",
'river:widget:description' => "Display latest activity",
@@ -1098,6 +1099,7 @@
'generic_comment:notdeleted' => "Sorry, we could not delete this comment.",
'generic_comment:failure' => "An unexpected error occurred when adding your comment. Please try again.",
'generic_comment:none' => 'No comments',
+ 'generic_comment:title' => 'Comment by %s',
'generic_comment:email:subject' => 'You have a new comment!',
'generic_comment:email:body' => "You have a new comment on your item \"%s\" from %s. It reads:
View
2  mod/oauth_api/vendors/oauth/library/OAuthRequestLogger.php
@@ -190,7 +190,7 @@ static function flush ()
// Log the request
if (OAuthRequestLogger::$store_log)
{
- $store = elggconnect_get_oauth_store();//OAuthStore::instance();
+ $store = OAuthStore::instance();
$store->addLog($keys, $received, $sent, $base_string, OAuthRequestLogger::$note, OAuthRequestLogger::$user_id);
}
View
2  mod/oauth_api/vendors/oauth/library/OAuthRequestSigner.php
@@ -56,7 +56,7 @@ class OAuthRequestSigner extends OAuthRequest
*/
function __construct ( $request, $method = 'GET', $params = null, $body = null )
{
- $this->store = elggconnect_get_oauth_store();//OAuthStore::instance();
+ $this->store = OAuthStore::instance();
if (is_string($params))
{
View
2  mod/oauth_api/vendors/oauth/library/OAuthRequestVerifier.php
@@ -49,7 +49,7 @@ class OAuthRequestVerifier extends OAuthRequest
*/
function __construct ( $uri = null, $method = 'GET' )
{
- $this->store = elggconnect_get_oauth_store();//OAuthStore::instance();
+ $this->store = OAuthStore::instance();
parent::__construct($uri, $method);
OAuthRequestLogger::start($this);
View
4 mod/oauth_api/vendors/oauth/library/OAuthRequester.php
@@ -150,7 +150,7 @@ static function requestRequestToken ( $consumer_key, $usr_id, $params = null, $m
$params['xoauth_token_ttl'] = intval($options['token_ttl']);
}
- $store = elggconnect_get_oauth_store();//OAuthStore::instance();
+ $store = OAuthStore::instance();
$r = $store->getServer($consumer_key, $usr_id);
$uri = $r['request_token_uri'];
@@ -220,7 +220,7 @@ static function requestAccessToken ( $consumer_key, $token, $usr_id, $method = '
{
OAuthRequestLogger::start();
- $store = elggconnect_get_oauth_store();//OAuthStore::instance();
+ $store = OAuthStore::instance();
$r = $store->getServerTokenSecrets($consumer_key, $token, 'request', $usr_id);
$uri = $r['access_token_uri'];
$token_name = $r['token_name'];
View
8 mod/oauth_api/vendors/oauth/library/OAuthServer.php
@@ -58,7 +58,7 @@ public function requestToken ()
}
// Create a request token
- $store = elggconnect_get_oauth_store();//OAuthStore::instance();
+ $store = OAuthStore::instance();
$token = $store->addConsumerRequestToken($this->getParam('oauth_consumer_key', true), $options);
$result = 'oauth_token='.$this->urlencode($token['token'])
.'&oauth_token_secret='.$this->urlencode($token['token_secret']);
@@ -104,7 +104,7 @@ public function authorizeVerify ( )
{
OAuthRequestLogger::start($this);
- $store = elggconnect_get_oauth_store();//OAuthStore::instance();
+ $store = OAuthStore::instance();
$token = $this->getParam('oauth_token', true);
$rs = $store->getConsumerRequestToken($token);
if (empty($rs))
@@ -142,7 +142,7 @@ public function authorizeFinish ( $authorized, $user_id )
&& $_SESSION['verify_oauth_token'] == $token)
{
// Flag the token as authorized, or remove the token when not authorized
- $store = elggconnect_get_oauth_store();//OAuthStore::instance();
+ $store = OAuthStore::instance();
// Fetch the referrer host from the oauth callback parameter
$referrer_host = '';
@@ -198,7 +198,7 @@ public function accessToken ()
$options['token_ttl'] = $ttl;
}
- $store = elggconnect_get_oauth_store();//OAuthStore::instance();
+ $store = OAuthStore::instance();
$token = $store->exchangeConsumerRequestForAccessToken($this->getParam('oauth_token', true), $options);
$result = 'oauth_token='.$this->urlencode($token['token'])
.'&oauth_token_secret='.$this->urlencode($token['token_secret']);
View
4 views/default/annotation/generic_comment.php
@@ -2,8 +2,8 @@
/**
* Elgg generic comment view
*
- * @uses $vars['annotation'] ElggAnnotation object
- * @uses $vars['full_view'] Display fill view or brief view
+ * @uses $vars['annotation'] ElggAnnotation object
+ * @uses $vars['full_view'] Display fill view or brief view
*/
if (!isset($vars['annotation'])) {
View
34 views/rss/annotation/default.php
@@ -1,34 +0,0 @@
-<?php
-/**
- * Elgg RSS view for a generic comment
- *
- * @package Elgg
- * @subpackage Core
- */
-
-$entity = get_entity($vars['annotation']->entity_guid);
-
-$title = substr($vars['annotation']->value, 0, 32);
-if (strlen($vars['annotation']->value) > 32) {
- $title .= " ...";
-}
-
-$permalink = $entity->getURL();
-$pubdate = date('r', $entity->time_created);
-
-$creator = elgg_view('object/creator', array('entity' => $entity));
-$georss = elgg_view('object/georss', array('entity' => $entity));
-$extensions = elgg_view('extensions/item');
-
-$item = <<<__HTML
-<item>
- <guid isPermaLink='true'>$permalink#{$vars['annotation']->id}</guid>
- <pubDate>$pubdate</pubDate>
- <link>$permalink#{$vars['annotation']->id}</link>
- <title><![CDATA[$title]]></title>
- <description><![CDATA[{$vars['annotation']->value}]]></description>
- $creator$georss$extensions
-</item>
-__HTML;
-
-echo $item;
View
33 views/rss/annotation/generic_comment.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Elgg RSS view for a generic_comment annotation
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+
+$annotation = $vars['annotation'];
+
+$poster = $annotation->getOwnerEntity();
+$poster_name = htmlspecialchars($poster->name, ENT_NOQUOTES, 'UTF-8');
+$pubdate = date('r', $annotation->getTimeCreated());
+$permalink = $annotation->getURL();
+
+$title = elgg_echo('generic_comment:title', array($poster_name));
+
+$creator = elgg_view('page/components/creator', array('entity' => $annotation));
+$extensions = elgg_view('extensions/item');
+
+$item = <<<__HTML
+<item>
+ <guid isPermaLink='true'>$permalink</guid>
+ <pubDate>$pubdate</pubDate>
+ <link>$permalink</link>
+ <title><![CDATA[$title]]></title>
+ <description><![CDATA[{$vars['annotation']->value}]]></description>
+ $creator$extensions
+</item>
+
+__HTML;
+
+echo $item;
View
54 views/rss/group/default.php
@@ -1,37 +1,37 @@
<?php
/**
- * Elgg default group view
+ * RSS group view
*
* @package Elgg
* @subpackage Core
*/
-?>
+$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8');
+$pubdate = date('r', $vars['entity']->getTimeCreated());
+$title = htmlspecialchars($vars['entity']->name, ENT_NOQUOTES, 'UTF-8');
+if ($vars['entity']->description) {
+ $description = autop($vars['entity']->description);
+} elseif ($vars['entity']->briefdescription) {
+ $description = autop($vars['entity']->briefdescription);
+} else {
+ $description = '';
+}
+
+$creator = elgg_view('page/components/creator', $vars);
+$georss = elgg_view('page/components/georss', $vars);
+$extension = elgg_view('extensions/item');
+
+$item = <<<__HTML
<item>
-<guid isPermaLink='true'><?php echo htmlspecialchars($vars['entity']->getURL()); ?></guid>
-<pubDate><?php echo date("r",$vars['entity']->time_created) ?></pubDate>
-<link><?php echo htmlspecialchars($vars['entity']->getURL()); ?></link>
-<title><![CDATA[<?php echo (($vars['entity']->name)); ?>]]></title>
-<description><![CDATA[<?php echo (autop($vars['entity']->description)); ?>]]></description>
-<?php
- $owner = $vars['entity']->getOwnerEntity();
- if ($owner) {
-?>
-<dc:creator><?php echo $owner->name; ?></dc:creator>
-<?php
- }
-?>
-<?php
- if (
- ($vars['entity'] instanceof Locatable) &&
- ($vars['entity']->getLongitude()) &&
- ($vars['entity']->getLatitude())
- ) {
- ?>
- <georss:point><?php echo $vars['entity']->getLatitude(); ?> <?php echo $vars['entity']->getLongitude(); ?></georss:point>
- <?php
- }
-?>
-<?php echo elgg_view('extensions/item'); ?>
+ <guid isPermaLink="true">$permalink</guid>
+ <pubDate>$pubdate</pubDate>
+ <link>$permalink</link>
+ <title><![CDATA[$title]]></title>
+ <description><![CDATA[$description]]></description>
+ $creator$georss$extension
</item>
+
+__HTML;
+
+echo $item;
View
8 views/rss/object/creator.php
@@ -1,8 +0,0 @@
-<?php
-/**
- *
- */
-
-if ($owner = $vars['entity']->getOwnerEntity()) {
- echo "<dc:creator>{$owner->name}</dc:creator>";
-}
View
17 views/rss/object/default.php
@@ -1,6 +1,6 @@
<?php
/**
- * Elgg default object view
+ * RSS object view
*
* @package Elgg
* @subpackage Core
@@ -8,18 +8,15 @@
$title = $vars['entity']->title;
if (empty($title)) {
- $subtitle = strip_tags($vars['entity']->description);
- $title = substr($subtitle, 0, 32);
- if (strlen($subtitle) > 32) {
- $title .= ' ...';
- }
+ $title = strip_tags($vars['entity']->description);
+ $title = elgg_get_excerpt($title, 32);
}
-$permalink = htmlspecialchars($vars['entity']->getURL());
-$pubdate = date('r', $vars['entity']->time_created);
+$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8');
+$pubdate = date('r', $vars['entity']->getTimeCreated());
-$creator = elgg_view('object/creator', $vars);
-$georss = elgg_view('object/georss', $vars);
+$creator = elgg_view('page/components/creator', $vars);
+$georss = elgg_view('page/components/georss', $vars);
$extension = elgg_view('extensions/item');
$item = <<<__HTML
View
10 views/rss/object/georss.php
@@ -1,10 +0,0 @@
-<?php
-/**
- *
- */
-
-if (($vars['entity'] instanceof Locatable) &&
- ($latitude = $vars['entity']->getLongitude()) && ($longitude = $vars['entity']->getLatitude())
-) {
- echo "<georss:point>$latitude $longitude</georss:point>";
-}
View
2  views/rss/output/url.php
@@ -1,6 +1,6 @@
<?php
/**
- * RSS url view
+ * RSS url output view
*
*/
echo elgg_view('output/url', $vars, false, false, 'default');
View
14 views/rss/page/components/creator.php
@@ -0,0 +1,14 @@
+<?php
+/**
+ * Creator view
+ *
+ * Implements Dublin Core creator
+ *
+ * @uses $vars['entity']
+ */
+
+$owner = $vars['entity']->getOwnerEntity();
+if ($owner) {
+ $owner_name = htmlspecialchars($owner->name, ENT_NOQUOTES, 'UTF-8');
+ echo "<dc:creator>$owner_name</dc:creator>";
+}
View
15 views/rss/page/components/georss.php
@@ -0,0 +1,15 @@
+<?php
+/**
+ * GeoRSS view
+ *
+ * This implements GeoRSS-Simple
+ *
+ * @uses $vars['entity']
+ */
+
+$longitude = $vars['entity']->getLongitude();
+$latitude = $vars['entity']->getLatitude();
+
+if ($vars['entity'] instanceof Locatable && $longitude && $latitude) {
+ echo "<georss:point>$latitude $longitude</georss:point>";
+}
View
17 views/rss/page/default.php
@@ -4,7 +4,6 @@
*
* @package Elgg
* @subpackage Core
- *
*/
header("Content-Type: text/xml");
@@ -12,7 +11,7 @@
// allow caching as required by stupid MS products for https feeds.
header('Pragma: public', TRUE);
-echo "<?xml version='1.0'?>\n";
+echo "<?xml version='1.0'?>";
// Set title
if (empty($vars['title'])) {
@@ -22,8 +21,8 @@
}
// Remove RSS from URL
-$url = str_replace('?view=rss','', full_url());
-$url = str_replace('&view=rss','', $url);
+$url = str_replace('?view=rss', '', full_url());
+$url = str_replace('&view=rss', '', $url);
?>
@@ -32,11 +31,9 @@
<title><![CDATA[<?php echo $title; ?>]]></title>
<link><?php echo htmlentities($url); ?></link>
<description></description>
- <?php echo elgg_view('extensions/channel'); ?>
- <?php
-
- echo $vars['body'];
-
- ?>
+<?php
+ echo elgg_view('extensions/channel');
+ echo $vars['body'];
+?>
</channel>
</rss>
View
13 views/rss/page/elements/comments.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * RSS comments view
+ *
+ * @uses $vars['entity']
+ */
+
+$options = array(
+ 'guid' => $vars['entity']->getGUID(),
+ 'annotation_name' => 'generic_comment',
+ 'order_by' => 'n_table.time_created desc',
+);
+echo elgg_list_annotations($options);
View
27 views/rss/river/item.php
@@ -6,27 +6,30 @@
*/
$item = $vars['item'];
-$view = $item->getView();
-
$name = $item->getSubjectEntity()->name;
-$body = elgg_view($item->getView(), array('item' => $item), false, false, 'default');
-$body = "$name $body";
+$name = htmlspecialchars($name, ENT_NOQUOTES, 'UTF-8');
+$title = elgg_echo('river:update', array($name));
-$title = strip_tags($body);
$timestamp = date('r', $item->getPostedTime());
+$body = elgg_view('river/elements/summary', $vars, false, false, 'default');
+
$object = $item->getObjectEntity();
if ($object) {
$url = htmlspecialchars($object->getURL());
} else {
- $url = elgg_get_site_url() . 'activity';
+ $url = elgg_normalize_url('activity');
}
-?>
+$html = <<<__HTML
<item>
- <guid isPermaLink='true'><?php echo $url; ?></guid>
- <pubDate><?php echo $timestamp; ?></pubDate>
- <link><?php echo $url; ?></link>
- <title><![CDATA[<?php echo $title; ?>]]></title>
- <description><![CDATA[<?php echo ($body); ?>]]></description>
+ <guid>$item->id</guid>
+ <pubDate>$timestamp</pubDate>
+ <link>$url</link>
+ <title><![CDATA[$title]]></title>
+ <description><![CDATA[$body]]></description>
</item>
+
+__HTML;
+
+echo $html;
View
12 views/rss/search/entity_list.php
@@ -1,12 +0,0 @@
-<?php
-/**
- * @package Elgg
- * @subpackage Core
- */
-
-$entities = $vars['entities'];
-if (is_array($entities) && sizeof($entities) > 0) {
- foreach($entities as $entity) {
- echo elgg_view_entity($entity);
- }
-}
View
43 views/rss/user/default.php
@@ -1,29 +1,34 @@
<?php
/**
- * Elgg default user view
+ * RSS user view
*
* @package Elgg
* @subpackage Core
*/
-?>
+$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8');
+$pubdate = date('r', $vars['entity']->getTimeCreated());
+$title = htmlspecialchars($vars['entity']->name, ENT_NOQUOTES, 'UTF-8');
+if ($vars['entity']->description) {
+ $description = autop($vars['entity']->description);
+} else {
+ $description = '';
+}
+
+$georss = elgg_view('page/components/georss', $vars);
+$extension = elgg_view('extensions/item');
+
+$item = <<<__HTML
<item>
-<guid isPermaLink='true'><?php echo $vars['entity']->getURL(); ?></guid>
-<pubDate><?php echo date("r",$vars['entity']->time_created) ?></pubDate>
-<link><?php echo $vars['entity']->getURL(); ?></link>
-<title><![CDATA[<?php echo (($vars['entity']->name)); ?>]]></title>
-<description><![CDATA[<?php echo (autop($vars['entity']->description)); ?>]]></description>
-<?php
- if (
- ($vars['entity'] instanceof Locatable) &&
- ($vars['entity']->getLongitude()) &&
- ($vars['entity']->getLatitude())
- ) {
- ?>
- <georss:point><?php echo $vars['entity']->getLatitude(); ?> <?php echo $vars['entity']->getLongitude(); ?></georss:point>
- <?php
- }
-?>
-<?php echo elgg_view('extensions/item'); ?>
+ <guid isPermaLink="true">$permalink</guid>
+ <pubDate>$pubdate</pubDate>
+ <link>$permalink</link>
+ <title><![CDATA[$title]]></title>
+ <description><![CDATA[$description]]></description>
+ $georss$extension
</item>
+
+__HTML;
+
+echo $item;
Please sign in to comment.
Something went wrong with that request. Please try again.