From: moodler Date: Thu, 17 Oct 2002 14:03:59 +0000 (+0000) Subject: ***NOTE NOTE NOTE ********************************************************** X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=2a439ba7f69ccade8bc42dd40c78e1e3c0af8f00;p=moodle.git ***NOTE NOTE NOTE ********************************************************** THIS IS A BIG CHANGE! I've renamed the "reading" module to "resource". This meant changing quite a few references throughout Moodle. The automatic upgrade process should work OK (it worked OK on my development server) and there shouldn't be any problems. BUT PLEASE PROCEED WITH CAUTION AND KEEP BACKUPS OF EVERYTHING UNTIL I HAVE A FEW MORE TESTS! If you upgrade please let me know. One thing that will break are any hard-coded links within forum messages. What I will be doing to fix this on my apache server is to add this to httpd.conf: Redirect /mod/reading/ http://moodle.com/mod/resource/ Sorry about any inconvenience, but it's better this is done sooner than later. --- diff --git a/RELEASE.html b/RELEASE.html index 74d751553f..ef2bb9b396 100644 --- a/RELEASE.html +++ b/RELEASE.html @@ -24,6 +24,16 @@
Languages
German and Italian have been added! Many thanks to the translators (see the credits). +
Reading module ===> Resource module +
After much thought and a vote of support (21 "yes" to 6 "no") on the "Using Moodle" + web site I changed the name of the "reading" module to "resource" (at the code level + and also the English language pack). Better now than later. + + This more generic name will be more meaningful to more people and opens the way to + some real development on a resource library. +

+ I don't anticipate ever having to change a module name again! :-) +
Other additions
An admin script to totally delete the Moodle data directory has been included (admin/delete.php) for people who need to tear down a Moodle installation but don't have root access on their diff --git a/course/lib.php b/course/lib.php index 00cd86132b..9af095e641 100644 --- a/course/lib.php +++ b/course/lib.php @@ -543,7 +543,7 @@ function print_course_admin_links($course, $width=180) { $adminicon[]="wwwroot/files/pix/files.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">"; $admindata[]="wwwroot/doc/view.php?id=$course->id&file=teacher.html\">".get_string("help")."..."; - $adminicon[]="wwwroot/mod/reading/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">"; + $adminicon[]="wwwroot/mod/resource/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">"; if ($teacherforum = forum_get_course_forum($course->id, "teacher")) { diff --git a/course/social.php b/course/social.php index 48e729fa74..b984549537 100644 --- a/course/social.php +++ b/course/social.php @@ -3,7 +3,7 @@ // included from view.php include_once("$CFG->dirroot/mod/forum/lib.php"); - include_once("$CFG->dirroot/mod/reading/lib.php"); + include_once("$CFG->dirroot/mod/resource/lib.php"); ?> diff --git a/doc/developer.html b/doc/developer.html index 2cfd58cd75..3935b1204a 100755 --- a/doc/developer.html +++ b/doc/developer.html @@ -84,7 +84,7 @@

Learning Activities

