Posts made by Itamar Tzadok

Actually it should be fairly easy to associate the images in the Files area with the database module. In the database you can have a text field for the image file name, say, imageName. Then you import (csv) the image file names (e.g. image001.jpg) into the imageName field. Then you add to the single or list view template or both, an img tag with the image file path and the image name.

For example, suppose your images location in your Moodle files is:

http://your.moodle.org/moodle/file.php/3/images/

You can add to the template the following html:

<img src="http://your.moodle.org/moodle/file.php/3/images/||imageName||" />


(|| stands for square brackets) and the image should be displayed.


Hope this helps smile
Average of ratings: Useful (1)
There are many ways neither of which is straightforward unless of course you display all the information in the list view and print this web page. Alternatively, you can enable the RSS of the database, set the RSS template to display the entry as you want it in the printout and then open the RSS page and print it. Alternatively you can do something more complex than these two ways, and I'd be happy to explain what and how if neither one of the above works for you. smile

Moodle in English -> Database -> Field IDs -> Re: Field IDs

by Itamar Tzadok -
For both text and HTML Editor fields you should use

document.getElementById(fieldID).value=

By the way, in your template code you have

...
<td Xonclick="setDefault('||Id kazu#id||','2345');">||Id kazu||</td>
...

This code means that when the 'Identifikátor kazuistiky' field in the form is clicked it will be assigned the default value. But if what you need is that the field will be assigned the default value only by the form and not by the user then that onclick in the td element should be omitted.

Also, the javascript as implemented will assign the default value to the field every time the form is opened, even if it is opened for editing in which case if the user updated the information in that field the user information will be overridden. To prevent that you need to first check in the function that the field is empty:

function setDefault(fieldID,val){
if (document.getElementById(fieldID).value=="") {
document.getElementById(fieldID).value=val;
}
}

Give it a try and let me know if it works.

:-)


You can try the following and see if it works for you. Add an html block on your course main page and in text mode add something like:

<script type="text/javascript"> openpopup('your_file.html', 'title', 'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500', 0); </script>

This uses Moodle's popup method but of course you can also use window.open.

smile