Skip to content

Commit

Permalink
Merge pull request Elgg#25 from juho-jaakkola/deprecated_in_19
Browse files Browse the repository at this point in the history
Replaced deprecated and outdated code.
  • Loading branch information
Juho Jaakkola committed Apr 8, 2014
2 parents acc6eef + 672604f commit 1598c6d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 35 deletions.
9 changes: 8 additions & 1 deletion actions/discussion/offtopic.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@
}

elgg_delete_river(array('annotation_id' => $reply->id));
add_to_river('river/object/groupforumtopic/create', 'create', $user_guid, $grouptopic->guid, $grouptopic->access_id, $original_topic->getTimeCreated());

elgg_create_river_item(array(
'view' => 'river/object/groupforumtopic/create',
'action_type' => 'create',
'subject_guid' => $user_guid,
'object_guid' => $grouptopic->guid,
'posted' => $original_topic->time_created
));

$new_text = $reply->value;
$new_text .= '<p>[' . elgg_echo('cg:form:offtopic:warning') . ']</p>';
Expand Down
9 changes: 1 addition & 8 deletions languages/en.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

$english = array(

return array(
'admin:groups' => "Groups",
'admin:groups:main' => "Administration",

Expand Down Expand Up @@ -65,7 +64,6 @@
'cg:search:post_on' => "Comment on the discussion \"%s\" in the group %s",
'cg:search:discussions' => 'Search discussions',


'cg:discussion:howto' => 'Using discussions',
'cg:groups:howto' => 'Using groups',
'cg:howto:discussion:loggedout:' => "To participate in the group discussions, you need to register for this site and join one of the groups.",
Expand All @@ -84,9 +82,4 @@
Check out Elgg's roadmap group.",
'cg:howto:groups:loggedin:4' => "Want email notifications when there is new group activity?
Select Settings on the topbar menu.",



);

add_translation("en", $english);
14 changes: 10 additions & 4 deletions manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@
<version>1.9</version>
<description>Overrides for Community groups. See README for details.</description>
<website>https://github.com/Elgg/community_groups</website>
<copyright>Elgg Foundation 2011-2013</copyright>
<copyright>Elgg Foundation 2011-2014</copyright>
<license>GNU Public License version 2</license>
<!-- All plugins must require either elgg_version or elgg_release. -->

<!-- All plugins must require elgg_release. -->
<requires>
<type>elgg_release</type>
<version>1.9</version>
</requires>


<requires>
<type>plugin</type>
<name>web_services</name>
<version>1.9</version>
</requires>

<category>Enhancements</category>
</plugin_manifest>
29 changes: 7 additions & 22 deletions start.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@
* Initialize the community groups extension plugin
*/
function community_groups_init() {

$action_path = elgg_get_plugins_path() . 'community_groups/actions';

// @todo remove when this is in Elgg core
elgg_register_page_handler('forum', 'forum_page_handler');

elgg_extend_view('css/elgg', 'community_groups/css');

// admin controls use a lightbox
Expand Down Expand Up @@ -52,7 +48,6 @@ function community_groups_init() {
elgg_register_action("groups/saveblogsettings", "$action_path/groups/saveblogsettings.php", 'admin');
elgg_register_action("groups/change_owner", "$action_path/groups/change_owner.php", 'admin');


// set up site menu for discussion
$item = new ElggMenuItem('discussion', elgg_echo('discussion'), 'discussion/all');
elgg_register_menu_item('site', $item);
Expand Down Expand Up @@ -90,21 +85,6 @@ function community_groups_init() {
}
}

/**
* Exists for backwards compatibility.
*/
function forum_page_handler($page) {
switch ($page[0]) {
case 'topic':
$page[0];
header('Status: 301 Moved Permanently');
forward("/discussion/view/{$page[1]}/{$page[2]}");
break;
default:
return false;
}
}

/**
* Replace the filter menu for group selection
*
Expand Down Expand Up @@ -281,7 +261,7 @@ function community_groups_limit_editing($hook, $type, $menu, $params) {
}
}
}

return $menu;
}

Expand Down Expand Up @@ -393,7 +373,12 @@ function community_groups_post_blog($username, $title, $body, $token) {
throw new InvalidParameterException('Unable to save post');
}

add_to_river('river/object/groupforumtopic/create', 'create', $user->getGUID(), $grouptopic->guid);
elgg_create_river_item(array(
'view' => 'river/object/groupforumtopic/create',
'action_type' => 'create',
'subject_guid' => $user->getGUID(),
'object_guid' => $grouptopic->guid,
));

return true;
}

0 comments on commit 1598c6d

Please sign in to comment.