Skip to content

Commit

Permalink
webpage_image.svg
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardokraus committed Oct 9, 2024
1 parent 5d9fc0b commit aeed70e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions classes/webpages.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function page_details() {
$imagem = "";
$fs = get_file_storage();
$file = $fs->get_file(context_system::instance()->id, 'local_kopere_dashboard', 'webpage_image',
$webpages->id, '/', 'webpage_image.img');
$webpages->id, '/', 'webpage_image.svg');
if ($file && isset($file->get_filename()[3])) {
$url = moodle_url::make_pluginfile_url($file->get_contextid(), $file->get_component(),
$file->get_filearea(), $file->get_itemid(), "/", $file->get_filename());
Expand Down Expand Up @@ -338,7 +338,7 @@ public function page_edit() {
$imagem = "";
$fs = get_file_storage();
$file = $fs->get_file(context_system::instance()->id, 'local_kopere_dashboard',
'webpage_image', $webpages->id, '/', 'webpage_image.img');
'webpage_image', $webpages->id, '/', 'webpage_image.svg');
if ($file && isset($file->get_filename()[3])) {
$url = moodle_url::make_pluginfile_url($file->get_contextid(), $file->get_component(),
$file->get_filearea(), $file->get_itemid(), "/", $file->get_filename());
Expand Down Expand Up @@ -511,7 +511,7 @@ private function save_image($webpages) {
'filearea' => "webpage_image",
'filepath' => '/',
'itemid' => $webpages->id,
'filename' => "webpage_image.img",
'filename' => "webpage_image.svg",
];

$fs->create_file_from_pathname($filerecord, $_FILES["imagem"]["tmp_name"]);
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
}

$fs = get_file_storage();
$file = $fs->get_file($context->id, 'local_kopere_dashboard', 'webpage_image', $webpages->id, '/', 'webpage_image.img');
$file = $fs->get_file($context->id, 'local_kopere_dashboard', 'webpage_image', $webpages->id, '/', 'webpage_image.svg');
if ($file && isset($file->get_filename()[3])) {
$webpages->imagem = moodle_url::make_pluginfile_url($file->get_contextid(),
$file->get_component(), $file->get_filearea(), $file->get_itemid(), "/", $file->get_filename());
Expand Down

0 comments on commit aeed70e

Please sign in to comment.