-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for mobile app #122
base: master
Are you sure you want to change the base?
Fix for mobile app #122
Conversation
Hi @andrewhancox , Thank you for your contribution. I can see how being able to specify the category ID will be very useful. With regards to the syntax, I would prefer if you would use a space to delimit the command and the category ID instead of an underscore. This is in keeping with the format of the rest of the FilterTags. In addition, one of my future plans was to be able to list courses with a particular tag. For example, if I wanted to present a list of "Featured" courses on the FrontPage, I might want to have something like {coursecards tag=featured} or {coursecardstag featured}. In fact, it might simplify your code if you just made a {coursecardscategory XX} where XX is the ID of the category. I welcome your thoughts on this. With regards to the deprecated function, could you tell me which function it is that you are referring to? As far as I can tell, they all seem to still be current from Moodle 3.2 through 3.9. I am happy to accept the change but I just need a good reason as the replacement functions you are proposing are also valid from 3.2 to 3.9. Otherwise it just feels like changing for the purpose of change. I noticed you moved all of the CSS into the styles.css file. Normally I would agree with you however my plan was to actually make the height and width of the cards configurable in the plugin settings which is why they were left in the PHP. Any alternative suggestions? I am definitely in favour of enabling support in the mobile app whenever possible. Best regards, Michael |
The deprecated function is file_encode_url - The deprecation notice is here: MDL-31071 The main reason I moved the styling to a css file was so it would be ignored by the app, some of these directives could definitely be moved back as in-line styles to make the configurable. I can't quite remember exactly which ones were breaking the app. I'll make the suggested change to the syntax. I would suggest not introducing a new substitution as it would introduce duplicated code. |
I had noticed MDL-31071. However the ticket was created 8 years ago and is still open - not even in progress. There are still MANY instances of file_encode_url() scattered throughout Moodle 3.9. Will it ever actually be deprecated? I don't know... maybe 4.0? There doesn't seem to be any rush. That said, it does work and your code is just as compatible as file_encode_url (back to Moodle 3.2 as far as I can tell. So I will agree. That way, should it ever end up deprecate, the tag will still work (develop for the future, right?) :-) |
e552c46
to
d87a45d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With regards to the syntax, I would prefer if you would use a space to delimit the command and the category ID instead of an underscore. This is in keeping with the format of the rest of the FilterCodes. So the tag format should be {coursecards id=xx,yy,zz} where xx,yy,zz would be one or more category IDs.
One of my future plans will be to add the ability to list courses with a particular tag. For example, I might want to present a list of courses that have been tagged with the word "featured" on the FrontPage so the syntax might be something like {coursecards tag=featured}. This is just for your information. I don't expect you create that functionality just yet as part of your PR (though you are welcome to do it).
As for the CSS, my plan was to actually make the height and width of the cards configurable in the plugin settings which is why these were left in the PHP.
If you would please be so kind as to make these changes, I would really appreciate it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for the CSS, my plan was to actually make the height and width of the cards configurable in the plugin settings which is why these were left in the PHP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to mention, please don't change the version.php file just yet. I only change the version number in that file with official releases so that people can test new functionality and revert back without having to re-install the plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change from file_encode_url to make_pluginfile_url is acceptable. Thank you.
Hi @andrewhancox , I was just wondering if you had submitted the changes yet? I am not trying to rush you or anything however, I also don't want you to think I have forgotten you if you did submit a new pull request but I didn't receive it. Best regards, Michael |
e21cd21
to
cd13bd2
Compare
I've made a new commit to the branch. I've altered the syntax of the placeholder as requested and re-instated the in-line styles related to sizing. |
832c453
to
b9e9c2a
Compare
93973ec
to
be79b30
Compare
…ted function call (file_encode_url), make compatible with mobile app (no support for background images on in-line styles).
cd13bd2
to
7ca4190
Compare
I've just realised I never got this closed off. I've rebased and done a force push - I don't think there were any requested changes outstanding though... |
eb3b60e
to
fa6c176
Compare
ce01a62
to
1acb5fe
Compare
54467e0
to
e44b3ab
Compare
f2a9222
to
fe74ded
Compare
a5019f6
to
c3d7a6f
Compare
5bbf018
to
e0978f3
Compare
4146ef8
to
83c4f53
Compare
6cab796
to
783b586
Compare
6c1d7a6
to
fc86c12
Compare
Includes:
Enhancement to allow embedding courses from a specific category
e.g. {coursecards|_categoryID}
Elimination of deprecated function call
Change to allow use in mobile app:
The mobile app does not handle background images set by in-line styles, they work the first time you view the content and then fail when you navigate away and back again.