These are by far the most important modules, and reside in the 'mod' directory. - There are six default modules: assignment, choice, forum, journal, reading, + There are seven default modules: assignment, choice, forum, journal, quiz, resource, and survey. Each module is in a separate subdirectory and consists of the following mandatory elements (plus extra scripts unique to each module):

    @@ -140,8 +140,9 @@
  • choice.php - strings for choice module
  • forum.php - strings for forum module
  • journal.php - strings for journal module
  • -
  • reading.php - strings for reading module
  • -
  • survey.php - strings for reading module
  • +
  • quiz.php - strings for quiz module
  • +
  • resource.php - strings for resource module
  • +
  • survey.php - strings for survey module
  • .... plus other modules if any.

    A string is called from these files using the get_string() diff --git a/doc/features.html b/doc/features.html index 848c95cede..de19f77b3e 100755 --- a/doc/features.html +++ b/doc/features.html @@ -9,14 +9,14 @@

    Features

    Here is a big list of some of the features in Moodle 1.0: -
    • Supports a social constructionist pedagogy (collaboration, activities, critical reflection, etc)
    • Suitable for 100% online classes as well as supplementing face-to-face learning
    • Simple, lightweight, browser-compatible interface
    • Plug-in "themes" allow you to customise the colours, fonts, layout etc
    • Easy to install on most platforms
    • Easy administration - students can create their own accounts. Email addresses are verified.
    • One account works for the whole server
    • Security - teachers can add an "enrolment key" to their courses to keep out non-students. They can give out this key face-to-face or via personal email etc
    • Students are encouraged to build an online profile including photos, description etc
    • Every user can specify their own timezone, and every date in Moodle is translated to that timezone (eg posting dates, assignment due dates etc)
    • Choice of course formats such as by week, by topic or a discussion-focussed social format
    • Flexible array of course modules - Forums, Journals, Readings, Choices, Surveys, Assignments.
    • New modules can be written and plugged in to existing Moodle installations
    • The code is clearly-written PHP under a GPL license - easy to modify and localise
    • Full database abstraction supports all major brands of database (except for initial table definition)
    • Ready for internationalisation - supports plug-in languages and locale-based date formats etc
    • Mail integration - copies of forum posts, teacher feedback etc can be mailed in HTML or plain text.
    • Recent changes to the course since the last login are displayed on the course home page
    • Full user logging and tracking - activity reports for each student are available with graphs and details about each module (last access, number of times read) as well as a detailed "story" of each students involvement including postings, journal entries etc on one page.
    • +
      • Supports a social constructionist pedagogy (collaboration, activities, critical reflection, etc)
      • Suitable for 100% online classes as well as supplementing face-to-face learning
      • Simple, lightweight, browser-compatible interface
      • Plug-in "themes" allow you to customise the colours, fonts, layout etc
      • Easy to install on most platforms
      • Easy administration - students can create their own accounts. Email addresses are verified.
      • One account works for the whole server
      • Security - teachers can add an "enrolment key" to their courses to keep out non-students. They can give out this key face-to-face or via personal email etc
      • Students are encouraged to build an online profile including photos, description etc
      • Every user can specify their own timezone, and every date in Moodle is translated to that timezone (eg posting dates, assignment due dates etc)
      • Choice of course formats such as by week, by topic or a discussion-focussed social format
      • Flexible array of course modules - Forums, Journals, Resources, Choices, Surveys, Assignments.
      • New modules can be written and plugged in to existing Moodle installations
      • The code is clearly-written PHP under a GPL license - easy to modify and localise
      • Full database abstraction supports all major brands of database (except for initial table definition)
      • Ready for internationalisation - supports plug-in languages and locale-based date formats etc
      • Mail integration - copies of forum posts, teacher feedback etc can be mailed in HTML or plain text.
      • Recent changes to the course since the last login are displayed on the course home page
      • Full user logging and tracking - activity reports for each student are available with graphs and details about each module (last access, number of times read) as well as a detailed "story" of each students involvement including postings, journal entries etc on one page.
      Forum Module
      • Different types of forums are available, such as teacher-only, course news, open-to-all, and one-thread-per-user.
      • All postings have the authors photo attached.
      • Discussions can be viewed nested, flat or threaded, oldest or newest first.
      • Individual forums can be subscribed to by each person so that copies are forwarded via email, or the teacher can force subscription for all
      Survey Module
      • Built-in surveys (COLLES, ATTLS) have been proven as instruments for analysing online classes
      • Online survey reports always available, including many graphs. Data is downloadable as an Excel spreadsheet or CSV text file.
      • Survey interface prevents partly-finished surveys.
      • Feedback is provided to the student of their results compared to the class averages
      -Readings Module +Resource Module
      • Supports display of any electronic content
      • Files can be uploaded and managed on the server, or created on the fly using web forms (text or HTML)
      • External content on the web can be linked to or seamlessly included within the course interface.
      Choice Module
      • Like a poll. Can either be used to vote on something, or to get feedback from every student (eg research consent)
      diff --git a/doc/future.html b/doc/future.html index ad27913709..f6685ac790 100755 --- a/doc/future.html +++ b/doc/future.html @@ -35,7 +35,7 @@
    • Full user account management (eg connection to external databases, import/export etc)
    • Full grade management
    • Ability to define groups and group work -
    • Automatic linking in texts to uploaded readings (like Wiki) +
    • Automatic linking in texts to uploaded resources (like Wiki)
    • Online support for teachers to design and maintain classes
    • Online support for students in collaboration processes
    diff --git a/doc/teacher.html b/doc/teacher.html index cd5f726c6c..5d33293bcc 100755 --- a/doc/teacher.html +++ b/doc/teacher.html @@ -92,7 +92,7 @@

     

    This interface is only available to teachers - it is not accessible by students. - Individual files are made available to students later on (as "Readings" + Individual files are made available to students later on (as "Resources" - see the next section).

    As you can see in the screenshot, files are listed alongside subdirectories. You can create any number of subdirectories to organise your files and move @@ -109,7 +109,7 @@ with the same name as an existing file it will automatically be overwritten.

    A final note: if your content resides out on the web then you don't need to upload the files at all - you can link directly to them from inside the - course (see the Readings module and the next section).

    + course (see the Resources module and the next section).


Setting up activities

@@ -158,8 +158,8 @@ and students will receive an automatic email informing them of your feedback.

-
Reading
-
Readings are the content of your course. Each reading can be any file +
Resource
+
Resources are the content of your course. Each resource can be any file you have uploaded or can point to using a URL. You can also maintain simple text-based pages by typing them directly into a form.

diff --git a/index.php b/index.php index 0f49d07131..6d9f5b06da 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ require("config.php"); include("course/lib.php"); - include("mod/reading/lib.php"); + include("mod/resource/lib.php"); include("mod/forum/lib.php"); if (! $site = get_site()) { diff --git a/lang/en/reading.php b/lang/en/resource.php similarity index 65% rename from lang/en/reading.php rename to lang/en/resource.php index abc1df9c6f..5254f56112 100644 --- a/lang/en/reading.php +++ b/lang/en/resource.php @@ -1,12 +1,12 @@ File Manager."; $string['notypechosen'] = "You need to choose a type. Use your back button to go back and retry."; -$string['readingtype'] = "Type of resource"; -$string['readingtype1'] = "Reference"; -$string['readingtype2'] = "Web Page"; -$string['readingtype3'] = "Uploaded File"; -$string['readingtype4'] = "Plain text"; -$string['readingtype5'] = "Web Link"; -$string['readingtype6'] = "HTML text"; +$string['resourcetype'] = "Type of resource"; +$string['resourcetype1'] = "Reference"; +$string['resourcetype2'] = "Web Page"; +$string['resourcetype3'] = "Uploaded File"; +$string['resourcetype4'] = "Plain text"; +$string['resourcetype5'] = "Web Link"; +$string['resourcetype6'] = "HTML text"; ?> diff --git a/lib/db/mysql.php b/lib/db/mysql.php index ac1b900583..5fdd2b0e06 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -77,6 +77,13 @@ function upgrade_moodle($oldversion=0) { if ($oldversion < 2002101001) { execute_sql(" ALTER TABLE `user` ADD `htmleditor` TINYINT(1) UNSIGNED DEFAULT '1' NOT NULL AFTER `maildisplay` "); } + if ($oldversion < 2002101701) { + execute_sql(" ALTER TABLE `reading` RENAME `resource` "); // Small line with big consequences! + execute_sql(" DELETE FROM `log_display` WHERE module = 'reading'"); + execute_sql(" INSERT INTO log_display VALUES ('resource', 'view', 'resource', 'name') "); + execute_sql(" UPDATE log SET module = 'resource' WHERE module = 'reading' "); + execute_sql(" UPDATE modules SET name = 'resource' WHERE name = 'reading' "); + } return true; } diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 6d66d41147..95b4c4b7a2 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -1886,7 +1886,7 @@ function add_to_log($course, $module, $action, $url="", $info="") { // any particular student has been doing. // // course = the course id -// module = forum, journal, reading, course, user etc +// module = forum, journal, resource, course, user etc // action = view, edit, post (often but not always the same as the file.php) // url = the file and parameters used to see the results of the action // info = additional description information diff --git a/mod/resource/db/mysql.php b/mod/resource/db/mysql.php new file mode 100644 index 0000000000..0183dddee0 --- /dev/null +++ b/mod/resource/db/mysql.php @@ -0,0 +1,12 @@ + + diff --git a/mod/resource/db/mysql.sql b/mod/resource/db/mysql.sql new file mode 100755 index 0000000000..d9c9a5ee63 --- /dev/null +++ b/mod/resource/db/mysql.sql @@ -0,0 +1,35 @@ +# phpMyAdmin MySQL-Dump +# version 2.2.1 +# http://phpwizard.net/phpMyAdmin/ +# http://phpmyadmin.sourceforge.net/ (download page) +# +# Host: localhost +# Generation Time: Nov 14, 2001 at 04:43 PM +# Server version: 3.23.36 +# PHP Version: 4.0.6 +# Database : `moodle` +# -------------------------------------------------------- + +# +# Table structure for table `resource` +# + +CREATE TABLE resource ( + id int(10) unsigned NOT NULL auto_increment, + course tinyint(10) unsigned NOT NULL default '0', + name varchar(255) NOT NULL default '', + type tinyint(4) NOT NULL default '0', + reference varchar(255) default NULL, + summary text NOT NULL, + alltext text NOT NULL, + timemodified int(10) unsigned NOT NULL default '0', + PRIMARY KEY (id), + UNIQUE KEY id (id) +) TYPE=MyISAM; + + +# +# Dumping data for table `log_display` +# + +INSERT INTO log_display VALUES ('resource', 'view', 'resource', 'name'); diff --git a/mod/resource/details.php b/mod/resource/details.php new file mode 100644 index 0000000000..5d7bd9256c --- /dev/null +++ b/mod/resource/details.php @@ -0,0 +1,194 @@ +course)) { + error("This course doesn't exist"); + } + + require_login($course->id); + + if (!isteacher($course->id)) { + error("You can't modify this course!"); + } + + $strediting = get_string("editingaresource", "resource"); + $strname = get_string("name"); + + print_header("$course->shortname: $strediting", "$course->shortname: $strediting", + "wwwroot/course/view.php?id=$course->id\">$course->shortname -> $strediting"); + + if (!$form->name or !$form->type or !$form->summary) { + error(get_string("filloutallfields"), $HTTP_REFERER); + } + + print_simple_box_start("center", "", "$THEME->cellheading"); + + if ($usehtmleditor and $form->type == HTML) { + $onsubmit = "onsubmit=\"copyrichtext(theform.alltext);\""; + } + echo "
destination\">"; + echo "
"; + echo ""; + + $strtypename = $RESOURCE_TYPE["$form->type"]; + $strexample = get_string("example", "resource"); + + switch ($form->type) { + case REFERENCE: + $strexamplereference = get_string("examplereference", "resource"); + ?> + + + + + + + + + + + + + + + + + + + + wwwroot/files/index.php?id=$course->id"); + ?> + + + + + + + + + + + + + + + + + + + + +

