Commit 8c9e46b9 authored by Clare Lenihan's avatar Clare Lenihan Committed by Clare Lenihan
Browse files

fixing group language strings

parent 280883cc
......@@ -34,10 +34,10 @@ $groupid = param_integer('id');
$group = get_record('group', 'id', $groupid, 'owner', $USER->get('id'));
if (!$group) {
throw new AccessDeniedException(get_string('cantdeletegroupdontown'));
throw new AccessDeniedException(get_string('cantdeletegroup', 'group'));
}
define('TITLE', get_string('deletespecifiedgroup', 'mahara', $group->name));
define('TITLE', get_string('deletespecifiedgroup', 'group', $group->name));
$views = count_records_sql(
'SELECT COUNT(a.*)
......@@ -53,7 +53,7 @@ $form = pieform(array(
'elements' => array(
'submit' => array(
'type' => 'submitcancel',
'title' => $views ? get_string('groupconfirmdeletehasviews') : get_string('groupconfirmdelete'),
'title' => $views ? get_string('groupconfirmdeletehasviews', 'group') : get_string('groupconfirmdelete', 'group'),
'value' => array(get_string('yes'), get_string('no')),
'goto' => get_config('wwwroot') . 'group/view.php?id=' . $groupid
)
......@@ -66,7 +66,7 @@ $smarty->assign('form', $form);
$smarty->display('group/delete.tpl');
function deletegroup_submit(Pieform $form, $values) {
global $USER, $groupid;
global $SESSION, $USER, $groupid;
db_begin();
delete_records('view_access_group', 'group', $groupid);
delete_records('group_member_invite', 'group', $groupid);
......@@ -74,6 +74,7 @@ function deletegroup_submit(Pieform $form, $values) {
delete_records('group_member', 'group', $groupid);
delete_records('group', 'id', $groupid);
db_commit();
$SESSION->add_ok_msg(get_string('deletegroup', 'group'));
redirect('/group/mygroups.php');
}
?>
......@@ -34,19 +34,19 @@ $returnto = param_alpha('returnto', 'mygroups');
$group = get_record('group', 'id', $groupid);
if (!$group) {
throw new GroupNotFoundException(get_string('groupnotfound', 'mahara', $groupid));
throw new GroupNotFoundException(get_string('groupnotfound', 'group', $groupid));
}
define('TITLE', get_string('leavespecifiedgroup', 'mahara', $group->name));
define('TITLE', get_string('leavespecifiedgroup', 'group', $group->name));
$membership = user_can_access_group($group);
if (!($membership & GROUP_MEMBERSHIP_MEMBER)) {
throw new AccessDeniedException(get_string('notamember'));
throw new AccessDeniedException(get_string('notamember', 'group'));
}
if (!group_user_can_leave($group)) {
throw new AccessDeniedException(get_string('cantleavegroup'));
throw new AccessDeniedException(get_string('cantleavegroup', 'group'));
}
$views = count_records_sql(
......@@ -66,7 +66,7 @@ $form = pieform(array(
'elements' => array(
'submit' => array(
'type' => 'submitcancel',
'title' => $views ? get_string('groupconfirmleavehasviews') : get_string('groupconfirmleave'),
'title' => $views ? get_string('groupconfirmleavehasviews', 'group') : get_string('groupconfirmleave', 'group'),
'value' => array(get_string('yes'), get_string('no')),
'goto' => get_config('wwwroot') . ($returnto == 'find' ? 'group/find.php' : 'group/mygroups.php')
),
......@@ -85,7 +85,7 @@ $smarty->display('group/leave.tpl');
function leavegroup_submit(Pieform $form, $values) {
global $USER, $SESSION, $groupid;
group_remove_user($groupid, $USER->get('id'));
$SESSION->add_ok_msg(get_string('leftgroup'));
$SESSION->add_ok_msg(get_string('leftgroup', 'group'));
redirect($values['returnto'] == 'find' ? '/group/find.php' : '/group/mygroups.php');
}
?>
......@@ -34,16 +34,16 @@ $returnto = param_alpha('returnto', 'mygroups');
$group = get_record('group', 'id', $groupid);
if (!$group) {
throw new GroupNotFoundException(get_string('groupnotfound', 'mahara', $groupid));
throw new GroupNotFoundException(get_string('groupnotfound', 'group', $groupid));
}
if ($group->jointype != 'request'
|| record_exists('group_member', 'group', $groupid, 'member', $USER->get('id'))
|| record_exists('group_member_request', 'group', $groupid, 'member', $USER->get('id'))) {
throw new AccessDeniedException(get_string('cannotrequestjoingroup'));
throw new AccessDeniedException(get_string('cannotrequestjoingroup', 'group'));
}
define('TITLE', get_string('requestjoinspecifiedgroup', 'mahara', $group->name));
define('TITLE', get_string('requestjoinspecifiedgroup', 'group', $group->name));
$form = pieform(array(
'name' => 'requestjoingroup',
......@@ -82,19 +82,19 @@ function requestjoingroup_submit(Pieform $form, $values) {
'reason' => isset($values['reason']) ? $values['reason'] : null
)
);
if (isset($values['reason'])) {
$message = get_string('grouprequestmessagereason', 'mahara', display_name($USER, get_record('usr', 'id', $group->owner)), $group->name, $values['reason']);
if (isset($values['reason']) && $values['reason'] != '') {
$message = get_string('grouprequestmessagereason', 'group', display_name($USER, get_record('usr', 'id', $group->owner)), $group->name, $values['reason']);
}
else {
$message = get_string('grouprequestmessage', 'mahara', display_name($USER, $group->owner), $group->name);
$message = get_string('grouprequestmessage', 'group', display_name($USER, get_record('usr', 'id', $group->owner)), $group->name);
}
require_once('activity.php');
activity_occurred('maharamessage',
array('users' => array($group->owner),
'subject' => get_string('grouprequestsubject'),
'subject' => get_string('grouprequestsubject', 'group'),
'message' => $message,
'url' => get_config('wwwroot') . 'group/view.php?id=' . $group->id));
$SESSION->add_ok_msg(get_string('grouprequestsent'));
$SESSION->add_ok_msg(get_string('grouprequestsent', 'group'));
redirect($values['returnto'] == 'find' ? '/group/find.php' : '/group/mygroups.php');
}
?>
......@@ -60,6 +60,7 @@ $string['groupalreadyexists'] = 'A Group by this name already exists';
$string['owner'] = 'Owner';
$string['members'] = 'Members';
$string['memberrequests'] = 'Membership requests';
$string['declinerequest'] = 'Decline request';
$string['submittedviews'] = 'Submitted views';
$string['releaseview'] = 'Release view';
$string['tutor'] = 'Tutor';
......@@ -96,6 +97,7 @@ $string['joinedgroup'] = 'You are now a group member';
$string['couldnotjoingroup'] = 'You cannot join this group';
$string['grouprequestsent'] = 'Group membership request sent';
$string['couldnotrequestgroup'] = 'Could not send group membership request';
$string['canntorequestjoingroup'] ='You cannot request to join this group';
$string['groupjointypeopen'] = 'Membership to this community is open';
$string['groupjointypecontrolled'] = 'Membership to this community is controlled. You cannot join this community';
$string['groupjointypeinvite'] = 'Membership to this community is invite only';
......@@ -103,6 +105,7 @@ $string['groupjointyperequest'] = 'Membership to this community is by request on
$string['grouprequestsubject'] = 'New community membership request';
$string['grouprequestmessage'] = '%s has sent a membership request to join the community %s';
$string['grouprequestmessagereason'] = '%s has sent a membership request to join the community %s with the reason %s.';
$string['cantdeletegroup'] = 'You cannot delete this group';
$string['groupconfirmdelete'] = 'Are you sure you wish to delete this community?';
$string['groupconfirmdeletehasviews'] = 'Are you sure you wish to delete this community? Some of your views use this community for access control, removing this community would mean that the members of that community would not have access to the views.';
$string['deletegroup'] = 'Group Deleted Successfully';
......@@ -131,6 +134,7 @@ $string['trysearchingforgroups'] = 'Try %ssearching for groups%s to join!';
$string['nogroupsfound'] = 'No groups found :(';
$string['group'] = 'Group';
$string['groups'] = 'Groups';
$string['notamember'] = 'You are not a member of this group';
// friendslist
$string['reasonoptional'] = 'Reason (optional)';
......
......@@ -81,7 +81,6 @@ $string['quotausage'] = 'You have used <span id="quota_used">%s</span> of your <
$string['mainmenu'] = 'Main menu';
$string['updatefailed'] = 'Update failed';
$string['declinerequest'] = 'Decline request';
$string['strftimenotspecified'] = 'Not specified';
......
......@@ -317,7 +317,7 @@ function setup_groups($groups, $returnto='mygroups') {
'elements' => array(
'join' => array(
'type' => 'submit',
'value' => get_string('joingroup')
'value' => get_string('joingroup', 'group')
),
'group' => array(
'type' => 'hidden',
......@@ -334,11 +334,11 @@ function setup_groups($groups, $returnto='mygroups') {
'elements' => array(
'accept' => array(
'type' => 'submit',
'value' => get_string('acceptinvitegroup')
'value' => get_string('acceptinvitegroup', 'group')
),
'decline' => array(
'type' => 'submit',
'value' => get_string('declineinvitegroup')
'value' => get_string('declineinvitegroup', 'group')
),
'group' => array(
'type' => 'hidden',
......@@ -360,7 +360,7 @@ function setup_groups($groups, $returnto='mygroups') {
function joingroup_submit(Pieform $form, $values) {
global $SESSION, $USER;
group_add_member($values['group'], $USER->get('id'));
$SESSION->add_ok_msg(get_string('joinedgroup'));
$SESSION->add_ok_msg(get_string('joinedgroup', 'group'));
redirect('/group/view.php?id=' . $values['group']);
}
......@@ -370,11 +370,11 @@ function group_invite_submit(Pieform $form, $values) {
delete_records('group_member_invite', 'group', $values['group'], 'member', $USER->get('id'));
if (isset($values['accept'])) {
group_add_member($values['group'], $USER->get('id'));
$SESSION->add_ok_msg(get_string('groupinviteaccepted'));
$SESSION->add_ok_msg(get_string('groupinviteaccepted', 'group'));
redirect('/group/view.php?id=' . $values['group']);
}
else {
$SESSION->add_ok_msg(get_string('groupinvitedeclined'));
$SESSION->add_ok_msg(get_string('groupinvitedeclined', 'group'));
redirect($values['returnto'] == 'find' ? '/group/find.php' : '/group/mygroups.php');
}
}
......
......@@ -4,7 +4,7 @@
{include file="columnleftstart.tpl"}
<h2>{$group->name|escape}</h2>
<p>{str tag='owner'}: {$group->ownername|escape}</p>
<p>{str tag='owner' section='group'}: {$group->ownername|escape}</p>
{assign var="jointype" value=$group->jointype}
{assign var="joinstr" value=groupjointype$jointype}
<p>{str tag=$joinstr section='group'}</p>
......@@ -20,7 +20,7 @@
<form>
<select name="submitted" onChange="viewlist.submitted=this.options[this.selectedIndex].value;viewlist.doupdate();">
<option value="0">{str tag='allviews'}</option>
<option value="1">{str tag='submittedviews'}</option>
<option value="1">{str tag='submittedviews' section='group'}</option>
</select>
</form>
{/if}
......@@ -28,7 +28,7 @@
<thead>
<tr>
<th>{str tag='name'}</th>
<th>{str tag='owner'}</th>
<th>{str tag='owner' section='group'}</th>
</tr>
</thead>
<tbody>
......@@ -41,8 +41,8 @@
{if $canupdate && $request}
<form>
<select id="pendingselect" name="pending" onChange="switchPending();">
<option value="0">{str tag='members'}</option>
<option value="1">{str tag='memberrequests'}</option>
<option value="0">{str tag='members' section='group'}</option>
<option value="1">{str tag='memberrequests' section='group'}</option>
</select>
</form>
{/if}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment