Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions block_course_contacts.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

/**
* Block Course Contacts class definition.
*
Expand Down Expand Up @@ -160,7 +158,7 @@ public function get_content() {

$courseid = $this->page->course->id;
$context = $this->page->context;
if($context->contextlevel != 50) {
if ($context->contextlevel != 50) {
return;
}
$isguest = is_guest($context);
Expand Down Expand Up @@ -216,8 +214,8 @@ public function get_content() {
$att = 'role_'.$key;
if (!empty($this->config->$att)) {
if ($this->config->$att == 1) {

$contacts = $this->get_role_users($key, $context, $inherit, $userfields, $orderby, $currentgroup, '', 30); // Because the role search finds the custom name and the proper name in brackets.
// Because the role search finds the custom name and the proper name in brackets.
$contacts = $this->get_role_users($key, $context, $inherit, $userfields, $orderby, $currentgroup, '', 30);

if (!empty($contacts)) {
if ($shortened = strstr($role, '(', true)) {
Expand Down Expand Up @@ -247,7 +245,6 @@ public function get_content() {
$content .= $contact->alternatename;
} else {
// Use first and last names and truncate as necessary.
// $content .= $this->shorten_name($contact->firstname)." ".$this->shorten_name($contact->lastname);
$content .= $contact->firstname." ".$contact->lastname;
}

Expand Down Expand Up @@ -302,7 +299,21 @@ public function get_content() {
|| ($isguest && $this->config->description_guest == 1))) {
$content .= html_writer::start_tag('div', array('class' => 'description'));
$usercontext = context_user::instance($contact->id);
$content .= substr(format_text(file_rewrite_pluginfile_urls($contact->description, 'pluginfile.php', $usercontext->id, 'user' ,'profile', null ), FORMAT_HTML), 0, 199);
$content .= substr(
format_text(
file_rewrite_pluginfile_urls(
$contact->description,
'pluginfile.php',
$usercontext->id,
'user',
'profile',
null
),
FORMAT_HTML
),
0,
199
);
$content .= html_writer::end_tag('div');
}
$content .= html_writer::end_tag('div');
Expand Down
2 changes: 0 additions & 2 deletions classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
*/

namespace block_course_contacts\privacy;
defined('MOODLE_INTERNAL') || die();

/**
* Privacy Subsystem for block_course_contacts implementing null_provider.
*
Expand Down
1 change: 0 additions & 1 deletion edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();
/**
* Block settings form class definition.
*
Expand Down