Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
30585a37
Commit
30585a37
authored
Jul 31, 2012
by
Sam Hemelryk
Browse files
Merge branch 'MDL-28568_noncontact_warning' of
git://github.com/andyjdavis/moodle
parents
6bfa9c49
77d187ed
Changes
3
Hide whitespace changes
Inline
Side-by-side
lang/en/message.php
View file @
30585a37
...
...
@@ -82,6 +82,7 @@ $string['messagehistory'] = 'Message history';
$string
[
'messagehistoryfull'
]
=
'All messages'
;
$string
[
'messages'
]
=
'Messages'
;
$string
[
'messaging'
]
=
'Messaging'
;
$string
[
'messagingblockednoncontact'
]
=
'{$a} will not be able to reply as you have blocked non-contacts'
;
$string
[
'messagingdisabled'
]
=
'Messaging is disabled on this site, emails will be sent instead'
;
$string
[
'mycontacts'
]
=
'My contacts'
;
$string
[
'newonlymsg'
]
=
'Show only new'
;
...
...
@@ -140,5 +141,5 @@ $string['unreadnewmessage'] = 'New message from {$a}';
$string
[
'unreadnewnotification'
]
=
'New notification'
;
$string
[
'unreadnewnotifications'
]
=
'New notifications ({$a})'
;
$string
[
'userisblockingyou'
]
=
'This user has blocked you from sending messages to them'
;
$string
[
'userisblockingyounoncontact'
]
=
'
This user is
only accept
ing
messages from
people listed as contacts, and you are not currently on the list
.'
;
$string
[
'userisblockingyounoncontact'
]
=
'
{$a}
only accept
s
messages from
their contacts
.'
;
$string
[
'userssearchresults'
]
=
'Users found: {$a}'
;
message/index.php
View file @
30585a37
...
...
@@ -153,7 +153,7 @@ if ($currentuser && !empty($user2) && has_capability('moodle/site:sendmessage',
if
(
!
empty
(
$userpreferences
[
'message_blocknoncontacts'
]))
{
// User is blocking non-contacts
if
(
empty
(
$contact
))
{
// We are not a contact!
$messageerror
=
get_string
(
'userisblockingyounoncontact'
,
'message'
);
$messageerror
=
get_string
(
'userisblockingyounoncontact'
,
'message'
,
fullname
(
$user2
)
);
}
}
...
...
@@ -287,8 +287,19 @@ echo html_writer::start_tag('div', array('class' => 'messagearea mdl-align'));
if
(
$currentuser
&&
has_capability
(
'moodle/site:sendmessage'
,
$context
))
{
echo
html_writer
::
start_tag
(
'div'
,
array
(
'class'
=>
'mdl-align messagesend'
));
if
(
!
empty
(
$messageerror
))
{
echo
$OUTPUT
->
heading
(
$messageerror
,
3
);
echo
html_writer
::
tag
(
'span'
,
$messageerror
,
array
(
'id'
=>
'messagewarning'
)
);
}
else
{
// Display a warning if the current user is blocking non-contacts and is about to message to a non-contact
// Otherwise they may wonder why they never get a reply
$blocknoncontacts
=
get_user_preferences
(
'message_blocknoncontacts'
,
''
,
$user1
->
id
);
if
(
!
empty
(
$blocknoncontacts
))
{
$contact
=
$DB
->
get_record
(
'message_contacts'
,
array
(
'userid'
=>
$user1
->
id
,
'contactid'
=>
$user2
->
id
));
if
(
empty
(
$contact
))
{
$msg
=
get_string
(
'messagingblockednoncontact'
,
'message'
,
fullname
(
$user2
));
echo
html_writer
::
tag
(
'span'
,
$msg
,
array
(
'id'
=>
'messagewarning'
));
}
}
$mform
=
new
send_form
();
$defaultmessage
=
new
stdClass
;
$defaultmessage
->
id
=
$user2
->
id
;
...
...
theme/standard/style/core.css
View file @
30585a37
...
...
@@ -453,3 +453,4 @@ table#tag-management-list {margin: 10px auto;width: 80%;}
#page-message-edit
table
.generaltable
th
.c0
{
text-align
:
left
;}
#page-message-edit
table
.generaltable
td
.c0
{
text-align
:
right
;}
#page-message-edit
table
.generaltable
td
.disallowed
{
text-align
:
center
;
vertical-align
:
middle
;}
#messagewarning
{
font-style
:
italic
;}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment