Skip to content

Commit

Permalink
Fix function declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
dasistwas committed Jan 24, 2024
1 parent 8045a99 commit 0c1c84e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions field/picture/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ public function render_edit_mode(MoodleQuickForm &$mform, stdClass $entry, array
*/
public function render_display_mode(stdClass $entry, array $options): string {
global $CFG, $PAGE;

$PAGE->requires->js_call_amd('mod_datalynx/zoomable', 'init');

$field = $this->_field;
$fieldid = $field->id();
$entryid = $entry->id;
Expand Down Expand Up @@ -110,13 +108,11 @@ public function render_display_mode(stdClass $entry, array $options): string {
$strfiles = array();
foreach ($files as $file) {
if (!$file->is_directory()) {

$filename = $file->get_filename();
$filenameinfo = pathinfo($filename);
$path = "/{$field->df()->context->id}/mod_datalynx/content/$contentid";

if (strpos($filename, 'thumb_') === false) {
$strfiles[] = $this->display_file($file, $path, $altname, $options);
$strfiles[] = $this->display_file($file, $entryid, $path, $altname, $options);
}
}
}
Expand All @@ -137,7 +133,15 @@ public function pluginfile_patterns() {
"[[{$fieldname}:lightbox]]");
}

protected function display_file($file, $path, $altname, $params = null) {
/**
* @param stored_file $file
* @param int $entryid
* @param $path
* @param $altname
* @param $params
* @return moodle_url|string
*/
protected function display_file(stored_file $file, int $entryid, string $path, string $altname, ?array $params = null) {
$field = $this->_field;

$imgattr = array('style' => array());
Expand Down

0 comments on commit 0c1c84e

Please sign in to comment.