$strname:

$form->name

+

:

+
+ +
+

()

+
+

+
+

:

+
+ +
+

()

+
+

+

+
+

:

+
+ dataroot."/".$course->id; + $coursedirs = get_directory_list($rootdir, $CFG->moddata); + foreach ($coursedirs as $dir) { + $options["$dir"] = $dir; + } + choose_from_menu ($options, "reference", $form->reference); + ?> +
+

:

+
+

+

+
+

:

+
+
+ +
+

:

+ +
+ +
+ +
+ alltext); ?> +
+ + + + + + + + + + + +
+ "> + "> +
+ + diff --git a/mod/resource/icon.gif b/mod/resource/icon.gif new file mode 100644 index 0000000000..550df5db8c Binary files /dev/null and b/mod/resource/icon.gif differ diff --git a/mod/resource/index.php b/mod/resource/index.php new file mode 100644 index 0000000000..dd7476bf6b --- /dev/null +++ b/mod/resource/index.php @@ -0,0 +1,72 @@ +category) { + require_login($course->id); + $navigation = "id\">$course->shortname ->"; + } + + add_to_log($course->id, "resource", "view all", "index.php?id=$course->id", ""); + + $strresource = get_string("modulename", "resource"); + $strresources = get_string("modulenameplural", "resource"); + $strweek = get_string("week"); + $strtopic = get_string("topic"); + $strname = get_string("name"); + $strsummary = get_string("summary"); + $strlastmodified = get_string("lastmodified"); + + print_header("$course->shortname: $strresources", "$course->fullname", "$navigation $strresources"); + + if ($course->format == "weeks" or $course->format == "topics") { + $sortorder = "cw.section ASC"; + } else { + $sortorder = "m.timemodified DESC"; + } + + if (! $resources = get_all_instances_in_course("resource", $course->id, $sortorder)) { + notice("There are no resources", "../../course/view.php?id=$course->id"); + exit; + } + + if ($course->format == "weeks") { + $table->head = array ($strweek, $strname, $strsummary); + $table->align = array ("CENTER", "LEFT", "LEFT"); + } else if ($course->format == "topics") { + $table->head = array ($strtopic, $strname, $strsummary); + $table->align = array ("CENTER", "LEFT", "LEFT"); + } else { + $table->head = array ($strlastmodified, $strname, $strsummary); + $table->align = array ("LEFT", "LEFT", "LEFT"); + } + + foreach ($resources as $resource) { + + $tt = ""; + if ($course->format == "weeks" or $course->format == "topics") { + if ($resource->section) { + $tt = "$resource->section"; + } + } else { + $tt = "".userdate($resource->timemodified); + } + $table->data[] = array ($tt, "coursemodule\">$resource->name", + text_to_html($resource->summary) ); + } + + echo "
"; + + print_table($table); + + print_footer($course); + + +?> + diff --git a/mod/resource/lib.php b/mod/resource/lib.php new file mode 100644 index 0000000000..f918a04dd4 --- /dev/null +++ b/mod/resource/lib.php @@ -0,0 +1,135 @@ + get_string("resourcetype1", "resource"), + WEBPAGE => get_string("resourcetype2", "resource"), + UPLOADEDFILE => get_string("resourcetype3", "resource"), + PLAINTEXT => get_string("resourcetype4", "resource"), + WEBLINK => get_string("resourcetype5", "resource"), + HTML => get_string("resourcetype6", "resource") ); + +function resource_list_all_resources($courseid=0, $sort="name ASC", $recent=0) { + // Returns list of all resource links in an array of strings + + global $CFG, $USER; + + if ($courseid) { + if (! $course = get_record("course", "id", $courseid)) { + error("Could not find the specified course"); + } + + require_login($course->id); + + } else { + if (! $course = get_record("course", "category", 0)) { + error("Could not find a top-level course!"); + } + } + + if ($resources = get_all_instances_in_course("resource", $course->id, $sort)) { + foreach ($resources as $resource) { + $link = "wwwroot/mod/resource/view.php?id=$resource->coursemodule\">$resource->name"; + if ($USER->editing) { + $link .= "    + wwwroot/course/mod.php?delete=$resource->coursemodule\">wwwroot/pix/t/delete.gif\" BORDER=0 ALT=Delete> + wwwroot/course/mod.php?update=$resource->coursemodule\">wwwroot/pix/t/edit.gif\" BORDER=0 ALT=Update>"; + } + $links[] = $link; + } + } + + return $links; +} + + +function resource_user_outline($course, $user, $mod, $resource) { + if ($logs = get_records_sql("SELECT * FROM log + WHERE user='$user->id' AND module='resource' + AND action='view' AND info='$resource->id' + ORDER BY time ASC")) { + + $numviews = count($logs); + $lastlog = array_pop($logs); + + $result->info = get_string("numviews", "", $numviews); + $result->time = $lastlog->time; + + return $result; + } + return NULL; +} + + +function resource_user_complete($course, $user, $mod, $resource) { + global $CFG, $THEME; + + if ($logs = get_records_sql("SELECT * FROM log + WHERE user='$user->id' AND module='resource' + AND action='view' AND info='$resource->id' + ORDER BY time ASC")) { + + $numviews = count($logs); + $lastlog = array_pop($logs); + + $strmostrecently = get_string("mostrecently"); + $strnumviews = get_string("numviews", "", $numviews); + + echo "$strnumviews - $strmostrecently ".userdate($lastlog->time); + + } else { + print_string("neverread", "resource"); + } +} + +function resource_add_instance($resource) { +// Given an object containing all the necessary data, +// (defined by the form in mod.html) this function +// will create a new instance and return the id number +// of the new instance. + + $resource->timemodified = time(); + + return insert_record("resource", $resource); +} + + +function resource_update_instance($resource) { +// Given an object containing all the necessary data, +// (defined by the form in mod.html) this function +// will update an existing instance with new data. + + $resource->id = $resource->instance; + $resource->timemodified = time(); + + return update_record("resource", $resource); +} + + +function resource_delete_instance($id) { +// Given an ID of an instance of this module, +// this function will permanently delete the instance +// and any data that depends on it. + + if (! $resource = get_record("resource", "id", "$id")) { + return false; + } + + $result = true; + + if (! delete_records("resource", "id", "$resource->id")) { + $result = false; + } + + return $result; +} + + +?> diff --git a/mod/resource/mod.html b/mod/resource/mod.html new file mode 100644 index 0000000000..d0c1b0dba0 --- /dev/null +++ b/mod/resource/mod.html @@ -0,0 +1,46 @@ +
+ + + + + + + + + + + + + +

:

+ +

:

+ dirroot/mod/resource/lib.php"); + asort($RESOURCE_TYPE); + if (!$form->type) { + $form->type = 4; + } + choose_from_menu($RESOURCE_TYPE, "type", $form->type, ""); + helpbutton("resourcetype", get_string("resourcetype", "resource"), "resource"); + ?> + +

:

+ + +
+
+ + + + + + + + + + + +"> +
+
diff --git a/mod/resource/version.php b/mod/resource/version.php new file mode 100644 index 0000000000..a2c41c2025 --- /dev/null +++ b/mod/resource/version.php @@ -0,0 +1,11 @@ +version = 2002101700; +$module->cron = 0; + +?> diff --git a/mod/resource/view.php b/mod/resource/view.php new file mode 100644 index 0000000000..a85ab7be79 --- /dev/null +++ b/mod/resource/view.php @@ -0,0 +1,131 @@ +course)) { + error("Course is misconfigured"); + } + + if (! $resource = get_record("resource", "id", $cm->instance)) { + error("Resource ID was incorrect"); + } + + $strresource = get_string("modulename", "resource"); + $strresources = get_string("modulenameplural", "resource"); + $strlastmodified = get_string("lastmodified"); + + if ($course->category) { + require_login($course->id); + $navigation = "id\">$course->shortname -> + id\">$strresources ->"; + } else { + $navigation = "id\">$strresources ->"; + } + + switch ($resource->type) { + case 1: // Reference (eg Journal or Book etc) + add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", "$resource->id"); + print_header("$course->shortname: $resource->name", "$course->fullname", "$navigation $resource->name", + "", "", true, update_module_button($cm->id, $course->id, $strresource)); + + print_simple_box($resource->reference, "center"); + echo "

"; + echo text_to_html($resource->summary); + echo "

"; + echo "

 

"; + echo "

$strlastmodified: ".userdate($resource->timemodified)."

"; + echo "
"; + print_footer($course); + break; + + case 5: // Web Link + add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", "$resource->id"); + redirect($resource->reference); + break; + + case 2: // Web Page + if ($frameset) { + print_header("$course->shortname: $resource->name", "$course->fullname", + "$navigation reference\" TITLE=\"$resource->reference\">$resource->name", + "", "", true, update_module_button($cm->id, $course->id, $strresource)); + echo "
".text_to_html($resource->summary, true, false)."
"; + + } else { + add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", "$resource->id"); + echo "$course->shortname: $resource->name\n"; + echo ""; + echo "id&frameset=true\">"; + echo "reference\">"; + echo ""; + } + break; + + case 3: // Uploaded File + if ($frameset) { + print_header("$course->shortname: $resource->name", "$course->fullname", "$navigation $resource->name", + "", "", true, update_module_button($cm->id, $course->id, $strresource)); + echo "
".text_to_html($resource->summary, true, false)."
"; + + } else { + add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", "$resource->id"); + if ($CFG->slasharguments) { + $ffurl = "file.php/$course->id/$resource->reference"; + } else { + $ffurl = "file.php?file=/$course->id/$resource->reference"; + } + echo "$course->shortname: $resource->name\n"; + echo ""; + echo "id&frameset=true\">"; + echo "wwwroot/$ffurl\">"; + echo ""; + } + break; + + case 4: // Plain text + add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", "$resource->id"); + print_header("$course->shortname: $resource->name", "$course->fullname", "$navigation $resource->name", + "", "", true, update_module_button($cm->id, $course->id, $strresource)); + + print_simple_box(text_to_html($resource->alltext), "CENTER", "", "$THEME->cellcontent", "20"); + + echo "

