Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Elgg/Elgg
Browse files Browse the repository at this point in the history
  • Loading branch information
brettp committed Oct 29, 2011
2 parents 3e46415 + 9046723 commit 6971cad
Show file tree
Hide file tree
Showing 26 changed files with 197 additions and 163 deletions.
Expand Up @@ -16,7 +16,7 @@


<requires> <requires>
<type>elgg_release</type> <type>elgg_release</type>
<version>1.8-svn</version> <version>1.8</version>
</requires> </requires>


<screenshot> <screenshot>
Expand Down
18 changes: 18 additions & 0 deletions 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>
Empty file.
15 changes: 8 additions & 7 deletions engine/classes/ElggEntity.php
Expand Up @@ -1434,10 +1434,11 @@ public function getLocation() {
* *
* @param string $location String representation of the location * @param string $location String representation of the location
* *
* @return true * @return bool
*/ */
public function setLocation($location) { public function setLocation($location) {
return $this->location = $location; $this->location = $location;
return true;
} }


/** /**
Expand All @@ -1446,7 +1447,7 @@ public function setLocation($location) {
* @param float $lat Latitude * @param float $lat Latitude
* @param float $long Longitude * @param float $long Longitude
* *
* @return true * @return bool
* @todo Unimplemented * @todo Unimplemented
*/ */
public function setLatLong($lat, $long) { public function setLatLong($lat, $long) {
Expand All @@ -1459,20 +1460,20 @@ public function setLatLong($lat, $long) {
/** /**
* Return the entity's latitude. * Return the entity's latitude.
* *
* @return int * @return float
* @todo Unimplemented * @todo Unimplemented
*/ */
public function getLatitude() { public function getLatitude() {
return $this->get('geo:lat'); return (float)$this->get('geo:lat');
} }


/** /**
* Return the entity's longitude * Return the entity's longitude
* *
* @return Int * @return float
*/ */
public function getLongitude() { public function getLongitude() {
return $this->get('geo:long'); return (float)$this->get('geo:long');
} }


/* /*
Expand Down
2 changes: 1 addition & 1 deletion engine/classes/Locatable.php
Expand Up @@ -13,7 +13,7 @@ interface Locatable {
* @param string $location Textual representation of location * @param string $location Textual representation of location
* *
* @return bool * @return bool
**/ */
public function setLocation($location); public function setLocation($location);


/** /**
Expand Down
2 changes: 2 additions & 0 deletions languages/en.php
Expand Up @@ -425,6 +425,7 @@
'riveritem:plural:user' => 'some users', 'riveritem:plural:user' => 'some users',
'river:ingroup' => 'in the group %s', 'river:ingroup' => 'in the group %s',
'river:none' => 'No activity', 'river:none' => 'No activity',
'river:update' => 'Update for %s',


'river:widget:title' => "Activity", 'river:widget:title' => "Activity",
'river:widget:description' => "Display latest activity", 'river:widget:description' => "Display latest activity",
Expand Down Expand Up @@ -1098,6 +1099,7 @@
'generic_comment:notdeleted' => "Sorry, we could not delete this comment.", '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:failure' => "An unexpected error occurred when adding your comment. Please try again.",
'generic_comment:none' => 'No comments', 'generic_comment:none' => 'No comments',
'generic_comment:title' => 'Comment by %s',


'generic_comment:email:subject' => 'You have a new comment!', '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: 'generic_comment:email:body' => "You have a new comment on your item \"%s\" from %s. It reads:
Expand Down
2 changes: 1 addition & 1 deletion mod/oauth_api/vendors/oauth/library/OAuthRequestLogger.php
Expand Up @@ -190,7 +190,7 @@ static function flush ()
// Log the request // Log the request
if (OAuthRequestLogger::$store_log) 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); $store->addLog($keys, $received, $sent, $base_string, OAuthRequestLogger::$note, OAuthRequestLogger::$user_id);
} }


Expand Down
2 changes: 1 addition & 1 deletion mod/oauth_api/vendors/oauth/library/OAuthRequestSigner.php
Expand Up @@ -56,7 +56,7 @@ class OAuthRequestSigner extends OAuthRequest
*/ */
function __construct ( $request, $method = 'GET', $params = null, $body = null ) 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)) if (is_string($params))
{ {
Expand Down
Expand Up @@ -49,7 +49,7 @@ class OAuthRequestVerifier extends OAuthRequest
*/ */
function __construct ( $uri = null, $method = 'GET' ) function __construct ( $uri = null, $method = 'GET' )
{ {
$this->store = elggconnect_get_oauth_store();//OAuthStore::instance(); $this->store = OAuthStore::instance();
parent::__construct($uri, $method); parent::__construct($uri, $method);


OAuthRequestLogger::start($this); OAuthRequestLogger::start($this);
Expand Down
4 changes: 2 additions & 2 deletions mod/oauth_api/vendors/oauth/library/OAuthRequester.php
Expand Up @@ -150,7 +150,7 @@ static function requestRequestToken ( $consumer_key, $usr_id, $params = null, $m
$params['xoauth_token_ttl'] = intval($options['token_ttl']); $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); $r = $store->getServer($consumer_key, $usr_id);
$uri = $r['request_token_uri']; $uri = $r['request_token_uri'];


Expand Down Expand Up @@ -220,7 +220,7 @@ static function requestAccessToken ( $consumer_key, $token, $usr_id, $method = '
{ {
OAuthRequestLogger::start(); OAuthRequestLogger::start();


$store = elggconnect_get_oauth_store();//OAuthStore::instance(); $store = OAuthStore::instance();
$r = $store->getServerTokenSecrets($consumer_key, $token, 'request', $usr_id); $r = $store->getServerTokenSecrets($consumer_key, $token, 'request', $usr_id);
$uri = $r['access_token_uri']; $uri = $r['access_token_uri'];
$token_name = $r['token_name']; $token_name = $r['token_name'];
Expand Down
8 changes: 4 additions & 4 deletions mod/oauth_api/vendors/oauth/library/OAuthServer.php
Expand Up @@ -58,7 +58,7 @@ public function requestToken ()
} }


// Create a request token // Create a request token
$store = elggconnect_get_oauth_store();//OAuthStore::instance(); $store = OAuthStore::instance();
$token = $store->addConsumerRequestToken($this->getParam('oauth_consumer_key', true), $options); $token = $store->addConsumerRequestToken($this->getParam('oauth_consumer_key', true), $options);
$result = 'oauth_token='.$this->urlencode($token['token']) $result = 'oauth_token='.$this->urlencode($token['token'])
.'&oauth_token_secret='.$this->urlencode($token['token_secret']); .'&oauth_token_secret='.$this->urlencode($token['token_secret']);
Expand Down Expand Up @@ -104,7 +104,7 @@ public function authorizeVerify ( )
{ {
OAuthRequestLogger::start($this); OAuthRequestLogger::start($this);


$store = elggconnect_get_oauth_store();//OAuthStore::instance(); $store = OAuthStore::instance();
$token = $this->getParam('oauth_token', true); $token = $this->getParam('oauth_token', true);
$rs = $store->getConsumerRequestToken($token); $rs = $store->getConsumerRequestToken($token);
if (empty($rs)) if (empty($rs))
Expand Down Expand Up @@ -142,7 +142,7 @@ public function authorizeFinish ( $authorized, $user_id )
&& $_SESSION['verify_oauth_token'] == $token) && $_SESSION['verify_oauth_token'] == $token)
{ {
// Flag the token as authorized, or remove the token when not authorized // 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 // Fetch the referrer host from the oauth callback parameter
$referrer_host = ''; $referrer_host = '';
Expand Down Expand Up @@ -198,7 +198,7 @@ public function accessToken ()
$options['token_ttl'] = $ttl; $options['token_ttl'] = $ttl;
} }


$store = elggconnect_get_oauth_store();//OAuthStore::instance(); $store = OAuthStore::instance();
$token = $store->exchangeConsumerRequestForAccessToken($this->getParam('oauth_token', true), $options); $token = $store->exchangeConsumerRequestForAccessToken($this->getParam('oauth_token', true), $options);
$result = 'oauth_token='.$this->urlencode($token['token']) $result = 'oauth_token='.$this->urlencode($token['token'])
.'&oauth_token_secret='.$this->urlencode($token['token_secret']); .'&oauth_token_secret='.$this->urlencode($token['token_secret']);
Expand Down
4 changes: 2 additions & 2 deletions views/default/annotation/generic_comment.php
Expand Up @@ -2,8 +2,8 @@
/** /**
* Elgg generic comment view * Elgg generic comment view
* *
* @uses $vars['annotation'] ElggAnnotation object * @uses $vars['annotation'] ElggAnnotation object
* @uses $vars['full_view'] Display fill view or brief view * @uses $vars['full_view'] Display fill view or brief view
*/ */


if (!isset($vars['annotation'])) { if (!isset($vars['annotation'])) {
Expand Down
34 changes: 0 additions & 34 deletions views/rss/annotation/default.php

This file was deleted.

33 changes: 33 additions & 0 deletions 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;
54 changes: 27 additions & 27 deletions views/rss/group/default.php
@@ -1,37 +1,37 @@
<?php <?php
/** /**
* Elgg default group view * RSS group view
* *
* @package Elgg * @package Elgg
* @subpackage Core * @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> <item>
<guid isPermaLink='true'><?php echo htmlspecialchars($vars['entity']->getURL()); ?></guid> <guid isPermaLink="true">$permalink</guid>
<pubDate><?php echo date("r",$vars['entity']->time_created) ?></pubDate> <pubDate>$pubdate</pubDate>
<link><?php echo htmlspecialchars($vars['entity']->getURL()); ?></link> <link>$permalink</link>
<title><![CDATA[<?php echo (($vars['entity']->name)); ?>]]></title> <title><![CDATA[$title]]></title>
<description><![CDATA[<?php echo (autop($vars['entity']->description)); ?>]]></description> <description><![CDATA[$description]]></description>
<?php $creator$georss$extension
$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'); ?>
</item> </item>
__HTML;

echo $item;
8 changes: 0 additions & 8 deletions views/rss/object/creator.php

This file was deleted.

17 changes: 7 additions & 10 deletions views/rss/object/default.php
@@ -1,25 +1,22 @@
<?php <?php
/** /**
* Elgg default object view * RSS object view
* *
* @package Elgg * @package Elgg
* @subpackage Core * @subpackage Core
*/ */


$title = $vars['entity']->title; $title = $vars['entity']->title;
if (empty($title)) { if (empty($title)) {
$subtitle = strip_tags($vars['entity']->description); $title = strip_tags($vars['entity']->description);
$title = substr($subtitle, 0, 32); $title = elgg_get_excerpt($title, 32);
if (strlen($subtitle) > 32) {
$title .= ' ...';
}
} }


$permalink = htmlspecialchars($vars['entity']->getURL()); $permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8');
$pubdate = date('r', $vars['entity']->time_created); $pubdate = date('r', $vars['entity']->getTimeCreated());


$creator = elgg_view('object/creator', $vars); $creator = elgg_view('page/components/creator', $vars);
$georss = elgg_view('object/georss', $vars); $georss = elgg_view('page/components/georss', $vars);
$extension = elgg_view('extensions/item'); $extension = elgg_view('extensions/item');


$item = <<<__HTML $item = <<<__HTML
Expand Down
10 changes: 0 additions & 10 deletions views/rss/object/georss.php

This file was deleted.

2 changes: 1 addition & 1 deletion views/rss/output/url.php
@@ -1,6 +1,6 @@
<?php <?php
/** /**
* RSS url view * RSS url output view
* *
*/ */
echo elgg_view('output/url', $vars, false, false, 'default'); echo elgg_view('output/url', $vars, false, false, 'default');

0 comments on commit 6971cad

Please sign in to comment.