aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt35
-rw-r--r--actions/comments/delete.php5
-rw-r--r--engine/lib/database.php4
-rw-r--r--engine/lib/group.php3
-rw-r--r--engine/lib/output.php25
-rw-r--r--engine/lib/pageowner.php4
-rw-r--r--engine/lib/users.php16
-rw-r--r--engine/tests/regression/trac_bugs.php52
-rw-r--r--mod/embed/start.php5
-rw-r--r--mod/externalpages/start.php8
-rw-r--r--mod/groups/actions/groups/membership/invite.php73
-rw-r--r--mod/htmlawed/start.php4
-rw-r--r--mod/htmlawed/tests/tags.php78
-rw-r--r--mod/pages/actions/annotations/page/delete.php20
-rw-r--r--mod/pages/languages/en.php5
-rw-r--r--mod/pages/lib/pages.php7
-rw-r--r--mod/pages/pages/pages/edit.php13
-rw-r--r--mod/pages/start.php21
-rw-r--r--mod/pages/views/default/annotation/page.php18
-rw-r--r--mod/pages/views/default/object/page_top.php26
-rw-r--r--mod/pages/views/default/pages/sidebar/history.php1
-rw-r--r--mod/reportedcontent/views/default/object/reported_content.php20
-rw-r--r--mod/twitter_api/languages/en.php2
-rw-r--r--mod/twitter_api/lib/twitter_api.php2
-rw-r--r--mod/twitter_api/start.php6
-rw-r--r--mod/twitter_api/views/default/plugins/twitter_api/settings.php15
-rw-r--r--version.php2
-rw-r--r--views/default/css/admin.php3
28 files changed, 326 insertions, 147 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 797fb9c62..fcdc97969 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,38 @@
+Version 1.8.15
+(April 23, 2013 from https://github.com/Elgg/Elgg/tree/1.8)
+ Contributing Developers:
+ * Cash Costello
+ * Ismayil Khayredinov
+ * Jeff Tilson
+ * Matt Beckett
+ * Paweł Sroka
+ * Sem
+ * Steve Clay
+ * Tom Voorneveld
+
+ Bugfixes:
+ * Not displaying http:// on profiles when website isn't set
+ * Fixed pagination display issue for small screens
+ * Not hiding subpages of top level pages that have been deleted
+ * Stop corrupting JavaScript views with elgg deprecation messages
+ * Fixed out of memory error due to query cache
+ * Fixed bug preventing users authorizing Twitter account access
+ * Fixed friends access level for editing pages
+
+ Enhancements:
+ * Added browser caching of language JS files
+ * Adding nofollow on user posted URLs for spam deterrence (thanks to Hellekin)
+ * Auto-registering views for simplecache when their URL is requested
+ * Display helpful message for those who have site URL configuration issues
+ * Can revert to a previous revision with pages plugin
+ * Site owners can turn off posting wire messages to Twitter
+ * Search results are sorted by relevance
+
+ Dropped Plugins:
+ * Twitter widget due to changes in Twitter API and terms of service
+ * OAuth API plugin due to conflicts with the Twitter API plugin
+
+
Version 1.8.14
(March 12, 2013 from https://github.com/Elgg/Elgg/tree/1.8)
Contributing Developers:
diff --git a/actions/comments/delete.php b/actions/comments/delete.php
index f2c058ff4..c6b481da4 100644
--- a/actions/comments/delete.php
+++ b/actions/comments/delete.php
@@ -5,11 +5,6 @@
* @package Elgg
*/
-// Ensure we're logged in
-if (!elgg_is_logged_in()) {
- forward();
-}
-
// Make sure we can get the comment in question
$annotation_id = (int) get_input('annotation_id');
$comment = elgg_get_annotation_from_id($annotation_id);
diff --git a/engine/lib/database.php b/engine/lib/database.php
index 3553d787d..37dfb8f8d 100644
--- a/engine/lib/database.php
+++ b/engine/lib/database.php
@@ -473,7 +473,7 @@ function insert_data($query) {
}
/**
- * Update a row in the database.
+ * Update the database.
*
* @note Altering the DB invalidates all queries in {@link $DB_QUERY_CACHE}.
*
@@ -498,7 +498,7 @@ function update_data($query) {
}
/**
- * Remove a row from the database.
+ * Remove data from the database.
*
* @note Altering the DB invalidates all queries in {@link $DB_QUERY_CACHE}.
*
diff --git a/engine/lib/group.php b/engine/lib/group.php
index 624029d98..359bc59c2 100644
--- a/engine/lib/group.php
+++ b/engine/lib/group.php
@@ -242,7 +242,8 @@ function get_users_membership($user_guid) {
$options = array(
'relationship' => 'member',
'relationship_guid' => $user_guid,
- 'inverse_relationship' => FALSE
+ 'inverse_relationship' => false,
+ 'limit' => false,
);
return elgg_get_entities_from_relationship($options);
}
diff --git a/engine/lib/output.php b/engine/lib/output.php
index c5a04989b..6905b9b71 100644
--- a/engine/lib/output.php
+++ b/engine/lib/output.php
@@ -13,28 +13,33 @@
* @param string $text The input string
*
* @return string The output string with formatted links
- **/
+ */
function parse_urls($text) {
+
+ // URI specification: http://www.ietf.org/rfc/rfc3986.txt
+ // This varies from the specification in the following ways:
+ // * Supports non-ascii characters
+ // * Does not allow parentheses and single quotes
+ // * Cuts off commas, exclamation points, and periods off as last character
+
// @todo this causes problems with <attr = "val">
// must be in <attr="val"> format (no space).
// By default htmlawed rewrites tags to this format.
// if PHP supported conditional negative lookbehinds we could use this:
// $r = preg_replace_callback('/(?<!=)(?<![ ])?(?<!["\'])((ht|f)tps?:\/\/[^\s\r\n\t<>"\'\!\(\),]+)/i',
- //
- // we can put , in the list of excluded char but need to keep . because of domain names.
- // it is removed in the callback.
- $r = preg_replace_callback('/(?<!=)(?<!["\'])((ht|f)tps?:\/\/[^\s\r\n\t<>"\'\!\(\),]+)/i',
+ $r = preg_replace_callback('/(?<!=)(?<!["\'])((ht|f)tps?:\/\/[^\s\r\n\t<>"\'\(\)]+)/i',
create_function(
'$matches',
'
$url = $matches[1];
- $period = \'\';
- if (substr($url, -1, 1) == \'.\') {
- $period = \'.\';
- $url = trim($url, \'.\');
+ $punc = \'\';
+ $last = substr($url, -1, 1);
+ if (in_array($last, array(".", "!", ","))) {
+ $punc = $last;
+ $url = rtrim($url, ".!,");
}
$urltext = str_replace("/", "/<wbr />", $url);
- return "<a href=\"$url\">$urltext</a>$period";
+ return "<a href=\"$url\" rel=\"nofollow\">$urltext</a>$punc";
'
), $text);
diff --git a/engine/lib/pageowner.php b/engine/lib/pageowner.php
index 7e8e6e430..bd63d08c6 100644
--- a/engine/lib/pageowner.php
+++ b/engine/lib/pageowner.php
@@ -29,7 +29,9 @@ function elgg_get_page_owner_guid($guid = 0) {
// return guid of page owner entity
$guid = elgg_trigger_plugin_hook('page_owner', 'system', NULL, 0);
- $page_owner_guid = $guid;
+ if ($guid) {
+ $page_owner_guid = $guid;
+ }
return $guid;
}
diff --git a/engine/lib/users.php b/engine/lib/users.php
index 868cd7815..9a5194896 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -705,18 +705,18 @@ function send_new_password_request($user_guid) {
* @return bool
*/
function force_user_password_reset($user_guid, $password) {
- global $CONFIG;
-
$user = get_entity($user_guid);
if ($user instanceof ElggUser) {
- $salt = generate_random_cleartext_password(); // Reset the salt
- $user->salt = $salt;
+ $ia = elgg_set_ignore_access();
- $hash = generate_user_password($user, $password);
+ $user->salt = generate_random_cleartext_password();
+ $hash = generate_user_password($user, $password);
+ $user->password = $hash;
+ $result = (bool)$user->save();
- $query = "UPDATE {$CONFIG->dbprefix}users_entity
- set password='$hash', salt='$salt' where guid=$user_guid";
- return update_data($query);
+ elgg_set_ignore_access($ia);
+
+ return $result;
}
return false;
diff --git a/engine/tests/regression/trac_bugs.php b/engine/tests/regression/trac_bugs.php
index 58444dd39..4de9c306b 100644
--- a/engine/tests/regression/trac_bugs.php
+++ b/engine/tests/regression/trac_bugs.php
@@ -236,4 +236,56 @@ class ElggCoreRegressionBugsTest extends ElggCoreUnitTest {
$this->assertIdentical($expected, $friendly_title);
}
}
+
+ /**
+ * Test #5369 -- parse_urls()
+ * https://github.com/Elgg/Elgg/issues/5369
+ */
+ public function test_parse_urls() {
+
+ $cases = array(
+ 'no.link.here' =>
+ 'no.link.here',
+ 'simple link http://example.org test' =>
+ 'simple link <a href="http://example.org" rel="nofollow">http:/<wbr />/<wbr />example.org</a> test',
+ 'non-ascii http://ñew.org/ test' =>
+ 'non-ascii <a href="http://ñew.org/" rel="nofollow">http:/<wbr />/<wbr />ñew.org/<wbr /></a> test',
+
+ // section 2.1
+ 'percent encoded http://example.org/a%20b test' =>
+ 'percent encoded <a href="http://example.org/a%20b" rel="nofollow">http:/<wbr />/<wbr />example.org/<wbr />a%20b</a> test',
+ // section 2.2: skipping single quote and parenthese
+ 'reserved characters http://example.org/:/?#[]@!$&*+,;= test' =>
+ 'reserved characters <a href="http://example.org/:/?#[]@!$&*+,;=" rel="nofollow">http:/<wbr />/<wbr />example.org/<wbr />:/<wbr />?#[]@!$&*+,;=</a> test',
+ // section 2.3
+ 'unreserved characters http://example.org/a1-._~ test' =>
+ 'unreserved characters <a href="http://example.org/a1-._~" rel="nofollow">http:/<wbr />/<wbr />example.org/<wbr />a1-._~</a> test',
+
+ 'parameters http://example.org/?val[]=1&val[]=2 test' =>
+ 'parameters <a href="http://example.org/?val[]=1&val[]=2" rel="nofollow">http:/<wbr />/<wbr />example.org/<wbr />?val[]=1&val[]=2</a> test',
+ 'port http://example.org:80/ test' =>
+ 'port <a href="http://example.org:80/" rel="nofollow">http:/<wbr />/<wbr />example.org:80/<wbr /></a> test',
+
+ 'parentheses (http://www.google.com) test' =>
+ 'parentheses (<a href="http://www.google.com" rel="nofollow">http:/<wbr />/<wbr />www.google.com</a>) test',
+ 'comma http://elgg.org, test' =>
+ 'comma <a href="http://elgg.org" rel="nofollow">http:/<wbr />/<wbr />elgg.org</a>, test',
+ 'period http://elgg.org. test' =>
+ 'period <a href="http://elgg.org" rel="nofollow">http:/<wbr />/<wbr />elgg.org</a>. test',
+ 'exclamation http://elgg.org! test' =>
+ 'exclamation <a href="http://elgg.org" rel="nofollow">http:/<wbr />/<wbr />elgg.org</a>! test',
+
+ 'already anchor <a href="http://twitter.com/">twitter</a> test' =>
+ 'already anchor <a href="http://twitter.com/">twitter</a> test',
+
+ 'ssl https://example.org/ test' =>
+ 'ssl <a href="https://example.org/" rel="nofollow">https:/<wbr />/<wbr />example.org/<wbr /></a> test',
+ 'ftp ftp://example.org/ test' =>
+ 'ftp <a href="ftp://example.org/" rel="nofollow">ftp:/<wbr />/<wbr />example.org/<wbr /></a> test',
+
+ );
+ foreach ($cases as $input => $output) {
+ $this->assertEqual($output, parse_urls($input));
+ }
+ }
}
diff --git a/mod/embed/start.php b/mod/embed/start.php
index 2ece9d2c4..e14e0efd4 100644
--- a/mod/embed/start.php
+++ b/mod/embed/start.php
@@ -13,6 +13,7 @@ elgg_register_event_handler('init', 'system', 'embed_init');
*/
function embed_init() {
elgg_extend_view('css/elgg', 'embed/css');
+ elgg_extend_view('css/admin', 'embed/css');
elgg_register_plugin_hook_handler('register', 'menu:longtext', 'embed_longtext_menu');
elgg_register_plugin_hook_handler('register', 'menu:embed', 'embed_select_tab', 1000);
@@ -20,7 +21,9 @@ function embed_init() {
// Page handler for the modal media embed
elgg_register_page_handler('embed', 'embed_page_handler');
- elgg_register_js('elgg.embed', 'js/embed/embed.js', 'footer');
+ $embed_js = elgg_get_simplecache_url('js', 'embed/embed');
+ elgg_register_simplecache_view('js/embed/embed');
+ elgg_register_js('elgg.embed', $embed_js, 'footer');
}
/**
diff --git a/mod/externalpages/start.php b/mod/externalpages/start.php
index 74da7f828..f0ffa6b9d 100644
--- a/mod/externalpages/start.php
+++ b/mod/externalpages/start.php
@@ -12,7 +12,7 @@ function expages_init() {
elgg_register_page_handler('terms', 'expages_page_handler');
elgg_register_page_handler('privacy', 'expages_page_handler');
elgg_register_page_handler('expages', 'expages_page_handler');
-
+
// Register public external pages
elgg_register_plugin_hook_handler('public_pages', 'walled_garden', 'expages_public');
@@ -65,7 +65,7 @@ function expages_page_handler($page, $handler) {
$type = strtolower($handler);
$title = elgg_echo("expages:$type");
- $content = elgg_view_title($title);
+ $header = elgg_view_title($title);
$object = elgg_get_entities(array(
'type' => 'object',
@@ -80,11 +80,11 @@ function expages_page_handler($page, $handler) {
$content = elgg_view('expages/wrapper', array('content' => $content));
if (elgg_is_logged_in() || !elgg_get_config('walled_garden')) {
- $body = elgg_view_layout('one_sidebar', array('content' => $content));
+ $body = elgg_view_layout('one_sidebar', array('title' => $title, 'content' => $content));
echo elgg_view_page($title, $body);
} else {
elgg_load_css('elgg.walled_garden');
- $body = elgg_view_layout('walled_garden', array('content' => $content));
+ $body = elgg_view_layout('walled_garden', array('content' => $header . $content));
echo elgg_view_page($title, $body, 'walled_garden');
}
return true;
diff --git a/mod/groups/actions/groups/membership/invite.php b/mod/groups/actions/groups/membership/invite.php
index db90ecf3a..a96165b0e 100644
--- a/mod/groups/actions/groups/membership/invite.php
+++ b/mod/groups/actions/groups/membership/invite.php
@@ -7,43 +7,48 @@
$logged_in_user = elgg_get_logged_in_user_entity();
-$user_guid = get_input('user_guid');
-if (!is_array($user_guid)) {
- $user_guid = array($user_guid);
+$user_guids = get_input('user_guid');
+if (!is_array($user_guids)) {
+ $user_guids = array($user_guids);
}
$group_guid = get_input('group_guid');
+$group = get_entity($group_guid);
-if (sizeof($user_guid)) {
- foreach ($user_guid as $u_id) {
- $user = get_entity($u_id);
- $group = get_entity($group_guid);
-
- if ($user && $group && ($group instanceof ElggGroup) && $group->canEdit()) {
-
- if (!check_entity_relationship($group->guid, 'invited', $user->guid)) {
-
- // Create relationship
- add_entity_relationship($group->guid, 'invited', $user->guid);
-
- // Send email
- $url = elgg_normalize_url("groups/invitations/$user->username");
- $result = notify_user($user->getGUID(), $group->owner_guid,
- elgg_echo('groups:invite:subject', array($user->name, $group->name)),
- elgg_echo('groups:invite:body', array(
- $user->name,
- $logged_in_user->name,
- $group->name,
- $url,
- )),
- NULL);
- if ($result) {
- system_message(elgg_echo("groups:userinvited"));
- } else {
- register_error(elgg_echo("groups:usernotinvited"));
- }
- } else {
- register_error(elgg_echo("groups:useralreadyinvited"));
- }
+if (count($user_guids) > 0 && elgg_instanceof($group, 'group') && $group->canEdit()) {
+ foreach ($user_guids as $guid) {
+ $user = get_user($guid);
+ if (!$user) {
+ continue;
+ }
+
+ if (check_entity_relationship($group->guid, 'invited', $user->guid)) {
+ register_error(elgg_echo("groups:useralreadyinvited"));
+ continue;
+ }
+
+ if (check_entity_relationship($user->guid, 'member', $group->guid)) {
+ // @todo add error message
+ continue;
+ }
+
+ // Create relationship
+ add_entity_relationship($group->guid, 'invited', $user->guid);
+
+ // Send notification
+ $url = elgg_normalize_url("groups/invitations/$user->username");
+ $result = notify_user($user->getGUID(), $group->owner_guid,
+ elgg_echo('groups:invite:subject', array($user->name, $group->name)),
+ elgg_echo('groups:invite:body', array(
+ $user->name,
+ $logged_in_user->name,
+ $group->name,
+ $url,
+ )),
+ NULL);
+ if ($result) {
+ system_message(elgg_echo("groups:userinvited"));
+ } else {
+ register_error(elgg_echo("groups:usernotinvited"));
}
}
}
diff --git a/mod/htmlawed/start.php b/mod/htmlawed/start.php
index 12b6470a3..25a70a4aa 100644
--- a/mod/htmlawed/start.php
+++ b/mod/htmlawed/start.php
@@ -156,10 +156,8 @@ function htmlawed_tag_post_processor($element, $attributes = false) {
* Runs unit tests for htmlawed
*
* @return array
- * */
+ */
function htmlawed_test($hook, $type, $value, $params) {
- global $CONFIG;
-
$value[] = dirname(__FILE__) . '/tests/tags.php';
return $value;
}
diff --git a/mod/htmlawed/tests/tags.php b/mod/htmlawed/tests/tags.php
index b3914a9d6..05fe829f4 100644
--- a/mod/htmlawed/tests/tags.php
+++ b/mod/htmlawed/tests/tags.php
@@ -1,45 +1,47 @@
<?php
+
/**
* Dupplicated tags in htmlawed
*/
class HtmLawedDuplicateTagsTest extends ElggCoreUnitTest {
- /**
- * Called before each test object.
- */
- public function __construct() {
- parent::__construct();
- }
-
- /**
- * Called before each test method.
- */
- public function setUp() {
- }
-
- /**
- * Called after each test method.
- */
- public function tearDown() {
- // do not allow SimpleTest to interpret Elgg notices as exceptions
- $this->swallowErrors();
- }
-
- /**
- * Called after each test object.
- */
- public function __destruct() {
- elgg_set_ignore_access($this->ia);
- // all __destruct() code should go above here
- parent::__destruct();
- }
-
- public function testNotDuplicateTags() {
- $filter_html = '<ul><li>item</li></ul>';
- set_input('test', $filter_html);
-
- $expected = $filter_html;
- $result = get_input('test');
- $this->assertEqual($result, $expected);
- }
+ /**
+ * Called before each test object.
+ */
+ public function __construct() {
+ parent::__construct();
+ }
+
+ /**
+ * Called before each test method.
+ */
+ public function setUp() {
+
+ }
+
+ /**
+ * Called after each test method.
+ */
+ public function tearDown() {
+ // do not allow SimpleTest to interpret Elgg notices as exceptions
+ $this->swallowErrors();
+ }
+
+ /**
+ * Called after each test object.
+ */
+ public function __destruct() {
+ // all __destruct() code should go above here
+ parent::__destruct();
+ }
+
+ public function testNotDuplicateTags() {
+ $filter_html = '<ul><li>item</li></ul>';
+ set_input('test', $filter_html);
+
+ $expected = $filter_html;
+ $result = get_input('test');
+ $this->assertEqual($result, $expected);
+ }
+
} \ No newline at end of file
diff --git a/mod/pages/actions/annotations/page/delete.php b/mod/pages/actions/annotations/page/delete.php
new file mode 100644
index 000000000..156b516d2
--- /dev/null
+++ b/mod/pages/actions/annotations/page/delete.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Remove a page (revision) annotation
+ *
+ * @package ElggPages
+ */
+
+// Make sure we can get the annotations and entity in question
+$annotation_id = (int) get_input('annotation_id');
+$annotation = elgg_get_annotation_from_id($annotation_id);
+$entity = get_entity($annotation->entity_guid);
+
+if ($annotation && $entity->canEdit() && $annotation->canEdit()) {
+ $annotation->delete();
+ system_message(elgg_echo("pages:revision:delete:success"));
+} else {
+ register_error(elgg_echo("pages:revision:delete:failure"));
+}
+
+forward("pages/history/{$annotation->entity_guid}"); \ No newline at end of file
diff --git a/mod/pages/languages/en.php b/mod/pages/languages/en.php
index 930676b3e..13b6ece2a 100644
--- a/mod/pages/languages/en.php
+++ b/mod/pages/languages/en.php
@@ -25,6 +25,8 @@ $english = array(
'pages:history' => "History",
'pages:view' => "View page",
'pages:revision' => "Revision",
+ 'pages:current_revision' => "Current Revision",
+ 'pages:revert' => "Revert",
'pages:navigation' => "Navigation",
'pages:new' => "A new page",
@@ -75,6 +77,9 @@ View and comment on the new page:
'pages:error:no_title' => 'You must specify a title for this page.',
'pages:delete:success' => 'The page was successfully deleted.',
'pages:delete:failure' => 'The page could not be deleted.',
+ 'pages:revision:delete:success' => 'The page revision was successfully deleted.',
+ 'pages:revision:delete:failure' => 'The page revision could not be deleted.',
+ 'pages:revision:not_found' => 'Cannot find this revision.',
/**
* Page
diff --git a/mod/pages/lib/pages.php b/mod/pages/lib/pages.php
index afe42b68f..7f90d53d8 100644
--- a/mod/pages/lib/pages.php
+++ b/mod/pages/lib/pages.php
@@ -9,7 +9,7 @@
* @param ElggObject $page
* @return array
*/
-function pages_prepare_form_vars($page = null, $parent_guid = 0) {
+function pages_prepare_form_vars($page = null, $parent_guid = 0, $revision = null) {
// input names => defaults
$values = array(
@@ -41,6 +41,11 @@ function pages_prepare_form_vars($page = null, $parent_guid = 0) {
elgg_clear_sticky_form('page');
+ // load the revision annotation if requested
+ if ($revision instanceof ElggAnnotation && $revision->entity_guid == $page->getGUID()) {
+ $values['description'] = $revision->value;
+ }
+
return $values;
}
diff --git a/mod/pages/pages/pages/edit.php b/mod/pages/pages/pages/edit.php
index 1f411b94d..a925cdc55 100644
--- a/mod/pages/pages/pages/edit.php
+++ b/mod/pages/pages/pages/edit.php
@@ -8,6 +8,7 @@
gatekeeper();
$page_guid = (int)get_input('guid');
+$revision = (int)get_input('annotation_id');
$page = get_entity($page_guid);
if (!$page) {
register_error(elgg_echo('noaccess'));
@@ -28,7 +29,17 @@ elgg_push_breadcrumb(elgg_echo('edit'));
$title = elgg_echo("pages:edit");
if ($page->canEdit()) {
- $vars = pages_prepare_form_vars($page);
+
+ if ($revision) {
+ $revision = elgg_get_annotation_from_id($revision);
+ if (!$revision || !($revision->entity_guid == $page_guid)) {
+ register_error(elgg_echo('pages:revision:not_found'));
+ forward(REFERER);
+ }
+ }
+
+ $vars = pages_prepare_form_vars($page, $page->parent_guid, $revision);
+
$content = elgg_view_form('pages/edit', array(), $vars);
} else {
$content = elgg_echo("pages:noaccess");
diff --git a/mod/pages/start.php b/mod/pages/start.php
index c1183c9bf..f9c34cd85 100644
--- a/mod/pages/start.php
+++ b/mod/pages/start.php
@@ -28,9 +28,10 @@ function pages_init() {
elgg_register_annotation_url_handler('page', 'pages_revision_url');
// Register some actions
- $action_base = elgg_get_plugins_path() . 'pages/actions/pages';
- elgg_register_action("pages/edit", "$action_base/edit.php");
- elgg_register_action("pages/delete", "$action_base/delete.php");
+ $action_base = elgg_get_plugins_path() . 'pages/actions';
+ elgg_register_action("pages/edit", "$action_base/pages/edit.php");
+ elgg_register_action("pages/delete", "$action_base/pages/delete.php");
+ elgg_register_action("annotations/page/delete", "$action_base/annotations/page/delete.php");
// Extend the main css view
elgg_extend_view('css/elgg', 'pages/css');
@@ -80,6 +81,9 @@ function pages_init() {
// entity menu
elgg_register_plugin_hook_handler('register', 'menu:entity', 'pages_entity_menu_setup');
+ // hook into annotation menu
+ elgg_register_plugin_hook_handler('register', 'menu:annotation', 'pages_annotation_menu_setup');
+
// register ecml views to parse
elgg_register_plugin_hook_handler('get_views', 'ecml', 'pages_ecml_views_hook');
@@ -364,14 +368,3 @@ function pages_ecml_views_hook($hook, $entity_type, $return_value, $params) {
return $return_value;
}
-
-/**
- * Process upgrades for the pages plugin
- */
-function pages_run_upgrades() {
- $path = elgg_get_plugins_path() . 'pages/upgrades/';
- $files = elgg_get_upgrade_files($path);
- foreach ($files as $file) {
- include "$path{$file}";
- }
-}
diff --git a/mod/pages/views/default/annotation/page.php b/mod/pages/views/default/annotation/page.php
index a621b9281..ecb289092 100644
--- a/mod/pages/views/default/annotation/page.php
+++ b/mod/pages/views/default/annotation/page.php
@@ -39,4 +39,22 @@ $body = <<< HTML
<p class="elgg-subtext">$subtitle</p>
HTML;
+if (!elgg_in_context('widgets')) {
+ $menu = elgg_view_menu('annotation', array(
+ 'annotation' => $annotation,
+ 'sort_by' => 'priority',
+ 'class' => 'elgg-menu-hz float-alt',
+ ));
+}
+
+$body = <<<HTML
+<div class="mbn">
+ $menu
+ <h3>$title_link</h3>
+ <span class="elgg-subtext">
+ $subtitle
+ </span>
+</div>
+HTML;
+
echo elgg_view_image_block($icon, $body); \ No newline at end of file
diff --git a/mod/pages/views/default/object/page_top.php b/mod/pages/views/default/object/page_top.php
index 945a22eed..f35202993 100644
--- a/mod/pages/views/default/object/page_top.php
+++ b/mod/pages/views/default/object/page_top.php
@@ -60,18 +60,26 @@ if ($comments_count != 0 && !$revision) {
$comments_link = '';
}
-$metadata = elgg_view_menu('entity', array(
- 'entity' => $vars['entity'],
- 'handler' => 'pages',
- 'sort_by' => 'priority',
- 'class' => 'elgg-menu-hz',
-));
-
$subtitle = "$editor_text $comments_link $categories";
// do not show the metadata and controls in widget view
-if (elgg_in_context('widgets') || $revision) {
- $metadata = '';
+if (!elgg_in_context('widgets')) {
+ // If we're looking at a revision, display annotation menu
+ if ($revision) {
+ $metadata = elgg_view_menu('annotation', array(
+ 'annotation' => $annotation,
+ 'sort_by' => 'priority',
+ 'class' => 'elgg-menu-hz float-alt',
+ ));
+ } else {
+ // Regular entity menu
+ $metadata = elgg_view_menu('entity', array(
+ 'entity' => $vars['entity'],
+ 'handler' => 'pages',
+ 'sort_by' => 'priority',
+ 'class' => 'elgg-menu-hz',
+ ));
+ }
}
if ($full) {
diff --git a/mod/pages/views/default/pages/sidebar/history.php b/mod/pages/views/default/pages/sidebar/history.php
index 7077edb9a..e0e8ed11a 100644
--- a/mod/pages/views/default/pages/sidebar/history.php
+++ b/mod/pages/views/default/pages/sidebar/history.php
@@ -14,6 +14,7 @@ if ($vars['page']) {
'limit' => 20,
'reverse_order_by' => true
);
+ elgg_push_context('widgets');
$content = elgg_list_annotations($options);
}
diff --git a/mod/reportedcontent/views/default/object/reported_content.php b/mod/reportedcontent/views/default/object/reported_content.php
index 0e733e154..cc33f54fb 100644
--- a/mod/reportedcontent/views/default/object/reported_content.php
+++ b/mod/reportedcontent/views/default/object/reported_content.php
@@ -57,16 +57,6 @@ if ($report->state == 'archived') {
<p>
<b><?php echo elgg_echo('reportedcontent:objecttitle'); ?>:</b>
<?php echo $report->title; ?>
- <br />
- <?php echo elgg_view('output/url', array(
- 'href' => "#report-$report->guid",
- 'text' => elgg_echo('reportedcontent:moreinfo'),
- 'rel' => "toggle",
- ));
- ?>
- </p>
- </div>
- <div class="report-details hidden" id="report-<?php echo $report->getGUID();?>">
<p>
<b><?php echo elgg_echo('reportedcontent:objecturl'); ?>:</b>
<?php echo elgg_view('output/url', array(
@@ -77,6 +67,16 @@ if ($report->state == 'archived') {
?>
</p>
<p>
+ <?php echo elgg_view('output/url', array(
+ 'href' => "#report-$report->guid",
+ 'text' => elgg_echo('reportedcontent:moreinfo'),
+ 'rel' => "toggle",
+ ));
+ ?>
+ </p>
+ </div>
+ <div class="report-details hidden" id="report-<?php echo $report->getGUID();?>">
+ <p>
<b><?php echo elgg_echo('reportedcontent:reason'); ?>:</b>
<?php echo $report->description; ?>
</p>
diff --git a/mod/twitter_api/languages/en.php b/mod/twitter_api/languages/en.php
index c19a058aa..a6f4b40a5 100644
--- a/mod/twitter_api/languages/en.php
+++ b/mod/twitter_api/languages/en.php
@@ -25,6 +25,8 @@ $english = array(
'twitter_api:revoke:success' => 'Twitter access has been revoked.',
+ 'twitter_api:post_to_twitter' => "Send users' wire posts to Twitter?",
+
'twitter_api:login' => 'Allow users to sign in with Twitter?',
'twitter_api:new_users' => 'Allow new users to sign up using their Twitter account even if user registration is disabled?',
'twitter_api:login:success' => 'You have been logged in.',
diff --git a/mod/twitter_api/lib/twitter_api.php b/mod/twitter_api/lib/twitter_api.php
index 8cb1b885e..a6d005287 100644
--- a/mod/twitter_api/lib/twitter_api.php
+++ b/mod/twitter_api/lib/twitter_api.php
@@ -274,7 +274,7 @@ function twitter_api_update_user_avatar($user, $file_location) {
* to establish session request tokens.
*/
function twitter_api_authorize() {
- $token = twitter_api_get_access_token();
+ $token = twitter_api_get_access_token(get_input('oauth_verifier'));
if (!isset($token['oauth_token']) || !isset($token['oauth_token_secret'])) {
register_error(elgg_echo('twitter_api:authorize:error'));
forward('settings/plugins', 'twitter_api');
diff --git a/mod/twitter_api/start.php b/mod/twitter_api/start.php
index e3e866c1f..7318ac55d 100644
--- a/mod/twitter_api/start.php
+++ b/mod/twitter_api/start.php
@@ -35,8 +35,10 @@ function twitter_api_init() {
// register Walled Garden public pages
elgg_register_plugin_hook_handler('public_pages', 'walled_garden', 'twitter_api_public_pages');
- // push status messages to twitter
- elgg_register_plugin_hook_handler('status', 'user', 'twitter_api_tweet');
+ // push wire post messages to twitter
+ if (elgg_get_plugin_setting('wire_posts', 'twitter_api') == 'yes') {
+ elgg_register_plugin_hook_handler('status', 'user', 'twitter_api_tweet');
+ }
$actions = dirname(__FILE__) . '/actions/twitter_api';
elgg_register_action('twitter_api/interstitial_settings', "$actions/interstitial_settings.php", 'logged_in');
diff --git a/mod/twitter_api/views/default/plugins/twitter_api/settings.php b/mod/twitter_api/views/default/plugins/twitter_api/settings.php
index 0b9afd4cf..3a3ec93a2 100644
--- a/mod/twitter_api/views/default/plugins/twitter_api/settings.php
+++ b/mod/twitter_api/views/default/plugins/twitter_api/settings.php
@@ -39,12 +39,27 @@ $new_users_with_twitter_view = elgg_view('input/dropdown', array(
'value' => $vars['entity']->new_users ? $vars['entity']->new_users : 'no',
));
+$post_to_twitter = '';
+if (elgg_is_active_plugin('thewire')) {
+ $post_to_twitter_string = elgg_echo('twitter_api:post_to_twitter');
+ $post_to_twitter_view = elgg_view('input/dropdown', array(
+ 'name' => 'params[wire_posts]',
+ 'options_values' => array(
+ 'yes' => elgg_echo('option:yes'),
+ 'no' => elgg_echo('option:no'),
+ ),
+ 'value' => $vars['entity']->wire_posts ? $vars['entity']->wire_posts : 'no',
+ ));
+ $post_to_twitter = "<div>$post_to_twitter_string $post_to_twitter_view</div>";
+}
+
$settings = <<<__HTML
<div class="elgg-content-thin mtm"><p>$instructions</p></div>
<div><label>$consumer_key_string</label><br /> $consumer_key_view</div>
<div><label>$consumer_secret_string</label><br /> $consumer_secret_view</div>
<div>$sign_on_with_twitter_string $sign_on_with_twitter_view</div>
<div>$new_users_with_twitter $new_users_with_twitter_view</div>
+$post_to_twitter
__HTML;
echo $settings;
diff --git a/version.php b/version.php
index b5822b371..c5fc817d4 100644
--- a/version.php
+++ b/version.php
@@ -14,4 +14,4 @@
$version = 2013030600;
// Human-friendly version name
-$release = '1.8.14';
+$release = '1.8.15';
diff --git a/views/default/css/admin.php b/views/default/css/admin.php
index 8197f29de..3896ded5d 100644
--- a/views/default/css/admin.php
+++ b/views/default/css/admin.php
@@ -446,7 +446,8 @@ input {
.elgg-input-text,
.elgg-input-tags,
.elgg-input-url,
-.elgg-input-plaintext {
+.elgg-input-plaintext,
+.elgg-input-longtext {
width: 98%;
}
textarea {