$strlastmodified: ".userdate($resource->timemodified)."

"; + + print_footer($course); + break; + + case 6: // HTML text + add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", "$resource->id"); + print_header("$course->shortname: $resource->name", "$course->fullname", "$navigation $resource->name", + "", "", true, update_module_button($cm->id, $course->id, $strresource)); + + print_simple_box_start("CENTER", "", "$THEME->cellcontent", "20"); + + echo $resource->alltext; + + print_simple_box_end(); + + echo "

$strlastmodified: ".userdate($resource->timemodified)."

"; + + print_footer($course); + break; + + default: + print_header("$course->shortname: $resource->name", "$course->fullname", "$navigation $resource->name", + "", "", true, update_module_button($cm->id, $course->id, $strresource)); + print_heading($resource->name); + + print_simple_box("Error: unknown type of resource", "center"); + + print_footer($course); + break; + } + + +?> diff --git a/version.php b/version.php index c6f0c0bbb0..fa28efea28 100644 --- a/version.php +++ b/version.php @@ -5,7 +5,7 @@ // database to determine whether upgrades should // be performed (see lib/db/*.php) -$version = 2002101700; // The current version is a date (YYYYMMDDXX) +$version = 2002101701; // The current version is a date (YYYYMMDDXX) $release = "1.0.6 dev 2"; // User-friendly version number