- Posts: 3
Feature Requests
Please do NOT use this section of the forum to request help if Joomdle does not work for you in some particular way. Your post will be deleted.
Please do NOT use this section of the forum to request help if Joomdle does not work for you in some particular way. Your post will be deleted.
[Closed] mycourses list with course image
- Mattia
- Topic Author
- Offline
- New Member
-
Less
More
10 years 7 months ago - 10 years 5 months ago #1
by Mattia
[Closed] mycourses list with course image was created by Mattia
Hi,
I would like to have "mycourses" list look like the "all courses" list. In particular, I'm interested in viewing the course main image in the list. I did the trick by myself editing either the joomla component layout and the counterpart moodle webservice (joomdle_my_courses) serving the course details. I also added in externallib.php the lines (in public static function my_courses_returns() )
and in auth.php
Would it be possible to have these changes integrated in the joomdle core plugin? (Or something similar). Because I must keep the plugin joomdle updated, so no custom editing are allowed.
Thanks in advance.
I would like to have "mycourses" list look like the "all courses" list. In particular, I'm interested in viewing the course main image in the list. I did the trick by myself editing either the joomla component layout and the counterpart moodle webservice (joomdle_my_courses) serving the course details. I also added in externallib.php the lines (in public static function my_courses_returns() )
Code:
'summary_files' => new external_multiple_structure(
new external_single_structure(
array(
'url' => new external_value(PARAM_TEXT, 'item url'),
)
)
)
Code:
$record['summary_files'] = array ();
$c2 = new course_in_list(get_course($course->id));
foreach ($c2->get_course_overviewfiles() as $file)
{
$isimage = $file->is_valid_image();
$url = file_encode_url("$CFG->wwwroot/auth/joomdle/pluginfile_joomdle.php",
'/'. $file->get_contextid(). '/'. $file->get_component(). '/'.
$file->get_filearea(). $file->get_filepath(). $file->get_filename(), !$isimage);
$url_item = array ();
$url_item['url'] = $url;
$record['summary_files'][] = $url_item;
}
Thanks in advance.
Last edit: 10 years 5 months ago by Antonio Durán.
The topic has been locked.
- Antonio Durán
-
- Offline
- Moderator
-
Less
More
- Posts: 7909
10 years 7 months ago #2
by Antonio Durán
Replied by Antonio Durán on topic mycourses list with course image
Thanks for sending your changes. I will review them soon and get back to you.
The topic has been locked.
- Antonio Durán
-
- Offline
- Moderator
-
Less
More
- Posts: 7909
10 years 6 months ago #3
by Antonio Durán
Replied by Antonio Durán on topic mycourses list with course image
Hi.
I have started looking into this, and was wondering if you could share your changes to the Joomdle view too, to see if I get some ideas on how to show the images. Currently we use a list to show "my courses", and it does not look very good when adding images.
I have started looking into this, and was wondering if you could share your changes to the Joomdle view too, to see if I get some ideas on how to show the images. Currently we use a list to show "my courses", and it does not look very good when adding images.
The topic has been locked.
- Mattia
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 3
10 years 6 months ago #4
by Mattia
Replied by Mattia on topic mycourses list with course image
Hi,
sure, you will find in the attachments all my mods. Notice at the beginning of the files the comment with the real location of the file, and along these I added some comments stating where the mod starts and where it ends, like /* ### mod START ### */ ..... /* ### mod END ### */.
Hope you'll appreciate this customization. You will also find a sample screenshot of how the page looks like after the mod.
Keep me updated.
Best regards
sure, you will find in the attachments all my mods. Notice at the beginning of the files the comment with the real location of the file, and along these I added some comments stating where the mod starts and where it ends, like /* ### mod START ### */ ..... /* ### mod END ### */.
Hope you'll appreciate this customization. You will also find a sample screenshot of how the page looks like after the mod.
Keep me updated.
Best regards
The topic has been locked.
- Mattia
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 3
10 years 6 months ago #5
by Mattia
Replied by Mattia on topic mycourses list with course image
In the case the attachments wouldn't be available, you can download the source code snippets here
www.filedropper.com/joomlemycoursesmod
www.filedropper.com/joomlemycoursesmod
The topic has been locked.
- Antonio Durán
-
- Offline
- Moderator
-
Less
More
- Posts: 7909
10 years 6 months ago #6
by Antonio Durán
Replied by Antonio Durán on topic mycourses list with course image
Thanks for sending your changes.
I have adapted your layout and CSS to fit in wirh current Joomdle styles (made font smaller, removed custom color...) and added a new option to show/hide summary and images in "my courses" view.
When we release a new version and you upgrade, I guess you'll need to create a template override to bring back your desired format, but as we will have the web service returning all required data, you won't need to do any mods to Joomdle.
Thanks again for your feedback.
I have adapted your layout and CSS to fit in wirh current Joomdle styles (made font smaller, removed custom color...) and added a new option to show/hide summary and images in "my courses" view.
When we release a new version and you upgrade, I guess you'll need to create a template override to bring back your desired format, but as we will have the web service returning all required data, you won't need to do any mods to Joomdle.
Thanks again for your feedback.
The topic has been locked.