Skip to content

Commit

Permalink
Remove forceclean when user is connected as someone else
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavobazzo committed Sep 6, 2023
1 parent 927ea68 commit 5139603
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function render() {
* @return string
*/
public function render_section_content($sectionid) {
global $USER;
global $USER, $CFG;
$section = null;
foreach ($this->sectionslist as $item) {

Expand Down Expand Up @@ -142,13 +142,13 @@ public function render_section_content($sectionid) {
$seehidden = has_capability('theme/recit2:accesshiddensections', $context, $USER->id, false);
$sectionsummary = '';
if ($section->available || ($hideVisible == 0 && $seehidden)){

// Show summary if section is available or has
$sectionsummary = file_rewrite_pluginfile_urls($section->summary, 'pluginfile.php', $context->id, 'course', 'section',
$section->id);

$sectionsummary = format_text($sectionsummary, $section->summaryformat, array('noclean' => true, 'overflowdiv' => true,
'filter' => true));
// Show summary if section is available or has
$sectionsummary = file_rewrite_pluginfile_urls($section->summary, 'pluginfile.php', $context->id, 'course', 'section', $section->id);
$bkpForceclean = $CFG->forceclean;
$CFG->forceclean = false;
$sectionsummary = format_text($sectionsummary, $section->summaryformat, array('noclean' => true, 'overflowdiv' => true, 'filter' => true));
$CFG->forceclean = $bkpForceclean;
}
$html = "<div class='section main clearfix tt-section $sectionstyle' ".($this->lazyLoading ? '' : 'style="display:none"')." data-section='$sectionid' role='region' aria-label='$sectionname'>";

Expand Down
2 changes: 1 addition & 1 deletion src/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
$plugin->requires = 2022041900.00; // Moodle 4.0.0
$plugin->component = 'format_recit'; // Full name of the plugin (used for diagnostics).
$plugin->maturity = MATURITY_STABLE;
$plugin->release = 'v3.1.2-stable';
$plugin->release = 'v3.1.3-stable';
$plugin->supported = [400, 410]; // Moodle 3.9.x, 3.10.x and 3.11.x are supported.
$plugin->dependencies = [
'theme_recit2' => 2023011900
Expand Down
9 changes: 9 additions & 0 deletions sync.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$from = "moodle-format_recit/src/*"
$to = "shared/recitfad/course/format/recit"

try {
. ("..\sync\watcher.ps1")
}
catch {
Write-Host "Error while loading sync.ps1 script."
}

0 comments on commit 5139603

Please sign in to comment.