Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.9.5
-
Fix Version/s: None
-
Component/s: Package: MrCuteJr
-
Labels:None
-
Environment:Only tested on Moodle 1.9.5, unix (ubuntu & redhat) installations.
-
Database:Any
-
Affected Branches:MOODLE_19_STABLE
Description
This is a set of 3 items:
1) a block module that allows searching of the database table created by the block module (I've called it "MrCUTE Jr. Repository" since some of the code comes from the MrCUTE2 module)
2) a resource type plugin which extends the functionality of resource_file (it literally sub-classes the resource_file resource type)
3) a patch which allows the mrcutejr resource type to have different icons depending on what the repository resource actually is (rather than just a single 'icon.gif' for all mrcutejr resources created).
I have instructions in a text file for installation and usage. Basically 3 buttons are added to the "create a new resource" view: "MrCUTE Jr. Search...", "New Shared URL" and "New Shared File" - these do what they say.
One known issue, which I need your/someones help with is the patch I've created; it's the first patch I've ever done, and though it appears to work fine (the files are patched correctly), some warnings are generated - I need someone experienced in this to have a look.
Attachments
-
$i18n.getText("admin.common.words.hide")
- mrcutejr_modules_1r1.zip
- 24/Jul/09 6:49 AM
- 49 kB
- Leo Thiessen
-
- mrcutejr_modules/.DS_Store 6 kB
- __MACOSX/mrcutejr_modules/._.DS_Store 0.1 kB
- mrcutejr_modules/blocks/.DS_Store 6 kB
- __MACOSX/mrcutejr_modules/.../._.DS_Store 0.1 kB
- mrcutejr_modules/blocks/.../.DS_Store 6 kB
- __MACOSX/mrcutejr_modules/.../._.DS_Store 0.1 kB
- mrcutejr_modules/.../block_mrcutejr.php 4 kB
- mrcutejr_modules/.../config_global.html 4 kB
- mrcutejr_modules/blocks/.../db/.DS_Store 6 kB
- __MACOSX/mrcutejr_modules/.../db/._.DS_Store 0.1 kB
- mrcutejr_modules/blocks/.../db/install.xml 2 kB
- mrcutejr_modules/blocks/.../lang/.DS_Store 6 kB
- __MACOSX/mrcutejr_modules/.../._.DS_Store 0.1 kB
- mrcutejr_modules/blocks/.../.DS_Store 6 kB
- __MACOSX/mrcutejr_modules/.../._.DS_Store 0.1 kB
- mrcutejr_modules/.../block_mrcutejr.php 3 kB
- mrcutejr_modules/mod/.DS_Store 6 kB
- __MACOSX/mrcutejr_modules/.../._.DS_Store 0.1 kB
- mrcutejr_modules/mod/resource/.DS_Store 6 kB
- __MACOSX/mrcutejr_modules/.../._.DS_Store 0.1 kB
- mrcutejr_modules/mod/.../type/.DS_Store 6 kB
- __MACOSX/mrcutejr_modules/.../._.DS_Store 0.1 kB
- mrcutejr_modules/mod/.../mrcutejr/.DS_Store 6 kB
- __MACOSX/mrcutejr_modules/.../._.DS_Store 0.1 kB
- mrcutejr_modules/mod/.../mrcutejr/config.php 7 kB
- mrcutejr_modules/mod/.../mrcutejr/edit.php 8 kB
- mrcutejr_modules/mod/.../forms/.DS_Store 6 kB
- __MACOSX/mrcutejr_modules/.../._.DS_Store 0.1 kB
- mrcutejr_modules/.../form_edit_mrcutejr.php 8 kB
- mrcutejr_modules/.../form_new_mrcutejr.php 6 kB
$i18n.getText("admin.common.words.show")- mrcutejr_modules_1r1.zip
- 24/Jul/09 6:49 AM
- 49 kB
- Leo Thiessen
-
$i18n.getText("admin.common.words.hide")
- mrcutejr_modules_1r2.zip
- 25/Jul/09 9:59 AM
- 36 kB
- Leo Thiessen
-
- mrcutejr_modules/.../block_mrcutejr.php 4 kB
- mrcutejr_modules/.../config_global.html 4 kB
- mrcutejr_modules/blocks/.../db/install.xml 2 kB
- mrcutejr_modules/.../block_mrcutejr.php 3 kB
- mrcutejr_modules/mod/.../mrcutejr/config.php 7 kB
- mrcutejr_modules/mod/.../mrcutejr/edit.php 8 kB
- mrcutejr_modules/.../form_edit_mrcutejr.php 8 kB
- mrcutejr_modules/.../form_new_mrcutejr.php 6 kB
- mrcutejr_modules/.../form_search_mrcutejr.php 3 kB
- mrcutejr_modules/mod/.../get_icon.php 3 kB
- mrcutejr_modules/mod/.../mrcutejr/icon.gif 0.6 kB
- mrcutejr_modules/.../resource_mrcutejr.php 6 kB
- mrcutejr_modules/mod/.../mrcutejr.css 2 kB
- mrcutejr_modules/mod/.../mrcutejr.js 2 kB
- mrcutejr_modules/mod/.../mrcutejr/new.php 8 kB
- mrcutejr_modules/mod/.../resource.class.php 10 kB
- mrcutejr_modules/mod/.../mrcutejr/search.php 12 kB
- mrcutejr_modules/mod_resource_dynamic_custom_icons.patch 4 kB
- mrcutejr_modules/README_(Installation_and_How-To).txt 3 kB
$i18n.getText("admin.common.words.show")- mrcutejr_modules_1r2.zip
- 25/Jul/09 9:59 AM
- 36 kB
- Leo Thiessen
-
$i18n.getText("admin.common.words.hide")
- mrcutejr_modules_1r3.zip
- 29/Jul/09 3:57 AM
- 36 kB
- Leo Thiessen
-
- mrcutejr_modules/.../block_mrcutejr.php 4 kB
- mrcutejr_modules/.../config_global.html 4 kB
- mrcutejr_modules/blocks/.../db/install.xml 2 kB
- mrcutejr_modules/.../block_mrcutejr.php 3 kB
- mrcutejr_modules/mod/.../mrcutejr/.cvsignore 0.0 kB
- mrcutejr_modules/mod/.../mrcutejr/config.php 7 kB
- mrcutejr_modules/mod/.../mrcutejr/edit.php 8 kB
- mrcutejr_modules/.../form_edit_mrcutejr.php 8 kB
- mrcutejr_modules/.../form_new_mrcutejr.php 6 kB
- mrcutejr_modules/.../form_search_mrcutejr.php 3 kB
- mrcutejr_modules/mod/.../get_icon.php 3 kB
- mrcutejr_modules/mod/.../mrcutejr/icon.gif 0.6 kB
- mrcutejr_modules/.../resource_mrcutejr.php 6 kB
- mrcutejr_modules/mod/.../mrcutejr.css 2 kB
- mrcutejr_modules/mod/.../mrcutejr.js 2 kB
- mrcutejr_modules/mod/.../mrcutejr/new.php 9 kB
- mrcutejr_modules/mod/.../resource.class.php 10 kB
- mrcutejr_modules/mod/.../mrcutejr/search.php 12 kB
- mrcutejr_modules/mod_resource_dynamic_custom_icons.patch 4 kB
- mrcutejr_modules/README.txt 3 kB
$i18n.getText("admin.common.words.show")- mrcutejr_modules_1r3.zip
- 29/Jul/09 3:57 AM
- 36 kB
- Leo Thiessen
-
$i18n.getText("admin.common.words.hide")
- mrcutejr_modules_1r4.zip
- 29/Jul/09 4:51 AM
- 36 kB
- Leo Thiessen
-
- mrcutejr_modules/.../block_mrcutejr.php 4 kB
- mrcutejr_modules/.../config_global.html 4 kB
- mrcutejr_modules/blocks/.../db/install.xml 2 kB
- mrcutejr_modules/.../block_mrcutejr.php 3 kB
- mrcutejr_modules/mod/.../mrcutejr/.cvsignore 0.0 kB
- mrcutejr_modules/mod/.../mrcutejr/config.php 7 kB
- mrcutejr_modules/mod/.../mrcutejr/edit.php 8 kB
- mrcutejr_modules/.../form_edit_mrcutejr.php 8 kB
- mrcutejr_modules/.../form_new_mrcutejr.php 6 kB
- mrcutejr_modules/.../form_search_mrcutejr.php 3 kB
- mrcutejr_modules/mod/.../get_icon.php 3 kB
- mrcutejr_modules/mod/.../mrcutejr/icon.gif 0.6 kB
- mrcutejr_modules/.../resource_mrcutejr.php 6 kB
- mrcutejr_modules/mod/.../mrcutejr.css 2 kB
- mrcutejr_modules/mod/.../mrcutejr.js 2 kB
- mrcutejr_modules/mod/.../mrcutejr/new.php 9 kB
- mrcutejr_modules/mod/.../resource.class.php 10 kB
- mrcutejr_modules/mod/.../mrcutejr/search.php 12 kB
- mrcutejr_modules/mod_resource_dynamic_custom_icons.patch 4 kB
- mrcutejr_modules/README.txt 3 kB
$i18n.getText("admin.common.words.show")- mrcutejr_modules_1r4.zip
- 29/Jul/09 4:51 AM
- 36 kB
- Leo Thiessen
-
$i18n.getText("admin.common.words.hide")
- mrcutejr_with_import.zip
- 25/Aug/09 4:31 AM
- 54 kB
- Leo Thiessen
-
- mrcutejr_with_import/.../block_mrcutejr.php 4 kB
- mrcutejr_with_import/.../config_global.html 4 kB
- mrcutejr_with_import/blocks/.../install.xml 2 kB
- mrcutejr_with_import/.../block_mrcutejr.php 3 kB
- mrcutejr_with_import/mod/.../config.php 12 kB
- mrcutejr_with_import/mod/.../Crypt_Xtea.php 17 kB
- mrcutejr_with_import/mod/.../edit.php 8 kB
- mrcutejr_with_import/.../form_edit_mrcutejr.php 8 kB
- mrcutejr_with_import/.../form_import_csv_mrcutejr.php 3 kB
- mrcutejr_with_import/.../form_new_mrcutejr.php 7 kB
- mrcutejr_with_import/.../form_search_mrcutejr.php 3 kB
- mrcutejr_with_import/mod/.../get.php 4 kB
- mrcutejr_with_import/mod/.../get_icon.php 3 kB
- mrcutejr_with_import/mod/.../icon.gif 0.6 kB
- mrcutejr_with_import/mod/.../import.php 13 kB
- mrcutejr_with_import/.../resource_mrcutejr.php 8 kB
- mrcutejr_with_import/.../mod_resource_dynamic_custom_icons.patch 4 kB
- mrcutejr_with_import/mod/.../mrcutejr.css 5 kB
- mrcutejr_with_import/mod/.../mrcutejr.js 4 kB
- mrcutejr_with_import/.../mrcutejr_auth.php 8 kB
- mrcutejr_with_import/mod/.../new.php 9 kB
- mrcutejr_with_import/mod/.../preview.php 3 kB
- mrcutejr_with_import/.../resource.class.php 11 kB
- mrcutejr_with_import/mod/.../search.php 13 kB
- mrcutejr_with_import/README.txt 0.1 kB
$i18n.getText("admin.common.words.show")- mrcutejr_with_import.zip
- 25/Aug/09 4:31 AM
- 54 kB
- Leo Thiessen
Issue Links
| This issue has been marked as being related by: | ||||
| MDL-18641 | [PATCH] Custom icons for resource types |
|
|
|
Activity
- All
- Comments
- History
- Activity
- Source
- Test Sessions
Please use "mrcutejr_modules_1r2.zip" in place of the "mrcutejr_modules_1r1.zip" file. Changes:
a) Updated the patch file - used NetBeans IDE to generate the patch file to make sure it's done correctly.
b) Replaced random tabs with spaces as per Moodle coding guidelines.
c) Updated the instructions/how-to text file to fix some spelling/grammar errors.
I've just developed some related functionality for Moodle in #CONTRIB-1439, called "MrCUTE Jr. Shared URL/File Repository" - it's a very basic version of a shared url/file repository that currently works on Moodle 1.9.5 and provides a quick solution for sharing resources across courses. A search functionality exists to find the shared resource based on kewords and other data associated to the shared resource when it was entered into the repository.
I flagged this as "duplicates" the repository api, based on it being the nearest match - obviously it doesn't actually do that, rather it provides a function that the repository api will enable, more fully, in the future.
I hope this will solve some basic sharing needs for Moodle 1.9.5 users in the meantime.
Has displaying the right type of icon for a repository resource been addressed in the resource api? (For example a URL could be to a .gif, or to a .flv, etc).
Btw, I'm new at tracker.moodle.org, so if I do something out of procedure/other - just let me know via email & I'll do my best to adjust my actions to accommodate!
Feedback is welcomed, please, and thanks!
Leo - Currently this looks like a patch; however, ideally we could work to make it a plugin. Plugins are seen from a system administrator's perspective simpler as it can be complicated for some folks to maintain patches. I removed the blocking links to MDL-13766 because this issue does not prevent MDL-13766 from being resolved. In fact, I would not worry about linking to MDL-13766 at all. As I understand it, the plugins (block and resource type) are fully functional without the patch and that the patch is purely for aesthetic purposes (please correct me if I am wrong). Whenever we have more than one plugin or patch that are intended to work together (as we do in this case with a resource type and a block) we are able to package them together into a single zip file. This makes it easier for folks to install as they can just unzip the file to their Moodle site and go to the notifications page. We could then provide the patch file as part of the package and provide instructions for those wishing to make those changes to their systems. So technically we could claim legitimately claim that this is a plugin but if folks wanted to patch they could. How does this sound to you? I have not started looking at code yet but this was my initial impression so I figured I would run it by you. Peace - Anthony
Leo - In the readme file you mention "Verify your Moodle version is 1.9.5 (other versions may work, but I've not tested them)". Technically speaking, there are multiple versions of 1.9.5. What I typically recommend is that folks use the latest version of 1.9.5+ (for example the weekly stable version). It just makes it clear that we are not talking about a specific subversion and lets folks know that we are supporting the latest stable version of 1.9. That way when 1.9.6 is released that will be supported. So the assumption is that we will support the latest release of Moodle. If someone is running 1.9.3 or some previous version of 1.9 and having difficulties we simply recommend that they upgrade to the latest stable release if they want to use the code. Does that make sense? I realize this is just a matter of semantics but I think it helps to clarify things. Peace - Anthony
Leo - In the installation instructions you have the user setting up the subfolder (step #5) before going to the navigation page and creating the databases (#6). Would it be possible to do #6 (notifications), #5 (create folders), #7 (setup block settings), and then mention #4 (optional application of patch)? I only mention this because the default is to have folks add code and immediately go to the notifications page so unless there is good reason not to do that then I would recommend changing the order. Again, minor points but I try to imagine how folks will go about installing the code and want it to be as smooth and natural of a process for them as possible. Let me know what you think. Peace - Anthony
Leo - I would recommend renaming the README file simply to README.txt. Also you can go ahead and create a Docs page on Moodle Docs (docs.moodle.org). See http://docs.moodle.org/en/Development:Guidelines_for_contributed_code for some recommendations about how to set that up. Again, do not hesitate to let me know if you have questions. Also, if you have not already done so go ahead and apply for CVS write access at http://moodle.org/cvs/ so that once I add the code I can give you access. I suspect the paths will be:
contrib/plugins/blocks/mrcutejr
contrib/plugins/mod/resource/type/mrcutejr
I will then package those together and explain how you can have a single zip file. We will add the patch file to the /mod/resource/type/mrcutejr folder since that is what the patch is for.
How does all this sound?
Peace - Anthony
This updated incorporates the feedback from the code review:
1) I've renamed & updated the README.txt file as per the suggestions & added an extra optional step (update css)
2) I've updated the css to do some basic resets
3) Minor update to the block module lang file
4) Yes, I've just double-checked to ensure the plugin works without the patch & so it is purely optional. Note that there is some moodle code that looks at the icon type to generate appropriate accessibility code, (in course/lib.php at around line #1408 "//Accessibility: for files get description via icon."), so I'd like to encourage the incorporation of the "dynamic" icon capability into Moodle core, in some way, shape or form.
I've added a documentation page at: http://docs.moodle.org/en/MrCuteJr_Shared_Resource_Repository
Cheers!
- Leo
- Leo
In mrcutejr_modules_1r4.zip I've updated the patch file to work from inside any root moodle folder (I simply removed the "moodle/" text).
Leo - OK, a few more comments. First, the README.txt file is auto-generated as part of the package building script. It first grabs a generic file explaining what a package is and generic installation instructions. Then it pulls in an include file for the individual package. In your case, I have given you access to contrib/tools/package_builder/readme/mrcutejr_package.inc which is the text of your previous README.txt file. I made a couple of changes including the recommendation to backup the Moodle code base prior to attempting to install the patch. I would also encourage you to describe how the MrCuteJr code differs from the MrCute code. It will be good to explain the differences to folks so that they can easily differentiate the two and not get them confused. You have some references to your code being based off of the MrCute code but a little more will not hurt. In testing the code, you may want to add a red asterisk indicating that a field is required. I had not anticipated that the keyword field was going to be required and tried leaving it blank. I have added the code to CVS and granted your CVS write request. In addition, I created a Package: MrCuteJr component in the tracker where users can track bug reports, feature requests, etc. These issues will automatically be assigned to you and you will get an email notifying you when they are added. I have bumped your privileges in the tracker so that you can manage issues related to the MrCuteJr package. Thanks again for your work on this and your work on shuffling things around so that we could maintain this as a plugin with an optional patch. It will take about 24 hours (usually about 5 p.m. EST) before the package will auto-generate. Once it does you should be able to use: http://download.moodle.org/download.php/packages/mrcutejr_package.zip to access the file. When you modify CVS, the zip file will be automatically updated when it is re-created every 24 hours. That way, folks who download the code can rest assured they are getting the latest version. Once you verify that the package has been created and are satisfied with the zip file you can update the M&P entry to point to the new location. You can check how many folks have downloaded the code by going to http://download.moodle.org/stats.php. I noticed that the M&P entry has already been approved. Again, thanks for your work on this and your generosity in sharing with the Moodle community. Peace - Anthony
code added to CVS, tracker component created, tracker privileges bumped, CVS write access granted, Docs page created, M&P entry approved - I think we are ready for lift off! Don't hesitate to let me know if you have questions or need anything else.
Leo - I had a typo in the package builder that caused the building of the mrcutejr package to fail. We'll have to wait until tomorrow - sorry for the delay. Peace - Anthony
Thanks for all your efforts!
I just checked out a copy from CVS. When I make changes to it will the download link always be for the latest snapshot? Do I need to concern myself with versions, or is that handled automatically?
Leo - The download link will automatically update every 24 hours so any changes you make in CVS will find their way into the zip file automatically. As such there is no reason to worry about versions. Technically a version number is generated for each file each time you change it and that is done automatically by CVS. So if you make a mistake you can always revert the change by going back to the previous version. In general, when making a change you are encouraged to associate the change with a tracker number. Obviously this is not required for something as simple as a typo but otherwise it helps for documentation purposes to create an issue in the tracker if you have a problem. By starting the comment with the tracker number - like I did by starting the commit comment with CONTRIB-1439 the change then becomes part of the history of the tracker issue so you can see what was changed. Feel free to let me know if you have any questions. I'm glad to see you making such a positive contribution to the community. Peace - Anthony
Leo - I just confirmed the package is now working so you can update the Docs and Modules and Plugins entry to use Moodle's download server using the URL I mentioned above. Let me know if you need anything or have any concerns about the auto-generated zip file. Peace - Anthony
Leo - Just a reminder that it is encouraged to associate a tracker issue with all commits. The exception being something simple like a typo. I noticed a recent commit that did not associate back to a tracker issue and did not know if I had mentioned this to you before so I figured I would take this opportunity to do so. Let me know if you have any questions. Peace - Anthony
Anthony - could you get the "this issue is blocked by: MDL-13766" removed? Currently I'm targeting Moodle 1.9.5+ as a interim repository solution while we all wait for the improved Moodle 2.0 release.
Anthony: I just realized how easy it was to delete the "blocks" link - sorry to bother you.
Question: I just noticed CONTRIB/component/10485... I was going to put everything as a sub-task to this tracker item, but it would seem the proper place is http://tracker.moodle.org/browse/CONTRIB/component/10485 – is that correct?
Leo - I am glad you figured out how to remove the link. I am not sure I understand your question but let me make a comment and see if it helps. I recommend creating a separate tracker issue for each bug, feature request, etc. If there is a large project like - rewrite block from Moodle 2.0 you can create a meta-issue and then use sub-tasks to track your progress on the one large issue. But generally speaking they will simply be separate issues in the tracker in the same component. Does that help to clarify? If not, feel free to ask me to clarify whatever is needed. Peace - Anthony
Leo - I find myself on the road again. Is the new snapshot with import functionality something that I need to do something with or are you just documenting work that you have done? Let me know if you need anything from me or have any questions. Peace - Anthony
No, you don't need to do anything with it. I put it here so people could download it - I missed a few files in the previous commit, I've added the missing files & re-committed; but this zip lets people download it right away.
Thanks Leo - that's what I figured but just wanted to double check. Peace - Anthony
I've just added experimental ajax support - I created a ticket (CONTRIB-1532) for this and referenced the new ticket during the CVS commit.
Leo - Thanks for your continue work on MrCuteJr. Keep up the good work. I've occasionally played with some AJAX functionality and while it works nice getting it to actually work can be quite a task. So your work is no small accomplishment. Peace - Anthony
The patch in the mrcutejr item (
CONTRIB-1439) is a modified version of theMDL-18641patch to allow for "dynamic" icons for a resource-type plugin, rather than a static "icon.gif." The mrcutejr resource type is a repository of sorts,, so it may return various different types of resources; while digging through the moodle code, I noticed some accessibility features seem to be based on the icon being used - this makes it important to display the right icon type for a resource (unless I'm missing something here). Any thoughts folks?CONTRIB-1439) is a modified version of theMDL-18641patch to allow for "dynamic" icons for a resource-type plugin, rather than a static "icon.gif." The mrcutejr resource type is a repository of sorts,, so it may return various different types of resources; while digging through the moodle code, I noticed some accessibility features seem to be based on the icon being used - this makes it important to display the right icon type for a resource (unless I'm missing something here). Any thoughts folks?