Compare commits

..

1026 Commits

Author SHA1 Message Date
moodler 81716d0d33 I'm going to start packaging the release this evening (in about 7 hours).
Any last-minute little bug fixes are very welcome!
2003-05-29 03:22:56 +00:00
moodler 658bf42b26 One new string! :-/ 2003-05-29 03:20:33 +00:00
moodler 3ee8f1715f Added a button on the language page that takes you to the moodle.org
page to download new language packs
2003-05-29 03:20:11 +00:00
moodler 2334e9083c Minor bug fixes 2003-05-29 03:09:37 +00:00
moodler 4a6a574f2a Robustness on finding country name 2003-05-29 03:06:10 +00:00
moodler a205123f06 Fixed page title 2003-05-29 03:02:10 +00:00
moodler a6ee2f5e7d Some minor fixes 2003-05-29 02:36:25 +00:00
moodler 8590fd913d French Canadian translation, based on French, by Jean-Fran?ois Nadeau <JFNadeau@coll-outao.qc.ca> 2003-05-29 02:33:38 +00:00
moodler e7f72d1658 Removed a typo 2003-05-29 02:27:04 +00:00
stronk7 64eed73fa2 Changed bahabior when restoring into a existing course
(don't create sections and assign to section 0 if original
section doesn't exist). Everything is saved in backup_ids
to use it when restoring modules.
2003-05-28 23:41:56 +00:00
stronk7 381ae36075 User files and course files are now working !! 2003-05-28 19:48:10 +00:00
stronk7 1bdeb2ca8e Implemented copying course_files and user_files. 2003-05-28 19:43:11 +00:00
stronk7 8af2a809fb Little modification to show course's full name and short name too. 2003-05-28 18:18:45 +00:00
coolbit 5d224d17b6 Added workshop help files. 2003-05-28 14:37:34 +00:00
coolbit f001154b33 *** empty log message *** 2003-05-28 14:21:10 +00:00
koenr bca7452938 Translated by Koen Roggemans 2003-05-28 12:42:58 +00:00
moodler b366308091 Just about there ... 2003-05-28 08:01:15 +00:00
moodler f38485140c Fixed a bug 2003-05-28 07:43:51 +00:00
moodler 258be26525 Updated translation from Stig Bjarne Haugen (Stig.B.Haugen@hinesna.no) 2003-05-28 07:42:54 +00:00
moodler 5f4c712ea8 Updated translation for 1.0.9 from Emmanuelle Gutierrez y Restrepo (emmanuelle@sidar.org) 2003-05-28 07:16:41 +00:00
moodler 6d9aa82c99 New file 2003-05-28 06:43:25 +00:00
moodler 4c5686d97f Complete 1.0.9, from Claudio Tavares (claudio@enlaceacademico.com) 2003-05-28 06:42:26 +00:00
stronk7 d688c342ad Begin restoring user files. 2003-05-27 22:37:05 +00:00
stronk7 3f676beac0 Finished restoring users.
Now, if selected, restore user files (in progress).
2003-05-27 22:34:29 +00:00
mits 978962c8bb Broken character fixed. 2003-05-27 21:41:41 +00:00
mits 87cc153beb New translation added. 2003-05-27 21:36:05 +00:00
moodler 7647e09126 Fix the version in case I forget later 2003-05-27 16:53:16 +00:00
moodler 0fcd21c3bc Updated the year 2003-05-27 15:21:14 +00:00
moodler b09069a4c7 Various updates, rewrites etc
Overall I'm trying to remove the Martin focus and make it more neutral.

More to go.
2003-05-27 15:18:20 +00:00
mits 576fd161a0 Mod 2003-05-27 14:57:05 +00:00
moodler 16cba4cf88 Latest changes from Howard Miller 2003-05-27 14:25:15 +00:00
moodler fc55b4e900 Latest changes from Howard 2003-05-27 14:24:06 +00:00
moodler ab8c78b03a Getting close now 2003-05-27 03:39:03 +00:00
moodler ba6c4a8701 Fixed a typo (thanks Mits!) 2003-05-27 02:14:44 +00:00
moodler 6337086aca New file 2003-05-27 01:53:52 +00:00
moodler 111bfff48a Latest files from Wim! 2003-05-27 01:52:48 +00:00
koenr 31d7714a84 More strings translated, based on the job by Hans De Zwart. Changed upgeload by ge?pload 2003-05-26 21:54:24 +00:00
koenr 68225f50b4 no message 2003-05-26 21:52:09 +00:00
mits b9f0af5fb0 Polished 2003-05-26 17:49:37 +00:00
mits 7fe2220fc0 New translation. 2003-05-26 17:42:50 +00:00
mits a26d994d2b New translation and Polish 2003-05-26 17:24:37 +00:00
mits e7d1f700d9 New translation. 2003-05-26 16:45:28 +00:00
mits 9fc3e0ebef Polished. 2003-05-26 16:37:12 +00:00
mits cee7b95a10 Polished. 2003-05-26 16:29:06 +00:00
minkowski f933b27c32 revised and rephrased for 1.09 2003-05-26 16:28:05 +00:00
moodler 16ba73512e Slight improvements to import of global variables
- don't globalise cookies
  - better checking of lang variables
2003-05-26 15:38:52 +00:00
mits 84a8415baf *** empty log message *** 2003-05-26 15:32:16 +00:00
mits f6590fb484 Polished 2003-05-26 15:28:57 +00:00
moodler 3662bce5b4 A few tweaks for robustness. 2003-05-26 14:43:19 +00:00
moodler 1dd2451954 Some minor cleanups and debugging of initial setup 2003-05-26 14:38:41 +00:00
moodler 8d2accb64c More robust check of argument 2003-05-26 07:54:53 +00:00
moodler 02e44e7cf4 Print better loggedin info at the top of the page 2003-05-26 07:54:34 +00:00
moodler 8df45f47bd FIxed all moodle.com links 2003-05-26 07:07:53 +00:00
moodler 399266ce40 Removed the non-breaking space &nbsp; from the section summaries because
it would cause problems when the summary ended in a URL
2003-05-26 06:58:10 +00:00
koenr 03fa434bb3 New strings translated, based on the translation by Hans De Zwart 2003-05-26 06:14:42 +00:00
moodler 644f6213f1 Removed funny line feeds? Hope so. 2003-05-26 02:44:29 +00:00
moodler 8fad496688 Still trying to get this retun situation sorted out 2003-05-26 02:42:49 +00:00
moodler c451c1f6bd Removed mystery character? 2003-05-26 02:40:26 +00:00
moodler c8ddb345b9 DOS format 2003-05-26 02:32:11 +00:00
moodler 05c7ec6f2b Trying to force DOS format 2003-05-26 02:20:39 +00:00
moodler f7a6049e57 Checking in the include error code in again, with improvements
The problems I thought were happening were in fact another problem
on someone's installation (missing files).  This code now checks
for that too.
2003-05-26 01:54:11 +00:00
mits ff27a09eca Polished. 2003-05-26 01:39:21 +00:00
mits a166e72e43 New translation. 2003-05-26 01:38:29 +00:00
stronk7 4848d55a9e Few changes to gather info to show in restore progress
(various user counts (existing, new,...)
2003-05-26 00:07:56 +00:00
stronk7 0be7c25ebe Minor bug creating newid when restorinf users 2003-05-25 23:37:07 +00:00
stronk7 2f6c832d5c Included User restore. Hard work !!! 2003-05-25 23:02:09 +00:00
stronk7 a2c7397c42 Restore into new course and existing course implemented.
Restore sections and mod implemented.
Restore users (all, course and none) implemented
2003-05-25 22:58:13 +00:00
mits 4565e9cc0a New translation. 2003-05-25 22:02:50 +00:00
mits b1106eb5ba Polished 2003-05-25 21:58:22 +00:00
koenr 5f6604b578 no message 2003-05-25 21:52:13 +00:00
koenr 018dcb996d Thanks to Kris Gonnissen and Gerd Cornelissen for help and review 2003-05-25 21:49:49 +00:00
mits 131f438648 Polished. 2003-05-25 21:45:19 +00:00
mits bbc2e4226a Polished and New translation added. 2003-05-25 21:32:09 +00:00
palojacko ab34a057ed improved menu translation 2003-05-25 19:53:40 +00:00
mits 092c819e68 Character breaking fixed. 2003-05-25 18:37:57 +00:00
mits 20598e0da3 New translation. 2003-05-25 18:34:25 +00:00
mits 06e9af99e7 New translation 2003-05-25 18:19:54 +00:00
mits df415fbf08 *** empty log message *** 2003-05-25 17:45:41 +00:00
mits 8bcabc74e2 New translation file. 2003-05-25 17:43:53 +00:00
mits 57bcdda9f5 New translation 2003-05-25 16:58:09 +00:00
mits d03e4db1b8 New translation. 2003-05-25 16:02:48 +00:00
mits 8a600d7d1d New translation. 2003-05-25 15:24:30 +00:00
moodler 3926deafe1 Removed three lines - this fixes the path problems occurring when
extracting files in Moodle on Windows platforms.

This should not affect normal use within Moodle on other platforms.
2003-05-25 12:46:17 +00:00
moodler c4ad9158e3 More robust check for $CFG->backup_version 2003-05-25 12:14:15 +00:00
moodler aa140aabfd Going back to old method, as the new one seems to have problems on some
platforms.
2003-05-25 12:11:10 +00:00
stronk7 0535cadae5 Included new "autosubscribe" fiel in users backup 2003-05-25 09:31:17 +00:00
coolbit a5eb9f335f *** empty log message *** 2003-05-25 01:26:48 +00:00
coolbit b391b14bda *** empty log message *** 2003-05-24 16:55:18 +00:00
coolbit 09026b19d9 add forum helps 2003-05-24 16:49:36 +00:00
coolbit 893e0c5c0b add shufflequestions.html 2003-05-24 15:52:02 +00:00
coolbit eefa6d6e06 add some help files. 2003-05-24 15:39:58 +00:00
mits 3c382acc28 New translation 2003-05-24 11:51:01 +00:00
mits bf442dc9d6 Polished 2003-05-24 11:40:23 +00:00
mits 0c59a23c67 text-decoration: underline problem fixed.
copy theme->standard->styles.php to theme->oceanblue->styles.php and
changed a:link, a:visited, a:hover
2003-05-24 11:30:58 +00:00
mits 7a6112792c Polished and New translation added. 2003-05-24 11:06:19 +00:00
stronk7 6a602d47e0 hanged info field in backp_ids to store text data
(used when restoring long portions of data)
2003-05-24 09:23:41 +00:00
stronk7 5881bb7e3c Changed info field in backp_ids to store text data
(used when restoring long portions of data9
2003-05-24 09:23:05 +00:00
moodler 40343df7fd Users were able to see their own user activity reports. This was a hang-over
from long time ago.  As there is no GUI for this, I'm removing it for now so
that students are not able to see their own activity reports.

This issue probably needs to be discussed, and a GUI developed for it.
2003-05-24 07:33:22 +00:00
moodler 783da26290 A bit of an audit and a clean up of require_login to add consistency.
No major problems found, just some code tidy-up
2003-05-24 07:29:17 +00:00
moodler 73fafc3886 Bad bug fixed. Non-teachers could hide/show whole sections. 2003-05-24 06:59:36 +00:00
moodler 522f608d02 Important bug fixed! Non-teachers could modify course! 2003-05-24 06:53:47 +00:00
moodler 12c55f3cd4 Fixed a few obviouos errors and excess blank lines in the language packs 2003-05-24 05:22:05 +00:00
moodler bb515027b5 The single quotes caused problem on the rare occasions that these
unset strings were being written to the database
2003-05-24 02:34:29 +00:00
moodler fe3b0f3a2f New string 2003-05-24 02:32:26 +00:00
moodler 5c0567b4cd Don't allow password changing if the user isn't confirmed yet 2003-05-24 02:25:57 +00:00
stronk7 8fdd5ab2b3 Advance a bit more.
Course, course_sections and course_modules finished.
We have to update instance (in course_modules) and modinfo
(in course) at the end of the restore. We haven't the necessary
info now.
2003-05-24 00:34:27 +00:00
stronk7 7ba7461530 Finished restoring course, course_sections and course_modules.
When ending the restore process, we've to update the instance
field of course_modules and the modinfo field of course. Now
we haven´t the necessary info to do that.
2003-05-24 00:27:45 +00:00
stronk7 47e9035598 In course_modules export the field ADDED too. 2003-05-24 00:23:35 +00:00
mits 7134ebc80b *** empty log message *** 2003-05-23 23:04:04 +00:00
mits feffd1dffe New translation 2003-05-23 22:58:24 +00:00
mits 0aa35815c4 Polished. 2003-05-23 22:47:35 +00:00
mits f897f346a3 New translation. 2003-05-23 22:18:11 +00:00
mits ac722cc42b *** empty log message *** 2003-05-23 21:58:30 +00:00
moodler 219633ea2b organised --> organized 2003-05-23 15:21:32 +00:00
moodler 5325f8b8cf A little more guidance on the quiz page. 2003-05-23 15:20:41 +00:00
moodler b39cadbfe7 Formatting fixes from Windows editor 2003-05-23 14:41:22 +00:00
moodler 020181047d Some hacks to stop the addition of blank lines on Windows machines during editing in the web forms. 2003-05-23 14:25:55 +00:00
moodler a3152e449d Fixed excess blanks using new admin/lang.php 2003-05-23 14:24:48 +00:00
coolbit 02997ce175 complete workshop.php 2003-05-23 13:37:03 +00:00
uermelin 499c23e8fc fullname changed from nachname to Bezeichnung 2003-05-23 09:09:51 +00:00
moodler d8e2e28044 Added a check to make sure CFG->dirroot is correct. 2003-05-23 08:54:36 +00:00
moodler 1cb2266ef7 Tweaking subscribe strings 2003-05-23 05:46:07 +00:00
moodler 40e5eb1b33 Slight rewording 2003-05-23 05:42:46 +00:00
moodler 7f2a3e678e New field for user: autosubscribe
This sets the default value for on-the-fly forum subscription.
Defaults to on = subscribe.

(Also fixed a bug in postgres7.sql - a missing field for htmleditor!)
2003-05-23 05:32:40 +00:00
moodler 4b2b7a7110 Full formatting looks bad (too much whitespace) but smilies are OK 2003-05-23 05:05:49 +00:00
moodler 6687be174a Improvements to the wordings for subscription 2003-05-23 05:00:58 +00:00
moodler f5ca7ebe1a Display forum intros as formatted text 2003-05-23 04:51:28 +00:00
stronk7 f698f3f394 Finished restore frontend. 2003-05-22 22:59:21 +00:00
stronk7 6157b82c7b none 2003-05-22 22:12:32 +00:00
stronk7 7c934d06ed Finished the check phase.
Tomorrow I'll start recovering course info !!
2003-05-22 22:11:17 +00:00
koenr b088919164 New strings translated. Workshop.php = new file => not complete yet 2003-05-22 20:45:12 +00:00
koenr 849f614bd1 no message 2003-05-22 19:57:56 +00:00
thepurpleblob dec96d4f2c Added question/answer formatting to wiki help 2003-05-22 10:52:26 +00:00
thepurpleblob b2878fc5ae Fixed problem with list lines not being formatted
Added CVS hooks for <hr> and Question/Answer (Q. and A.) lines
2003-05-22 10:41:40 +00:00
coolbit ab48c1bb53 *** empty log message *** 2003-05-21 17:07:57 +00:00
bobopinna ec3db5a310 New updates from Roberto Pinna 2003-05-21 15:26:28 +00:00
bobopinna 31861ff29c *** empty log message *** 2003-05-21 15:08:45 +00:00
moodler 7a1205eea9 Changed instructions for Windows to Tortoise CVS 2003-05-21 13:52:07 +00:00
moodler 70d9c95acf New updates from Roberto Pinna 2003-05-21 12:56:34 +00:00
moodler 0e3e960a33 New file for debugging purposes, simply shows phpinfo() 2003-05-21 09:50:17 +00:00
moodler d805c3462e Removed the remote debugging functions.
I used to find these quite useful for helping people debug
configuration problems. I don't think they present a security
problem, but I can see there is the possibility that it can
be PERCEIVED as an issue, and I don't want to be responsible
for that, nor blamed for any break-ins (warranty or not).

So I'll find another way to do remote debugging.
2003-05-21 09:39:51 +00:00
moodler c3219da409 Much improved favicons (transparent and more consistent)
submitted by jdell (bug 442).
2003-05-21 08:48:18 +00:00
moodler c7ba7904cb Ray prefers icon3.gif 2003-05-21 08:13:08 +00:00
moodler be23a53ca9 Some fixes, after some testing 2003-05-21 06:10:43 +00:00
moodler 79da6d8717 Change to parsing to allow answers in any order - needs testing 2003-05-21 05:00:44 +00:00
mits 931ade40e3 New translation 2003-05-20 21:43:15 +00:00
paca70 f64fb7b192 Updates from Teemu Sumi. Thanks again! 2003-05-20 17:27:25 +00:00
moodler 353d033843 get_course_users now calls get_site_users if the course is a site.
There is something wrong with this SQL still though ... it mostly works
but I'm still getting wierd behaviour with small numbers of users.

Need some help here ...  for example just look at get_site_users()
on your test site.

It's supposed to return a list of users who are admins, creators,
teachers or students
2003-05-20 09:33:30 +00:00
moodler 35d606e6fa Just incrementing 2003-05-20 08:17:45 +00:00
moodler 11697b48ea Minor code cleanups
- lowercasing
  - removing short php tags
  - adding some emoticon help here and there
2003-05-20 08:03:12 +00:00
moodler 60ffb53a7d Minor code cleanup 2003-05-20 08:01:40 +00:00
moodler b5987b0f49 Added missing style - .forumpostheadertopic 2003-05-20 06:17:06 +00:00
moodler b1f505771e Fixed the bug I introduced in the last checkin (it was related to the
re-introduction of text fields in surveys)   See bug 441
2003-05-20 04:26:57 +00:00
stronk7 91d7f813e5 Initial checks. More to do !! 2003-05-19 22:34:12 +00:00
stronk7 304d7785ca Now all the required variables are set to call restore_check.html 2003-05-19 22:33:45 +00:00
stronk7 7e092fdaed Now call restore_check.html too. 2003-05-19 22:28:39 +00:00
stronk7 3f50cab58d Checks everything is OK before lanunch the process. It allows to
select the destination course.
Initial version, it doesn't work !!
2003-05-19 19:29:51 +00:00
stronk7 8d5b052f35 Now, one more step. Call to restore_check.html 2003-05-19 19:28:14 +00:00
paca70 844bad05a9 Updates. Thanks to Teemu Sumi. 2003-05-19 17:32:45 +00:00
moodler ad03ae446e Many corrections ... more needed 2003-05-19 15:34:27 +00:00
moodler 043b94f66d Glossary file from John Captain 2003-05-19 15:08:42 +00:00
moodler b95c3ab896 Add slashes to data when setting up guest account 2003-05-19 13:14:29 +00:00
moodler 779a4a8da4 Fixed up some of the headers during installation (remove logout links). 2003-05-19 13:12:27 +00:00
moodler 54242af0d6 Changed default strings to use single-quotes and avoid possible slash problems 2003-05-19 07:41:12 +00:00
moodler e9564a5a80 Fixed previous over-zealous lowercasing 2003-05-19 06:11:56 +00:00
moodler 240aca4b34 missing closing php tag 2003-05-19 04:55:11 +00:00
moodler 5d0f5a599b Removing strings make no worky worky 2003-05-19 03:34:57 +00:00
moodler 3ee236820a Some fixes for check_gd_version -- please test this for me on every server you have! 2003-05-19 03:27:13 +00:00
moodler 17ec8eb684 Remove unnecessary check (from a lazy copy/paste) 2003-05-19 03:03:34 +00:00
moodler 8c5b0c41bb Updated docs to use php_flag instead of php_value for booleans 2003-05-19 02:31:14 +00:00
moodler 730cb6bac3 Updated docs about using php_flag settings instead of php_value 2003-05-19 02:28:47 +00:00
moodler 6a6681294a Should use php_flag, not php_value, for boolean settings!!
See bug 429
2003-05-19 02:25:11 +00:00
stronk7 96376e9a4f Finalized. Form data is displayed dinamically, depending of
every mod features and the backup file-contents.
2003-05-18 22:57:23 +00:00
stronk7 96112b5224 Initial version. Does nothing !!, but needed to show info in
restore_form.php
2003-05-18 22:55:54 +00:00
stronk7 f2deadb30c Control when cancel has been selected. Inform and finalize. 2003-05-18 22:53:11 +00:00
stronk7 87d8623181 One more string to restore. Forget it in previous commit. ;-) 2003-05-18 22:51:52 +00:00
stronk7 4c94c21b11 Some restore strings... 2003-05-18 21:43:55 +00:00
stronk7 fd2f02d4cd Initial version. Form to select where and what to restore. 2003-05-18 21:41:08 +00:00
paca70 775f689b0f Some additions for postgresql 2003-05-18 18:23:07 +00:00
stronk7 c563a9a0d1 added check login, check admin and check site to every page.
If not, it was possible to execute them...!!
2003-05-18 17:15:05 +00:00
stronk7 cc7fa0dc05 Added a 4th OPTIONAL (default "get") parameter to
"print_single_button" function. Now can make "post"
forms too.
2003-05-18 16:41:23 +00:00
stronk7 729035fdaa Advance a bit more... 2003-05-18 15:54:01 +00:00
stronk7 76bf541df8 Course Header and Backup info is showed now !!
I'll start using sessions to mange all this data.
2003-05-18 15:51:20 +00:00
moodler 41a03b45f0 Added a stub for workshop_get_submission to stop errors on activity reports 2003-05-18 14:38:12 +00:00
moodler d41947c6be Some alternative icons for the workshop module!
Any comments, votes?
2003-05-18 09:28:42 +00:00
moodler c525b27592 Strip tags from page title, and some minor code cleanups 2003-05-18 06:05:23 +00:00
moodler 713386aadb Left out a field! mailformat 2003-05-18 02:36:02 +00:00
stronk7 fd43f7d026 Now course header is retrieved too !! 2003-05-17 17:34:30 +00:00
stronk7 48cbf566bb XML generation. Included the main course data under a HEADER tag.
Needed for recover.
2003-05-17 15:58:24 +00:00
moodler cd86c938b2 Some updates from Koen Roggemans 2003-05-17 12:44:28 +00:00
stronk7 ca2129424f Reading more info... 2003-05-17 11:40:27 +00:00
stronk7 a4ad03f175 Debug a bit 2003-05-17 08:56:53 +00:00
moodler 8b50d2a76e Some fixes to make choice reports work better when used at site level.
PLus some HTML lowercasing
2003-05-17 06:17:10 +00:00
moodler 06cffaf0bb No need to get all the user data for forum_subscribed_users 2003-05-17 06:13:38 +00:00
moodler bbf9b1624d Improved get_site_users a bit for efficiency 2003-05-17 06:10:20 +00:00
moodler 2563c5ef7b Improvements to trustworthiness of the registry form (for suspicious admins!)
Hashed password is no longer sent as a key, "secret" field is used instead.

HTML code is now more readable for the View Source crowd.  :-)
2003-05-17 05:34:49 +00:00
moodler 6879123761 This seems to help too. 2003-05-17 05:06:08 +00:00
moodler eab79dc13d Hopefully this will fix the logout problems - it now specifically
checks for PHP 4.3.0 or later, and also does the unset anyway.

Sessions are not consistent in PHP versions.
2003-05-17 04:45:52 +00:00
moodler 958facf055 Better cleanup of site description meta tag 2003-05-17 03:46:31 +00:00
moodler 14159d0960 Post beta 1 stage 2003-05-17 03:16:30 +00:00
moodler 07b586eaa3 Use global variable for phpinfo debugging info 2003-05-17 03:10:22 +00:00
moodler 7170501293 Better detection of register_globals 2003-05-17 03:05:39 +00:00
moodler 4d01ada343 More on Bug 427_ on second thoughts it's better this way, now at least
the true/false entries get updated every time the question is updated.
2003-05-17 03:02:59 +00:00
moodler a6ccb416f1 This should fix the non-translatability of true/false questions bug 427 2003-05-17 02:54:20 +00:00
moodler fcb12a1e0c Every line had three blank lines after it - please be careful Ursula 2003-05-17 02:31:31 +00:00
moodler c39c66a5e8 Using new ini_get_bool function to work around a bug with ini_get where
the result is different for items set in htaccess
2003-05-17 02:05:10 +00:00
stronk7 785ae439eb Begin parsing xml data.
Info tags.
2003-05-16 23:57:35 +00:00
stronk7 d348c53f1f Simple advance. None to do in DB. 2003-05-16 22:05:50 +00:00
stronk7 880fd2146c Updated. Some preliminary steps about restoring done. 2003-05-16 22:04:06 +00:00
stronk7 b9846a9b9e Copy, expand and do preliminary checks from backup file 2003-05-16 21:52:49 +00:00
stronk7 7641819df0 Moved the check_version code to lib.php
Formatted portions of code
2003-05-16 21:51:07 +00:00
stronk7 740aa005dc Interchange delete old data and create temp structures. The first time
an error ocurred, because we were trying to access an no-existent dir.
2003-05-16 17:36:47 +00:00
mits c061b8d2a5 New translation added. 2003-05-16 12:01:41 +00:00
mits 9ba291e88d Polished and New translation added. 2003-05-16 11:19:26 +00:00
uermelin 67d5ab6dc1 Licenz changed to Lizenz 2003-05-16 11:07:58 +00:00
uermelin 05c1cfba93 changed filloutthreequestions, savemyAnswers, marks 2003-05-16 11:06:32 +00:00
uermelin 71f64e123b bug in emailpasswordsent removed 2003-05-16 09:57:21 +00:00
moodler bf2919bf84 Some stuff about workshop 2003-05-16 08:53:22 +00:00
moodler 30739c3daf Added registration info 2003-05-16 08:51:10 +00:00
moodler bfe42924da Latest tags for vi etc 2003-05-16 07:04:09 +00:00
moodler 67fb6d3aaf Added a missing string 2003-05-16 06:40:46 +00:00
moodler 69ec0a8b1d Moved info about automatic unenrolling to the top where it makes more sense
I think.
2003-05-16 06:27:23 +00:00
moodler 5c219ea46d Added hyphen (-) to the list of allowed characters in a filename 2003-05-16 06:08:42 +00:00
moodler 60a60432a1 Explicit casting to (bool) may help 4.2.3 2003-05-16 04:47:40 +00:00
moodler 3a4c2fd089 I knew there was something else I'd forgotten!
Added a check to all modules (well view.php anyway) to check whether a
module is hidden or not.  If it is, then students get a message.
2003-05-15 18:03:22 +00:00
moodler 610603be4d More tweaks 2003-05-15 17:31:56 +00:00
moodler 7adf67875d Some notices to remind people about things they need to do. 2003-05-15 17:26:59 +00:00
moodler cf565fd7cf OK, this is pretty much time to call it 1.0.9 Beta 1 ... I'm going to
do a few last checks then tag it as "Moodle_109_B1" and package it all up.
2003-05-15 17:16:15 +00:00
moodler 33de9f7bdc FIxed bug where questions weren't being shown in reviews. 2003-05-15 17:01:35 +00:00
moodler 17df1ae4bd Obsolete 2003-05-15 16:17:37 +00:00
moodler 455d308f5d Some updates 2003-05-15 16:16:53 +00:00
moodler ae384ef160 New configuration variable: secureforms (defaults to 'true')
Replaces the old $CFG->buggy_referer (reverses it, in fact) and can
now be set in the configuration page (no need for it in config.php).
2003-05-15 15:59:52 +00:00
moodler 6bebcf8d72 Some minor cleanups, nothing functional, just code-level niceness mostly.
- xhtml cleanups, mostly from Peter Bazira
   - removed all short php tags
2003-05-15 14:34:48 +00:00
moodler c6a0f9d5bf Minor touch-ups to the front page HTML 2003-05-15 14:02:13 +00:00
moodler e48feed988 Many little clean-ups for themes.
- Got rid of obvious non-XHTML code in headers and footers.
  - Got rid of all the PHP short tags
  - Added new styles for the headers
2003-05-15 13:55:22 +00:00
mits 3e54b808bc Polished. 2003-05-15 13:15:44 +00:00
mits 0817d5cac0 New translation. 2003-05-15 13:14:40 +00:00
moodler ce729f49c8 New override for Apache's LimitRequestBody parameter which may limit files. 2003-05-15 11:15:55 +00:00
stronk7 0f192e2cd6 Initial version of restore. Simply, a copy from backup.php 2003-05-14 23:25:00 +00:00
stronk7 01a16f7e5e Lib to include all backup particulary functions (came from lib.php), but
desglosed now
2003-05-14 23:24:00 +00:00
stronk7 5aca97a20a Reset to empty lib before start developing 2003-05-14 23:22:50 +00:00
stronk7 476fd9c716 Minor changes to support the "restore" option with zip files. Only
showed if the backup utility is installed ($CFG->backup_version exists)
and the user is an admin. Sent email to Martin to say him this !!
2003-05-14 23:09:34 +00:00
stronk7 52376d940f Now backuplib.php includes all the functions needed in backup, restorelib.php all
the functions needed in restore and lib.php the rest of common functions.
2003-05-14 22:09:30 +00:00
moodler d288fa5255 Better code to deal with shuffleorder.
Now feedback is always in the same order as the quiz, and
reports are always in the natural order.
2003-05-14 16:52:25 +00:00
moodler a53cef7e80 Removed obsolete get_users_search function 2003-05-14 16:29:26 +00:00
moodler d8eece23c9 Revamped "Assign Creators" page with the same code as admins and teachers 2003-05-14 16:27:27 +00:00
moodler 46a244605d Some little fixes (can only see them on a server with lots of users!) 2003-05-14 16:05:21 +00:00
moodler e808d25f56 Fixed up "Assign teacher" page, and moved it to admin directory. 2003-05-14 15:58:48 +00:00
moodler ada728e24d Fix the order of questions when shuffle is NOT being used.
See bug 423 for details: http://moodle.org/bugs/bug.php?op=show&bugid=423
2003-05-14 15:23:54 +00:00
moodler 5a74165523 FIxed up function get_user() which now takes lots of parameters and
can be used all over the place.

Also, related fixes to "add admin" (MUCH better performance) and the user listings

More to come for "add teacher" and "add creator"
2003-05-14 15:19:04 +00:00
moodler 9a2efc9fb0 Don't be so pushy about subscription 2003-05-14 07:47:04 +00:00
moodler 76c1650d02 Changed home page link to moodle.org (from moodle.com)
I did some heavy thinking about this, and I think this is
best for the community.  I had wanted to drive some traffic
past moodle.com (the moodle.com will feature very prominent
links to moodle.org).  What I'll do now, I think, is put a
advertisements on http://moodle.org pointing to moodle.com.

Also some lowercasing of HTML.
2003-05-14 05:01:01 +00:00
moodler b086c2b527 Fixed variable name 2003-05-14 03:37:47 +00:00
moodler edea91f37b Fixed links in emails 2003-05-14 03:23:01 +00:00
moodler b13f7b84ec New Taiwanese (Traditional Chinese) version by Fu-Kwun Hwang (hwang@phy.ntnu.edu.tw)!
Strings mostly done, and about half the help files.
2003-05-14 02:43:27 +00:00
adamtpaw ce3b1d1f7d small corrections 2003-05-13 21:14:28 +00:00
stronk7 4f446b2e36 Minor changes in course_files_check_backup to avoid the backup
of files under get_string("backupdir")
2003-05-13 19:53:17 +00:00
mits 21951923a5 New translation. 2003-05-13 17:00:00 +00:00
rkingdon 16a0e6f05c Addition of teacher admin features 2003-05-13 16:37:47 +00:00
moodler e9d3eca323 Re-order list for consistency 2003-05-13 16:37:34 +00:00
rkingdon 72a2547d05 Some missing strings added; plus strings for admin 2003-05-13 16:33:34 +00:00
rkingdon daec2fede2 Minor change to wording 2003-05-13 16:29:54 +00:00
moodler ae078a9809 Mail-outs for assignment and journal module are now translatable. 2003-05-13 16:02:08 +00:00
moodler 0a9f61b55f When posting a forum, users can unsubscribe/subscribe on the fly.
The flag has a memory, but it keeps pushing you to subscribe.  :-)
(so that by default it behaves like it did before)

Hopefully now subscription is a bit easier to understand.
2003-05-13 13:53:36 +00:00
moodler ac4f6d455f Images are not put in a frame, but embedded in a normal page 2003-05-13 07:51:26 +00:00
moodler fa6a30b75c Added release and version information to registration 2003-05-13 07:35:18 +00:00
moodler 4bcc7ebfd6 Slight update to a string 2003-05-13 01:18:54 +00:00
rkingdon 56a800aac5 Correcting bugs in agreement of assessment and for self assessed
submissions
2003-05-12 21:18:21 +00:00
coolbit 6cdbd5d52a some modification 2003-05-12 15:53:08 +00:00
moodler 64900c048e If you can see this - please try the new admin registration interface! 2003-05-12 15:40:11 +00:00
moodler fe930cf3ca New feature - registration page. Registration should be working,
but I'm still working on the server-side stuff.

Look for the new button on the admin page.
2003-05-12 11:30:19 +00:00
moodler a0deb5db60 Add a backdoor for match_referer ... if the referer is "nomatch" then
it always returns true.
2003-05-12 09:22:00 +00:00
moodler 6a7ce0c1ab Some new strings for the registration function 2003-05-12 09:05:43 +00:00
moodler 170a9c4612 Force subscription on a teacher's forum only includes teachers! 2003-05-12 09:01:23 +00:00
moodler 393c9b4ff4 Fixes for detect_munged_arguments() and default values for p() s() etc 2003-05-12 06:35:32 +00:00
moodler 3551966092 Added new FAQ and fixed the TOC a bit 2003-05-12 05:49:06 +00:00
stronk7 f11d6df519 Survey backup included. 2003-05-11 22:44:40 +00:00
stronk7 af478c0b2b Avoid counting files under get_string("backupdir") as course files 2003-05-11 22:17:56 +00:00
stronk7 9025fec405 Choices are now backupables 2003-05-11 21:14:50 +00:00
stronk7 05b2871dfa Change in comment 2003-05-11 21:13:45 +00:00
stronk7 d06863d95f No it's backupable too 2003-05-11 21:12:28 +00:00
stronk7 df52003fb1 Little bug ending submission tag 2003-05-11 19:47:12 +00:00
stronk7 14014fb7e1 Some backup words... 2003-05-11 17:46:55 +00:00
stronk7 4784696533 Backup finished.
Limitations:
   - Only assignment and resource mods are exported.
Little problems persit:
   - PCLZIP/UNZIP incompatibility
   - Do not count backup files in course_files_check_backup
2003-05-11 17:45:56 +00:00
stronk7 b294bc4b1d Zipping files.
Ok under command line. Bad under pcl lib
2003-05-11 11:06:23 +00:00
stronk7 543009a54d Updated. User and course files copied to backup dir 2003-05-11 00:16:32 +00:00
stronk7 667d2f2a86 User files and course files are saved selectively to backup directory 2003-05-11 00:14:11 +00:00
stronk7 23e3e468aa no comments 2003-05-10 17:49:56 +00:00
stronk7 d0ef834745 Preparing the user_files and course_files copy 2003-05-10 17:44:08 +00:00
stronk7 4f6ae69e0e Bug returning status 2003-05-10 17:31:33 +00:00
stronk7 efead3b909 Now generate mod info about assignments (with file copy to temp/backup)
and resources.
2003-05-10 17:25:20 +00:00
moodler 2f518143de Tidy up of a code - took out all the short PHP tags 2003-05-10 09:36:57 +00:00
moodler be912538fa Tidy up of code, including removal of short php tags 2003-05-10 09:29:53 +00:00
moodler 232d36dffa Some minor cleanups to this page, including removal of short php tags 2003-05-10 09:21:02 +00:00
moodler 215e628dcf Removed some debug statements I'd left in by mistake 2003-05-10 03:02:19 +00:00
stronk7 32ad57746b Avoid undefined backupable mods to be exported 2003-05-09 23:21:55 +00:00
adamtpaw 54157606e0 Few mistakes rem?ved. 2003-05-09 22:37:08 +00:00
rkingdon a3a4cd3ed6 Corrected bug in SQL for workshop_comments table 2003-05-09 22:13:03 +00:00
stronk7 537718f85a Included log generation to XML 2003-05-09 20:05:15 +00:00
moodler 9d85990f62 Some additions 2003-05-09 17:48:31 +00:00
moodler 6d3566f8d5 Black M 2003-05-09 17:43:46 +00:00
moodler 5867bfb50e New feature to manage installed code modules!
You can now hide/show individual activity modules and even delete them completely!

For example, if you hide the "choice" module, then all choice activities
will be hidden throughout the whole site, and "Choice" will not
appear on any "Add..." menu.

Deleting a module is a complete deletion of all data from the database.

If you want to try out the deletion on a real module, I suggest the
pgassignment module, since it will soon be deleted from CVS anyway
(because it's being replaced with workshop).

Look for "Manage modules" on the admin menu.
2003-05-09 17:24:17 +00:00
stronk7 cfb9c52577 User accounts are now included in XML generation 2003-05-09 14:57:41 +00:00
moodler 7e6b0b3b6e Added new 'visible' field for module management. 2003-05-09 13:32:27 +00:00
moodler 767141c19e Latest updates from Hans De Zwart 2003-05-09 12:47:56 +00:00
moodler 92ce3481fc Please don't put English docs in non-English packs ... they are changing
rapidly so these just go out of date for no reason.

Cheers,
Martin
2003-05-09 12:41:20 +00:00
compuproggy de1a5345cb Who is interested working in a free general open source translating network? Mails to
HS@interS4S,net
2003-05-09 07:18:14 +00:00
compuproggy d6be31eeed *** empty log message *** 2003-05-09 07:10:26 +00:00
moodler 6afe855886 Better tooltip help on post attachments 2003-05-09 06:03:47 +00:00
compuproggy 98a792faaf *** empty log message *** 2003-05-09 05:58:22 +00:00
moodler bbc0d9abbf IMPORTANT SECURITY FIX: prevents external PHP code from being run 2003-05-09 02:32:43 +00:00
moodler 9f71c9e713 Use the new $CFG->dbpersist variable in config.php to determine whether
to use persistent connections or not.  The default is to use them (for
speed/efficiency) but now they can be switched off with:

$CFG->dbpersist = false;
2003-05-09 02:20:03 +00:00
moodler 6c8e8b5ed4 IMPORTANT SECURITY FIX: this prevents bad characters being passed to help.php 2003-05-09 02:05:16 +00:00
moodler 3d9f0f81d6 IMPORTANT SECURITY FIX - this makes sure $CFG can not be overridden 2003-05-09 02:02:27 +00:00
rkingdon 9b09f7d0cd workshop: addition of peer agreement 2003-05-08 20:31:05 +00:00
rkingdon 319b375ecc workshop: add peer agreement 2003-05-08 20:26:51 +00:00
rkingdon 5c2ba38c45 version 1.1 with peer agreement 2003-05-08 20:24:41 +00:00
moodler 5f94c13b6b New version of Wiki stuff from Howard Miller.
Some cool new features, including linking to Moodle activities!
2003-05-08 16:20:38 +00:00
moodler e825f27967 New pop-up help page about smileys - clicking on the smiley inserts it
into the form using Javascript!

Also rationalised and patched some of the other help about text formats.

LANGUAGE EDITORS MAY WANT TO RE-CHECK:

   lang/en/help/textformat.html
2003-05-08 16:09:30 +00:00
moodler a9c2c8fd8f New "special" help file with javascript :-) 2003-05-08 16:03:57 +00:00
moodler eb7ec77d68 FIxed bug 406 - richtext setting resets! 2003-05-08 13:34:42 +00:00
compuproggy ac6e435422 *** empty log message *** 2003-05-08 06:55:32 +00:00
compuproggy a414246dc9 *** empty log message *** 2003-05-08 06:28:24 +00:00
compuproggy 729fbeee94 *** empty log message *** 2003-05-08 05:16:07 +00:00
coolbit 1f49a7b780 *** empty log message *** 2003-05-07 23:07:50 +00:00
stronk7 0915679c36 Updated. Sections included !!! 2003-05-07 22:18:05 +00:00
stronk7 52b538621e Changes to support xml sections generation.
And convert htmlentities an utf8
2003-05-07 22:15:14 +00:00
gregb_cc ea6e952d88 fix for bug 324. we are now checking to see if there is a conflict caused by
multiple teachers gradign simultaneously.
2003-05-07 20:53:24 +00:00
stronk7 95f6c01b03 Only admins can execute me !! 2003-05-07 16:09:34 +00:00
moodler e51de1e846 Fixed a typo 2003-05-07 15:08:50 +00:00
moodler ab74168b2d FIxed typo in favicon 2003-05-07 14:12:45 +00:00
moodler d94dc588ab Slightly better favicons 2003-05-07 13:04:52 +00:00
moodler d6513bbb0c Seemed like a good idea. 2003-05-07 11:57:10 +00:00
moodler 0f4f911059 Added .jpe as a JPEG (some people do it I notice! :-( ) 2003-05-07 11:43:08 +00:00
moodler e865ded4ba Don't treat Flash files (.swf) like other images. 2003-05-07 11:41:27 +00:00
moodler 0cb29cc411 Turn off PHP error reporting while connecting to database 2003-05-07 08:07:48 +00:00
moodler 4f5dbd132c Try persistent connection first, but if that fails for some reason then
automatically fall back to a non-persistent connection.
2003-05-07 08:03:43 +00:00
moodler f5fb84cee7 Small bug fixed where last question of a file wasn't detected if it
wasn't followed by a blank line
2003-05-07 05:46:01 +00:00
moodler 7aab220e4b Fixed typo 2003-05-07 02:13:24 +00:00
stronk7 fdcdc04730 Updated. XML generation (header & info only) 2003-05-06 23:01:53 +00:00
stronk7 3b8bad6ff0 Included support to clean /temp/backup automatically and to write
the xml file (header and info only)
2003-05-06 22:48:25 +00:00
stronk7 000969becd Included to get Moodle's version into xml file 2003-05-06 22:47:06 +00:00
moodler 2fb7c49f17 Undoing an accidental check-in. These were some experiments trying to
solve a Windows problem (not successful yet).
2003-05-06 16:06:56 +00:00
moodler 1f33691c86 Cleaned up the initial setup process. It looks a bit smoother now.
Hopefully this is also the end of the occasional errors we keep
hearing about to do with never getting to setup the admin user.
(I think admin/site.php had a redirect that didn't always work).

The setup process is now much better at "trapping" you until it's all done.
2003-05-06 15:58:20 +00:00
moodler 49543158f7 Upgraded to latest code, and add lots of new languages 2003-05-06 11:14:31 +00:00
moodler 851a89ff1b Minor fixes for re-inclusion and also links in email 2003-05-06 03:33:55 +00:00
moodler 813ec7ad65 Prevent guests from taking surveys 2003-05-06 03:06:06 +00:00
moodler fce1ce13c8 Hide admin links (eg grades) from guest accounts 2003-05-06 03:02:58 +00:00
moodler 266fbe1a8a Changes to improve hide/show of individual activities when the last
action was to hide/show a topic
2003-05-06 02:51:38 +00:00
moodler 5f350e8f6d Improvements for PLAIN FORMAT (links) plus some efficiency I think 2003-05-05 16:40:46 +00:00
moodler 01d799665d Better detection of URLs in brackets etc ... plus some tweaks 2003-05-05 16:28:40 +00:00
moodler b879effb4a Fixed bug that was not listing discussions that had identical subjects! 2003-05-05 16:21:45 +00:00
paca70 a918234e91 Postgres limit fix 2003-05-05 16:13:45 +00:00
moodler 11a876e1b6 Minor touches to notice() padding 2003-05-05 12:25:08 +00:00
moodler 4105fe9dd2 Added two styles: .noticebox and .noticeboxcontent 2003-05-05 12:17:34 +00:00
moodler 581d7b4959 Fixes for isadmin() 2003-05-05 11:38:54 +00:00
moodler bb19372c0f Some additions 2003-05-05 09:02:17 +00:00
moodler 068be67d83 Formatting fixes only 2003-05-05 08:31:04 +00:00
moodler 1e2fedeef0 Some additions etc 2003-05-05 08:25:53 +00:00
moodler ea23100a02 Style cleanups. Some consistency, converted all to Unix format, and
added manual setting of the MIME type.
2003-05-05 08:12:28 +00:00
moodler 2bc269fd7b Typo in javascript .... selectedindex should selectedIndex ! 2003-05-05 07:44:53 +00:00
stronk7 be4c89b86a Updated and new entries. Don't forget them !!! 2003-05-04 23:39:24 +00:00
stronk7 674b30f5f7 Begin the execute process. Created temporary structures (dir) 2003-05-04 23:24:48 +00:00
stronk7 39c4f15a40 Removed from CVS. Changed to backup_check.html and backup_form.html 2003-05-04 21:33:05 +00:00
stronk7 b0778a76c3 Changed to link with new files (backup_form.html, backup_check.html
and backup_execute.html)
2003-05-04 21:32:11 +00:00
stronk7 a615cc7bb6 Renamed from check.html, execute.html and backup.html to avoid
problems when doing restore.
Old files deleted from CVS
2003-05-04 21:29:27 +00:00
stronk7 3868b9c666 Finished the check phase. Ready to begin the execute phase. 2003-05-04 21:01:47 +00:00
paca70 465fd00e04 Lang column was missing from postgresql-files (?) 2003-05-04 16:05:59 +00:00
paca70 8a230a7d96 Better postgresql support for column creation 2003-05-04 16:03:45 +00:00
moodler 1215e52299 CVS is acting up 2003-05-04 15:18:25 +00:00
moodler d15cbab76f Remove dashes 2003-05-04 15:17:20 +00:00
moodler 93d64ea469 Get rid of dashes 2003-05-04 15:16:17 +00:00
moodler 1ea7c62794 Weeks now do show/hide too ... and some cleanups all round 2003-05-04 15:10:25 +00:00
moodler b37eb1bf00 Theme updates to suit new course formatting 2003-05-04 15:09:13 +00:00
moodler f50f74f6e4 Missed some pixels 2003-05-04 13:48:39 +00:00
moodler ff82802366 Slightly better logic 2003-05-04 13:44:56 +00:00
moodler 3bb49201b1 Some image spacing issues 2003-05-04 12:56:05 +00:00
moodler 2fe2985a53 Nicer eye :-) 2003-05-04 12:49:35 +00:00
moodler 8140c67e45 More tweaks to the topic interface ... nice light globes! 2003-05-04 12:34:43 +00:00
moodler a6d71a2199 Upgraded ADOdb to version 3.40
Works OK for me in tests under MySQL on my server
2003-05-04 11:59:49 +00:00
paca70 c0ba103ca7 Added transaction around table creation 2003-05-04 10:45:57 +00:00
mits cda45e5506 New translation added. 2003-05-04 10:28:13 +00:00
paca70 5ade559e8e updates 2003-05-04 09:56:35 +00:00
moodler 4fc61176b9 Some tweaks to some strings (hide/show) 2003-05-04 09:44:40 +00:00
moodler dfec7b013f Some clean ups - various things to do with Topics view 2003-05-04 09:43:03 +00:00
paca70 592188b42c First versions for postgres7 2003-05-04 08:56:30 +00:00
mits ffb71387cb no message 2003-05-04 08:36:53 +00:00
moodler 59345eb4ec Removed unused function 2003-05-04 08:36:32 +00:00
mits b2a47e2052 New translation added. 2003-05-04 08:31:16 +00:00
moodler 228b823898 Topic strings etc 2003-05-04 08:14:48 +00:00
moodler 59cd767a99 Beta workshop icon 2003-05-04 08:04:22 +00:00
moodler 46772d8c60 These icons are just temporary - they don't look great 2003-05-04 08:02:07 +00:00
moodler 7d99d6959e New feature: hide/show topics! 2003-05-04 07:59:46 +00:00
moodler 81ed361792 Added new style for hidden topics as well as some docs about
all the changes in this version
2003-05-04 07:58:15 +00:00
moodler 2627a658f8 Latest tags 2003-05-04 04:14:14 +00:00
moodler d342c76370 Added Wiki format as a system-wide format (forums, journals, etc)
Also, added better formatting to plain-text emails via a new function
in weblib.php  -  format_text_email
2003-05-04 04:07:36 +00:00
moodler d7c8a46bc5 Don't throw errors when deleting old logs and unsent mail 2003-05-04 03:46:15 +00:00
moodler 9f0b8269ac Fixed bug where text format of a new discussion was not being saved 2003-05-04 03:43:46 +00:00
moodler eb347b6b68 Fixes to improve the password recovery process. There is now a
confirmation step required before the password is changed and sent.

Also, many of the email texts have been cleaned up.

TRANSLATORS:  check your texts in moodle.php starting with "email.."
2003-05-04 03:00:52 +00:00
stronk7 1b502431a8 Commented the "needed users" option (too complex for this initial release).
Check all and course users.
2003-05-04 01:10:20 +00:00
stronk7 dfe5f88b3b Check mods and check users done 2003-05-04 01:05:58 +00:00
stronk7 b4bee933da Added some entries to the backup/restore utility 2003-05-04 00:01:43 +00:00
stronk7 afbe3de8cf Library to every functions related with the backup/restore matter 2003-05-03 23:20:38 +00:00
stronk7 04aa5b2de1 To mantain updated the db with the auto-update feature.
This file is for mysql installations. Every DB must have
its own file.
2003-05-03 23:19:07 +00:00
stronk7 c4c8f73c4a File that contains currect backup/restore version. To use with the
auto-update feature (copied from moodle main code).
2003-05-03 23:17:40 +00:00
stronk7 8cc242516e Changed to support the backup_ids table in all modules (to store and
convert ids in backup/restore.
Added a check_version (copied from main moodle auto-update) to mantain
changes in backup/restore system.
2003-05-03 23:15:43 +00:00
moodler 8980a4e8db Trying to unregister sessions properly and hopefully avoid the "compat"
warnings on some setups
2003-05-03 11:45:41 +00:00
adamtpaw 24a39b1761 Few corrections to inital translation. 2003-05-03 09:30:22 +00:00
moodler 984a8bf349 Two new language variables implemented.
langmenu  - turns the language menu on and off
langlist  - allows the admin to restrict and/or re-order the available language choices
2003-05-03 06:50:29 +00:00
moodler 107b010b43 Some random lowercasing 2003-05-03 06:49:37 +00:00
paca70 ea563f8f99 Postgres needs full longnames for indexes to prevent overlapping names. 2003-05-03 06:44:03 +00:00
moodler 3565715c76 Moved the "turn editing on" button and tidied some other things up a bit 2003-05-03 05:57:29 +00:00
moodler 005103e0bc Changed some function names, making room for export functions later 2003-05-03 04:31:49 +00:00
stronk7 141097ff80 Finalized every mod check 2003-05-02 23:32:02 +00:00
stronk7 d6545aefbc Check page finished (all mods except quiz). 2003-05-02 17:22:18 +00:00
moodler c6bcd06aba Tidied up the quiz imports a bit, and added AON as a format choice
Also added Scott Elliott's Blackboard module!
2003-05-02 15:31:24 +00:00
stronk7 02fee14e28 Changed the name of the backup 2003-05-02 14:48:11 +00:00
stronk7 82e8e7f569 Two new strings to backup function 2003-05-02 14:40:32 +00:00
stronk7 75da62deee changed backupnameformat 2003-05-02 14:39:54 +00:00
stronk7 519bd9342a Completed the module_check_backup_mods function (used in check.html) 2003-05-02 14:38:16 +00:00
stronk7 61ae5d36ca Modified the userdate() function. No changes needed when invoking it.
Added a new parameter (fixday->default true->old behavior) to avoid
formatting days when invoked with false value.
2003-05-02 09:37:41 +00:00
moodler b1834f2dde More tweaks 2003-05-02 08:42:31 +00:00
moodler 6f40f198d2 Tweaks 2003-05-02 08:35:02 +00:00
moodler e6622eda6a Simplified intro a bit 2003-05-02 08:29:35 +00:00
moodler c45855e551 Added FAQ about quotes 2003-05-02 01:24:27 +00:00
stronk7 7db29e6783 More strings to the backup utility 2003-05-02 00:58:34 +00:00
stronk7 10332943ca Add more things !! 2003-05-02 00:57:57 +00:00
stronk7 d67257815d Completed the module_check_backup_mods function (used in check.html) 2003-05-02 00:54:51 +00:00
stronk7 c53987bbb8 This file shows all the info gathered before launch the backup
process itself.
2003-05-02 00:53:40 +00:00
gregb_cc aa0959690c fixed isadmin so that it checks once on each page view if the user is an admin
fixed check_gd_version to properly identify bundled gd versions (old
check_gd_version was returning 0 instead of 2 for bundled gd).
2003-05-01 23:12:05 +00:00
mits 890a2cfeea New translation added. 2003-05-01 17:50:05 +00:00
stronk7 c5be7d8e8e Included Schema of evey mod (comments) and complete
assignments
2003-05-01 17:43:03 +00:00
stronk7 737c4885be Simplified a lot (I discover the variable variables in php !!) 2003-05-01 17:42:08 +00:00
stronk7 3fe1c56cdd Changed 2003-05-01 17:41:16 +00:00
moodler b3afe8244a Useful function for XML ... currently used only in Blackboard quiz importing 2003-05-01 13:57:35 +00:00
moodler 52ff6a7f44 Updates (removed Peer-graded module) 2003-05-01 13:46:11 +00:00
moodler d22d31c659 Workshop module from Ray Kingdon
This version is still beta!
2003-05-01 13:16:58 +00:00
moodler edffca1558 Changes to make forum mailouts a little more robust, and avoid duplicates
I hope, at least the ones caused by overlapping cron jobs.
2003-05-01 12:56:03 +00:00
stronk7 28408ed2ac Two more strings to backup utility 2003-05-01 12:47:52 +00:00
stronk7 d4ccfc2a2b Now all the variables are correctly transfered
Changer error to notice
2003-05-01 12:41:11 +00:00
stronk7 5f5ea8cc4c Include some entries to use in the backup utility. 2003-05-01 12:06:38 +00:00
stronk7 a36175db4c Now checks dinamically if "backuplib.php" and function "module_backup_mods"
exists !!
2003-05-01 11:19:33 +00:00
moodler 6db95aa730 new help file from Howard Miller (needs a little editing still) 2003-05-01 03:44:30 +00:00
moodler 3e9ca9fbc5 Added new Wiki code to allow Resource web pages to be created/edited using Wiki format
This code contributed by Howard Miller.  Thanks!
2003-05-01 03:43:16 +00:00
stronk7 bf32194357 Initial version. Do nothing. Just exist !! 2003-05-01 00:48:58 +00:00
stronk7 3b777608ac Continue 2003-05-01 00:46:39 +00:00
stronk7 3920667ee3 First Version. Do nothing but I saved it from accidental remove !! 2003-05-01 00:45:40 +00:00
stronk7 ea914a66ae Included possible feature
Restore into new course or existing course
2003-04-29 23:22:34 +00:00
stronk7 d565341a2f Frontend started. 2003-04-29 21:23:20 +00:00
stronk7 ea65b07cdd Included ID info. Simple. 2003-04-29 21:09:27 +00:00
stronk7 6b14fdcb1d Initial version of STATUS.txt
Used to show the detailed status of every part of the backup/restore.
2003-04-29 20:21:27 +00:00
stronk7 482fa9f6c6 Initial version of README.txt
Used for general comments about the backup/restore feature
2003-04-29 20:19:51 +00:00
moodler ca16eaeb31 Make sure all these links break out of subframes and go to mainframe 2003-04-29 13:54:53 +00:00
moodler f855f6062b Some tidying up - too much thesis wool in the head 2003-04-29 13:51:28 +00:00
moodler 5d0d5d5ac5 Images, when displayed as resources, are now centered and controlled
by a new style resourceimage
2003-04-29 13:31:47 +00:00
moodler 31d6331615 Don't go through enrolment procedure if they are already enrolled. 2003-04-29 13:04:22 +00:00
moodler dc95f4a11b Always print full number of student at the top 2003-04-29 12:51:21 +00:00
moodler 9d6f5d42eb Only retrieve records that are needed (eg description never is used) 2003-04-29 03:16:32 +00:00
stronk7 6d41991acc Little spell in word "Recursos" 2003-04-28 21:35:03 +00:00
minkowski 46956de552 no message 2003-04-28 18:08:23 +00:00
moodler a273084d7a Strange no-one has noticed this so far ... ! 2003-04-28 16:56:57 +00:00
moodler 81f186b47a I'm getting wierd numbers of records returned on moodle.org.
This fix makes the page a bit more robust even if this is
happening.
2003-04-28 16:13:46 +00:00
moodler df48be741a Minor fixes 2003-04-28 15:52:51 +00:00
moodler 8de14dc72b Print some nice feedback when a discussion has been moved, to help
prevent accidents.
2003-04-28 15:27:44 +00:00
paca70 28ba0d55cc ...And now it works 2003-04-28 15:24:13 +00:00
paca70 8809fee944 updates 2003-04-28 14:59:28 +00:00
moodler b86fc0e2a6 New feature replacing the old zoom function.
Now these are saved in a new table called course_display,
each user and each course can have independent settings.

I'm intending to expand this table later for all the other
course display stuff (like hidden topics etc)
2003-04-28 13:29:26 +00:00
paca70 9655b654a5 Now postgres works as it should, returned primarykeys are correct. 2003-04-28 12:51:19 +00:00
paca70 6492992616 I did't test previous change well, have take changes back. 2003-04-28 12:02:29 +00:00
paca70 9a652ddb2b Don't give fatal error when questions were not found. 2003-04-28 06:36:14 +00:00
moodler f343161392 Some random tidy-ups 2003-04-28 06:07:02 +00:00
moodler b72c80db7e New info 2003-04-28 05:29:26 +00:00
moodler 95abee03e6 Fixed user images 2003-04-28 04:55:31 +00:00
moodler 028677d7b2 Forgot one 2003-04-28 04:45:44 +00:00
moodler 9d2dda0f85 Added new custompix parameter 2003-04-28 04:45:15 +00:00
moodler e313ef4476 The rest of the images 2003-04-28 04:43:51 +00:00
moodler d14c1e0687 Added example of how "custompix" is to be used 2003-04-28 04:41:21 +00:00
moodler dc0dc7d5dd Tidying up the way pix images are used.
It's now also possible to override the standard pix with a set of new ones
in a theme.
2003-04-28 04:32:55 +00:00
moodler 2b83b7f98b Moving some images around - cleaning up organisation 2003-04-28 03:09:27 +00:00
moodler f0eec3b641 Whoops ... left and old line in there during the last fix 2003-04-28 02:43:18 +00:00
paca70 e8a0fc9a4f Corrected typo 2003-04-27 17:35:54 +00:00
paca70 e9ececbb1e $db->Insert_ID seems to work with postgresql too 2003-04-27 16:03:01 +00:00
paca70 5352ceba67 quiz_match was missing... 2003-04-27 15:33:31 +00:00
moodler dc2590e587 Don't process $usernew->username if it doesn't exist (prevents normal users from editing profile). 2003-04-27 14:50:03 +00:00
moodler e13d05801c Fixed rogue spaces 2003-04-27 12:45:51 +00:00
moodler 16aefd75fb New and very complete translation in Russian, from
Yakov Alperin and http://elearning.microtest.ru
2003-04-27 12:10:27 +00:00
mits 667e2e0293 New translation added. 2003-04-27 11:32:42 +00:00
mits 7716babeb2 New translation added and polished some.
I'm keeping my head above water, Martin :-)
2003-04-27 11:31:45 +00:00
moodler 6d21fd37f2 Added new format to this file ... heads up for translators! 2003-04-27 10:58:20 +00:00
moodler 6901fa7955 New plain text format.
Translates smileys and carriage returns, but prints all other tags and code
as plain text
2003-04-27 10:46:16 +00:00
paca70 e209e0b09e indexes for postgres 2003-04-27 09:54:03 +00:00
moodler f5e82bc7f4 Moved microtime_diff() to moodlelib 2003-04-27 08:13:45 +00:00
moodler 026bcf8ce1 Fixed typo 2003-04-27 06:51:44 +00:00
moodler 7aaedff8de Changed my mind about the default setting for loglifetime 2003-04-27 06:50:19 +00:00
moodler 2656b1351f Some rewording about loglifetime 2003-04-27 06:48:13 +00:00
moodler 81a383ca7a New string - saveall 2003-04-27 06:42:28 +00:00
moodler f8bccb148a iNew configuration variable delete old logs - loglifetime 2003-04-27 06:41:53 +00:00
moodler 540bab47d4 Delete old logs is required 2003-04-27 06:21:15 +00:00
moodler 30f89d6833 New delete_records_select() function 2003-04-27 06:18:03 +00:00
moodler f9d5fd3b3c Added a LIMIT to the SQL query for a bit more efficiency 2003-04-27 03:32:45 +00:00
moodler f9ce68ee7f Using multiple indexes for slightly increased performance 2003-04-27 02:58:26 +00:00
stronk7 c0605295bd Changed to dimm non-visible grades (mods). Bug #378.
Done a bit more:
  - Show dimmed entire column.
  - Difference html (for web) and text (for .xls and .txt export) in
    many variables.
  - Using the dimmed_text style to dimm.
2003-04-26 19:35:27 +00:00
stronk7 85093cf4f9 Added the dimmed_text css style to show normal text dimmed (gray #AAAAAA) 2003-04-26 18:54:37 +00:00
stronk7 0830bae4d7 Changed to hide non-visible grades (mods). Bug #378. 2003-04-26 18:16:36 +00:00
moodler 1ba3960285 Working much better with indexes - update the schema 2003-04-26 15:26:51 +00:00
moodler 6459f225b8 Update to add new indexes to MySQL tables. Speeds up the log access. 2003-04-26 15:24:04 +00:00
moodler 1b5910c4a5 Trying a different tack for recent_activity since the old way was
still producing too much data and overflowing PHP memory on busier
sites (eg moodle.org).

Now, there are more database queries, which is unfortunate, but the
data is much more specific, and no sorting needs to be done, so
this is a performance boost.

I don't know how these will cancel out ... my guess is that very
small sites may be very slightly slower on the course page, but
that large sites will be much faster.

Let's see.
2003-04-26 15:08:34 +00:00
moodler a54b8dd3af Need course module stuff 2003-04-26 14:21:42 +00:00
moodler 667ab3252b Get less logs from the database 2003-04-26 14:12:12 +00:00
moodler b1992e65cf Trying an experiment on moodle.org 2003-04-26 13:49:13 +00:00
moodler 10a95b432c Fix for use of COURSE_MAX_RECENT_PERIOD 2003-04-26 13:41:31 +00:00
moodler ad08fdc277 Performance improvements
- better checking of data before processing
  - used logs are removed to avoid re-processing by other modules
2003-04-26 12:59:41 +00:00
moodler 38e5dbf319 No changes, just rearranges 2003-04-26 12:38:53 +00:00
moodler ec2a28a607 Extended number of select fields allowed for get_field() and set_field() from 1 to 3 2003-04-26 12:38:04 +00:00
moodler 278a229c25 Slight fix to teacheronly coloring 2003-04-26 12:22:52 +00:00
moodler 3d89198946 Cleaned up definition of constant COURSE_* values in course/lib.php
Moved COURSE_TEACHER_COLOR out to style sheets where it belongs (.teacheronly)

Added some efficiency when printing recent activity

 - don't print more than one weeks worth of updates
  - don't keep re-parsing logs once they've been used
2003-04-26 12:17:30 +00:00
moodler 78e0146055 Argh! Excess quotes in CSS 2003-04-26 12:12:30 +00:00
moodler 6eb6cd8753 New style for teacher-only colour (eg when showing teacher posts in recent activity) 2003-04-26 12:07:14 +00:00
stronk7 fbca88e692 Show activity log only from visible surveys. Bug #367. 2003-04-26 11:04:46 +00:00
stronk7 2953d5e865 Show activity log only from visible journals. Bug #367. 2003-04-26 10:14:54 +00:00
stronk7 86e6076b3b Modified the instance_is_visible function. It has a bug, having
the "forum" table harcoded. Simplify a bit. Now seems to work
fine with every mod.
2003-04-26 09:34:11 +00:00
moodler c3357723de FAQ in full is too long - offends my eye :-) 2003-04-26 06:05:24 +00:00
moodler 09368e3938 Moved most-asked question to the top 2003-04-26 06:02:58 +00:00
moodler a95ae47bdf Imprved intro 2003-04-26 05:55:39 +00:00
moodler 50d673157b Long form of FAQ 2003-04-26 05:44:42 +00:00
moodler 65eed52ded Style for question links 2003-04-26 05:42:51 +00:00
moodler d1db7bee92 More cleanup 2003-04-26 05:40:24 +00:00
moodler 39b5b3fa2a more clean up 2003-04-26 05:30:00 +00:00
moodler e317d04919 Cleaned up, with additions 2003-04-26 05:24:07 +00:00
stronk7 dff0db9ad5 Show activity log only from visible forums. Bug #367. 2003-04-26 00:17:42 +00:00
stronk7 746546a8f8 Show activity log only from visible assignments. Bug #367. 2003-04-25 23:49:35 +00:00
stronk7 b3cc742cf9 Avoid showing course updates (add, update, delete) about hidden mods. Bug #367 2003-04-25 23:17:53 +00:00
paca70 c4c575979e Allow caseinsensitive search for postgesql 2003-04-25 19:32:38 +00:00
paca70 3399a22c9f Show adduser only when adding new user from moodle is posible. 2003-04-25 17:18:40 +00:00
paca70 4dd0497164 Dont allow edit username when external authentication is active. 2003-04-25 16:42:07 +00:00
moodler 826293c75b Allowed - and . during signup by email 2003-04-25 12:35:17 +00:00
moodler 5a9126f75a Renamed signup_form.php to signup_form.html (this part of the code is really old) 2003-04-25 12:32:26 +00:00
moodler a2f1ef3067 Some default values for variables 2003-04-25 12:29:52 +00:00
moodler 266cc04fe7 Footers use new styles for links 2003-04-25 09:25:25 +00:00
moodler b328523cc1 Style for "You are logged in as xxx" and the link to the course home page. 2003-04-25 09:23:08 +00:00
moodler a5c411d4c2 Smaller font 2003-04-25 09:01:01 +00:00
moodler 583a7283e9 Edit my profile link goes straight to the edit screen 2003-04-25 08:59:10 +00:00
moodler fc613dff69 Directories are now made using make_upload_directory from moodlelib 2003-04-25 08:39:11 +00:00
moodler 4d4267739c Some minor visual improvements - firstname/lastname separated, initialised some variables 2003-04-25 07:15:12 +00:00
moodler a282d0ffda Adding user's name at the top of the course page.
Just experimenting with it there for a while ... feedback welcome
2003-04-25 06:40:30 +00:00
paca70 87b490dfc6 Hide password field when password change is not supported by auth-module. 2003-04-25 06:01:59 +00:00
moodler 580f2fbc07 New function to detect visibility of a single module, and
use of this function when displaying list of forums
2003-04-25 05:24:29 +00:00
moodler 047d30d1eb MySQL code (etc) to convert all usernames to lowercase ... does a lot more
checking than it really needs to, since MySQL is not case sensitive
2003-04-25 03:54:21 +00:00
paca70 1e22bc9c04 Conver usernames to lowercase for internal use. This prevent duplicate users
when using external authentication and posgresql.
2003-04-24 20:06:40 +00:00
paca70 e40488f80c routines to convert postgeruser to lowercase. 2003-04-24 18:48:09 +00:00
stronk7 c37053ea2f Changed to show the hidden surveys dimmed (bug #364) 2003-04-24 18:28:30 +00:00
stronk7 e6c136e1bf Changed to show the hidden quizzes dimmed (bug #364) 2003-04-24 18:19:23 +00:00
paca70 1dea7ebb04 global $CFG was missing...? 2003-04-24 17:38:20 +00:00
stronk7 f99d236832 Little update to select the forum info (avoid duplicates). 2003-04-24 17:35:34 +00:00
paca70 dbe0be0059 Added missing $ 2003-04-24 17:21:54 +00:00
stronk7 3b0fb381ea Changed to show the hidden forums dimmed (bug #364) 2003-04-24 17:15:59 +00:00
moodler 61367e6417 More robust variable checking 2003-04-24 17:13:52 +00:00
moodler 719e7b04f8 Default value for alltext variable 2003-04-24 17:05:54 +00:00
stronk7 5094d166b7 Changed to show the hidden choices dimmed (bug #364) 2003-04-24 16:47:06 +00:00
stronk7 dd8d521d91 Changed to show the hidden assignments dimmed (bug #364) 2003-04-24 16:38:49 +00:00
stronk7 81cdaada93 Changed to show the hidden resources dimmed (bug #364) 2003-04-24 15:25:21 +00:00
stronk7 7cfb83477c Modified to obtain the visible property too. To use it when showing the list
of instances of every mod (bug #364)
2003-04-24 15:17:43 +00:00
moodler 638f95b1ff Latest things 2003-04-24 15:03:42 +00:00
moodler 88478a664f New authentication method - a very simple one called "manual".
Accounts have to exist in the internal database, and there is
no way to create an account on the site - admins have to do it.
2003-04-24 15:01:15 +00:00
moodler 67b0821af9 Fixed a typo, see bug 361 2003-04-24 14:37:22 +00:00
moodler e1c4617441 Added recent stuff 2003-04-24 14:28:24 +00:00
moodler 3395f2d67e Forum posts are now not allowed to have blank subjects or messages,
if a message is entered with one of these blank then the user gets
an error message and a chance to re-edit the message.
2003-04-24 14:05:47 +00:00
moodler 41ab15fba5 Added Polish info 2003-04-24 08:46:44 +00:00
moodler 1fc49f0019 New feature to allow teachers to move a discussion from one forum
to another.

A simple popup menu now appears when teachers view any discussion.

Includes a new log entry to log when a discussion is moved.
2003-04-24 08:45:27 +00:00
moodler 2a40936834 Mark the hidden ones for teachers 2003-04-23 17:25:20 +00:00
moodler 13df5aeef3 Rebuild course modinfo caches to include the visible variable 2003-04-23 17:02:24 +00:00
moodler 7acaa63d09 Tidy up a bit 2003-04-23 16:57:35 +00:00
moodler feffa4e695 chmod after mkdir (just in case) 2003-04-23 16:51:26 +00:00
stronk7 fec5a6a63f Changed the get_array_of_activities function to return the visible property too 2003-04-23 16:37:37 +00:00
stronk7 cf055081ef Changed the navmenu function to show only visible-mods on the
jumpmenu. Everything is showed when the user is a teacher.
2003-04-23 16:32:11 +00:00
stronk7 00d26a208b Changed the get_course_mods function to obtain the visible property too. 2003-04-23 16:09:56 +00:00
mits d4269e95c0 fix again. 2003-04-23 15:43:56 +00:00
mits 91162b4688 fixed :-) 2003-04-23 15:39:54 +00:00
moodler a7eedb343c Sorry, Mits, I think I broke it :-( ... can you check this file? 2003-04-23 15:34:12 +00:00
moodler f861185a4a Added dynamic display of post delay time as currently defined for the server 2003-04-23 15:30:22 +00:00
moodler b7637a30d4 Dynamic value of minutes displayed in help file 2003-04-23 15:25:27 +00:00
moodler c032b59db9 Help button about subscription on forum page 2003-04-23 15:19:01 +00:00
moodler 312447111c Got a bit slash-happy 2003-04-23 15:01:37 +00:00
moodler 3af4a3653c some HTML tags made a bit more XHTMLish 2003-04-23 14:50:44 +00:00
mits 847179dc91 New translation added and polished some. 2003-04-23 14:22:19 +00:00
moodler bc3df42048 Initial, partial translation from Adam Pawelczak <adamp@wsb.poznan.pl> 2003-04-23 11:30:14 +00:00
stronk7 c7da6f7a8f Bug #363. When everyting is hidden at main-menu, error occurs. Changed the get_all_mods function to check this. 2003-04-22 20:46:12 +00:00
stronk7 e6cf424727 Bug #261 closed. Appended course short-name to distinguish courses
when assigning teacher.
2003-04-22 19:27:11 +00:00
paca70 e05566015e More updates. Thanks to Teemu! 2003-04-22 14:38:37 +00:00
paca70 3c7f99a447 Updates 2003-04-22 14:18:03 +00:00
paca70 7d6cac54f3 New string conversion function to help with multibyte-locales 2003-04-21 16:39:43 +00:00
moodler 3ba2985594 Robustness fixes 2003-04-21 08:08:33 +00:00
moodler b369ff55fe Whoops, chmod not chown 2003-04-21 07:26:23 +00:00
moodler 718ad19f47 trying to fix up old file permissions 2003-04-21 07:21:33 +00:00
moodler 9dd0b37817 Make sure to change the ownership of uploaded files 2003-04-21 07:11:29 +00:00
moodler 3269b238a7 Updated (to make the new release notes show up for CVS people :-) 2003-04-21 06:44:13 +00:00
moodler 6b708b9844 More info about new features in the upcoming release 2003-04-21 06:43:05 +00:00
paca70 978704f095 More comments 2003-04-20 18:15:03 +00:00
paca70 d2802df553 Added mimetype and icon for avi-files. 2003-04-20 07:42:18 +00:00
paca70 44a334d874 Undoing needless change. 2003-04-19 19:09:01 +00:00
paca70 d61bf02f18 Works now also with $a->something 2003-04-19 17:45:50 +00:00
paca70 4dddd64b5f Hilite also empty stings. 2003-04-19 10:25:58 +00:00
paca70 fe8bc4c9a5 Removed two `'s 2003-04-18 21:05:12 +00:00
paca70 cefc7e817e Fix for postgresql column adding( $oldfield is always '"$oldfield"') 2003-04-18 20:50:42 +00:00
moodler 2ab968e937 Trying some optimisations 2003-04-18 09:53:41 +00:00
moodler 32dcc87484 Fixed new bug that was preventing news being shown on course page 2003-04-18 07:25:58 +00:00
moodler fc6a91994e Robustness on a variable 2003-04-18 07:25:32 +00:00
moodler 02a7699f0d Tweak for generalbox 2003-04-18 06:41:34 +00:00
moodler 03aa0dfa10 Style improvements and upgrades 2003-04-18 06:39:40 +00:00
moodler 9e0a08bd28 Discussion, not subject 2003-04-18 06:14:17 +00:00
moodler c20b762a06 Fixed location of Older discussions link 2003-04-18 05:57:45 +00:00
moodler 3c8a606d85 Added simple paging ... only top 100 are shown by default. If there
are more then "older discussions" link shows all of them.

Someday proper 1,2,3,4 paging would be nice but this will do for now.
2003-04-18 05:54:18 +00:00
moodler 546be6dd89 don't valign subjects in html 2003-04-18 05:28:08 +00:00
moodler 96e301a7c9 Undoing last checkin 2003-04-18 05:25:46 +00:00
moodler 9ddb00e600 Improved colours 2003-04-18 05:22:49 +00:00
moodler 29507631a9 First pass at a cleaner display for discussion listings 2003-04-18 03:58:12 +00:00
moodler 801e1f0a3e Set guest name in current language on login 2003-04-18 02:18:12 +00:00
moodler bf3bc898ac Assigned $strsearchresults 2003-04-18 01:57:24 +00:00
moodler a00283d6cd Clear a variable, just in case 2003-04-17 15:46:39 +00:00
moodler c1d9daca3c Clear the variable, just in case 2003-04-17 15:45:57 +00:00
moodler 7226ce02b1 Robustness for $course variable 2003-04-17 13:20:26 +00:00
moodler da63e99627 Updating version because the quiz work is finished, for now 2003-04-16 15:20:21 +00:00
moodler 3abe21ab94 Latest tags 2003-04-16 15:19:23 +00:00
moodler e1122620b5 Er, similar to the last few changes but this way seems to actually work. :-)
Need sleep ...
2003-04-16 13:48:16 +00:00
moodler 2408867e8c Improvements for shuffleorder in collections of random questions 2003-04-16 13:25:03 +00:00
moodler 96192c4459 After doing a quiz that has been shuffled, present the feedback in the
same order.  Note that shuffled ANSWERS may still appear reshuffled.

When viewing reports, all shuffling is switched off so that quizzes
always appear in the default order (for easier comparison).

Also a few tweaks, robustness etc
2003-04-16 13:10:48 +00:00
moodler 77cff58927 Fixes for bug 268 - Changing answers of questions can lose responses for
existing quizzes with those questions.

When updating a question it now checks for existing answers and updates
those instead of making new ones.
2003-04-15 14:43:29 +00:00
moodler eece3a331a Tweakin' icons 2003-04-15 14:29:09 +00:00
mits f24f17c5bb no message 2003-04-15 14:07:48 +00:00
mits 2386e97f89 New translation added. 2003-04-15 14:05:47 +00:00
moodler d6a6331129 Add category to random question names 2003-04-15 13:14:33 +00:00
moodler c9548d4a5d Slight mods ... are they better? 2003-04-15 06:20:27 +00:00
moodler de38e2621d More robust use of $_FILES['imagefile'] 2003-04-15 02:08:27 +00:00
moodler 1acfbce5b6 Hide/show individual activities in any section
Code submitted by Eloy Lafuente (thanks!) for 1.0.8 ... I hand-merged it
into 1.0.9.
2003-04-14 15:11:09 +00:00
moodler 5a25f84d25 Fix for off-by-one grade error when 'Save Grades' had not been used 2003-04-14 13:52:59 +00:00
moodler 8b72b41bf9 Better looking code 2003-04-14 05:44:47 +00:00
moodler b610b4c2fd Showall is sticky, and also you get a warning about the number 2003-04-14 03:02:25 +00:00
moodler dea49bdd6c Changed wording a little 2003-04-14 02:56:31 +00:00
moodler 99de5ed02b New string "showall" 2003-04-14 02:55:48 +00:00
moodler cb77b5b67f Better wording 2003-04-14 02:53:55 +00:00
moodler a625debc38 Simplified display - less unnecessary clutter 2003-04-14 02:52:11 +00:00
moodler 15c715211e Mucking with the formtting 2003-04-14 02:48:40 +00:00
moodler 980d545f4f Smaller info 2003-04-14 02:45:03 +00:00
moodler 9ecb1bd3a4 New strings for showing users 2003-04-14 02:43:53 +00:00
moodler c5b6666eaf Better support for large classes 2003-04-14 02:42:40 +00:00
mits 63a77d2d39 no message 2003-04-13 18:48:24 +00:00
mits c76f49060f New translation added. 2003-04-13 18:47:03 +00:00
moodler 7c81b6e273 Sort subscribers by email address (easier to find subscribers based on
bounced messages)
2003-04-12 07:52:52 +00:00
moodler 752e1c2b62 Don't pass alltext from mod.html to details.php ... more efficient this way 2003-04-12 03:42:17 +00:00
moodler 67b69ce15b No real point to changing the numbers - changing them back to the original plan 2003-04-12 03:18:50 +00:00
moodler cdb0ca8315 Update to stop it falling too far behind 2003-04-12 03:18:02 +00:00
moodler f475564878 Latest tags 2003-04-11 14:46:21 +00:00
moodler 0bf2925db8 Minor fixes 2003-04-11 14:44:12 +00:00
paca70 5e776a02ad To check string sizes 2003-04-11 12:05:21 +00:00
moodler c6eed09730 New "create multiple questions" wizard.
Improvements to the importing routine for AON
2003-04-10 17:55:57 +00:00
moodler 340191ded7 Added Danish 2003-04-10 14:17:01 +00:00
moodler 085e317dbf Danish! From S?ren Vinther Hansen <info@thenavigator.dk> 2003-04-10 14:04:30 +00:00
moodler be09831ac3 More info about admin location and a fix 2003-04-10 13:57:21 +00:00
moodler dae73c05e9 New $CFG->admin directory can override the location of the admin
directory.

Useful because some web hosts use /admin for other things.
2003-04-10 13:46:52 +00:00
moodler bc700e6559 New function swapshuffle_assoc 2003-04-10 13:45:07 +00:00
moodler c05eca327c Importing improved to include pre and post-processing.
Removal of Random Matching code from the generic case.
Implementing a particular custom import style aon.php
2003-04-10 13:12:40 +00:00
moodler da5fb074c3 Minor robustness fix 2003-04-10 13:11:34 +00:00
moodler b1db099b7e New icons 2003-04-10 13:04:20 +00:00
moodler 44ce983d45 Updated number of languages 2003-04-10 06:24:57 +00:00
moodler 66a68c1739 Updated with current thoughts about general path this year 2003-04-10 06:22:04 +00:00
moodler 1365bacde6 Correct a typo 2003-04-09 14:30:04 +00:00
moodler 52c018a0b5 More logical position for shuffle options 2003-04-09 14:27:58 +00:00
moodler 4b85b71712 New quiz switches to
- shuffle questions order
  - shuffle answers order
2003-04-09 13:57:08 +00:00
moodler f5cbbecaf5 empty() --> !isset() 2003-04-09 13:41:11 +00:00
moodler 72e5815533 More fixes resulting from random question feature 2003-04-09 08:11:20 +00:00
moodler 434802d5ce Slightly more efficient database access. 2003-04-09 07:23:42 +00:00
moodler 34d52ad7d2 First implementation of completely random questions.
When you add a random question to a quiz, then a question
is chosen randomly from the same category.

Questions are not repeated in a particular quiz attempt.

This still needs more testing, but it's looking OK so far.
2003-04-09 06:32:51 +00:00
moodler d62413e869 Use "modified" date of posts when displaying them, not the "created" date. 2003-04-08 14:09:24 +00:00
moodler 329f046798 Don't use session.path check when the server is in safe mode 2003-04-08 03:51:38 +00:00
moodler 29cbd93a45 Just much simpler way of doing the last patch. 2003-04-07 16:08:52 +00:00
moodler aa6fbca550 Use the cached admin bit if it's there!
(saves one database access per editable activity on the course page!)  :-/
2003-04-07 15:30:34 +00:00
moodler 8daaf761c3 Added code to catch runaway case when there is more than one news forum.
It shouldn't happen, but I think it can when the database is having
problems.
2003-04-07 15:20:08 +00:00
moodler 8f202463d5 New file 2003-04-07 03:30:50 +00:00
mits b4e3b12234 New translation add and modify $string['configunzip'] , $string['configzip'] :) 2003-04-06 06:15:00 +00:00
moodler e64984a0bb Modifications to allow Moodle files management page to use PclZip
instead of external zip programs.

To use the internal PclZip, the config variables "zip" and "unzip"
must be left blank.

Code for PclZip integration originally from Robert Hetzel, though
I've expanded it and modified it a lot.

The zip files seem compatible with itself and Windows XP, but I had a
compatibility problem trying to unzip a PclZip file using Zip 2.3 on Linux
(directories are unpacked as empty files)
2003-04-06 05:53:47 +00:00
moodler 8ef3483b60 Added Version 1.3 of PclZip to the distribution 2003-04-06 05:48:56 +00:00
mits f07e21dec4 no message 2003-04-06 03:29:28 +00:00
mits f561b68011 Polished 2003-04-06 03:24:49 +00:00
moodler 46d552b810 Partial translation, by Ilia Chipitsine <ilia@chel.skbkontur.ru> 2003-04-05 14:29:26 +00:00
moodler e52c4f2231 Latest improvements from Paula 2003-04-05 14:21:10 +00:00
moodler c4dfc485eb Fixes for main SQL defintions - from Juro Chlebec 2003-04-04 10:47:37 +00:00
moodler ef49e5c301 addslashes to string used for javascript link 2003-04-02 07:24:42 +00:00
moodler 8a205861e0 Added a robustness check for USER->id 2003-04-01 02:38:31 +00:00
moodler 0305fe824d Undoing recent changes 2003-04-01 02:24:58 +00:00
moodler ffb410df03 Sorry, Petri, but we need to undo these changes, because:
- they could break accounts in existing installations
  - strtolower can corrupt strings in multibyte languages

Is it really a problem that usernames are case sensitive on PostgreSQL?
2003-04-01 02:14:16 +00:00
paca70 b398d5ee2a Use always only lowercase version of username.
When using authentication module (ldap, smb, pop etc...) and postgres-database multiple moodle
users were created for usernames like 'Username' 'username' 'userName'
2003-03-31 17:05:52 +00:00
mits 73f131b7a6 New translation added and polished some. 2003-03-31 03:03:20 +00:00
moodler e4be3d5943 Renamed randommatch.html -> randomsamatch.html 2003-03-30 16:51:24 +00:00
moodler 432d39026d New template for Match questions 2003-03-30 16:48:34 +00:00
moodler 54a67a5921 First cut at adding new "fixed" Match question type, which is manually
created.  Works OK after limited testing.

I've also renamed some strings to do with "Random Match", so that this
question type is now called "Random Short-Answer Match".

Later there will be a new 'Random Match' which randomly selects one of the
existing "Match" questions.
2003-03-30 16:46:50 +00:00
moodler 03fd6a965e Fixed a slight typo 2003-03-30 13:54:28 +00:00
moodler 0d0baabf2c Fixed a missing global $CFG declaration. 2003-03-30 13:25:49 +00:00
moodler 2d0b30a028 What was I thinking? This is much cleaner (and no duplicates). 2003-03-29 04:08:51 +00:00
moodler adaf39283c Changes to activate the "force subscribe" option on the Site News forum.
By default it is OFF, but if it is turned on, then site news is emailed
to ALL enrolled students and ALL current teachers.
2003-03-29 03:39:56 +00:00
paca70 754786f1be Updates 2003-03-28 08:58:47 +00:00
paca70 a3b0dbfa80 updates from Jaana 2003-03-27 20:04:24 +00:00
moodler 90707adb7f Added Romanian author, plus some fixes 2003-03-27 03:28:25 +00:00
moodler b8a0fb13a3 Eugen Tanul <roinstitute@fx.ro> 2003-03-27 03:14:44 +00:00
moodler aa9f961b7d New language: Romanian by Eugen Tanul <roinstitute@fx.ro> 2003-03-27 03:13:36 +00:00
moodler bad357c414 Restoring Paula de Waal's versions for the time being 2003-03-26 15:14:52 +00:00
moodler ea6003eb8a New translations of the help files, from Adriana Beal 2003-03-26 15:08:46 +00:00
moodler b60aa549fc Added Bobo 2003-03-26 14:14:16 +00:00
moodler b6f64be2a5 Fixes related to AcceptPathInfo - removed need for ifDefine lines. 2003-03-26 14:13:42 +00:00
moodler 075a591656 Better regular expresssion for detecting URLs at the very start of a text.
I don't know what the old one thought it was doing!  :-)
2003-03-26 07:33:26 +00:00
moodler 0ece16e90c Added tags file for codewalkers who can't generate one.
This file will not be included in distributions.
2003-03-26 06:03:34 +00:00
moodler 036d3c1f90 Typo! 2003-03-26 05:48:21 +00:00
moodler 6eff984aee Added some new indexes on quiz tables in MySQL 2003-03-26 05:46:09 +00:00
moodler 264d4e0b9a Added two new indexes on log table to help speed it up.
See Greg's note in bug 113
2003-03-26 02:17:46 +00:00
mits 1495667946 pgassignment.php done.
needs enough polish :)
2003-03-24 16:34:21 +00:00
mits 8cc7286ccc New translation added. 2003-03-24 15:33:37 +00:00
paca70 f5cdd4d133 Corrected typo 2003-03-24 13:15:48 +00:00
moodler b2d0ca3b7c Removed some tabs :-) 2003-03-21 14:09:51 +00:00
moodler 000cc405ba Hack from Roberto Pinna (Bobo) to add sorting when viewing submissions
Might need some tidying up still but it's functional ..
2003-03-21 14:07:25 +00:00
moodler e384fb7b73 Can now count a search of users 2003-03-21 10:10:21 +00:00
moodler 49e16355c2 Improvements to display of users 2003-03-21 10:08:23 +00:00
moodler c750592ac4 Added a search form to the "edit users" admin page yay! 2003-03-21 09:42:42 +00:00
moodler 6a3461ad1c Links to admin page in header are now relative 2003-03-21 04:56:05 +00:00
moodler 746665838a More robustness on checking sequence variables 2003-03-21 04:53:08 +00:00
moodler f8430195d9 Small fix to avoid PHP warnings 2003-03-21 04:49:29 +00:00
moodler ef4145f6ae Changes to make regrading work properly if the quiz has changed
and also an exptended timelimit for when regrading is REALLLLY slow
fue to some other unknown reason (as yet)
2003-03-20 07:28:53 +00:00
mits f2cc50f192 New translation added. 2003-03-20 06:10:00 +00:00
moodler 4c0e951049 Updated credit for Slovak 2003-03-18 12:57:01 +00:00
moodler 0fdddefbaa Improved Portuguese (Brazil) version by Paula de Waal 2003-03-16 15:02:38 +00:00
moodler d4120c3d7c Added some more options for longtimenosee 2003-03-16 02:35:03 +00:00
paca70 509139373e Fixed incorrect comparison. Peter Paluch pointed this out. 2003-03-15 18:26:46 +00:00
moodler 78e72ed16b Didn't quite finish the last patch of user -> usernew 2003-03-15 09:15:44 +00:00
moodler e6829515b0 Bug fix from Ray Le Couteur ... alphanumeric check was checking old
username but not the new username
2003-03-15 08:26:00 +00:00
paca70 e582b65e30 Fixed logic error.
Now also first time users can be course creators.
2003-03-14 21:34:39 +00:00
gregb_cc a2631c99d9 This closes bug http://moodle.org/bugs/bug.php?op=show&bugid=310
assignment_get_unmailed_submissions now ensures that a student is still enrolled
2003-03-14 19:58:53 +00:00
moodler 01cf7d2ebc Added some people 2003-03-14 12:45:05 +00:00
moodler a4ef9df2d7 Initial version from Les Kopari - les_kopari@yahoo.com 2003-03-14 08:22:37 +00:00
moodler 9d5b689c8a Added vim commands at the bottom of the file to try it out 2003-03-14 07:55:22 +00:00
gregb_cc b9287b2fba Added a useful message, to make the cron output more helpful in diagnosing
"stuck" assignments.
2003-03-13 20:59:31 +00:00
mits d48f938420 New translation added. 2003-03-13 15:22:43 +00:00
mits ddde5a8c82 New translation added. 2003-03-13 14:17:21 +00:00
gregb_cc c0f728ba9e code formatting change: switched from alternative syntax to using {} 2003-03-12 21:40:47 +00:00
gregb_cc 6908193151 speed improvement in smilie_replace. It is now almost as fast (within 5-10%) of
the version that used global smilie definitions.
2003-03-12 21:37:05 +00:00
gregb_cc 617778f2d3 Added benchmark and test for replace_smilies 2003-03-12 20:36:55 +00:00
moodler 4c31e7cfba Removed main_frame 2003-03-12 08:37:42 +00:00
moodler d4be5253aa Making a consistent download link for uploaded resources (same as web page) 2003-03-12 08:02:05 +00:00
moodler 2d8cf6799a Whoops! Accidentally checked in a quick hack I did for someone. 2003-03-12 07:49:54 +00:00
moodler c9082a8c2f Integrated the default redirect message delay from Greg B 2003-03-12 07:44:29 +00:00
moodler f82c2d428a Modified Greg's work to:
- rename the main_frame variable to framename, because it
       - might have caused some confusion
       - none of the global variables have underscores
  - put the config in the config table, with a default of _top
2003-03-12 07:36:22 +00:00
gregb_cc 2ea9027bc4 Small cleanup of smilie replacement.
This change removes the smilie variable assignment from the global namespace.
This change retains the original user input as the alt text.
The main reason for this change is to make it possible for me to use my
make_class function on weblib.php (still need to do something about the defines
though).
2003-03-12 03:42:44 +00:00
gregb_cc 08b3606390 This is a first attempt to make moodle frame safe.
I've added the variable CFG->main_frame to config-dist.php, and replaced _top
targets with the variable in all the php files.  HTML files, like those in the
documentation, have not been modified, as they are not (yet) parsed.

The variable should probably get moved into the config table, and get some
documentation.

I've also included, but commented out, a slight change in weblib.php, which
would guarantee that messages would be seen before redirecting the user (unless
delay intentionally set to 0 when redirect is used).
2003-03-11 21:35:12 +00:00
moodler 754b76fe65 Whoops, paca70! You accidentally jumped a month forward in the date. :-)
We need to increment the version.php file slowly now until time catches up.
2003-03-11 06:04:28 +00:00
moodler 3ac1dedc35 Added some popup help for topic/week summaries 2003-03-11 05:57:00 +00:00
moodler 1e5a2bf584 You can now use Richtext editor to edit section texts, plus the page is a
bit more consistent now
2003-03-11 05:43:39 +00:00
mits 8f6dcdbaa4 no message 2003-03-11 04:24:32 +00:00
mits 5c34d1e3a4 New translation added. 2003-03-11 04:19:12 +00:00
moodler 8fb2f0fa1e Corrected typo 2003-03-10 14:05:10 +00:00
moodler ac234d0262 Tidied up and rearranged a little 2003-03-10 14:02:12 +00:00
moodler fe32b83bbf Improvements to explain about AcceptPathInfo 2003-03-10 13:59:06 +00:00
moodler 76a359ba93 Added something for Apache 2 (to make 'slasharguments' work)
<IfDefine APACHE2>
    AcceptPathInfo on
</IfDefine>
2003-03-10 13:39:56 +00:00
paca70 7563a073c3 rtf-editor had mixed up some files 2003-03-07 17:55:44 +00:00
villate d106f1d9ae Improved translation of "search forums". 2003-03-07 16:15:30 +00:00
moodler 9a9a2907c2 Add a target to the "made with moodle" link to avoid confusing students 2003-03-07 15:09:12 +00:00
paca70 c605097983 RitchText editor had mixed up all php code. 2003-03-07 07:04:54 +00:00
mits 25f3420857 New translation added. 2003-03-06 17:48:25 +00:00
paca70 5fcda72588 updates 2003-03-06 16:39:17 +00:00
moodler e00f0f9f51 Added missing styles and so fixed bug of display of generalbox 2003-03-06 08:54:28 +00:00
moodler 548daac7d9 Some fixes sent in by "Adriana Beal - Vydia Tecnologia" <adriana@vydia.com.br> 2003-03-06 02:01:05 +00:00
mits 19bbe230f6 Polished 2003-03-05 14:12:48 +00:00
mits 66ea5000db New translation added. 2003-03-05 13:11:05 +00:00
mits 706e019764 Polished 2003-03-05 13:10:37 +00:00
paca70 1b7f43a40a updates 2003-03-05 13:01:29 +00:00
mits 247612cfe7 New translation added. 2003-03-05 03:29:32 +00:00
mits 049100796f Polished 2003-03-05 02:06:49 +00:00
compuproggy b1ca03e9cf *** empty log message *** 2003-03-04 12:45:58 +00:00
compuproggy cdf198d345 New Translations 2003-03-04 12:30:47 +00:00
moodler 70e5e91e9e Remove some old save_sessions 2003-03-04 09:01:26 +00:00
mits 7470fb3782 New translation 2003-03-03 17:55:19 +00:00
mits d831f93c73 no message 2003-03-03 17:54:27 +00:00
mits 1862b9eb54 New translation added. 2003-03-03 17:53:40 +00:00
moodler 0d1a40f00a Updated versions only 2003-03-03 17:48:39 +00:00
moodler 31ce4b538c Fixed quotes on column 2003-03-03 17:46:53 +00:00
moodler df103e8212 Questions now have a defaultgrade column (which defaults to 1)
... this grade is used as the default grade when adding questions
to a quiz.

At the moment it's just so that some imported questions can have
different defaults, but a field should be added to all question
editing pages.
2003-03-03 17:43:13 +00:00
moodler c363d9d11f Added QUIZ_DEFAULT_SCORE ... later this will be a quiz option 2003-03-03 17:05:35 +00:00
moodler 9314930280 Slight rewording 2003-03-03 13:23:50 +00:00
moodler 43f2302fdf Started a Frequently Asked Questions page 2003-03-03 13:18:34 +00:00
mits c4eb7e254f New translation added. 2003-03-02 06:10:16 +00:00
mits cd4b225bd0 no message 2003-03-02 01:13:47 +00:00
mits f84148d015 *** empty log message *** 2003-03-02 01:12:11 +00:00
mits d57d61e3a7 New translation added. 2003-03-02 01:10:16 +00:00
mits b365072d7c New translation added. 2003-03-01 16:54:36 +00:00
mits 687f38368e no message 2003-03-01 16:54:06 +00:00
paca70 9eee5e0559 Updates 2003-03-01 16:45:45 +00:00
mits 44ac5310a8 New translation added. 2003-03-01 14:10:43 +00:00
moodler 068e57cebc Courses are forced to have unique shortnames (see bug 299) 2003-03-01 12:52:04 +00:00
moodler b4b7572b9a new strings 2003-03-01 05:16:20 +00:00
moodler 14bdb2387a Sort question list by question type 2003-03-01 05:11:44 +00:00
moodler 02986c8002 Can now specify a number of random match questions to create automatically
during import.
2003-03-01 05:08:03 +00:00
villate 7169069bd5 Initial translation. 2003-02-27 19:27:06 +00:00
moodler 45930f2db5 Add support for Taiwan Chinese 2003-02-27 12:15:00 +00:00
moodler 3e7542449b Removed save_session() - no longer necessary 2003-02-27 02:49:18 +00:00
moodler 7a361c8b55 Removed save_session() - no longer needed. 2003-02-27 02:46:37 +00:00
moodler 55271c3047 Removed save_session() - no longer needed 2003-02-27 02:43:34 +00:00
moodler 08c17336a7 Fixed $USER and $SESSION to be pointers to the real $_SESSION
variables, so there's no longer a need for save_session  (thanks,Petri)
2003-02-27 02:38:55 +00:00
paca70 4e94d2608b updates 2003-02-26 19:18:56 +00:00
moodler ff20ee79f6 Use caching if necessary, so that teachers can't lock themselves out
accidentally during the current session.
2003-02-26 05:58:44 +00:00
moodler d92a53d182 No need for ismainteacher() ... it's enough to check that the user is
a teacher in a course, and a creator.
2003-02-26 05:55:31 +00:00
moodler c0f271aa5c Cleanups for course creator. 2003-02-26 04:18:46 +00:00
villate 12faa2684e Fixes the name of the "eachuserforum" type. 2003-02-25 17:39:06 +00:00
villate f8b8aa347b Initial translation. 2003-02-25 17:30:18 +00:00
villate 111f984300 Fixes an HTML syntas error. 2003-02-25 17:07:57 +00:00
villate ab202116b9 Initial translation. 2003-02-25 17:06:37 +00:00
moodler f02ca41cca Removed space from end of file 2003-02-25 17:04:40 +00:00
moodler 06334957fa Complete translation into Slovak! From Pavol Jackulik. 2003-02-25 16:54:07 +00:00
villate 66d323459e Translate "post" as "mensagem", "isolated knowledge" as "aprendizagem
individual" and "connected knowledge" as "aprendizagem colectiva".
2003-02-25 16:52:20 +00:00
villate 7dd3b70b10 A few changes in the translation 2003-02-25 16:08:58 +00:00
moodler 610b9de6f7 Draft-only version from Les 2003-02-25 12:43:56 +00:00
paca70 d7466bdecb Redirect teachers to course after coursecreation. 2003-02-25 10:45:37 +00:00
paca70 44996d00f9 Fixed some typos 2003-02-25 10:31:59 +00:00
paca70 38620c460b One strange 'o' jumped in.. 2003-02-25 07:24:48 +00:00
moodler 5b337cdf3b No need for course creators to have a link to the admin page. 2003-02-25 04:22:57 +00:00
moodler 38972a40a4 Some English spelling/grammar fixes. 2003-02-25 04:03:49 +00:00
moodler 8b2fc31ce0 Fix link in admin links 2003-02-25 03:57:14 +00:00
moodler 2fdb54b819 Fixed bug in table creation - (it was creating a null table!) 2003-02-25 03:53:50 +00:00
moodler 0ca1825cab Tidied up some of Petri's code :-/ 2003-02-25 03:46:06 +00:00
paca70 ea81ca5f6d README updates 2003-02-24 21:09:53 +00:00
paca70 6c891932c0 Some updates 2003-02-24 20:06:53 +00:00
paca70 9f9f92c6df Updates to Finnish translation and some correction to English one. 2003-02-24 19:00:39 +00:00
paca70 1924074c76 Added support for nonadmin course creation.
Course creators are managed by /admin/creator.php , same way that admins.
Or if authetication module have 'auth_iscreator'-function (right now only ldap-module have) ,
users are added to creators at login time.
2003-02-24 18:48:55 +00:00
moodler 38b68c5d6f More detail, clearer description 2003-02-24 10:45:49 +00:00
moodler 86bce68fa8 New table for Postgres 2003-02-24 10:42:07 +00:00
moodler 95dbc030a8 First version of code to implement new "Random Matching" type
of questions.  These use 2 or more short answer questions at
random to construct a questions where you have to match
answers to questions.  Only lightly tested so far.

Quiz questions can now be edited with Richtext editor.

Sundry little fixes along the way.
2003-02-24 10:37:56 +00:00
moodler 2b051f1c8e Changes to modify_database() so it works with string input 2003-02-24 09:36:15 +00:00
moodler ee0e5d57e2 Two new functions for randomizing arrays 2003-02-24 09:34:10 +00:00
moodler 663f70777a Restored Davide Suraci info 2003-02-21 09:19:22 +00:00
moodler 8f8e4f01b0 Updates and fixes, mostly from Paolo Lariccia. 2003-02-21 09:07:44 +00:00
paca70 652fd67246 Reverted to older version, those changes should never got to CVS. 2003-02-20 22:09:59 +00:00
paca70 f9a14cc720 Show creation option when available. 2003-02-20 21:55:14 +00:00
paca70 5f2c35db18 Added support for usercreation from Moodle to authentication module.
Works currently only with ldap-module (tested with e-directory), but
 other modules could be extended too by
adding following functions:

function auth_user_exists ($username) {
//returns true if given username  already exists on authetication database
}

function auth_user_create ($userobject,$plainpass) {
//create new user to authentication database
//in inactive state (if posible)
//returns true if user is created
}
function auth_user_activate ($username) {
//activate external user  after email-address is confirmed
//returns true if user is activated
}
2003-02-20 21:39:51 +00:00
moodler 47623d4f8f Portuguese, first version, contributed by Jaime Villate. 2003-02-19 11:12:22 +00:00
paca70 5443a18b8f Finnish installation instructions. 2003-02-18 22:52:55 +00:00
paca70 4c398dda96 updates
CV: ----------------------------------------------------------------------
2003-02-18 10:20:42 +00:00
paca70 79ba7581de Fixed some typos and making translation more consistent. 2003-02-18 08:41:49 +00:00
moodler 5a4d292bca Added changes to table_column from Petri Asikainen for Postgresql 7.3 2003-02-18 07:44:26 +00:00
moodler c2a96d6b32 Fixes for the use of LIMIT in SQL for Postgres 7.3 (from Petri Asikainen) 2003-02-18 03:16:07 +00:00
paca70 e10ed4f09f updates 2003-02-17 22:19:38 +00:00
moodler 14c7248d3c Select all 2003-02-17 18:14:06 +00:00
moodler a01b257195 Little changes 2003-02-17 18:13:41 +00:00
moodler dc1dc6e973 Added function to check everything on a page 2003-02-17 17:02:56 +00:00
paca70 035aa1848c updates 2003-02-17 13:35:55 +00:00
moodler 734d2c9887 Fixes to survey_get_responses() to make it work better with PostgreSQL
(from Petri Asikainen)
2003-02-17 08:35:51 +00:00
moodler 2f05b46ec9 Added language menus to top of login pages 2003-02-16 09:42:06 +00:00
moodler a59cbb7851 Update version 2003-02-16 09:25:02 +00:00
moodler 811c88b32f Fix short column 2003-02-16 09:24:25 +00:00
moodler 2a231ed650 Remove English word 'ago' 2003-02-16 09:22:52 +00:00
moodler c4e78a1b60 Tidy up the import screen 2003-02-16 08:03:55 +00:00
moodler 68fefdbe14 Change MC answers to letters a, b, c etc ... 2003-02-16 08:03:17 +00:00
moodler 49220fa70c Various quiz changes. Most importantly is the new framework for importing
quiz questions.   Importing works but is still being tested.
2003-02-16 07:08:57 +00:00
moodler 4270bba267 Fixed navigation link to login page 2003-02-15 02:58:34 +00:00
paca70 01a660a583 Updates 2003-02-12 10:27:21 +00:00
moodler 3f3960656d Fixed link to picture file in print_picture_file 2003-02-11 01:53:10 +00:00
moodler 434f33c00a Fixed license link 2003-02-11 01:35:31 +00:00
rkingdon 402eb657a6 peer graded assignment version 1.01 2003-02-06 21:43:57 +00:00
moodler 40f1246b14 Missing semicolon 2003-02-06 18:07:31 +00:00
moodler de2146b276 Note for something that needs to be fixed 2003-02-06 06:37:10 +00:00
moodler 73f8658c36 Provide the possibility that the format of a text is not defined properly 2003-02-05 12:41:59 +00:00
moodler bcdfe14e02 Whoops, fixed some obvious bugs when getting slash arguments 2003-02-05 10:52:55 +00:00
moodler eaa50dbc83 Removed some redundant code when looking for slash arguments (use me() function instead) 2003-02-05 10:48:13 +00:00
minkowski ac68f7ffc8 Completed Thai Translation 2003-02-04 04:35:17 +00:00
minkowski acf0f21ab1 rephrased quite a number of phrases 2003-02-04 04:12:30 +00:00
moodler ecc114ee3b Add better escaping for double quotes 2003-02-02 02:37:09 +00:00
rkingdon f879140423 peer graded assignment version 1.0 2003-02-01 22:04:27 +00:00
mits 08ffd31db1 New translation added. 2003-02-01 18:28:10 +00:00
rkingdon 49c4b1f779 Peer graded assignment - English Language file version 1.0 2003-02-01 17:53:41 +00:00
moodler 498d403283 Add some timing 2003-02-01 01:36:31 +00:00
paca70 56a4ed732a some updates 2003-01-31 11:05:43 +00:00
paca70 33ff2cca85 *** empty log message *** 2003-01-31 10:43:24 +00:00
moodler fced815cd7 Improved me() function 2003-01-30 15:52:38 +00:00
moodler db11e52dec Allow tags for embedded objects 2003-01-28 03:55:55 +00:00
moodler b35e8568ff Ignore all files and directories beginning with "." 2003-01-28 03:34:26 +00:00
moodler 7750f58e0c Explicitly set the character set 2003-01-28 03:06:52 +00:00
moodler f2e19ba41d Added some missing PHP variables to make it consistent with lib/htaccess 2003-01-28 03:06:20 +00:00
moodler d686bf500b Added some checks for PHP server variables - warnings are printed that
prevent installation until these are fixed.
2003-01-28 02:52:13 +00:00
moodler a09b86a693 Use On and Off instead of 0 and 1 2003-01-28 02:28:17 +00:00
moodler 0d3cbf4cca Changed some settings from "1" to "On" 2003-01-28 02:27:18 +00:00
moodler 1b27d92ad4 Old version of this file ... Ray will replace it shortly 2003-01-27 02:50:34 +00:00
moodler 89600ce15f Don't need this either 2003-01-26 16:59:39 +00:00
moodler 34afe40fb5 Removing English versions in the German lang pack 2003-01-26 16:58:55 +00:00
compuproggy c74a276913 *** empty log message *** 2003-01-26 12:22:09 +00:00
compuproggy a2da49f38b A better german version. Thx to a few modified translations of Michael Schneider 2003-01-26 12:08:01 +00:00
moodler 750ab759ed Slightly better robustness for notice() when there is no referer 2003-01-26 06:04:14 +00:00
compuproggy b49d73511b *** empty log message *** 2003-01-25 13:01:16 +00:00
moodler e79ddee2ad Smaller random number for smaller machines. :-) 2003-01-24 08:47:20 +00:00
moodler 03f06a1412 Remove the ampersand thing ... it was actually a Mozilla display bug. :-) 2003-01-24 08:41:18 +00:00
moodler 9223049919 Fixes to insert_record for inserting null values.
Also some unfinished changes to table_column ... not recommended for use right now
2003-01-24 07:51:55 +00:00
moodler 54d0590b47 Robustness fixes 2003-01-24 07:48:54 +00:00
moodler eb58acca4d New sessiontimeout config variable to set the timeout for sessions 2003-01-24 04:31:58 +00:00
moodler 7d8f674dea Implemented a safer version of stripslashes called stripslashes_safe.
This will only fix these three cases:

  \'
  \"
  \\

and leaves all other backslashes alone.  Should fix problems in forums
and forms where backslashes were sometimes disappearing from windows
paths like C:\temp - usually only in the richtext editor, but still.
2003-01-23 13:07:49 +00:00
moodler f3e48e6ef0 Solve this silly mpersand display problem 2003-01-23 05:03:27 +00:00
moodler 66fef9f99f If comment contains quotes then it can cause problems when
an assignment is uploaded.  Bug fixed by Ray Kingdon.
2003-01-23 04:23:05 +00:00
moodler 48d38fad63 Some robustness fixes 2003-01-23 02:50:38 +00:00
mits 878ece7eca New translation 2003-01-22 18:39:17 +00:00
mits 04222f70a3 no message 2003-01-22 18:38:19 +00:00
mits 5ca400f257 no message 2003-01-22 14:27:45 +00:00
mits 071df54ffd Modify strftime format for more natural Japanese way. 2003-01-22 14:26:35 +00:00
moodler dd98f2e261 Ignore the fonts folder 2003-01-22 12:03:22 +00:00
moodler 1042139455 Adding correct character set for Japanese.
These pages have to specify this stuff manually so that they work
even when not displayed within Moodle.

Nice job on the install translation, Mits!
2003-01-22 05:34:25 +00:00
moodler a42fcc51cb Removed all additional stuff for now 2003-01-22 04:15:29 +00:00
moodler 9f44d972c7 Add slashes to data pulled out of external source, just in case O'Brien logs in :-) 2003-01-22 01:55:54 +00:00
mits 5c71840819 New translation 2003-01-21 19:09:22 +00:00
moodler 7ba3fb64c9 More changes ... can't mess with the GPL. :-( 2003-01-21 16:13:23 +00:00
moodler cfe22ac921 Clean up 2003-01-21 13:22:05 +00:00
moodler eca6a3b781 Even better :-) 2003-01-21 12:57:10 +00:00
moodler 2d05c39303 Further rewording ... it's getting better I think. 2003-01-21 11:46:03 +00:00
moodler a43d392c69 Some info about this directory 2003-01-21 09:21:20 +00:00
moodler d60131c3c9 Changes to use fonts in language packs, and also to use a language
decoding function if necessary
2003-01-21 09:17:10 +00:00
moodler f6e653e06a Moved fonts into language pack so that other languages can have
proper displays in graphs
2003-01-21 07:27:01 +00:00
moodler bc43adf16d Slight changes to the wording of this new stuff 2003-01-21 04:52:17 +00:00
moodler b1e6dcb26c Rewritten for clarity 2003-01-21 03:08:37 +00:00
moodler ce9f2be2f9 Added new clause to Copyright about the use of Moodle logos. 2003-01-21 02:33:48 +00:00
moodler 86b32d51d9 Fixed a string 2003-01-20 15:55:41 +00:00
moodler 7d2e5b6595 Remove name on submit button 2003-01-20 15:43:09 +00:00
moodler 4e2767f8e0 Add times 2003-01-20 14:23:09 +00:00
moodler 17654e3845 Use $CFG->directorypermissions for new directories 2003-01-20 14:04:33 +00:00
moodler 63dddf351a Better control over directory permissions: $CFG->directorypermissions 2003-01-20 14:04:06 +00:00
moodler 2e6d42735f Added new configuration value $CFG->directorypermissions to set the
permissions for new directories created in dataroot
2003-01-20 14:03:11 +00:00
moodler 5a99c0de4d Fixes to make it work on safe mode servers, but also better control of
directory/file permissions.
2003-01-20 13:40:02 +00:00
moodler de5aabd2d2 Password had no default 2003-01-20 09:30:24 +00:00
moodler 0f61744597 Language editor uses current language (ie even the session language) 2003-01-20 09:28:38 +00:00
moodler 832ead4969 Fixed times 2003-01-20 09:23:06 +00:00
moodler 28e30091f0 Always. 2003-01-20 09:03:35 +00:00
moodler 25786a263a Throw away session language when logging in (use users language instead) 2003-01-20 09:00:36 +00:00
moodler caf7ccd44f Info 2003-01-20 08:51:50 +00:00
moodler 2fafa4bf31 Robustness fixes 2003-01-20 08:49:00 +00:00
moodler a53f918172 SOme more fixes - needs more 2003-01-20 08:40:41 +00:00
moodler b9fcddd16d FIxed some acutes 2003-01-20 08:38:30 +00:00
moodler 789a2500eb Slightly better formatting ... needs work still I think 2003-01-20 08:22:53 +00:00
moodler 3e9b5d5a90 Moved session lang setting into setup.php (works on all pages) 2003-01-20 08:09:25 +00:00
moodler 858156a995 Take session language into account when setting locale 2003-01-20 08:06:09 +00:00
moodler a38e24a544 Rearranged menu 2003-01-20 08:03:32 +00:00
moodler a5e3644bd2 Add setting of language to home page, and setting of new user accounts
to whatever the current language is.
2003-01-20 08:01:46 +00:00
moodler 0b949a6d0c Whoops, forgot a debug statement 2003-01-20 07:30:47 +00:00
moodler 1f3eb3191a More robustness on recover-password stuff 2003-01-20 07:16:23 +00:00
moodler 4028fcb159 Added Rodrigo 2003-01-20 07:13:25 +00:00
moodler 37208cd23a Some robustness 2003-01-20 07:13:02 +00:00
moodler dde4495df4 Update the version 2003-01-20 07:11:39 +00:00
moodler dc8791f367 Undoing recent change to insert_record() because of some problems 2003-01-20 07:10:14 +00:00
moodler 207190aa87 Make sure config array is always initialised before use 2003-01-20 06:43:44 +00:00
moodler c9d4e6da89 Remove old doclang variable 2003-01-19 12:37:56 +00:00
moodler 3db3acfb99 Instead of using doclang, use $SESSION->lang, and make it override other
language settings.  This should fix documentation display, but also will
be how setting registration languages and login languages works
2003-01-19 12:32:55 +00:00
mits 69ae05837c New translation 2003-01-19 12:00:06 +00:00
mits ecb1e78aaf no message 2003-01-19 11:26:28 +00:00
moodler a7e838796a Rogue tabs 2003-01-19 06:07:05 +00:00
moodler fe2874294c If we create a directory, then chmod it to protect the contents. 2003-01-19 05:54:08 +00:00
moodler 3c72e2f9c9 Some changes to insert_record to help Postgres 7.3 2003-01-19 05:46:49 +00:00
moodler e01b5c0e77 Small fix to make this script more usable on Multi-Byte languages like zh_hk 2003-01-19 05:25:31 +00:00
moodler b5fdd4c60a Updates 2003-01-19 05:05:45 +00:00
moodler 842b894b91 New translation Argentinian Spanish from Rodrigo Vigil 2003-01-19 04:57:25 +00:00
moodler 67c6f56f05 New updates for Spanish (esp. all-new help files) from Antonio Navarro 2003-01-19 03:42:29 +00:00
moodler 7fb92a3388 Changed Czech code 2003-01-19 01:23:53 +00:00
coolbit 59e6addbc9 add some new strings 2003-01-18 15:50:06 +00:00
moodler 2e43b5d987 Better notification and continue button is more useful 2003-01-18 14:24:40 +00:00
coolbit 319aa49306 update date formats 2003-01-18 14:20:22 +00:00
moodler 8f94fbcd4a Add slashes when printing correct Windows path to problems with backslashes 2003-01-18 14:05:52 +00:00
mits a9630e4f60 no message 2003-01-18 09:29:28 +00:00
mits ca791cb4a5 New translation added. 2003-01-18 09:26:55 +00:00
moodler cf194fc831 Latest updates - compatible with 1.0.8 2003-01-18 03:30:57 +00:00
moodler fdf5a1e2fb Changes to Course catagery editor to prevent duplicates 2003-01-17 02:03:42 +00:00
moodler 41b95af210 Strip slashes from short answers before comparing 2003-01-16 15:19:49 +00:00
moodler 536d3e22be Added Wales 2003-01-16 12:17:45 +00:00
moodler 722d4d1e14 Cleaned up the logic a bit 2003-01-16 11:57:34 +00:00
moodler d57bc55729 Updating the date 2003-01-16 04:06:23 +00:00
mits 83948780bc Update for New Date formatt. 2003-01-16 03:58:06 +00:00
moodler 2e41586e07 Added default date/time strings to all languages.
All European languages have now been changed to 24 hr time,
because AM and PM were not being displayed correctly.

Language editors should check these strings to see if there is
a more natural way to format these dates in their language.
2003-01-16 03:15:21 +00:00
moodler 7f43f576fc Updates from Hans de Zwart 2003-01-15 15:07:23 +00:00
moodler 7684f1efcc Minor fix with display of %% in language strings 2003-01-15 11:28:54 +00:00
moodler dcde9f020a Displayed time formats are now stored in lang files
(see the new strftime* strings) so they can be customised per language
2003-01-15 10:55:54 +00:00
moodler 9277dbd42d Bummer ... I introduced a new bug in 1.0.8.1 with pathinfo. Fixed. 2003-01-15 05:32:14 +00:00
moodler 1c418003d7 FIxed logic problem when checking has_default variable in the database
when inserting new data
2003-01-14 15:36:20 +00:00
moodler 7af6281f22 Don't bother working with empty course modules (can happen when an
module is uninstalled improperly)
2003-01-14 14:56:57 +00:00
moodler 2c104c0152 Fixed redirection when user not completed yet in some instances when
using external authentication
2003-01-14 14:54:45 +00:00
moodler ac0ac75240 Made this a bit clearer 2003-01-14 11:24:43 +00:00
moodler c078c29bb2 For assignments without a timemodified stamp, add one when graded 2003-01-14 03:01:10 +00:00
moodler dfcfb72876 Removing these files again 2003-01-14 01:47:27 +00:00
compuproggy a9a55d693e *** empty log message *** 2003-01-13 21:00:56 +00:00
moodler ab387834ab Development phase .. hold on to your hats! :-) 2003-01-13 15:26:57 +00:00
moodler 9ae687afb0 A little more robustness 2003-01-13 14:11:05 +00:00
moodler d98228e497 More checks to solve support requests before they happen. 2003-01-13 14:05:29 +00:00
moodler 13770d0c36 More fixes for robustness 2003-01-13 12:16:46 +00:00
moodler 11159c3c60 Fixed some PHP warnings 2003-01-13 12:14:47 +00:00
moodler 1063d08854 Add info that may help solve a bug on some old servers 2003-01-13 12:06:33 +00:00
moodler bcb5c5095e Fixed the default locale 2003-01-13 10:03:17 +00:00
moodler 94e3411897 Slightly more robust function 2003-01-13 02:42:57 +00:00
moodler 03c17ddfec Fix for dates (the last?) 2003-01-13 02:37:47 +00:00
moodler 3fb5b92095 RELEASE 1.0.8.1 2003-01-12 07:16:33 +00:00
moodler 29f18614e2 Updated version and release notes 2003-01-12 07:11:44 +00:00
moodler 6ed3da1da4 Cleaned up file argument processing a bit 2003-01-12 06:53:25 +00:00
moodler 1685298e60 Removed a line from config.php 2003-01-12 06:31:07 +00:00
moodler 105afdcb2e Daily changes 2003-01-12 03:35:58 +00:00
moodler 353439a354 Slight cleanup 2003-01-11 14:01:39 +00:00
moodler 6b72b9a911 A small standalone test program to test session support 2003-01-11 13:58:17 +00:00
moodler 704ac9fe76 Slightly clearer documentation 2003-01-11 05:29:49 +00:00
moodler bee00f48aa Closing sessions may fix some problems on WIndows/CGI systems ... 2003-01-11 03:03:54 +00:00
moodler 4738ab0d37 Daily changes 2003-01-10 13:47:48 +00:00
moodler f8c898243d Editing with Richtext wasn't working ... fixed now (typo) 2003-01-10 13:07:41 +00:00
moodler f978ad0acb Put in a check for the sessions directory 2003-01-10 07:33:26 +00:00
moodler d96b410816 More details about requirements 2003-01-10 07:22:34 +00:00
moodler 6c14c3948f PLease read the README.txt in this directory 2003-01-10 06:29:40 +00:00
moodler 61dcfc31e0 Updated version number 2003-01-10 05:50:34 +00:00
mits 5af670da9a no message 2003-01-10 05:44:51 +00:00
moodler 3db75c62fc Fix when making timestamps from web selector 2003-01-10 05:41:20 +00:00
moodler 39e018b338 Fix for display of date selector, and also for finding server name from
environment
2003-01-10 05:40:35 +00:00
mits a6602862fb Modified 2003-01-10 05:29:31 +00:00
moodler c897eac5e4 Some small robustness things, and a new style for quiz feedback text 2003-01-08 09:08:05 +00:00
moodler 1079c8a872 More robust when dealing with a plugin module that isn't readable 2003-01-08 09:07:07 +00:00
moodler 4e080c888a Missed something 2003-01-07 14:52:51 +00:00
moodler cd8ecdb0b9 Fixed typo 2003-01-07 14:48:06 +00:00
moodler af4542c29e Cleaned up, and improved the logic to avoid very rare case
when secret keys matched on two users
2003-01-07 14:46:12 +00:00
moodler 7dba8c384f Whoops forgot the date 2003-01-06 14:17:05 +00:00
moodler 8375fe4f88 More touch-ups 2003-01-06 14:15:45 +00:00
moodler 5cc1aff3db Robustness fixes 2003-01-06 14:01:56 +00:00
moodler ce78926df0 Small robustness fixes 2003-01-06 13:55:37 +00:00
moodler 8af3e37948 Slight increase in log field size 2003-01-06 13:40:05 +00:00
moodler 5be03da1e8 New file 2003-01-06 12:36:35 +00:00
moodler 0b963b9041 Tidying up old files 2003-01-06 12:36:08 +00:00
moodler 8d61f85e32 Update 2003-01-06 12:31:39 +00:00
moodler df8dd5f479 New strings from Fabricio 2003-01-06 12:29:52 +00:00
1598 changed files with 96843 additions and 30924 deletions
+1166 -10493
View File
File diff suppressed because it is too large Load Diff
+8 -7
View File
@@ -3,16 +3,17 @@ README $Id$
If you are installing the first time, then you
should read the installation guide which is
stored in the doc subdirectory:
doc/install.html
You can also access the latest version (as well
complete information about upgrading and using
Moodle on the moodle.com web site:
part of the Moodle documentation (along with
information about upgrading etc):
http://moodle.com/doc/
There is a copy of all this documentation as part of
this Moodle distribution. You can access your local
copy of the installation guide here:
lang/en/docs/install.html
Once Moodle is installed on your machine, then
you can also access a local copy of all this
documentation (localised to your language) at:
+61 -61
View File
@@ -1,15 +1,16 @@
<?PHP // $Id$
// Admin-only script to assign administrative rights to users
// !!! based on ../course/teacher.php (cut and pasted, then mangled)
require_once("../config.php");
define("MAX_USERS_PER_PAGE", 30);
# sanity checks
assert("!ereg('[^0-9]', \$_REQUEST['add'])");
assert("!ereg('[^0-9]', \$_REQUEST['remove'])");
optional_variable($add, "");
optional_variable($remove, "");
optional_variable($search, "");
if (! $site = get_site()) {
redirect("$CFG->wwwroot/admin/");
redirect("$CFG->wwwroot/$CFG->admin/index.php");
}
require_login();
@@ -39,6 +40,7 @@
"search",
"searchagain",
"toomanytoshow",
"searchresults"
);
foreach ($stringstoload as $stringtoload){
@@ -46,16 +48,22 @@
$$strstringtoload = get_string($stringtoload);
}
print_header("$site->shortname: $course->shortname: $strassignadmins",
if ($search) {
$searchstring = $strsearchagain;
} else {
$searchstring = $strsearch;
}
print_header("$site->shortname: $strassignadmins",
"$site->fullname",
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> ->
<A HREF=\"{$_SERVER['PHP_SELF']}\">$strassignadmins</A>", "");
"<a href=\"index.php\">$stradministration</a> ->
<a href=\"{$_SERVER['PHP_SELF']}\">$strassignadmins</a>", "");
/// Get all existing admins
$admins = get_admins();
/// Add an admin if one is specified
if ($_REQUEST['add']) {
if ($add) {
$user = @get_record("user", "id", $_REQUEST['add']) or
error("That account (id = {$_REQUEST['add']}) doesn't exist");
@@ -73,7 +81,7 @@
}
/// Remove an admin if one is specified.
if ($_REQUEST['remove']) {
if ($remove) {
$user = @get_record("user", "id", $_REQUEST['remove']) or
error("That account (id = {$_REQUEST['remove']}) doesn't exist");
@@ -96,83 +104,75 @@
/// Print the lists of existing and potential admins
echo "<TABLE CELLPADDING=2 CELLSPACING=10 ALIGN=CENTER>";
echo "<TR><TH WIDTH=50%>$strexistingadmins</TH><TH WIDTH=50%>$strpotentialadmins</TH></TR>";
echo "<TR><TD WIDTH=50% NOWRAP VALIGN=TOP>";
echo "<table cellpadding=2 cellspacing=10 align=center>";
echo "<tr><th width=50%>$strexistingadmins</th><th width=50%>$strpotentialadmins</th></tr>";
echo "<tr><td width=50% nowrap valign=top>";
/// First, show existing admins
if (! $admins) {
echo "<P ALIGN=CENTER>$strnoexistingadmins</A>";
echo "<p align=center>$strnoexistingadmins</a>";
$adminlist = "";
} else {
$adminarray = array();
foreach ($admins as $admin) {
echo "<P ALIGN=right>$admin->firstname $admin->lastname,
$admin->email &nbsp;&nbsp; ";
$adminarray[] = $admin->id;
echo "<p align=right>$admin->firstname $admin->lastname,
$admin->email &nbsp;&nbsp; ";
if ($primaryadmin->id == $admin->id){
print_spacer(10, 9, false);
} else {
echo "<A HREF=\"{$_SERVER['PHP_SELF']}?remove=$admin->id\"
TITLE=\"$strremoveadmin\"><IMG SRC=\"../pix/t/right.gif\"
BORDER=0></A>";
echo "<a href=\"{$_SERVER['PHP_SELF']}?remove=$admin->id\"
title=\"$strremoveadmin\"><img src=\"../pix/t/right.gif\"
border=0></A>";
}
echo "</P>";
echo "</p>";
}
$adminlist = implode(",",$adminarray);
unset($adminarray);
}
echo "<TD WIDTH=50% NOWRAP VALIGN=TOP>";
echo "<td width=50% nowrap valign=top>";
/// Print list of potential admins
if ($search) {
$users = get_users_search($search);
} else {
$users = get_users_confirmed();
}
$usercount = get_users(false, $search, true, $adminlist);
if ($users) {
foreach ($users as $user) { // Remove users who are already admins
if ($admins) {
foreach ($admins as $admin) {
if ($admin->id == $user->id) {
continue 2;
}
}
}
$potential[] = $user;
}
}
if ($usercount == 0) {
echo "<p align=center>$strnopotentialadmins</p>";
if (! $potential) {
echo "<P ALIGN=CENTER>$strnopotentialadmins</A>";
if ($search) {
echo "<FORM ACTION={$_SERVER['PHP_SELF']} METHOD=POST>";
echo "<INPUT TYPE=text NAME=search SIZE=20>";
echo "<INPUT TYPE=submit VALUE=\"$strsearchagain\">";
echo "</FORM>";
}
} else if ($usercount > MAX_USERS_PER_PAGE) {
echo "<p align=center>$strtoomanytoshow</p>";
} else {
if ($search) {
echo "<P ALIGN=CENTER>($strsearchresults)</P>";
echo "<p align=center>($strsearchresults : $search)</p>";
}
if (count($potential) <= 20) {
foreach ($potential as $user) {
echo "<P ALIGN=LEFT><A HREF=\"{$_SERVER['PHP_SELF']}?add=$user->id\"
TITLE=\"$straddadmin\"><IMG SRC=\"../pix/t/left.gif\" BORDER=0></A>&nbsp;&nbsp;$user->firstname $user->lastname, $user->email";
}
} else {
echo "<P ALIGN=CENTER>There are too many users to show.<BR>";
echo "Enter a search word here.";
echo "<FORM ACTION={$_SERVER['PHP_SELF']} METHOD=POST>";
echo "<INPUT TYPE=text NAME=search SIZE=20>";
echo "<INPUT TYPE=submit VALUE=\"$strsearch\">";
echo "</FORM>";
if (!$users = get_users(true, $search, true, $adminlist)) {
error("Could not get users!");
}
foreach ($users as $user) {
echo "<p align=left><a href=\"{$_SERVER['PHP_SELF']}?add=$user->id\"".
"title=\"$straddadmin\"><img src=\"../pix/t/left.gif\"".
"border=0></a>&nbsp;&nbsp;$user->firstname $user->lastname, $user->email";
}
}
echo "</TR></TABLE>";
if ($search or $usercount > MAX_USERS_PER_PAGE) {
echo "<form action={$_SERVER['PHP_SELF']} method=post>";
echo "<input type=text name=search size=20>";
echo "<input type=submit value=\"$searchstring\">";
echo "</form>";
}
echo "</tr></table>";
print_footer();
+24 -10
View File
@@ -2,7 +2,6 @@
// config.php - allows admin to edit all configuration variables
include("../config.php");
require_login();
if (!$site = get_site()) {
@@ -54,7 +53,7 @@
} else {
$auth = $config->auth;
}
require_once("$CFG->dirroot/auth/$auth/lib.php"); //just to make sure that current authentication functions are loaded
if (! isset($config->guestloginbutton)) {
$config->guestloginbutton = 1;
}
@@ -80,6 +79,9 @@
$guestoptions[0] = get_string("hide");
$guestoptions[1] = get_string("show");
$createoptions[0] = get_string("no");
$createoptions[1] = get_string("yes");
$stradministration = get_string("administration");
$strauthentication = get_string("authentication");
$strauthenticationoptions = get_string("authenticationoptions","auth");
@@ -89,7 +91,7 @@
"<A HREF=\"index.php\">$stradministration</A> -> $strauthenticationoptions", "$focus");
echo "<CENTER><P><B>";
echo "<form TARGET=\"_top\" NAME=\"authmenu\" method=\"post\" action=\"auth.php\">";
echo "<form TARGET=\"{$CFG->framename}\" NAME=\"authmenu\" method=\"post\" action=\"auth.php\">";
print_string("chooseauthmethod","auth");
choose_from_menu ($options, "auth", $auth, "","top.location='auth.php?auth='+document.authmenu.auth.options[document.authmenu.auth.selectedIndex].value", "");
@@ -99,11 +101,11 @@
print_simple_box_start("center", "100%", "$THEME->cellheading");
print_heading($options[$auth]);
echo "<BLOCKQUOTE><CENTER><P>";
print_simple_box_start("center", "60%", "$THEME->cellcontent");
print_string("auth_$auth"."description", "auth");
echo "</P></CENTER></BLOCKQUOTE>";
print_simple_box_end();
echo "<HR>";
echo "<hr>";
print_heading($strsettings);
@@ -117,7 +119,7 @@
print_string("changepassword", "auth");
echo ":</p></td>";
echo "<td>";
echo "<INPUT TYPE=\"text\" NAME=\"changepassword\" SIZE=40 VALUE=\"$config->changepassword\">";
echo "<input type=\"text\" name=\"changepassword\" size=40 value=\"$config->changepassword\">";
echo "</td>";
echo "<td>";
print_string("changepasswordhelp","auth");
@@ -134,12 +136,24 @@
echo "</td>";
echo "<td>";
print_string("showguestlogin","auth");
echo "</td></tr></table>";
echo "</td></tr>";
if (function_exists('auth_user_create')){
echo "<tr valign=\"top\">";
echo "<td align=right nowrap><p>";
print_string("auth_user_create", "auth");
echo ":</p></td>";
echo "<td>";
choose_from_menu($createoptions, "auth_user_create", $config->auth_user_create, "");
echo "</td>";
echo "<td>";
print_string("auth_user_creation","auth");
echo "</td></tr>";
}
echo "<CENTER><P><INPUT TYPE=\"submit\" VALUE=\"";
echo "</table><center><p><input type=\"submit\" value=\"";
print_string("savechanges");
echo "\"></P></CENTER></FORM>";
echo "\"></p></center></form>";
print_simple_box_end();
+260 -157
View File
@@ -1,74 +1,100 @@
<FORM METHOD="post" action="config.php" NAME="form">
<form method="post" action="config.php" name="form">
<TABLE cellpadding=9 cellspacing=0 >
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>lang:</TD>
<TD>
<? choose_from_menu (get_list_of_languages(), "lang", $config->lang, "", "", ""); ?>
</TD>
<TD>
<? print_string("configlang") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>langdir:</TD>
<TD>
<? unset($options);
<table cellpadding=9 cellspacing=0 >
<tr valign=top>
<td align=right><p>lang:</td>
<td>
<?php choose_from_menu (get_list_of_languages(), "lang", $config->lang, "", "", ""); ?>
</td>
<td>
<?php print_string("configlang") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>langdir:</td>
<td>
<?php
unset($options);
$options["LTR"] = get_string("langltr");
$options["RTL"] = get_string("langrtl");
choose_from_menu ($options, "langdir", $config->langdir, "", "", "");
?>
</TD>
<TD>
<? print_string("configlangdir") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>locale:</TD>
<TD>
<INPUT NAME=locale TYPE=text SIZE=10 VALUE="<?=$config->locale?>">
</TD>
<TD>
<? print_string("configlocale") ?>
</TD>
</td>
<td>
<?php print_string("configlangdir") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>langmenu:</td>
<td>
<?php
unset($options);
$options[0] = get_string("no");
$options[1] = get_string("yes");
choose_from_menu ($options, "langmenu", $config->langmenu, "", "", "");
?>
</td>
<td>
<?php print_string("configlangmenu") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>langlist:</td>
<td>
<input name=langlist type=text size=40 value="<?php p($config->langlist) ?>">
</td>
<td>
<?php print_string("configlanglist") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>locale:</td>
<td>
<input name=locale type=text size=10 value="<?php p($config->locale) ?>">
</td>
<td>
<?php print_string("configlocale") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>country:</td>
<td><?php choose_from_menu ($COUNTRIES, "country", $config->country, get_string("selectacountry"), "", "") ?>
</td>
<td>
<?php print_string("configcountry") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>smtphosts:</td>
<td>
<input name=smtphosts type=text size=30 value="<?php p($config->smtphosts)?>">
</td>
<td>
<?php print_string("configsmtphosts") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>smtpuser:</td>
<td>
<input name=smtpuser type=text size=10 value="<?php p($config->smtpuser)?>">
</td>
<td rowspan=2>
<?php print_string("configsmtpuser") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>smtppass:</td>
<td>
<input name=smtppass type=text size=10 value="<?php p($config->smtppass)?>">
</td>
</TR>
<tr valign=top>
<td align=right><P>country:</td>
<td><? choose_from_menu ($COUNTRIES, "country", $config->country, get_string("selectacountry"), "", "") ?>
</td>
<TD>
<? print_string("configcountry") ?>
</TD>
</tr>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>smtphosts:</TD>
<TD>
<INPUT NAME=smtphosts TYPE=text SIZE=30 VALUE="<?=$config->smtphosts?>">
</TD>
<TD>
<? print_string("configsmtphosts") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>smtpuser:</TD>
<TD>
<INPUT NAME=smtpuser TYPE=text SIZE=10 VALUE="<?=$config->smtpuser?>">
</TD>
<TD ROWSPAN=2>
<? print_string("configsmtpuser") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>smtppass:</TD>
<TD>
<INPUT NAME=smtppass TYPE=text SIZE=10 VALUE="<?=$config->smtppass?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>gdversion:</TD>
<TD>
<? unset($options);
<td align=right><p>gdversion:</td>
<td>
<?php
unset($options);
$options[0] = get_string("gdnot");
$options[1] = get_string("gd1");
$options[2] = get_string("gd2");
@@ -77,28 +103,31 @@
choose_from_menu ($options, "gdversion", $installed, "", "", "");
?>
</TD>
<TD>
<? print_string("configgdversion") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>htmleditor:</TD>
<TD>
<? unset($options);
</td>
<td>
<?php print_string("configgdversion") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>htmleditor:</td>
<td>
<?php
unset($options);
$options[0] = get_string("allownot");
$options[1] = get_string("allow");
choose_from_menu ($options, "htmleditor", $config->htmleditor, "", "", "");
?>
</TD>
<TD>
<? print_string("confightmleditor") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>maxeditingtime:</TD>
<TD>
<? $options[3600] = get_string("numminutes", "", 60);
</td>
<td>
<?php print_string("confightmleditor") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>maxeditingtime:</td>
<td>
<?php
unset($options);
$options[3600] = get_string("numminutes", "", 60);
$options[2700] = get_string("numminutes", "", 45);
$options[1800] = get_string("numminutes", "", 30);
$options[900] = get_string("numminutes", "", 15);
@@ -106,17 +135,18 @@
$options[60] = get_string("numminutes", "", 1);
choose_from_menu ($options, "maxeditingtime", $config->maxeditingtime, "", "", "");
unset($options);
?>
</TD>
<TD>
<? print_string("configmaxeditingtime") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>longtimenosee:</TD>
<TD>
<? $options[1000] = get_string("numdays", "", 1000);
</td>
<td>
<?php print_string("configmaxeditingtime") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>longtimenosee:</td>
<td>
<?php
unset($options);
$options[1000] = get_string("numdays", "", 1000);
$options[365] = get_string("numdays", "", 365);
$options[180] = get_string("numdays", "", 180);
$options[150] = get_string("numdays", "", 150);
@@ -124,85 +154,158 @@
$options[90] = get_string("numdays", "", 90);
$options[60] = get_string("numdays", "", 60);
$options[30] = get_string("numdays", "", 30);
$options[21] = get_string("numdays", "", 21);
$options[14] = get_string("numdays", "", 14);
$options[7] = get_string("numdays", "", 7);
choose_from_menu ($options, "longtimenosee", $config->longtimenosee, "", "", "");
unset($options);
?>
</TD>
<TD>
<? print_string("configlongtimenosee") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>zip:</TD>
<TD>
<INPUT name=zip TYPE=text SIZE=30 VALUE="<?=$config->zip?>">
</TD>
<TD>
<? print_string("configzip") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>unzip:</TD>
<TD>
<INPUT name=unzip TYPE=text SIZE=30 VALUE="<?=$config->unzip?>">
</TD>
<TD>
<? print_string("configunzip") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>slasharguments:</TD>
<TD>
<? $options[0] = "file.php?file=/pic.jpg";
</td>
<td>
<?php print_string("configlongtimenosee") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>loglifetime:</td>
<td>
<?php
unset($options);
$options[0] = get_string("neverdeletelogs");
$options[1000] = get_string("numdays", "", 1000);
$options[365] = get_string("numdays", "", 365);
$options[180] = get_string("numdays", "", 180);
$options[150] = get_string("numdays", "", 150);
$options[120] = get_string("numdays", "", 120);
$options[90] = get_string("numdays", "", 90);
$options[60] = get_string("numdays", "", 60);
$options[30] = get_string("numdays", "", 30);
choose_from_menu ($options, "loglifetime", $config->loglifetime, "", "", "");
?>
</td>
<td>
<?php print_string("configloglifetime") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>sessiontimeout:</td>
<td>
<?php
unset($options);
$options[14400] = get_string("numhours", "", 4);
$options[10800] = get_string("numhours", "", 3);
$options[7200] = get_string("numhours", "", 2);
$options[5400] = get_string("numhours", "", "1.5");
$options[3600] = get_string("numminutes", "", 60);
$options[2700] = get_string("numminutes", "", 45);
$options[1800] = get_string("numminutes", "", 30);
$options[900] = get_string("numminutes", "", 15);
$options[300] = get_string("numminutes", "", 5);
choose_from_menu ($options, "sessiontimeout", $config->sessiontimeout, "", "", "");
?>
</td>
<td>
<?php print_string("configsessiontimeout") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>zip:</td>
<td>
<input name=zip type=text size=30 value="<?php p($config->zip) ?>">
</td>
<td>
<?php print_string("configzip") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>unzip:</td>
<td>
<input name=unzip type=text size=30 value="<?php p($config->unzip) ?>">
</td>
<td>
<?php print_string("configunzip") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>slasharguments:</td>
<td>
<?php unset($options);
$options[0] = "file.php?file=/pic.jpg";
$options[1] = "file.php/pic.jpg";
$installed = check_gd_version();
choose_from_menu ($options, "slasharguments", $config->slasharguments, "", "", "");
unset($options);
?>
</TD>
<TD>
<? print_string("configslasharguments") ?>
</TD>
</td>
<td>
<?php print_string("configslasharguments") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>proxyhost:</td>
<td>
<input name=proxyhost type=text size=30 value="<?php p($config->proxyhost) ?>">
</td>
<td rowspan=2>
<?php print_string("configproxyhost") ?>
</td>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>proxyhost:</TD>
<TD>
<INPUT name=proxyhost TYPE=text SIZE=30 VALUE="<?=$config->proxyhost?>">
</TD>
<TD ROWSPAN=2>
<? print_string("configproxyhost") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>proxyport:</TD>
<TD>
<INPUT name=proxyport TYPE=text SIZE=5 VALUE="<?=$config->proxyport?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>debug:</TD>
<TD>
<? $options[7] = get_string("no");
<tr valign=top>
<td align=right><p>proxyport:</td>
<td>
<input name=proxyport type=text size=5 value="<?php p($config->proxyport) ?>">
</td>
</tr>
<tr valign=top>
<td align=right><p>debug:</td>
<td>
<?php
unset($options);
$options[7] = get_string("no");
$options[15] = get_string("yes");
choose_from_menu ($options, "debug", $config->debug, "", "", "");
unset($options);
?>
</TD>
<TD>
<? print_string("configdebug") ?>
</TD>
</TR>
</td>
<td>
<?php print_string("configdebug") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>framename:</td>
<td>
<?php
if (empty($config->framename)) {
$config->framename = "_top";
}
?>
<input name=framename type=text size=15 value="<?php p($config->framename)?>">
</td>
<td>
<?php print_string("configframename") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>secureforms:</td>
<td>
<?php
unset($options);
$options[0] = get_string("no");
$options[1] = get_string("yes");
choose_from_menu ($options, "secureforms", $config->secureforms, "", "", "");
?>
</td>
<td>
<?php print_string("configsecureforms") ?>
</td>
</tr>
<TR>
<TD COLSPAN=3 ALIGN=CENTER>
<INPUT TYPE="submit" VALUE="<? print_string("savechanges") ?>"></TD>
</TR>
</TABLE>
<tr>
<td colspan=3 align=center>
<input type="submit" value="<?php print_string("savechanges") ?>"></td>
</tr>
</table>
</FORM>
</form>
+12 -23
View File
@@ -1,29 +1,9 @@
<?PHP // $Id$
// config.php - allows admin to edit all configuration variables
if (isset($phpinfo)) { // For debugging purposes, protected by password
if (md5($phpinfo) == "caf9b6b99962bf5c2264824231d7a40c") {
phpinfo();
exit;
}
}
require_once("../config.php");
require_once("../lib/countries.php");
if (isset($config)) { // For debugging purposes, protected by password
if (md5($config) == "caf9b6b99962bf5c2264824231d7a40c") {
if ($site = get_site()) {
print_heading("$site->fullname");
}
$TEMPCFG = $CFG;
unset($TEMPCFG->dbuser);
unset($TEMPCFG->dbpass);
print_object($TEMPCFG);
exit;
}
}
if ($site = get_site()) { // If false then this is a new installation
require_login();
@@ -32,10 +12,16 @@
}
}
/// This is to overcome the "insecure forms paradox"
if (isset($secureforms) and $secureforms == 0) {
$match = "nomatch";
} else {
$match = "";
}
/// If data submitted, then process and store.
if ($config = data_submitted()) {
if ($config = data_submitted($match)) {
validate_form($config, $err);
@@ -86,13 +72,16 @@
print_header();
print_heading($strconfigvariables);
print_simple_box(get_string("configintro"), "center");
echo "<BR>";
echo "<br />";
}
print_simple_box_start("center", "", "$THEME->cellheading");
include("config.html");
print_simple_box_end();
print_footer();
if ($site) {
print_footer();
}
exit;
+165
View File
@@ -0,0 +1,165 @@
<?PHP // $Id$
// Admin only script to assign course creator rights to users
require_once("../config.php");
define("MAX_USERS_PER_PAGE", 30);
optional_variable($search, "");
optional_variable($add, "");
optional_variable($remove, "");
if (! $site = get_site()) {
redirect("$CFG->wwwroot/$CFG->admin/index.php");
}
require_login();
if (!isadmin()) {
error("You must be an administrator to use this page.");
}
$primaryadmin = get_admin();
/// If you want any administrator to have the ability to assign admin
/// rights, then comment out the following if statement
if ($primaryadmin->id != $USER->id) {
error("You must be the primary administrator to use this page.");
}
/// assign all of the configurable language strings
$stringstoload = array (
"assigncreators",
"administration",
"existingcreators",
"noexistingcreators",
"potentialcreators",
"nopotentialcreators",
"addcreator",
"removecreator",
"search",
"searchagain",
"toomanytoshow",
);
foreach ($stringstoload as $stringtoload){
$strstringtoload = "str" . $stringtoload;
$$strstringtoload = get_string($stringtoload);
}
if ($search) {
$searchstring = $strsearchagain;
} else {
$searchstring = $strsearch;
}
print_header("$site->shortname: $strassigncreators",
"$site->fullname",
"<a href=\"index.php\">$stradministration</a> ->
<a href=\"{$_SERVER['PHP_SELF']}\">$strassigncreators</a>", "");
/// Get all existing creators
$creators = get_creators();
/// Add an creator if one is specified
if ($add) {
$user = @get_record("user", "id", $add) or
error("That account (id = $add) doesn't exist");
if ($creators) {
foreach ($creators as $aa) {
if ($aa->id == $user->id) {
error("That user is already a creator .");
}
}
}
$creator->userid = $user->id;
$creator->id = insert_record("user_coursecreators", $creator);
$creators[] = $user;
}
/// Remove an creator if one is specified.
if ($remove) {
$user = @get_record("user", "id", $remove) or
error("That account (id = $remove) doesn't exist");
if ($creators) {
foreach ($creators as $key => $aa) {
if ($aa->id == $user->id) {
delete_records("user_coursecreators","userid",$user->id);
unset($creators[$key]);
}
}
}
}
/// Print the lists of existing and potential creators
echo "<table cellpadding=2 cellspacing=10 align=center>";
echo "<tr><th width=50%>$strexistingcreators</th><th width=50%>$strpotentialcreators</th></tr>";
echo "<tr><td width=50% nowrap valign=top>";
/// First, show existing creators
if (! $creators) {
echo "<p align=center>$strnoexistingcreators</a>";
$creatorlist = "";
} else {
$creatorarray = array();
foreach ($creators as $creator) {
$creatorarray[] = $creator->id;
echo "<p align=right>$creator->firstname $creator->lastname,
$creator->email &nbsp;&nbsp; ";
echo "<a href=\"{$_SERVER['PHP_SELF']}?remove=$creator->id\"
title=\"$strremovecreator\"><img src=\"../pix/t/right.gif\"
border=0></a>";
echo "</p>";
}
$creatorlist = implode(",",$creatorarray);
unset($creatorarray);
}
echo "<td width=50% nowrap valign=top>";
/// Print list of potential creators
$usercount = get_users(false, $search, true, $creatorlist);
if ($usercount == 0) {
echo "<p align=center>$strnopotentialcreators</p>";
} else if ($usercount > MAX_USERS_PER_PAGE) {
echo "<p align=center>$strtoomanytoshow</p>";
} else {
if ($search) {
echo "<p align=center>($strsearchresults : $search)</p>";
}
if (!$users = get_users(true, $search, true, $creatorlist)) {
error("Could not get users!");
}
foreach ($users as $user) {
echo "<p align=left><a href=\"{$_SERVER['PHP_SELF']}?add=$user->id\"".
"title=\"$straddcreator\"><img src=\"../pix/t/left.gif\"".
"border=0></a>&nbsp;&nbsp;$user->firstname $user->lastname, $user->email";
}
}
if ($search or $usercount > MAX_USERS_PER_PAGE) {
echo "<form action={$_SERVER['PHP_SELF']} method=post>";
echo "<input type=text name=search size=20>";
echo "<input type=submit value=\"$searchstring\">";
echo "</form>";
}
echo "</tr></table>";
print_footer();
?>
+32 -13
View File
@@ -1,25 +1,27 @@
<?PHP // $Id$
// This script looks through all the module directories for cron.php files
// and runs them. These files can contain cleanup functions, email functions
// or anything that needs to be run on a regular basis.
//
// This file is best run from cron on the host system (ie outside PHP).
// The script can either be invoked via the web server or via a standalone
// version of PHP compiled for CGI.
//
// eg wget -q -O /dev/null 'http://moodle.somewhere.edu/admin/cron.php'
// or php /web/moodle/admin/cron.php
/// This script looks through all the module directories for cron.php files
/// and runs them. These files can contain cleanup functions, email functions
/// or anything that needs to be run on a regular basis.
///
/// This file is best run from cron on the host system (ie outside PHP).
/// The script can either be invoked via the web server or via a standalone
/// version of PHP compiled for CGI.
///
/// eg wget -q -O /dev/null 'http://moodle.somewhere.edu/admin/cron.php'
/// or php /web/moodle/admin/cron.php
$FULLME = "cron";
$starttime = microtime();
require_once("../config.php");
echo "<PRE>\n";
$timenow = time();
// Run all cron jobs for each module
/// Run all cron jobs for each module
if ($mods = get_records_select("modules", "cron > 0 AND (($timenow - lastcron) > cron)")) {
foreach ($mods as $mod) {
@@ -39,7 +41,7 @@
}
// Unenrol users who haven't logged in for $CFG->longtimenosee
/// Unenrol users who haven't logged in for $CFG->longtimenosee
if ($CFG->longtimenosee) { // value in days
$longtime = $timenow - ($CFG->longtimenosee * 3600 * 24);
@@ -53,7 +55,7 @@
}
// Delete users who haven't confirmed within seven days
/// Delete users who haven't confirmed within seven days
$oneweek = $timenow - (7 * 24 * 3600);
if ($users = get_users_unconfirmed($oneweek)) {
@@ -64,6 +66,23 @@
}
}
/// Delete old queued mail that didn't get sent within 30 minutes
$oldmailtime = $timenow - 1800;
delete_records_select("mail_queue", "timecreated < '$oldmailtime'");
/// Delete old logs to save space (this might need a timer to slow it down...)
if (!empty($CFG->loglifetime)) { // value in days
$loglifetime = $timenow - ($CFG->loglifetime * 3600 * 24);
delete_records_select("log", "time < '$loglifetime'");
}
echo "Cron script completed correctly\n";
$difftime = microtime_diff($starttime, microtime());
echo "Execution took ".$difftime." seconds\n";
?>
+136 -40
View File
@@ -1,22 +1,90 @@
<?PHP // $Id$
/// Check that config.php exists
if (!file_exists("../config.php")) {
echo "<H2 align=center>You need to create a config.php.<BR>
See the <A HREF=\"http://moodle.com/doc/?frame=install.html\">installation instructions</A>.</H2>";
die;
}
require_once("../config.php");
/// Check that PHP is of a sufficient version
if ( ! check_php_version("4.1.0") ) {
if (!check_php_version("4.1.0")) {
$version = phpversion();
print_heading("Sorry, Moodle requires PHP 4.1.0 or later (currently using version $version)");
die;
}
/// Check some PHP server settings
$documentationlink = "please read the <A HREF=\"../doc/?frame=install.html&sub=webserver\">install documentation</A>";
if (ini_get_bool('session.auto_start')) {
error("The PHP server variable 'session.auto_start' should be Off - $documentationlink");
}
if (ini_get_bool('magic_quotes_runtime')) {
error("The PHP server variable 'magic_quotes_runtime' should be Off - $documentationlink");
}
if (!ini_get_bool('magic_quotes_gpc')) {
error("The PHP server variable 'magic_quotes_gpc' is not turned On - $documentationlink");
}
if (!ini_get_bool('file_uploads')) {
error("The PHP server variable 'file_uploads' is not turned On - $documentationlink");
}
if (!ini_get_bool('short_open_tag')) {
error("The PHP server variable 'short_open_tag' is not turned On - $documentationlink");
}
/// Check that sessions are supported
if (!is_readable(ini_get('session.save_path')) and !ini_get_bool('safe_mode')) {
$sessionpath = ini_get('session.save_path');
notify("Warning: It appears your server does not support sessions (session.save_path = '$sessionpath')");
}
/// Check that config.php has been edited
if ($CFG->wwwroot == "http://example.com/moodle") {
error("Moodle has not been configured yet. You need to to edit config.php first.");
}
/// Check settings in config.php
$dirroot = dirname(realpath("../config.php"));
if ($dirroot != $CFG->dirroot) {
error("Please fix your settings in config.php:
<P>You have:
<P>\$CFG->dirroot = \"".addslashes($CFG->dirroot)."\";
<P>but it should be:
<P>\$CFG->dirroot = \"".addslashes($dirroot)."\";",
"./");
}
/// Set some necessary variables during set-up to avoid PHP warnings later on this page
if (!isset($CFG->framename)) {
$CFG->framename = "_top";
}
if (!isset($CFG->release)) {
$CFG->release = "";
}
if (!isset($CFG->version)) {
$CFG->version = "";
}
/// Check if the main tables have been installed yet or not.
if (! $tables = $db->Metatables() ) { // No tables yet at all.
@@ -36,23 +104,23 @@
}
if (! $maintables) {
if (!$agreelicence) {
if (empty($agreelicence)) {
$strlicense = get_string("license");
print_header($strlicense, $strlicense, $strlicense);
print_heading("<A HREF=\"http://moodle.com\">Moodle</A> - Modular Object-Oriented Dynamic Learning Environment");
print_header($strlicense, $strlicense, $strlicense, "", "", false, "&nbsp;", "&nbsp;");
print_heading("<A HREF=\"http://moodle.org\">Moodle</A> - Modular Object-Oriented Dynamic Learning Environment");
print_heading(get_string("copyrightnotice"));
print_simple_box_start("CENTER");
print_simple_box_start("center");
echo text_to_html(get_string("gpl"));
print_simple_box_end();
echo "<BR>";
echo "<br />";
notice_yesno(get_string("doyouagree"), "index.php?agreelicence=true",
"http://www.gnu.org/copyleft/gpl.html");
"http://moodle.org/doc/?frame=licence.html");
exit;
}
$strdatabasesetup = get_string("databasesetup");
$strdatabasesuccess = get_string("databasesuccess");
print_header($strdatabasesetup, $strdatabasesetup, $strdatabasesetup);
print_header($strdatabasesetup, $strdatabasesetup, $strdatabasesetup, "", "", false, "&nbsp;", "&nbsp;");
if (file_exists("$CFG->libdir/db/$CFG->dbtype.sql")) {
$db->debug = true;
set_time_limit(0); // To allow slow databases to complete the long SQL
@@ -82,7 +150,8 @@
$a->newversion = $version;
$strdatabasechecking = get_string("databasechecking", "", $a);
$strdatabasesuccess = get_string("databasesuccess");
print_header($strdatabasechecking, $strdatabasechecking, $strdatabasechecking);
print_header($strdatabasechecking, $strdatabasechecking, $strdatabasechecking,
"", "", false, "&nbsp;", "&nbsp;");
print_heading($strdatabasechecking);
$db->debug=true;
if (main_upgrade($CFG->version)) {
@@ -103,8 +172,9 @@
}
} else {
$strdatabaseupgrades = get_string("databaseupgrades");
print_header($strdatabaseupgrades, $strdatabaseupgrades, $strdatabaseupgrades);
$strcurrentversion = get_string("currentversion");
print_header($strcurrentversion, $strcurrentversion, $strcurrentversion,
"", "", false, "&nbsp;", "&nbsp;");
if (set_config("version", $version)) {
print_heading("You are currently using Moodle version $version (Release $release)");
@@ -124,8 +194,8 @@
/// Updated human-readable release version if necessary
if ($release <> $CFG->release) { // Update the release version
$strdatabaseupgrades = get_string("databaseupgrades");
print_header($strdatabaseupgrades, $strdatabaseupgrades, $strdatabaseupgrades);
$strcurrentrelease = get_string("currentrelease");
print_header($strcurrentrelease, $strcurrentrelease, $strcurrentrelease, "", "", false, "&nbsp;", "&nbsp;");
print_heading($release);
if (!set_config("release", $release)) {
notify("ERROR: Could not update release version in database!!");
@@ -155,8 +225,20 @@
unset($module);
include_once("$fullmod/version.php"); # defines $module with version etc
include_once("$fullmod/db/$CFG->dbtype.php"); # defines upgrading function
if ( is_readable("$fullmod/version.php")) {
include_once("$fullmod/version.php"); # defines $module with version etc
} else {
notify("Module $mod: $fullmod/version.php was not readable");
continue;
}
if ( is_readable("$fullmod/db/$CFG->dbtype.php")) {
include_once("$fullmod/db/$CFG->dbtype.php"); # defines upgrading function
} else {
notify("Module $mod: $fullmod/db/$CFG->dbtype.php was not readable");
continue;
}
if (!isset($module)) {
continue;
@@ -194,7 +276,7 @@
} else { // module not installed yet, so install it
if (empty($updated_modules)) {
$strmodulesetup = get_string("modulesetup");
print_header($strmodulesetup, $strmodulesetup, $strmodulesetup);
print_header($strmodulesetup, $strmodulesetup, $strmodulesetup, "", "", false, "&nbsp;", "&nbsp;");
}
print_heading($module->name);
$updated_modules = true;
@@ -250,8 +332,8 @@
}
/// Check for valid admin user
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
if (!iscreator()) {
error("You need to be an admin user or teacher to use this page.", "$CFG->wwwroot/login/index.php");
}
@@ -259,31 +341,45 @@
$stradministration = get_string("administration");
print_header("$site->shortname: $stradministration","$site->fullname: $stradministration", "$stradministration");
$table->head = array (get_string("site"), get_string("courses"), get_string("users"));
$table->align = array ("CENTER", "CENTER", "CENTER");
$table->data[0][0] = "<P><A HREF=\"config.php\">".get_string("configvariables")."</A></P>".
"<P><A HREF=\"site.php\">".get_string("sitesettings")."</A></P>".
"<P><A HREF=\"../course/log.php?id=$site->id\">".get_string("sitelogs")."</A></P>".
"<P><A HREF=\"../theme/index.php\">".get_string("choosetheme")."</A></P>".
"<P><A HREF=\"lang.php\">".get_string("checklanguage")."</A></P>";
if (file_exists("$CFG->dirroot/admin/$CFG->dbtype")) {
$table->data[0][0] .= "<P><A HREF=\"$CFG->dbtype/frame.php\">".get_string("managedatabase")."</A></P>";
}
$table->data[0][1] = "<P><A HREF=\"../course/edit.php\">".get_string("addnewcourse")."</A></P>".
"<P><A HREF=\"../course/teacher.php\">".get_string("assignteachers")."</A></P>".
"<P><A HREF=\"../course/delete.php\">".get_string("deletecourse")."</A></P>".
"<P><A HREF=\"../course/categories.php\">".get_string("categories")."</A></P>";
$table->data[0][2] = "<P><A HREF=\"user.php?newuser=true\">".get_string("addnewuser")."</A></P>".
"<P><A HREF=\"user.php\">".get_string("edituser")."</A></P>".
"<P><A HREF=\"admin.php\">".get_string("assignadmins")."</A></P>".
"<P><A HREF=\"auth.php\">".get_string("authentication")."</A></P>";
if (isadmin()) {
$table->head = array (get_string("site"), get_string("courses"), get_string("users"));
$table->align = array ("CENTER", "CENTER", "CENTER");
$table->data[0][0] = "<p><a href=\"config.php\">".get_string("configvariables")."</a></p>".
"<p><a href=\"site.php\">".get_string("sitesettings")."</a></p>".
"<p><a href=\"../course/log.php?id=$site->id\">".get_string("sitelogs")."</a></p>".
"<p><a href=\"../theme/index.php\">".get_string("choosetheme")."</a></p>".
"<p><a href=\"lang.php\">".get_string("checklanguage")."</a></p>".
"<p><a href=\"modules.php\">".get_string("managemodules")."</a></p>";
if (file_exists("$CFG->dirroot/admin/$CFG->dbtype")) {
$table->data[0][0] .= "<p><a href=\"$CFG->dbtype/frame.php\">".get_string("managedatabase")."</a></p>";
}
$table->data[0][1] = "<p><a href=\"../course/edit.php\">".get_string("addnewcourse")."</a></p>".
"<p><a href=\"teacher.php\">".get_string("assignteachers")."</a></p>".
"<p><a href=\"../course/delete.php\">".get_string("deletecourse")."</a></p>".
"<p><a href=\"../course/categories.php\">".get_string("categories")."</a></p>";
if ($CFG->auth == "email" || $CFG->auth == "none" || $CFG->auth == "manual") {
$table->data[0][2] = "<p><a href=\"user.php?newuser=true\">".get_string("addnewuser")."</a></p>";
}
$table->data[0][2] .= "<p><a href=\"user.php\">".get_string("edituser")."</a></p>".
"<p><a href=\"admin.php\">".get_string("assignadmins")."</a></p>".
"<p><a href=\"creators.php\">".get_string("assigncreators")."</a></p>".
"<p><a href=\"auth.php\">".get_string("authentication")."</a></p>";
} else { /// user is coursecreator
$table->head = array (get_string("courses"));
$table->align = array ("CENTER");
$table->data[0][1] = "<p><a href=\"../course/edit.php\">".get_string("addnewcourse")."</a></p>".
"<p><a href=\"teacher.php\">".get_string("assignteachers")."</a></p>";
}
print_table($table);
echo "<BR><DIV align=center>";
echo "<br><div align=center>";
print_single_button("$CFG->wwwroot/doc", NULL, get_string("documentation"));
echo "</DIV>";
echo "</div>";
echo "<br><div align=center>";
print_single_button("register.php", NULL, get_string("registration"));
echo "</div>";
print_heading("Moodle $CFG->release ($CFG->version)", "CENTER", 1);
+28 -16
View File
@@ -36,19 +36,19 @@
break;
}
if ($USER->lang) {
$currentlang = $USER->lang;
} else {
$currentlang = $CFG->lang;
}
$currentlang = current_language();
print_header("$site->shortname: $title", "$site->fullname",
"<A HREF=\"index.php\">$stradministration</A> -> $navigation");
"<a href=\"index.php\">$stradministration</a> -> $navigation");
if (!$mode) {
print_heading("$strcurrentlanguage: $currentlang - ".get_string("thislanguage"));
print_heading("<A HREF=\"lang.php?mode=missing\">$strmissingstrings</A>");
print_heading("<A HREF=\"lang.php?mode=compare\">$strcomparelanguage</A>");
print_heading("<a href=\"lang.php?mode=missing\">$strmissingstrings</a>");
print_heading("<a href=\"lang.php?mode=compare\">$strcomparelanguage</a>");
echo "<center><hr noshade size=1>";
$options["lang"] = $currentlang;
print_single_button("http://moodle.org/download/lang/", $options, get_string("latestlanguagepack"));
echo "</center>";
print_footer();
exit;
}
@@ -63,7 +63,7 @@
}
foreach ($stringfiles as $key => $file) {
if ($file == "README" or $file == "help" or $file == "docs") {
if ($file == "README" or $file == "help" or $file == "docs" or $file == "fonts") {
unset($stringfiles[$key]);
}
}
@@ -89,12 +89,13 @@
if (!isset($string[$key]) or $string[$key] == "") {
$value = htmlspecialchars($value);
$value = str_replace("$"."a", "\\$"."a", $value);
$value = str_replace("%%","%",$value);
if ($first) {
echo "</PRE><HR><P><B>".get_string("stringsnotset","","$langdir/$file")."</B></P><PRE>";
$first = false;
$somethingfound = true;
}
echo "$"."string[$key] = \"$value\";<BR>";
echo "$"."string['$key'] = \"$value\";<BR>";
}
}
}
@@ -147,7 +148,7 @@
echo "</CENTER>";
foreach ($stringfiles as $file) {
print_heading("$file", "LEFT", 4);
if (!file_exists("$langdir/$file")) {
@@ -180,14 +181,22 @@
echo "<TABLE WIDTH=\"100%\" CELLPADDING=2 CELLSPACING=3 BORDER=0>";
foreach ($enstring as $key => $envalue) {
$envalue = nl2br(htmlspecialchars($envalue));
$envalue = str_replace("\$a","<B>\$a</B>", $envalue); // Make variables bold
// TODO: It would be nice if all the $a->something variables were bold too
$envalue = preg_replace('/(\$a\-\&gt;[a-zA-Z0-9]*|\$a)/', '<b>$0</b>', $envalue); // Make variables bold.
$envalue = str_replace("%%","%",$envalue);
echo "<TR>";
echo "<TD WIDTH=20% BGCOLOR=\"$THEME->cellheading\" NOWRAP VALIGN=TOP>$key</TD>";
echo "<TD WIDTH=40% BGCOLOR=\"$THEME->cellheading\" VALIGN=TOP>$envalue</TD>";
$value = str_replace("\\","",$string[$key]); // Delete all slashes
$value = $string[$key];
$value = str_replace("\r","",$value); // Bad character caused by Windows
$value = str_replace("\n\n\n\n\n\n","\n",$value); // Collapse runs of blank lines
$value = str_replace("\n\n\n\n\n","\n",$value);
$value = str_replace("\n\n\n\n","\n",$value);
$value = str_replace("\n\n\n","\n",$value);
$value = str_replace("\n\n\n","\n",$value);
$value = str_replace("\\","",$value); // Delete all slashes
$value = str_replace("%%","%",$value);
$value = htmlspecialchars($value);
$cellcolour = $value ? $THEME->cellcontent: $THEME->highlight;
@@ -258,9 +267,12 @@ function lang_save_file($path, $file, $strings) {
foreach ($strings as $key => $value) {
list($id, $stringname) = explode("-",$key);
$value = str_replace("\\","",$value); // Delete all slashes
if ($CFG->lang != "zh_hk" and $CFG->lang != "zh_tw") { // Some MB languages include backslash bytes
$value = str_replace("\\","",$value); // Delete all slashes
}
$value = str_replace("$"."a", "\\$"."a", $value); // Add slashes for $a
$value = str_replace("\"", "\\\"", $value); // Add slashes for "
$value = str_replace("\"", "\\\\\\\"", $value); // Add slashes for "
$value = str_replace("%","%%",$value); // Escape % characters
if ($id == "string" and $value != ""){
fwrite($f,"\$string['$stringname'] = \"$value\";\n");
}
+182
View File
@@ -0,0 +1,182 @@
<?PHP // $Id$
// Allows the admin to create, delete and rename course categories
require_once("../config.php");
require_once("../course/lib.php");
optional_variable($disable);
optional_variable($enable);
optional_variable($delete);
optional_variable($confirm);
if (!isadmin()) {
error("Only administrators can use this page!");
}
if (!$site = get_site()) {
error("Site isn't defined!");
}
/// Print headings
$stradministration = get_string("administration");
$strmanagemodules = get_string("managemodules");
$strdelete = get_string("delete");
$strhide = get_string("hide");
$strshow = get_string("show");
$stractivitymodule = get_string("activitymodule");
print_header("$site->shortname: $strmanagemodules", "$site->fullname",
"<a href=\"../$CFG->admin/index.php\">$stradministration</a> -> $strmanagemodules");
print_heading($strmanagemodules);
/// If data submitted, then process and store.
if (!empty($hide)) {
if (!$module = get_record("modules", "name", $hide)) {
error("Module doesn't exist!");
}
set_field("modules", "visible", "0", "id", $module->id); // Hide main module
set_field("course_modules", "visible", "0", "module", $module->id); // Hide all related activity modules
}
if (!empty($show)) {
if (!$module = get_record("modules", "name", $show)) {
error("Module doesn't exist!");
}
set_field("modules", "visible", "1", "id", $module->id); // Show main module
set_field("course_modules", "visible", "1", "module", $module->id); // Show all related activity modules
}
if (!empty($delete)) {
$strmodulename = get_string("modulename", "$delete");
if (empty($confirm)) {
notice_yesno(get_string("moduledeleteconfirm", "", $strmodulename),
"modules.php?delete=$delete&confirm=$delete",
"modules.php");
print_footer();
exit;
} else { // Delete everything!!
if ($delete == "forum") {
error("You can not delete the forum module!!");
}
if (!$module = get_record("modules", "name", $delete)) {
error("Module doesn't exist!");
}
// OK, first delete all the relevant instances from all course sections
if ($coursemods = get_records("course_modules", "module", $module->id)) {
foreach ($coursemods as $coursemod) {
if (! delete_mod_from_section($coursemod->id, $coursemod->section)) {
notify("Could not delete the $strmodulename with id = $coursemod->id from section $coursemod->section");
}
}
}
// Now delete all the course module records
if (!delete_records("course_modules", "module", $module->id)) {
notify("Error occurred while deleting all $strmodulename records in course_modules table");
}
// Then delete all the logs
if (!delete_records("log", "module", $module->name)) {
notify("Error occurred while deleting all $strmodulename records in log table");
}
// And log_display information
if (!delete_records("log_display", "module", $module->name)) {
notify("Error occurred while deleting all $strmodulename records in log_display table");
}
// And the module entry itself
if (!delete_records("modules", "name", $module->name)) {
notify("Error occurred while deleting the $strmodulename record from modules table");
}
// Then the tables themselves
if ($tables = $db->Metatables()) {
$prefix = $CFG->prefix.$module->name;
foreach ($tables as $table) {
if (strpos($table, $prefix) === 0) {
if (!execute_sql("DROP TABLE $table", false)) {
notify("ERROR: while trying to drop table $table");
}
}
}
}
rebuild_course_cache(); // Because things have changed
$a->module = $strmodulename;
$a->directory = "$CFG->dirroot/mod/$delete";
notice(get_string("moduledeletefiles", "", $a), "modules.php");
}
}
/// Get and sort the existing modules
if (!$modules = get_records("modules")) {
error("No modules found!!"); // Should never happen
}
foreach ($modules as $module) {
$strmodulename = get_string("modulename", "$module->name");
$modulebyname[$strmodulename] = $module;
}
ksort($modulebyname);
/// Print the table of all modules
if (empty($THEME->custompix)) {
$pixpath = "../pix";
$modpixpath = "../mod";
} else {
$pixpath = "../theme/$CFG->theme/pix";
$modpixpath = "../theme/$CFG->theme/pix/mod";
}
$table->head = array ($stractivitymodule, "$strhide/$strshow", $strdelete);
$table->align = array ("LEFT", "CENTER", "CENTER");
$table->wrap = array ("NOWRAP", "", "");
$table->size = array ("100%", "10", "10");
$table->width = "100";
foreach ($modulebyname as $modulename => $module) {
$icon = "<img src=\"$modpixpath/$module->name/icon.gif\" hspace=10 height=16 width=16 border=0>";
$delete = "<a href=\"modules.php?delete=$module->name\">$strdelete</a>";
if ($module->visible) {
$visible = "<a href=\"modules.php?hide=$module->name\" title=\"$strhide\">".
"<img src=\"$pixpath/i/hide.gif\" align=\"absmiddle\" height=16 width=16 border=0></a>";
$class = "";
} else {
$visible = "<a href=\"modules.php?show=$module->name\" title=\"$strshow\">".
"<img src=\"$pixpath/i/show.gif\" align=\"absmiddle\" height=16 width=16 border=0></a>";
$class = "class=\"dimmed_text\"";
}
if ($module->name == "forum") {
$delete = "";
$visible = "";
$class = "";
}
$table->data[] = array ("<p $class>$icon $modulename</p>", $visible, $delete);
}
print_table($table);
echo "<br /><br />";
print_footer();
?>
+22
View File
@@ -0,0 +1,22 @@
<?PHP // $Id$
// phpinfo.php - shows phpinfo for the current server
require_once("../config.php");
require_login();
if (!isadmin()) {
error("Only the admin can use this page");
}
$stradministration = get_string("administration");
$site = get_site();
print_header("$site->shortname: phpinfo", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> phpinfo");
phpinfo();
print_footer();
?>
+138
View File
@@ -0,0 +1,138 @@
<?PHP // $Id$
// register.php - allows admin to register their site on moodle.org
include("../config.php");
require_once("../lib/countries.php");
require_login();
if (!isadmin()) {
error("Only the admin can use this page");
}
if (!$site = get_site()) {
redirect("index.php");
}
if (!$admin = get_admin()) {
error("No admins");
}
if (!$admin->country and $CFG->country) {
$admin->country = $CFG->country;
}
if (!$admin->secret) { // secret field hasn't been set yet
$admin->secret = random_string(15);
if (!set_field("user", "secret", $admin->secret, "id", $admin->id)) {
error("Could not set admin's secret string!");
}
}
/// Print headings
$stradministration = get_string("administration");
$strregistration = get_string("registration");
$strregistrationinfo = get_string("registrationinfo");
print_header("$site->shortname: $strregistration", "$site->fullname",
"<a href=\"../$CFG->admin/index.php\">$stradministration</a> -> $strregistration");
print_heading($strmanagemodules);
print_simple_box($strregistrationinfo, "center", "70%");
echo "<br />";
/// Print the form
print_simple_box_start("center", "", "$THEME->cellheading");
echo "<form name=\"form\" action=\"http://moodle.org/register/\" method=post>\n";
echo "<table cellpadding=9 border=0>\n";
echo "<tr valign=top>\n";
echo "<td align=right><p>Moodle URL:</td>\n";
echo "<td><p>$CFG->wwwroot</td>\n";
echo "<!-- The following hidden variables are to help prevent fake entries being sent. -->\n";
echo "<!-- Together they form a key. If any of these change between updates then the entry -->\n";
echo "<!-- is flagged as a new entry and will be manually checked by the list maintainer -->\n";
echo "<input type=\"hidden\" name=\"url\" value=\"$CFG->wwwroot\">\n";
echo "<input type=\"hidden\" name=\"secret\" value=\"$admin->secret\">\n";
echo "<input type=\"hidden\" name=\"host\" value=\"".$_SERVER["HTTP_HOST"]."\">\n";
echo "<input type=\"hidden\" name=\"lang\" value=\"".current_language()."\">\n";
echo "</td></tr>\n";
echo "<tr valign=top>\n";
echo "<td align=right><p>".get_string("currentversion").":</td>\n";
echo "<td><p>$CFG->release ($CFG->version)</td>\n";
echo "<input type=\"hidden\" name=\"version\" value=\"$CFG->version\">\n";
echo "<input type=\"hidden\" name=\"release\" value=\"$CFG->release\">\n";
echo "</td></tr>\n";
echo "<tr valign=top>\n";
echo "<td align=right><p>".get_string("fullsitename").":</td>\n";
echo "<td><p><input size=50 type=\"text\" name=\"sitename\" value=\"$site->fullname\"></td>\n";
echo "</tr>\n";
echo "<tr valign=top>\n";
echo "<td align=right><p>".get_string("country").":</td>\n";
echo "<td><p>";
choose_from_menu ($COUNTRIES, "country", $admin->country, get_string("selectacountry")."...", "", "");
echo "</td>\n";
echo "</tr>\n";
echo "<tr valign=top>\n";
echo "<td align=right><p><a href=\"http://moodle.org/sites\" title=\"See the current list of sites\" target=_blank>".get_string("publicdirectory")."</a>:</td>\n";
echo "<td><p>";
$options[0] = get_string("publicdirectory0");
$options[1] = get_string("publicdirectory1");
$options[2] = get_string("publicdirectory2");
choose_from_menu ($options, "public", "2", "", "", "");
unset($options);
echo "</td>\n";
echo "</tr>\n";
echo "<tr valign=top>\n";
echo "<td colspan=2><hr size=1 noshade>\n";
echo "</tr>\n";
echo "<tr valign=top>\n";
echo "<td align=right><p>".get_string("administrator").":</td>\n";
echo "<td><p><input size=50 type=\"text\" name=\"adminname\" value=\"$admin->firstname $admin->lastname\"></td>\n";
echo "</tr>\n";
echo "<tr valign=top>\n";
echo "<td align=right><p>".get_string("email").":</td>\n";
echo "<td><p><input size=50 type=\"text\" name=\"adminemail\" value=\"$admin->email\"></td>\n";
echo "</tr>\n";
echo "<tr valign=top>\n";
echo "<td align=right><p>".get_string("registrationemail")."</a>:</td>\n";
echo "<td><p>\n";
$options[0] = get_string("registrationno");
$options[1] = get_string("registrationyes");
choose_from_menu ($options, "mailme", "1", "", "", "");
unset($options);
echo "</td>\n";
echo "</tr>\n";
echo "<tr valign=top>\n";
echo "<td align=right>&nbsp;</td>\n";
echo "<td><p><input type=\"submit\" value=\"".get_string("registrationsend")."\"></td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</form>\n";
print_simple_box_end();
echo "<br />\n";
print_footer();
?>
+23 -21
View File
@@ -1,29 +1,31 @@
<FORM METHOD="post" action="site.php" NAME="form">
<TABLE cellpadding=9 cellspacing=0 >
<form method="post" action="site.php" name="form">
<table cellpadding=9 cellspacing=0 >
<tr valign=top>
<td align=right><P><? print_string("fullsitename") ?>:</td>
<td><input type="text" name="fullname" size=50 value="<? p($form->fullname) ?>">
<? if (isset($err["fullname"])) formerr($err["fullname"]); ?>
<td align=right><P><?php print_string("fullsitename") ?>:</td>
<td><input type="text" name="fullname" size=50 value="<?php p($form->fullname) ?>">
<?php if (isset($err["fullname"])) formerr($err["fullname"]); ?>
</td>
</tr>
<tr valign=top>
<td align=right><P><? print_string("shortsitename") ?>:</td>
<td><input type="text" name="shortname" size=50 value="<? p($form->shortname) ?>">
<? if (isset($err["shortname"])) formerr($err["shortname"]); ?>
<td align=right><P><?php print_string("shortsitename") ?>:</td>
<td><input type="text" name="shortname" size=50 value="<?php p($form->shortname) ?>">
<?php if (isset($err["shortname"])) formerr($err["shortname"]); ?>
</td>
</tr>
<tr valign=top>
<td align=right><P><? print_string("frontpagedescription") ?>:</P><BR>
<? helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br \>
<? helpbutton("text", get_string("helptext"), "moodle", true, true) ?><br \>
<td align=right><P><?php print_string("frontpagedescription") ?>:</P><br />
<font size=1>
<?php helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br />
<?php helpbutton("html", get_string("helphtml"), "moodle", true, true) ?><br />
</font>
</td>
<td><TEXTAREA NAME=summary COLS=50 ROWS=10 WRAP=virtual><? p($form->summary) ?></TEXTAREA>
<? if (isset($err["summary"])) formerr($err["summary"]); ?>
<td><textarea name=summary cols=50 rows=10 wrap=virtual><?php p($form->summary) ?></textarea>
<?php if (isset($err["summary"])) formerr($err["summary"]); ?>
</td>
</tr>
<tr valign=top>
<td align=right><P><? print_string("frontpageformat") ?>:</td>
<td><?
<td align=right><P><?php print_string("frontpageformat") ?>:</td>
<td><?php
$newsitem = get_string("newsitem");
$newsitems = get_string("newsitems");
$options = array("0" => get_string("showlistofcourses"),
@@ -43,10 +45,10 @@
</tr>
<tr>
<td></td>
<td><input type="submit" value="<? print_string("savechanges") ?>"></td>
<td><input type="submit" value="<?php print_string("savechanges") ?>"></td>
</tr>
</TABLE>
<INPUT type="hidden" name="id" value="<?=$form->id ?>">
<INPUT type="hidden" name="category" value="<?=$form->category ?>">
<INPUT type="hidden" name="format" value="<?=$form->format ?>">
</FORM>
</table>
<input type="hidden" name="id" value="<?php p($form->id) ?>">
<input type="hidden" name="category" value="<?php p($form->category) ?>">
<input type="hidden" name="format" value="<?php p($form->format) ?>">
</form>
+24 -7
View File
@@ -6,8 +6,8 @@
if (!isadmin()) {
error("You need to be admin to edit this page");
}
$site->format = "social"; // override
}
$site->format = "social"; // override
/// If data submitted, then process and store.
@@ -21,7 +21,7 @@
if ($form->id) {
if (update_record("course", $form)) {
redirect("index.php", get_string("changessaved"));
redirect("$CFG->wwwroot/admin/index.php", get_string("changessaved"));
} else {
error("Serious Error! Could not update the site record! (id = $form->id)");
}
@@ -29,7 +29,7 @@
if ($newid = insert_record("course", $form)) {
$cat->name = get_string("miscellaneous");
if (insert_record("course_categories", $cat)) {
redirect("index.php", get_string("changessaved"), "1");
redirect("$CFG->wwwroot/admin/index.php", get_string("changessaved"));
} else {
error("Serious Error! Could not set up a default course category!");
}
@@ -50,10 +50,17 @@
if ($site and empty($form)) {
$form = $site;
$firsttime = false;
} else {
$form->fullname = "";
$form->shortname = "";
$form->summary = "";
$form->newsitems = 0;
$form->id = "";
$form->category = 0;
$form->format = "social";
$form->newsitems = 0;
$firsttime = true;
}
if (empty($focus)) {
@@ -63,14 +70,24 @@
$stradmin = get_string("administration");
$strsitesettings = get_string("sitesettings");
print_header("$site->shortname: $strsitesettings", "$site->fullname",
"<A HREF=\"index.php\">$stradmin</A> -> $strsitesettings", "$focus");
if ($firsttime) {
print_header();
print_heading($strsitesettings);
print_simple_box(get_string("configintrosite"), "center");
echo "<br />";
} else {
print_header("$site->shortname: $strsitesettings", "$site->fullname",
"<A HREF=\"index.php\">$stradmin</A> -> $strsitesettings", "$focus");
print_heading($strsitesettings);
}
print_heading($strsitesettings);
print_simple_box_start("center", "", "$THEME->cellheading");
include("site.html");
print_simple_box_end();
print_footer();
if (!$firsttime) {
print_footer();
}
exit;
+204
View File
@@ -0,0 +1,204 @@
<?PHP // $Id$
// Admin-only script to assign teachers to courses
require_once("../config.php");
define("MAX_USERS_PER_PAGE", 30);
optional_variable($id); // course id
optional_variable($add, "");
optional_variable($remove, "");
optional_variable($search, ""); // search string
if (! $site = get_site()) {
redirect("$CFG->wwwroot/$CFG->admin/index.php");
}
require_login();
if (!iscreator()) {
error("You must be an administrator or course creator to use this page.");
}
$strassignteachers = get_string("assignteachers");
$stradministration = get_string("administration");
$strexistingteachers = get_string("existingteachers");
$strnoexistingteachers = get_string("noexistingteachers");
$strpotentialteachers = get_string("potentialteachers");
$strnopotentialteachers = get_string("nopotentialteachers");
$straddteacher = get_string("addteacher");
$strremoveteacher = get_string("removeteacher");
$strsearch = get_string("search");
$strsearchresults = get_string("searchresults");
$strsearchagain = get_string("searchagain");
$strtoomanytoshow = get_string("toomanytoshow");
if ($search) {
$searchstring = $strsearchagain;
} else {
$searchstring = $strsearch;
}
if (!$id) {
print_header("$site->shortname: $strassignteachers", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> $strassignteachers");
$isadmin = isadmin(); /// cache value
$courses = get_courses();
print_heading(get_string("choosecourse"));
print_simple_box_start("center");
foreach ($courses as $course) {
if ($isadmin or isteacher($course->id, $USER->id)){
echo "<a href=\"teacher.php?id=$course->id\">$course->fullname ($course->shortname)</a><br>\n";
$coursesfound = TRUE;
}
}
print_simple_box_end();
if ($coursesfound == FALSE) {
print_heading(get_string("nocoursesyet"));
print_continue("../$CFG->admin/index.php");
}
print_footer();
exit;
}
if (! $course = get_record("course", "id", $id)) {
error("Course ID was incorrect (can't find it)");
}
print_header("$site->shortname: $course->shortname: $strassignteachers",
"$site->fullname",
"<a href=\"index.php\">$stradministration</a> ->
<a href=\"teacher.php\">$strassignteachers</a> -> $course->shortname", "");
print_heading("<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname ($course->shortname)</a>");
/// Get all existing teachers for this course.
$teachers = get_course_teachers($course->id);
/// Add a teacher if one is specified
if (!empty($add)) {
if (!isteacher($course->id)){
error("You must be an administrator or teacher to modify this course.");
}
if (! $user = get_record("user", "id", $add)) {
error("That teacher (id = $add) doesn't exist", "teacher.php?id=$course->id");
}
if (!empty($teachers)) {
foreach ($teachers as $tt) {
if ($tt->id == $user->id) {
error("That user is already a teacher for this course.", "teacher.php?id=$course->id");
}
}
}
$teacher->userid = $user->id;
$teacher->course = $course->id;
if (!empty($teachers)) {
$teacher->authority = 2;
} else {
$teacher->authority = 1; // First teacher is the main teacher
}
$teacher->id = insert_record("user_teachers", $teacher);
if (empty($teacher->id)) {
error("Could not add that teacher to this course!");
}
$teachers[] = $user;
}
/// Remove a teacher if one is specified.
if (!empty($remove)) {
if (!isteacher($course->id)){
error("You must be an administrator or teacher to modify this course.");
}
if (! $user = get_record("user", "id", $remove)) {
error("That teacher (id = $remove) doesn't exist", "teacher.php?id=$course->id");
}
if (!empty($teachers)) {
foreach ($teachers as $key => $tt) {
if ($tt->id == $user->id) {
remove_teacher($user->id, $course->id);
unset($teachers[$key]);
}
}
}
}
/// Print the lists of existing and potential teachers
echo "<table cellpadding=2 cellspacing=10 align=center>";
echo "<tr><th width=50%>$strexistingteachers</th><th width=50%>$strpotentialteachers</th></tr>";
echo "<tr><td width=50% nowrap valign=top>";
/// First, show existing teachers for this course
if (empty($teachers)) {
echo "<p align=center>$strnoexistingteachers</a>";
$teacherlist = "";
} else {
$teacherarray = array();
foreach ($teachers as $teacher) {
$teacherarray[] = $teacher->id;
echo "<p align=right>$teacher->firstname $teacher->lastname, $teacher->email &nbsp;&nbsp; <a href=\"teacher.php?id=$course->id&remove=$teacher->id\" title=\"$strremoveteacher\"><img src=\"../pix/t/right.gif\" border=0></a></p>";
}
$teacherlist = implode(",",$teacherarray);
unset($teacherarray);
}
echo "<td width=50% nowrap valign=top>";
/// Print list of potential teachers
$usercount = get_users(false, $search, true, $teacherlist);
if ($usercount == 0) {
echo "<p align=center>$strnopotentialteachers</p>";
} else if ($usercount > MAX_USERS_PER_PAGE) {
echo "<p align=center>$strtoomanytoshow</p>";
} else {
if ($search) {
echo "<p align=center>($strsearchresults : $search)</p>";
}
if (!$users = get_users(true, $search, true, $teacherlist)) {
error("Could not get users!");
}
foreach ($users as $user) {
echo "<p align=left><a href=\"{$_SERVER['PHP_SELF']}?id=$course->id&add=$user->id\"".
"title=\"$straddteacher\"><img src=\"../pix/t/left.gif\"".
"border=0></a>&nbsp;&nbsp;$user->firstname $user->lastname, $user->email";
}
}
if ($search or $usercount > MAX_USERS_PER_PAGE) {
echo "<form action={$_SERVER['PHP_SELF']} method=post>";
echo "<input type=hidden name=id value=\"$course->id\">";
echo "<input type=text name=search size=20>";
echo "<input type=submit value=\"$searchstring\">";
echo "</form>";
}
echo "</tr></table>";
print_footer();
?>
+109 -78
View File
@@ -12,10 +12,11 @@
optional_variable($sort, "name");
optional_variable($dir, "ASC");
optional_variable($page, 0);
optional_variable($search, "");
if (! record_exists("user_admins")) { // No admin user yet
$user->firstname = "Admin";
$user->lastname = "User";
$user->firstname = get_string("admin");
$user->lastname = get_string("user");
$user->username = "admin";
$user->password = md5("admin");
$user->email = "root@localhost";
@@ -54,9 +55,10 @@
$USER->site = $CFG->wwwroot;
$USER->admin = true;
$USER->teacher["$site->id"] = true;
save_session("USER");
$USER->newadminuser = true;
redirect("$CFG->wwwroot/user/edit.php?id=$user->id&course=$site->id");
exit;
} else {
if (! $site = get_site()) {
@@ -95,6 +97,8 @@
$stredit = get_string("edit");
$strdelete = get_string("delete");
$strdeletecheck = get_string("deletecheck");
$strsearch = get_string("search");
$strshowallusers = get_string("showallusers");
print_header("$site->shortname: $stredituser", $site->fullname,
"<A HREF=\"index.php\">$stradministration</A> -> $stredituser");
@@ -126,7 +130,6 @@
// Carry on with the user listing
$usercount = get_users_count();
$columns = array("name", "email", "city", "country", "lastaccess");
@@ -141,7 +144,7 @@
if ($columnsort == $sort) {
$$column = $string[$column];
} else {
$$column = "<A HREF=\"user.php?sort=$columnsort&dir=$columndir\">".$string[$column]."</A>";
$$column = "<A HREF=\"user.php?sort=$columnsort&dir=$columndir&search=$search\">".$string[$column]."</A>";
}
}
@@ -149,89 +152,117 @@
$sort = "firstname";
}
if ($users = get_users_listing($sort, $dir, $page, $recordsperpage)) {
if (!$users = get_users_listing($sort, $dir, $page, $recordsperpage, $search)) {
if (!$users = get_users_listing($sort, $dir, 0, $recordsperpage)) {
error("No users found!");
} else {
notify(get_string("nousersmatching", "", $search));
$search = "";
}
}
$usercount = get_users(false);
if ($search) {
$usersearchcount = get_users(false, $search);
print_heading("$usersearchcount / $usercount ".get_string("users"));
$usercount = $usersearchcount;
} else {
print_heading("$usercount ".get_string("users"));
}
$a->start = $page;
$a->end = $page + $recordsperpage;
if ($a->end > $usercount) {
$a->end = $usercount;
}
echo "<TABLE align=center cellpadding=10><TR>";
echo "<TD>";
if ($page) {
$prevpage = $page - $recordsperpage;
if ($prevpage < 0) {
$prevpage = 0;
}
$options["dir"] = $dir;
$options["page"] = 0;
$options["sort"] = $sort;
print_single_button("user.php", $options, " << ");
echo "</TD><TD>";
$options["page"] = $prevpage;
print_single_button("user.php", $options, " < ");
$a->start = $page;
$a->end = $page + $recordsperpage;
if ($a->end > $usercount) {
$a->end = $usercount;
}
echo "<TABLE align=center cellpadding=10><TR>";
echo "<TD>";
if ($page) {
$prevpage = $page - $recordsperpage;
if ($prevpage < 0) {
$prevpage = 0;
}
$options["dir"] = $dir;
$options["page"] = 0;
$options["sort"] = $sort;
$options["search"] = $search;
print_single_button("user.php", $options, " << ");
echo "</TD><TD>";
print_heading(get_string("displayingusers", "", $a));
$options["page"] = $prevpage;
print_single_button("user.php", $options, " < ");
}
echo "</TD><TD>";
print_heading(get_string("displayingusers", "", $a));
echo "</TD><TD>";
$nextpage = $page + $recordsperpage;
if ($nextpage < $usercount) {
$options["dir"] = $dir;
$options["page"] = $nextpage;
$options["sort"] = $sort;
$options["search"] = $search;
print_single_button("user.php", $options, " > ");
echo "</TD><TD>";
$nextpage = $page + $recordsperpage;
if ($nextpage < $usercount) {
$options["dir"] = $dir;
$options["page"] = $nextpage;
$options["sort"] = $sort;
print_single_button("user.php", $options, " > ");
echo "</TD><TD>";
$options["page"] = $usercount-$recordsperpage;
print_single_button("user.php", $options, " >> ");
}
echo "</TD></TR></TABLE>";
$options["page"] = $usercount-$recordsperpage;
print_single_button("user.php", $options, " >> ");
}
echo "</TD></TR></TABLE>";
flush();
flush();
foreach ($users as $key => $user) {
foreach ($users as $key => $user) {
if (!empty($user->country)) {
$users[$key]->country = $COUNTRIES[$user->country];
}
if ($sort == "country") { // Need to resort by full country name, not code
foreach ($users as $user) {
$susers[$user->id] = $user->country;
}
asort($susers);
foreach ($susers as $key => $value) {
$nusers[] = $users[$key];
}
$users = $nusers;
}
$table->head = array ($name, $email, $city, $country, $lastaccess, "", "");
$table->align = array ("LEFT", "LEFT", "LEFT", "LEFT", "LEFT", "CENTER", "CENTER");
$table->width = "95%";
foreach ($users as $user) {
if ($user->id == $USER->id or $user->username == "changeme") {
$deletebutton = "";
} else {
$deletebutton = "<A HREF=\"user.php?delete=$user->id\" TARGET=\"$strdeletecheck\">$strdelete</A>";
}
if ($user->lastaccess) {
$strlastaccess = format_time(time() - $user->lastaccess);
} else {
$strlastaccess = get_string("never");
}
$table->data[] = array ("<A HREF=\"../user/view.php?id=$user->id&course=$site->id\">$user->firstname $user->lastname</A>",
"$user->email",
"$user->city",
"$user->country",
$strlastaccess,
"<A HREF=\"../user/edit.php?id=$user->id&course=$site->id\">$stredit</A>",
$deletebutton);
}
print_table($table);
print_heading("<A HREF=\"user.php?newuser=true\">".get_string("addnewuser")."</A>");
} else {
error("No users found!");
}
if ($sort == "country") { // Need to resort by full country name, not code
foreach ($users as $user) {
$susers[$user->id] = $user->country;
}
asort($susers);
foreach ($susers as $key => $value) {
$nusers[] = $users[$key];
}
$users = $nusers;
}
$table->head = array ($name, $email, $city, $country, $lastaccess, "", "");
$table->align = array ("LEFT", "LEFT", "LEFT", "LEFT", "LEFT", "CENTER", "CENTER");
$table->width = "95%";
foreach ($users as $user) {
if ($user->id == $USER->id or $user->username == "changeme") {
$deletebutton = "";
} else {
$deletebutton = "<A HREF=\"user.php?delete=$user->id\" TARGET=\"$strdeletecheck\">$strdelete</A>";
}
if ($user->lastaccess) {
$strlastaccess = format_time(time() - $user->lastaccess);
} else {
$strlastaccess = get_string("never");
}
$table->data[] = array ("<A HREF=\"../user/view.php?id=$user->id&course=$site->id\">$user->firstname $user->lastname</A>",
"$user->email",
"$user->city",
"$user->country",
$strlastaccess,
"<A HREF=\"../user/edit.php?id=$user->id&course=$site->id\">$stredit</A>",
$deletebutton);
}
echo "<TABLE align=center cellpadding=10><TR><TD>";
echo "<FORM ACTION=user.php METHOD=POST>";
echo "<INPUT TYPE=text NAME=search VALUE=\"$search\" SIZE=20>";
echo "<INPUT TYPE=submit VALUE=\"$strsearch\">";
if ($search) {
echo "<INPUT type=\"button\" onClick=\"document.location='user.php';\" value=\"$strshowallusers\">";
}
echo "</FORM>";
echo "</TD></TR></TABLE>";
print_table($table);
print_heading("<A HREF=\"user.php?newuser=true\">".get_string("addnewuser")."</A>");
print_footer();
}
+5
View File
@@ -31,6 +31,11 @@ none - no authentication at all .. very insecure!!
- when user tries to access a course they
are forced to set up their account details
manual - internal authentication only
- user logs in using username and password
- no way for user to make their own account
ldap - Uses an external LDAP server
+1 -2
View File
@@ -1,4 +1,3 @@
LDAP-module README
07.10.2002 Version 0.1, Petri Asikainen <paca@sci.fi>
Ldap-authetication module is work in progress.
Please read comments from lib.php
+28
View File
@@ -82,7 +82,35 @@
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>ldap_memberattribute:</TD>
<TD>
<INPUT name=ldap_memberattribute TYPE=text SIZE=30 VALUE="<?=$config->ldap_memberattribute?>">
<? if (isset($err["ldap_memberattribute"])) formerr($err["ldap_memberattribute"]); ?>
</TD><TD>
<? print_string("auth_ldap_memberattribute","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>ldap_creators:</TD>
<TD>
<INPUT name=ldap_creators TYPE=text SIZE=30 VALUE="<?=$config->ldap_creators?>">
<? if (isset($err["ldap_creators"])) formerr($err["ldap_creators"]); ?>
</TD><TD>
<? print_string("auth_ldap_creators","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>ldap_create_context:</TD>
<TD>
<INPUT name=ldap_create_context TYPE=text SIZE=30 VALUE="<?=$config->ldap_create_context?>">
<? if (isset($err["ldap_create_context"])) formerr($err["ldap_create_context"]); ?>
</TD><TD>
<? print_string("auth_ldap_create_context","auth") ?>
</TD>
</TR>
<TR>
<TD ALIGN=RIGHT><P><? print_string("firstname") ?>:</TD>
+201 -54
View File
@@ -1,12 +1,35 @@
<?PHP // $Id$
//CHANGELOG:
//24.02.2003 Added support for coursecreators
//20.02.2003 Added support for user creation
//12.10.2002 Reformatted source for consistency
//03.10.2002 First version to CVS
//29.09.2002 Clean up and splitted code to functions v. 0.02
//29.09.2002 LDAP authentication functions v. 0.01
//Distributed under GPL (c)Petri Asikainen 2002
//Distributed under GPL (c)Petri Asikainen 2002-2003
/* README!
Module is quite complete and most functinality can be configured from
configinterfave /admin/auth.php. Some of latest additions/features need to
be configured by modifying source code.
If you plan to use user creation feature, look function auth_user_create
and modify it for your needs.
You have to change all hardcoded attribute values to fit your LDAP-server.
User-creation makes posible that your current
users can authenticate with existings usernames/password and new users can
create own accounts to LDAP-directory. I'm using this feature and new users
are created to LDAP different context, without rights to other system. When
user-creation feature is set like that, there's no known security issues.
I write ldap-module on Novell E-directory / Linux & Solaris ,
so all default values are for it.
Any feedback is wellcome,
Petri Asikainen paca@sci.fi
*/
function auth_user_login ($username, $password) {
/// Returns true if the username and password work
/// and false if they don't
@@ -20,7 +43,6 @@ function auth_user_login ($username, $password) {
$ldap_connection = auth_ldap_connect();
if ($ldap_connection) {
$ldap_user_dn = auth_ldap_find_userdn($ldap_connection, $username);
//if ldap_user_dn is empty, user does not exist
@@ -49,23 +71,14 @@ function auth_get_userinfo($username){
global $CFG;
$config = (array)$CFG;
$fields = array("firstname", "lastname", "email", "phone1", "phone2",
"department", "address", "city", "country", "description",
"idnumber", "lang");
$moodleattributes = array();
foreach ($fields as $field) {
if ($config["auth_user_$field"]) {
$moodleattributes[$field] = $config["auth_user_$field"];
}
}
$attrmap = auth_ldap_attributes();
$ldap_connection=auth_ldap_connect();
$result = array();
$search_attribs = array();
foreach ($moodleattributes as $key=>$value) {
foreach ($attrmap as $key=>$value) {
array_push($search_attribs, $value);
}
@@ -79,7 +92,7 @@ function auth_get_userinfo($username){
if ($user_info_result) {
$user_entry = ldap_get_entries($ldap_connection, $user_info_result);
foreach ($moodleattributes as $key=>$value){
foreach ($attrmap as $key=>$value){
if(isset($user_entry[0][$value][0])){
$result[$key]=$user_entry[0][$value][0];
}
@@ -91,49 +104,113 @@ function auth_get_userinfo($username){
return $result;
}
function auth_get_userlist() {
/// returns all users from ldap servers
function auth_get_userlist () {
global $CFG;
$fresult = array();
$ldap_connection = auth_ldap_connect();
auth_ldap_bind($ldap_connection);
if (! isset($CFG->ldap_objectclass)) {
$CFG->ldap_objectclass="objectClass=*";
}
$contexts = explode(";",$CFG->ldap_contexts);
foreach ($contexts as $context) {
if ($CFG->ldap_search_sub) {
//use ldap_search to find first user from subtree
$ldap_result = ldap_search($ldap_connection, $context,
"(".$CFG->ldap_objectclass.")",
array($CFG->ldap_user_attribute));
} else {
//search only in this context
$ldap_result = ldap_list($ldap_connection, $context,
"(".$CFG->ldap_objectclass.")",
array($CFG->ldap_user_attribute));
}
$users = ldap_get_entries($ldap_connection, $ldap_result);
//add found users to list
for ($i=0;$i<$users['count'];$i++) {
array_push($fresult, ($users[$i][$CFG->ldap_user_attribute][0]) );
}
}
return $fresult;
return auth_ldap_get_userlist("($CFG->ldap_user_attribute=*)");
}
function auth_user_exists ($username) {
global $CFG;
//returns true if given usernname exist on ldap
$users = auth_ldap_get_userlist("($CFG->ldap_user_attribute=$username)");
return count($users);
}
function auth_user_create ($userobject,$plainpass) {
//create new user to ldap
//use auth_user_exists to prevent dublicate usernames
//return true if user is created, false on error
global $CFG;
$attrmap = auth_ldap_attributes();
$ldapconnect = auth_ldap_connect();
$ldapbind = auth_ldap_bind($ldapconnect);
$newuser = array();
foreach ($attrmap as $key=>$value){
if(isset($userobject->$key) ){
$newuser[$value]=utf8_encode($userobject->$key);
}
}
//Following sets all mandatory and other forced attribute values
//this should be moved to config inteface ASAP
$newuser['objectClass']= array("inetOrgPerson","organizationalPerson","person","top");
$newuser['uniqueId']= $userobject->username;
$newuser['logindisabled']="TRUE";
$newuser['userpassword']=$plainpass;
unset($newuser[country]);
$uadd = ldap_add($ldapconnect, $CFG->ldap_user_attribute."=$userobject->username,".$CFG->ldap_create_context, $newuser);
ldap_close($ldapconnect);
return $uadd;
}
function auth_user_activate ($username) {
//activate new ldap-user after email-address is confirmed
global $CFG;
$ldapconnect = auth_ldap_connect();
$ldapbind = auth_ldap_bind($ldapconnect);
$userdn = auth_ldap_find_userdn($ldapconnect, $username);
$newinfo['loginDisabled']="FALSE";
$result = ldap_modify($ldapconnect, $userdn, $newinfo);
ldap_close($ldapconnect);
return $result;
}
function auth_user_disable ($username) {
//activate new ldap-user after email-address is confirmed
global $CFG;
$ldapconnect = auth_ldap_connect();
$ldapbind = auth_ldap_bind($ldapconnect);
$userdn = auth_ldap_find_userdn($ldapconnect, $username);
$newinfo['loginDisabled']="TRUE";
$result = ldap_modify($ldapconnect, $userdn, $newinfo);
ldap_close($ldapconnect);
return $result;
}
function auth_iscreator($username=0) {
///if user is member of creator group return true
global $CFG, $USER;
$ldapconnect = auth_ldap_connect();
$ldapbind = auth_ldap_bind($ldapconnect);
if (! $username) {
$username=$USER->username;
}
if ((! $CFG->ldap_creators) OR (! $CFG->ldap_memberattribute)) {
return false;
} else {
$groups = explode(";",$CFG->ldap_creators);
}
//build filter
$filter = "(& ($CFG->ldap_user_attribute=$username)(|";
foreach ($groups as $group){
$filter .= "($CFG->ldap_memberattribute=$group)";
}
$filter .= "))";
//search
$result = auth_ldap_get_userlist($filter);
return count($result);
}
//PRIVATE FUNCTIONS starts
//private functions are named as auth_ldap*
function auth_ldap_connect(){
/// connects to ldap-server
@@ -192,6 +269,10 @@ function auth_ldap_find_userdn ($ldap_connection, $username){
//get all contexts and look for first matching user
$ldap_contexts = explode(";",$CFG->ldap_contexts);
if (!empty($CFG->ldap_create_context)){
array_push($ldap_contexts, $CFG->ldap_create_context);
}
foreach ($ldap_contexts as $context) {
@@ -217,4 +298,70 @@ function auth_ldap_find_userdn ($ldap_connection, $username){
return $ldap_user_dn;
}
function auth_ldap_attributes (){
//returns array containg attribute mappings between Moodle and ldap
global $CFG;
$config = (array)$CFG;
$fields = array("firstname", "lastname", "email", "phone1", "phone2",
"department", "address", "city", "country", "description",
"idnumber", "lang");
$moodleattributes = array();
foreach ($fields as $field) {
if ($config["auth_user_$field"]) {
$moodleattributes[$field] = $config["auth_user_$field"];
}
}
return $moodleattributes;
}
function auth_ldap_get_userlist($filter="*") {
/// returns all users from ldap servers
global $CFG;
$fresult = array();
$ldap_connection = auth_ldap_connect();
auth_ldap_bind($ldap_connection);
if (! isset($CFG->ldap_objectclass)) {
$CFG->ldap_objectclass="objectClass=*";
}
if ($filter=="*") {
$filter = "(&(".$CFG->ldap_user_attribute."=*)(".$CFG->ldap_objectclass."))";
}
$contexts = explode(";",$CFG->ldap_contexts);
if (!empty($CFG->ldap_create_context)){
array_push($contexts, $CFG->ldap_create_context);
}
foreach ($contexts as $context) {
if ($CFG->ldap_search_sub) {
//use ldap_search to find first user from subtree
$ldap_result = ldap_search($ldap_connection, $context,
$filter,
array($CFG->ldap_user_attribute));
} else {
//search only in this context
$ldap_result = ldap_list($ldap_connection, $context,
$filter,
array($CFG->ldap_user_attribute));
}
$users = ldap_get_entries($ldap_connection, $ldap_result);
//add found users to list
for ($i=0;$i<$users['count'];$i++) {
array_push($fresult, ($users[$i][$CFG->ldap_user_attribute][0]) );
}
}
return $fresult;
}
?>
+11
View File
@@ -0,0 +1,11 @@
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("instructions", "auth") ?>:</TD>
<TD>
<TEXTAREA NAME=auth_instructions COLS=30 ROWS=10 WRAP=virtual><? p($config->auth_instructions) ?></TEXTAREA>
</TD>
<TD>
<? print_string("authinstructions","auth") ?>
<? helpbutton("text", get_string("helptext")) ?>
</TD>
</TR>
+16
View File
@@ -0,0 +1,16 @@
<?PHP // $Id$
// manual method - Just does a simple check against the database
function auth_user_login ($username, $password) {
// Returns false if the username doesn't exist yet
// Returns true if the username and password work
if ($user = get_user_info_from_db("username", $username)) {
return ($user->password == md5($password));
}
return false;
}
?>
+33
View File
@@ -0,0 +1,33 @@
README $Id$
----------
This directory contains my try to create a backup/recover
admin option to moodle. I don't know when and how it'll be
finished, but I'going to try it, sure.
Some day, if this is fully functional, it could be integrated
into the main Moodle distribution (ask uncle Martin). :-)
Code here may not be tested - so there are no guarantees as
to the quality of the code in here, even if part of a stable
Moodle release.
Please, for any comment about this option, do it in Moodle
Developer Forum at:
http://moodle.org/mod/forum/view.php?id=55
(searching an "backup" topic)
or you can put tour comments in Moodel Bugs at:
http://moodle.org/bugs/bug.php?op=show&bugid=84.
All comments will be welcome. TIA.
To see the general status of the utility, take a look to
"STATUS.txt" in this directory.
And this is all, I start with it NOW.
Eloy (stronk7)
29-04-2003
+197
View File
@@ -0,0 +1,197 @@
STATUS $Id$
----------
This documment shows the current status of the backup/restore option.
Backup: WORKING. COMPLETED but only assignments, resources,
choices and surveys.
Restore: WORKING. NOT COMPLETED. Only course, users, user_files and
course_files. No logs, mods or final checks !!!!
========== ========== ========== ========== ========== ==========
Now I show the specific detailed status of every item in the process:
Backup Details:
===============
- Backup FrontEnd............................................DONE
- Check Security........................................DONE
- Select Info to Backup.(from mods).....................DONE
- Check (summary info)..................................DONE
- Check mods.......................................DONE
- Check logs.......................................DONE
- Check users......................................DONE
- Check User Files.................................DONE
- Check Course Files...............................DONE
- Launch Backup.........................................DONE
- Show progress.........................................DONE
- Determine Backup location.............................DONE
- Delete old entries at backup startup..................DONE
- From database....................................DONE
- From filesystem..................................DONE
- Backup Items:..............................................IN PROGRESS
- Backup Info data......................................DONE
- Course................................................IN PROGRESS
- Course Summary Data................................DONE
x course info.....................................DONE
x sections info...................................DONE
x mods info.......................................DONE
- User Accounts Info.................................DONE
x admins..........................................DONE
- All..........................................DONE
x course creators.................................DONE
- All..........................................DONE
x teachers........................................DONE
- Course.......................................DONE
- All..........................................DONE
x students........................................DONE
- Course.......................................DONE
- All..........................................DONE
- Logs...............................................DONE
- Mods Info..........................................IN PROGRESS
x assignments.....................................DONE
+ course data..................................DONE
+ user data....................................DONE
+ files........................................DONE
x choices.........................................DONE
+ course data..................................DONE
+ user data....................................DONE
+ files.....(NOT EXISTS).......................DONE
x forums..........................................IN PROGRESS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x journals........................................IN PROGRESS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x peer graded assignments.........................IN PROGRESS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x quizzes.........................................IN PROGRESS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x resources.......................................DONE
+ course data..................................DONE
+ user data....................................DONE
+ files..(ARE COURSE FILES !!!)................DONE
x surveys.........................................DONE
+ course data..................................DONE
+ user data....................................DONE
+ files.....(NOT EXISTS).......................DONE
x workshops.......................................NO EXISTS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x user files to temp..............................DONE
x course files to temp............................DONE
- Compress the backup (zip)..................................DONE. PROBLEMS PCLZIP/UNZIP
- XML File................................................DONE. PROBLEMS PCLZIP/UNZIP
- moddata files...........................................DONE. PROBLEMS PCLZIP/UNZIP
- Course Files............................................DONE. PROBLEMS PCLZIP/UNZIP
- User Files..............................................DONE. PROBLEMS PCLZIP/UNZIP
- Copy finished file to browseable dir.......................DONE
- Delete old entries at backup end...........................DONE
- From database...........................................DONE
- From filesystem.........................................DONE
- Browse backup files........................................DONE
- Download backup files......................................DONE
- Delete backup files........................................DONE
- Program automatic backups..................................NO EXISTS
Restore Details:
===============
- Delete old entries at restore start........................DONE
- From database...........................................DONE
- From filesystem.........................................DONE
- Restore FrontEnd...........................................DONE
- Check Security........................................DONE
- Select File to Restore................................DONE
- Uncompress the backup (unzip).........................DONE
- XML File..........................................DONE
- Course Files......................................DONE
- User Files........................................DONE
- Check file is a valid one.............................DONE
- Load info from file...................................DONE
- Load Backup Info......................................DONE
- Load Course Header....................................DONE
- Restore into feature..................................DONE
- New course (restore)...............................DONE
- Existing course (import)...........................DONE
- Select Info to Restore (depending from backup)........DONE
- Make decisions........................................DONE
- About existing users...............................DONE
- Launch Restore........................................DONE
- Show progress.........................................DONE
- Restore Items:.............................................IN PROGRESS
- Course................................................DONE
- Course Summary Data................................DONE
- Course Table....................................DONE
- Sections Table..................................DONE
- Modules Table...................................DONE
- User Accounts Info.................................DONE
x teacheras. .....................................DONE
- None .......................................DONE
- Course.......................................DONE
- All..........................................DONE
x students........................................DONE
- None.........................................DONE
- Course.......................................DONE
- All..........................................DONE
x creators........................................DONE
- None.........................................DONE
- Course.......................................DONE
- All..........................................DONE
x admins..........................................DONE
- None.........................................DONE
- Course.......................................DONE
- All..........................................DONE
- Mods Info..........................................NO EXISTS
x assignments.....................................NO EXISTS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x choices.........................................NO EXISTS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x forums..........................................NO EXISTS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x journals........................................NO EXISTS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x quizzes.........................................NO EXISTS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x resources.......................................NO EXISTS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x surveys.........................................NO EXISTS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
- User files from temp.......................................DONE
- Course files from temp.....................................DONE
- Log entries................................................NO EXISTS
- Readjust instance in course_modules........................NO EXISTS
- Readjust modinfo in course (serialize).....................NO EXISTS
- Delete old entries at restore end. .......................NO EXISTS
- From database...........................................NO EXISTS
- From filesystem.........................................NO EXISTS
- Upload backup files........................................DONE
========== ========== ========== =========== =========== =========== ===
This is all. It's no a little thing !!! :-)
Eloy (stronk7)
29-04-2003
+91
View File
@@ -0,0 +1,91 @@
<?PHP //$Id$
//This script is used to configure and execute the backup proccess.
//Define some globals for all the script
//MUST CHANGE WITH FINAL BACKUP LOCATION !! WITHOUT TRAILING SLASH !!
//ALL RELATIVE FROM THE LOCATION OF THE backup.php SCRIPT !!!
$moodle_home = "../../..";
$mods_home = "mod";
//END MUST CHANGE
//Units used
require_once ("$moodle_home/config.php");
require_once ("$moodle_home/version.php");
require_once ("backup_version.php");
require_once ("db/backup_$CFG->dbtype.php");
require_once ("lib.php");
require_once ("backuplib.php");
//Optional variables
optional_variable($id); // course id
//Check login
require_login();
//Check admin
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
//Check site
if (!$site = get_site()) {
error("Site not found!");
}
//Check backup_version
upgrade_backup_db($backup_version,$backup_release,"backup.php");
//Get strings
$strcoursebackup = get_string("coursebackup");
$stradministration = get_string("administration");
//If no course has been selected or cancel button pressed
if (!$id or $cancel) {
print_header("$site->shortname: $strcoursebackup", $site->fullname,
"<A HREF=\"$moodle_home/$CFG->admin/index.php\">$stradministration</A> -> $strcoursebackup");
if ($courses = get_courses()) {
print_heading(get_string("choosecourse"));
print_simple_box_start("CENTER");
foreach ($courses as $course) {
echo "<A HREF=\"backup.php?id=$course->id\">$course->fullname ($course->shortname)</A><BR>";
}
print_simple_box_end();
} else {
print_heading(get_string("nocoursesyet"));
print_continue("$moodle_home/$CFG->admin/index.php");
}
print_footer();
exit;
}
//Get and check course
if (! $course = get_record("course", "id", $id)) {
error("Course ID was incorrect (can't find it)");
}
//Print header
print_header("$site->shortname: $strcoursebackup", $site->fullname,
"<A HREF=\"$moodle_home/$CFG->admin/index.php\">$stradministration</A> ->
<A HREF=\"backup.php\">$strcoursebackup</A> -> $course->fullname ($course->shortname)");
//Print form
print_heading("$strcoursebackup: $course->fullname ($course->shortname)");
print_simple_box_start("center", "", "$THEME->cellheading");
//Call the form, depending the step we are
if (!$launch) {
include_once("backup_form.html");
} else if ($launch == "check") {
include_once("backup_check.html");
} else if ($launch == "execute") {
include_once("backup_execute.html");
}
print_simple_box_end();
//Print footer
print_footer();
?>
+214
View File
@@ -0,0 +1,214 @@
<?PHP //$Id$
//This page prints the backup todo list to see everything
//Check login
require_login();
//Check admin
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
//Check site
if (!$site = get_site()) {
error("Site not found!");
}
//Checks for the required files/functions to backup every mod
//And check if there is data about it
$count = 0;
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$modfile = "$mods_home/$modname/backuplib.php";
$modbackup = $modname."_backup_mods";
$modcheckbackup = $modname."_check_backup_mods";
if (file_exists($modfile)) {
include_once($modfile);
if (function_exists($modbackup) and function_exists($modcheckbackup)) {
$var = "exists_".$modname;
$$var = true;
$count++;
}
}
//Check data
//Check module info
$var = "backup_".$modname;
if (!isset($$var)) {
$$var = 1;
}
//Check include user info
$var = "backup_user_info_".$modname;
if (!isset($$var)) {
$$var = 1;
}
}
}
//Check other parameters
if (!isset($backup_users)) {
$backup_users = 1;
}
if (!isset($backup_logs)) {
$backup_logs = 1;
}
if (!isset($backup_user_files)) {
$backup_user_files = 1;
}
if (!isset($backup_course_files)) {
$backup_course_files = 2;
}
if ($count == 0) {
notice("No backupable modules are installed!");
}
?>
<form name="form" method="post" <?=$onsubmit ?> action="<?=$ME ?>">
<table cellpadding=5>
<?
//Now print the Backup Name tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string("name").":";
echo "</B></td><td>";
//Calculate the backup string
$backup_name = strtolower(get_string("backup"));
//If non-translated, use "backup"
if (substr($backup_name,0,1) == "[") {
$backup_name = "backup";
}
//Calculate the format string
$backup_name_format = get_string("backupnameformat");
//If non-translated, use "%Y%m%d-%H%M"
if (substr($backup_name_format,0,1) == "[") {
$backup_name_format = "%%Y%%m%%d-%%H%%M";
}
$backup_name .= "-".strtolower($course->shortname)."-".userdate(time(),$backup_name_format,99,false).".zip";
echo $backup_name;
//Add as hidden name
echo "<input type=\"hidden\" name=\"backup_name\" value=\"".$backup_name."\">";
echo "</td></tr>";
//Calculate the backup unique code to allow simultaneus backups (to define
//the temp-directory name and records in backup temp tables
$backup_unique_code = time();
//Add as hidden name
echo "<input type=\"hidden\" name=\"backup_unique_code\" value=\"".$backup_unique_code."\">";
//Line
echo "<tr><td colspan=\"2\"><hr noshade size=\"1\"></td></tr>";
//Now print the To Do list
echo "<tr>";
echo "<td colspan=\"2\" align=\"center\"><P><B>";
echo get_string("backupdetails").":";
echo "</td></tr>";
//This is tha align to every ingo table
$table->align = array ("LEFT","RIGHT");
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$modbackup = $modname."_backup_mods";
//If exists the lib & function
$var = "exists_".$modname;
if ($$var) {
//Add hidden fields
$var = "backup_".$modname;
echo "<input type=\"hidden\" name=\"".$var."\" value=\"".$$var."\">";
$var = "backup_user_info_".$modname;
echo "<input type=\"hidden\" name=\"".$var."\" value=\"".$$var."\">";
$var = "backup_".$modname;
//Only if selected
if ($$var == 1) {
//Print the full tr
echo "<tr>";
echo "<td colspan=\"2\"><P><B>";
//Print the mod name
echo "<li>".get_string("include")." ".get_string("modulenameplural",$modname)." ";
//Now look for user-data status
$backup_user_options[0] = get_string("withoutuserdata");
$backup_user_options[1] = get_string("withuserdata");
$var = "backup_user_info_".$modname;
//Print the user info
echo $backup_user_options[$$var]."<P>";
//Call the check function to show more info
$modcheckbackup = $modname."_check_backup_mods";
$table->data = $modcheckbackup($id,$$var,$backup_unique_code);
print_table($table);
echo "</td></tr>";
}
}
}
//Line
echo "<tr><td colspan=\"2\"><hr noshade size=\"1\"></td></tr>";
//Now print the Users tr
echo "<tr>";
echo "<td colspan=\"2\"><P><B>";
$user_options[0] = get_string("includeallusers");
$user_options[1] = get_string("includecourseusers");
///$user_options[2] = get_string("includeneededusers");--->NOT IMPLEMENTED
echo "<li>".$user_options[$backup_users]."<P>";
//Add as hidden name
echo "<input type=\"hidden\" name=\"backup_users\" value=\"".$backup_users."\">";
//Print info
$table->data = user_check_backup($id,$backup_unique_code,$backup_users);
print_table($table);
echo "</td></tr>";
//Now print the Logs tr conditionally
if ($backup_logs) {
echo "<tr>";
echo "<td colspan=\"2\"><P><B>";
echo "<li>".get_string("includelogentries")."<P>";
//Print info
$table->data = log_check_backup($id);
print_table($table);
echo "</td></tr>";
}
//Add as hidden name
echo "<input type=\"hidden\" name=\"backup_logs\" value=\"".$backup_logs."\">";
//Now print the User Files tr conditionally
if ($backup_user_files) {
echo "<tr>";
echo "<td colspan=\"2\"><P><B>";
echo "<li>".get_string("includeuserfiles")."<P>";
//Print info
$table->data = user_files_check_backup($id,$backup_unique_code);
print_table($table);
echo "</td></tr>";
}
//Add as hidden name
echo "<input type=\"hidden\" name=\"backup_user_files\" value=\"".$backup_user_files."\">";
//Now print the Course Files tr conditionally
if ($backup_course_files) {
echo "<tr>";
echo "<td colspan=\"2\"><P><B>";
echo "<li>".get_string("includecoursefiles")."<P>";
//Print info
$table->data = course_files_check_backup($id,$backup_unique_code);
print_table($table);
echo "</td></tr>";
}
//Add as hidden name
echo "<input type=\"hidden\" name=\"backup_course_files\" value=\"".$backup_course_files."\">";
}
?>
</table>
<BR>
<CENTER>
<input type="hidden" name=id value="<? p($id) ?>">
<input type="hidden" name=launch value="execute">
<input type="submit" value="<? print_string("continue") ?>">
<input type="submit" name=cancel value="<? print_string("cancel") ?>">
</CENTER>
</FORM>
+277
View File
@@ -0,0 +1,277 @@
<?PHP //$Id$
//This page prints the backup todo list to see everything
//Check login
require_login();
//Check admin
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
//Check site
if (!$site = get_site()) {
error("Site not found!");
}
//Checks for the required files/functions to backup every mod
//And check if there is data about it
$count = 0;
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$modfile = "$mods_home/$modname/backuplib.php";
$modbackup = $modname."_backup_mods";
$modcheckbackup = $modname."_check_backup_mods";
if (file_exists($modfile)) {
include_once($modfile);
if (function_exists($modbackup) and function_exists($modcheckbackup)) {
$var = "exists_".$modname;
$$var = true;
$count++;
}
}
//Check data
//Check module info
$var = "backup_".$modname;
if (!isset($$var)) {
//Every undefined backup_XXXX isn't exported
$$var = 0;
}
//Now stores all the mods preferences into an array into preferences
$preferences->mods[$modname]->backup = $$var;
//Check include user info
$var = "backup_user_info_".$modname;
if (!isset($$var)) {
$$var = 1;
}
//Now stores all the mods preferences into an array into preferences
$preferences->mods[$modname]->userinfo = $$var;
//And the name of the mod
$preferences->mods[$modname]->name = $modname;
}
}
//Check other parameters
if (!isset($backup_users)) {
$backup_users = 1;
}
$preferences->backup_users = $backup_users;
if (!isset($backup_logs)) {
$backup_logs = 1;
}
$preferences->backup_logs = $backup_logs;
if (!isset($backup_user_files)) {
$backup_user_files = 1;
}
$preferences->backup_user_files = $backup_user_files;
if (!isset($backup_course_files)) {
$backup_course_files = 2;
}
$preferences->backup_course_files = $backup_course_files;
if (!isset($id)) {
error ("Course not specified");
}
$preferences->backup_course = $id;
if (!isset($backup_name)) {
error ("Backup name not specified");
}
$preferences->backup_name = $backup_name;
if (!isset($backup_unique_code)) {
error ("Backup unique code not specified");
}
$preferences->backup_unique_code = $backup_unique_code;
//Another Info
$preferences->moodle_version = $version;
$preferences->moodle_release = $release;
$preferences->backup_version = $backup_version;
$preferences->backup_release = $backup_release;
if ($count == 0) {
notice("No backupable modules are installed!");
}
//Start the main table
echo "<table cellpadding=5>";
//Now print the Backup Name tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string("name").":";
echo "</B></td><td>";
echo $backup_name;
echo "</td></tr>";
//Start the main tr, where all the backup progress is done
echo "<tr>";
echo "<td colspan=\"2\">";
//Start the main ul
echo "<ul>";
//Check for temp and backup and backup_unique_code directory
//Create them as needed
echo "<li>Creating temporary structures";
$status = check_and_create_backup_dir($backup_unique_code);
//Empty dir
if ($status) {
$status = clear_backup_dir($backup_unique_code);
}
//Delete old_entries from backup tables
echo "<li>Deteting old data";
$status = backup_delete_old_data();
if (!$status) {
error ("An error has ocurred");
}
//Create the moodle.xml file
if ($status) {
echo "<li>Creating xml file";
//Begin a new list to xml contents
echo "<ul>";
echo "<li>Writing header";
//Obtain the xml file (create and open) and print prolog information
$backup_file = backup_open_xml($backup_unique_code);
echo "<li>Writing general info";
//Prints general info about backup to file
if ($backup_file) {
$status = backup_general_info($backup_file,$preferences);
}
echo "<li>Writing course data";
//Start new ul (for course)
echo "<ul>";
echo "<li>Course info";
//Prints course start (tag and general info)
if ($status) {
$status = backup_course_start($backup_file,$preferences);
}
echo "<li>Sections";
//Section info
if ($status) {
$status = backup_course_sections($backup_file,$preferences);
}
//End course contents (close ul)
echo "</ul>";
echo "<li>Writing users info";
//User info
if ($status) {
$status = backup_user_info($backup_file,$preferences);
}
//Print logs if selected
if ($status) {
if ($preferences->backup_logs) {
echo "<li>Writing logs info";
$status = backup_log_info($backup_file,$preferences);
}
}
//Module info, this unique function makes all the work!!
//db export and module fileis copy
if ($status) {
$mods_to_backup = false;
//Check if we have any mod to backup
foreach ($preferences->mods as $module) {
if ($module->backup) {
$mods_to_backup = true;
}
}
//If we have to backup some module
if ($mods_to_backup) {
echo "<li>Writing modules info";
//Start modules tag
$status = backup_modules_start ($backup_file,$preferences);
//Open ul for module list
echo "<ul>";
//Iterate over modules and call backupa
foreach ($preferences->mods as $module) {
if ($module->backup and $status) {
echo "<li>".$module->name;
$status = backup_module($backup_file,$preferences,$module->name);
}
}
//Close ul for module list
echo "</ul>";
//Close modules tag
$status = backup_modules_end ($backup_file,$preferences);
}
}
//Prints course end
if ($status) {
$status = backup_course_end($backup_file,$preferences);
}
//Close the xml file and xml data
if ($backup_file) {
backup_close_xml($backup_file);
}
//End xml contents (close ul)
echo "</ul>";
}
//Now, if selected, copy user files
if ($status) {
if ($preferences->backup_user_files) {
echo "<li>Copying user files";
$status = backup_copy_user_files ($preferences);
}
}
//Now, if selected, copy course files
if ($status) {
if ($preferences->backup_course_files) {
echo "<li>Copying course files";
$status = backup_copy_course_files ($preferences);
}
}
//Now, zip all the backup directory contents
if ($status) {
echo "<li>Zipping backup";
$status = backup_zip ($preferences,$moodle_home);
}
//Now, copy the zip file to course directory
if ($status) {
echo "<li>Copying zip file";
$status = copy_zip_to_course_dir ($preferences);
}
//Now, clean temporary data (db and filesystem)
if ($status) {
echo "<li>Cleaning up temp data";
$status = clean_temp_data ($preferences);
}
if (!$status) {
error ("An error has ocurred");
}
//Ends th main ul
echo "</ul>";
//End the main tr, where all the backup is done
echo "</td></tr>";
//End the main table
echo "</table>";
//Print final message
print_simple_box(get_string("backupfinished"),"CENTER");
print_continue($moodle_home."/files/index.php?id=".$preferences->backup_course."&wdir=/".get_string("backupdir"));
?>
+150
View File
@@ -0,0 +1,150 @@
<?PHP //$Id$
//This page prints the backup form to select everything
//Check login
require_login();
//Check admin
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
//Check site
if (!$site = get_site()) {
error("Site not found!");
}
//Checks for the required files/functions to backup every mod
//And check if there is data about it
$count = 0;
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$modfile = "$mods_home/$modname/backuplib.php";
$modbackup = $modname."_backup_mods";
$modcheckbackup = $modname."_check_backup_mods";
if (file_exists($modfile)) {
include_once($modfile);
if (function_exists($modbackup) and function_exists($modcheckbackup)) {
$var = "exists_".$modname;
$$var = true;
$count++;
}
}
//Check data
//Check module info
$var = "backup_".$modname;
if (!isset($$var)) {
$$var = 1;
}
//Check include user info
$var = "backup_user_info_".$modname;
if (!isset($$var)) {
$$var = 1;
}
}
}
//Check other parameters
if (!isset($backup_users)) {
$backup_users = 1;
}
if (!isset($backup_logs)) {
$backup_logs = 1;
}
if (!isset($backup_user_files)) {
$backup_user_files = 1;
}
if (!isset($backup_course_files)) {
$backup_course_files = 1;
}
if ($count == 0) {
notice("No backupable modules are installed!");
}
?>
<form name="form" method="post" <?=$onsubmit ?> action="<?=$ME ?>">
<table cellpadding=5>
<?
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$modbackup = $modname."_backup_mods";
//If exists the lib & function
$var = "exists_".$modname;
if ($$var) {
//Print the full tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string("include")." ". get_string("modulenameplural",$modname).":";
echo "</td><td>";
$backup_options[0] = get_string("no");
$backup_options[1] = get_string("yes");
$var = "backup_".$modname;
choose_from_menu($backup_options, $var, $$var, "");
$backup_user_options[0] = get_string("withoutuserdata");
$backup_user_options[1] = get_string("withuserdata");
$var = "backup_user_info_".$modname;
choose_from_menu($backup_user_options, $var, $$var, "");
echo "</td></tr>";
}
}
//Line
echo "<tr><td colspan=\"2\"><hr noshade size=\"1\"></td></tr>";
//Now print the Users tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string("users").":";
echo "</td><td>";
$user_options[0] = get_string("all");
$user_options[1] = get_string("course");
//$user_options[2] = get_string("needed");-->NOT IMPLEMENTED
choose_from_menu($user_options, "backup_users", $backup_users, "");
echo "</td></tr>";
//Now print the Logs tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string("logs").":";
echo "</td><td>";
$log_options[0] = get_string("no");
$log_options[1] = get_string("yes");
choose_from_menu($log_options, "backup_logs", $backup_logs, "");
echo "</td></tr>";
//Now print the User Files tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string ("userfiles").":";
echo "</td><td>";
$user_file_options[0] = get_string("no");
$user_file_options[1] = get_string("yes");
choose_from_menu($user_file_options, "backup_user_files", $backup_user_files, "");
echo "</td></tr>";
//Now print the Course Files tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string ("coursefiles").":";
echo "</td><td>";
$course_file_options[0] = get_string("no");
$course_file_options[1] = get_string("yes");
choose_from_menu($course_file_options, "backup_course_files", $backup_course_files, "");
echo "</td></tr>";
}
?>
</table>
<BR>
<CENTER>
<input type="hidden" name=id value="<? p($id) ?>">
<input type="hidden" name=launch value="check">
<input type="submit" value="<? print_string("continue") ?>">
<input type="submit" name=cancel value="<? print_string("cancel") ?>">
</CENTER>
</FORM>
+10
View File
@@ -0,0 +1,10 @@
<?PHP //$Id$
// This file defines the current version of the
// backup/restore code that is being used. This can be
// compared against the values stored in the
// database (backup_version) to determine whether upgrades should
// be performed (see db/backup_*.php)
$backup_version = 2003052000; // The current version is a date (YYYYMMDDXX)
$backup_release = "0.2.1 alpha"; // User-friendly version number
+883
View File
@@ -0,0 +1,883 @@
<?PHP //$Id$
//This file contains all the function needed in the backup utility
//except the mod-related funtions that are into every backuplib.php inside
//every mod directory
//Insert necessary category ids to backup_ids table
function insert_category_ids ($course,$backup_unique_code) {
global $CFG;
$status = true;
$status = execute_sql("INSERT INTO {$CFG->prefix}backup_ids
(backup_code, table_name, old_id)
SELECT DISTINCT '$backup_unique_code','quiz_categories',t.category
FROM {$CFG->prefix}quiz_questions t,
{$CFG->prefix}quiz_question_grades g,
{$CFG->prefix}quiz q
WHERE q.course = '$course' AND
g.quiz = q.id AND
g.question = t.id",false);
return $status;
}
//Delete category ids from backup_ids table
function delete_category_ids ($backup_unique_code) {
global $CFG;
$status = true;
$status = execute_sql("DELETE FROM {$CFG->prefix}backup_ids
WHERE backup_code = '$backup_unique_code'",false);
return $status;
}
//Calculate the number of users to backup and put their ids in backup_ids
//Return an array of info (name,value)
function user_check_backup($course,$backup_unique_code,$backup_users) {
//$backup_users=0-->all
// 1-->course
// 2-->needed-->NOT IMPLEMEMTED
global $CFG;
global $db;
$count_users = 0;
//Select all users from user
$users = get_records ("user");
//Iterate over users putting their roles
foreach ($users as $user) {
$user->info = "";
//Is Admin in tables (not is_admin()) !!
if (record_exists("user_admins","userid",$user->id)) {
$user->info .= "admin";
$user->role_admin = true;
}
//Is Course Creator in tables (not is_coursecreator()) !!
if (record_exists("user_coursecreators","userid",$user->id)) {
$user->info .= "coursecreator";
$user->role_coursecreator = true;
}
//Is Teacher in tables (not is_teacher()) !!
if (record_exists("user_teachers","course",$course,"userid",$user->id)) {
$user->info .= "teacher";
$user->role_teacher = true;
}
//Is Student in tables (not is_student()) !!
if (record_exists("user_students","course",$course,"userid",$user->id)) {
$user->info .= "student";
$user->role_student = true;
}
//Now create the backup_id record
$backupids_rec->backup_code = $backup_unique_code;
$backupids_rec->table_name = "user";
$backupids_rec->old_id = $user->id;
$backupids_rec->info = $user->info;
//Insert the record id. backup_users decide it.
//When all users
if ($backup_users == 0) {
$status = insert_record("backup_ids",$backupids_rec,false);
$count_users++;
//When course users
} else if ($backup_users == 1) {
//Only if user has any role
if ($backupids_rec->info) {
$status = insert_record("backup_ids",$backupids_rec,false);
$count_users++;
}
}
}
//Prepare Info
//Gets the user data
$info[0][0] = get_string("users");
$info[0][1] = $count_users;
return $info;
}
//Calculate the number of log entries to backup
//Return an array of info (name,value)
function log_check_backup($course) {
global $CFG;
//Execute the insert
$status = execute_sql($sql_insert,false);
//Now execute the select
$ids = get_records_sql("SELECT DISTINCT l.id,l.course
FROM {$CFG->prefix}log l
WHERE l.course = '$course'");
//Gets the user data
$info[0][0] = get_string("logs");
if ($ids) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
return $info;
}
//Calculate the number of user files to backup
//Under $CFG->dataroot/users
//and put them (their path) in backup_ids
//Return an array of info (name,value)
function user_files_check_backup($course,$backup_unique_code) {
global $CFG;
$rootdir = $CFG->dataroot."/users";
//Check if directory exists
if (is_dir($rootdir)) {
$coursedirs = get_directory_list($rootdir);
foreach ($coursedirs as $dir) {
//Extracts user id from file path
$tok = strtok($dir,"/");
if ($tok) {
$userid = $tok;
} else {
$tok = "";
}
//Insert them into backup_files
$status = execute_sql("INSERT INTO {$CFG->prefix}backup_files
(backup_code, file_type, path, old_id)
VALUES
('$backup_unique_code','user','$dir','$userid')",false);
}
}
//Now execute the select
$ids = get_records_sql("SELECT DISTINCT b.path, b.old_id
FROM {$CFG->prefix}backup_files b
WHERE backup_code = '$backup_unique_code' AND
file_type = 'user'");
//Gets the user data
$info[0][0] = get_string("files");
if ($ids) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
return $info;
}
//Calculate the number of course files to backup
//under $CFG->dataroot/$course, except $CFG->moddata, and get_string("backupdir)
//and put them (their path) in backup_ids
//Return an array of info (name,value)
function course_files_check_backup($course,$backup_unique_code) {
global $CFG;
$rootdir = $CFG->dataroot."/$course";
//Check if directory exists
if (is_dir($rootdir)) {
$coursedirs = get_directory_list($rootdir,$CFG->moddata);
$backupdir = get_string("backupdir");
foreach ($coursedirs as $dir) {
//Check it isn't backupdir
if (strpos($dir,$backupdir)!==0) {
//Insert them into backup_files
$status = execute_sql("INSERT INTO {$CFG->prefix}backup_files
(backup_code, file_type, path)
VALUES
('$backup_unique_code','course','$dir')",false);
}
}
}
//Now execute the select
$ids = get_records_sql("SELECT DISTINCT b.path, b.old_id
FROM {$CFG->prefix}backup_files b
WHERE backup_code = '$backup_unique_code' AND
file_type = 'course'");
//Gets the user data
$info[0][0] = get_string("files");
if ($ids) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
return $info;
}
//Function to check and create the needed moddata dir to
//save all the mod backup files. We always name it moddata
//to be able to restore it, but in restore we check for
//$CFG->moddata !!
function check_and_create_moddata_dir($backup_unique_code) {
global $CFG;
$status = check_dir_exists($CFG->dataroot."/temp/backup/".$backup_unique_code."/moddata",true);
return $status;
}
//Function to check and create the "user_files" dir to
//save all the user files we need from "users" dir
function check_and_create_user_files_dir($backup_unique_code) {
global $CFG;
$status = check_dir_exists($CFG->dataroot."/temp/backup/".$backup_unique_code."/user_files",true);
return $status;
}
//Function to check and create the "course_files" dir to
//save all the course files we need from "CFG->datadir/course" dir
function check_and_create_course_files_dir($backup_unique_code) {
global $CFG;
$status = check_dir_exists($CFG->dataroot."/temp/backup/".$backup_unique_code."/course_files",true);
return $status;
}
//Function to create, open and write header of the xml file
function backup_open_xml($backup_unique_code) {
global $CFG;
$status = true;
//Open for writing
$file = $CFG->dataroot."/temp/backup/".$backup_unique_code."/moodle.xml";
$backup_file = fopen($file,"w");
//Writes the header
$status = fwrite ($backup_file,"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
if ($status) {
$status = fwrite ($backup_file,start_tag("MOODLE_BACKUP",0,true));
}
if ($status) {
return $backup_file;
} else {
return false;
}
}
//Close the file
function backup_close_xml($backup_file) {
$status = fwrite ($backup_file,end_tag("MOODLE_BACKUP",0,true));
return fclose($backup_file);
}
//Return the xml start tag
function start_tag($tag,$level=0,$endline=false) {
if ($endline) {
$endchar = "\n";
} else {
$endchar = "";
}
return str_repeat(" ",$level*2)."<".strtoupper($tag).">".$endchar;
}
//Return the xml end tag
function end_tag($tag,$level=0,$endline=true) {
if ($endline) {
$endchar = "\n";
} else {
$endchar = "";
}
return str_repeat(" ",$level*2)."</".strtoupper($tag).">".$endchar;
}
//Return the start tag, the contents and the end tag
function full_tag($tag,$level=0,$endline=true,$content,$to_utf=true) {
$st = start_tag($tag,$level,$endline);
$co="";
if ($to_utf) {
$co = utf8_encode(htmlspecialchars($content));
} else {
$co = htmlspecialchars($content);
}
$et = end_tag($tag,0,true);
return $st.$co.$et;
}
//Prints General info about the course
//name, moodle_version (internal and release), backup_version, date, info in file...
function backup_general_info ($bf,$preferences) {
global $CFG;
fwrite ($bf,start_tag("INFO",1,true));
//The name of the backup
fwrite ($bf,full_tag("NAME",2,false,$preferences->backup_name));
//The moodle_version
fwrite ($bf,full_tag("MOODLE_VERSION",2,false,$preferences->moodle_version));
fwrite ($bf,full_tag("MOODLE_RELEASE",2,false,$preferences->moodle_release));
//The backup_version
fwrite ($bf,full_tag("BACKUP_VERSION",2,false,$preferences->backup_version));
fwrite ($bf,full_tag("BACKUP_RELEASE",2,false,$preferences->backup_release));
//The date
fwrite ($bf,full_tag("DATE",2,false,$preferences->backup_unique_code));
//Te includes tag
fwrite ($bf,start_tag("DETAILS",2,true));
//Now, go to mod element of preferences to print its status
foreach ($preferences->mods as $element) {
//Calculate info
$included = "false";
$userinfo = "false";
if ($element->backup) {
$included = "true";
if ($element->userinfo) {
$userinfo = "true";
}
}
//Prints the mod start
fwrite ($bf,start_tag("MOD",3,true));
fwrite ($bf,full_tag("NAME",4,false,$element->name));
fwrite ($bf,full_tag("INCLUDED",4,false,$included));
fwrite ($bf,full_tag("USERINFO",4,false,$userinfo));
//Print the end
fwrite ($bf,end_tag("MOD",3,true));
}
//The user in backup
if ($preferences->backup_users == 1) {
fwrite ($bf,full_tag("USERS",3,false,"course"));
} else {
fwrite ($bf,full_tag("USERS",3,false,"all"));
}
//The logs in backup
if ($preferences->backup_logs == 1) {
fwrite ($bf,full_tag("LOGS",3,false,"true"));
} else {
fwrite ($bf,full_tag("LOGS",3,false,"false"));
}
//The user files
if ($preferences->backup_user_files == 1) {
fwrite ($bf,full_tag("USERFILES",3,false,"true"));
} else {
fwrite ($bf,full_tag("USERFILES",3,false,"false"));
}
//The course files
if ($preferences->backup_course_files == 1) {
fwrite ($bf,full_tag("COURSEFILES",3,false,"true"));
} else {
fwrite ($bf,full_tag("COURSEFILES",3,false,"false"));
}
fwrite ($bf,end_tag("DETAILS",2,true));
$status = fwrite ($bf,end_tag("INFO",1,true));
return $status;
}
//Prints course's general info (table course)
function backup_course_start ($bf,$preferences) {
global $CFG;
$status = true;
//Course open tag
fwrite ($bf,start_tag("COURSE",1,true));
//Header open tag
fwrite ($bf,start_tag("HEADER",2,true));
//Get info from course
$course=false;
if ($courses = get_records("course","id",$preferences->backup_course)) {
$course = $courses[$preferences->backup_course];
}
if ($course) {
//Prints course info
fwrite ($bf,full_tag("ID",3,false,$course->id));
//Obtain the category
$category = false;
if ($categories = get_records("course_categories","id","$course->category")) {
$category = $categories[$course->category];
}
if ($category) {
//Prints category info
fwrite ($bf,start_tag("CATEGORY",3,true));
fwrite ($bf,full_tag("ID",4,false,$course->category));
fwrite ($bf,full_tag("NAME",4,false,$category->name));
fwrite ($bf,end_tag("CATEGORY",3,true));
}
//Continues with the course
fwrite ($bf,full_tag("PASSWORD",3,false,$course->password));
fwrite ($bf,full_tag("FULLNAME",3,false,$course->fullname));
fwrite ($bf,full_tag("SHORTNAME",3,false,$course->shortname));
fwrite ($bf,full_tag("SUMMARY",3,false,$course->summary));
fwrite ($bf,full_tag("FORMAT",3,false,$course->format));
fwrite ($bf,full_tag("NEWSITEMS",3,false,$course->newsitems));
fwrite ($bf,full_tag("TEACHER",3,false,$course->teacher));
fwrite ($bf,full_tag("TEACHERS",3,false,$course->teachers));
fwrite ($bf,full_tag("STUDENT",3,false,$course->student));
fwrite ($bf,full_tag("STUDENTS",3,false,$course->students));
fwrite ($bf,full_tag("GUEST",3,false,$course->guest));
fwrite ($bf,full_tag("STARDATE",3,false,$course->stardate));
fwrite ($bf,full_tag("NUMSECTIONS",3,false,$course->numsections));
fwrite ($bf,full_tag("SHOWRECENT",3,false,$course->showrecent));
fwrite ($bf,full_tag("MARKER",3,false,$course->marker));
fwrite ($bf,full_tag("TIMECREATED",3,false,$course->timecreated));
$status = fwrite ($bf,full_tag("TIMEMODIFIED",3,false,$course->timemodified));
//Print header end
fwrite ($bf,end_tag("HEADER",2,true));
} else {
$status = false;
}
return $status;
}
//Prints course's end tag
function backup_course_end ($bf,$preferences) {
//Course end tag
$status = fwrite ($bf,end_tag("COURSE",1,true));
return $status;
}
//Prints course's sections info (table course_sections)
function backup_course_sections ($bf,$preferences) {
global $CFG;
$status = true;
//Get info from sections
$section=false;
if ($sections = get_records("course_sections","course",$preferences->backup_course,"section")) {
//Section open tag
fwrite ($bf,start_tag("SECTIONS",2,true));
//Iterate over every section (ordered by section)
foreach ($sections as $section) {
//Begin Section
fwrite ($bf,start_tag("SECTION",3,true));
fwrite ($bf,full_tag("ID",4,false,$section->id));
fwrite ($bf,full_tag("NUMBER",4,false,$section->section));
fwrite ($bf,full_tag("SUMMARY",4,false,$section->summary));
fwrite ($bf,full_tag("VISIBLE",4,false,$section->visible));
//Now print the mods in section
backup_course_modules ($bf,$preferences,$section);
//End section
fwrite ($bf,end_tag("SECTION",3,true));
}
//Section close tag
$status = fwrite ($bf,end_tag("SECTIONS",2,true));
}
return $status;
}
//Prints course's modules info (table course_modules)
//Only for selected mods in preferences
function backup_course_modules ($bf,$preferences,$section) {
global $CFG;
$status = true;
$first_record = true;
//Now print the mods in section
//Extracts mod id from sequence
$tok = strtok($section->sequence,",");
while ($tok) {
//Get module's type
$moduletype = get_module_type ($preferences->backup_course,$tok);
//Check if we've selected to backup that type
if ($moduletype and $preferences->mods[$moduletype]->backup) {
$selected = true;
} else {
$selected = false;
}
if ($selected) {
//Gets course_module data from db
$course_module = get_records ("course_modules","id",$tok);
//If it's the first, pring MODS tag
if ($first_record) {
fwrite ($bf,start_tag("MODS",4,true));
$first_record = false;
}
//Print mod info from course_modules
fwrite ($bf,start_tag("MOD",5,true));
//Save neccesary info to backup_ids
fwrite ($bf,full_tag("ID",6,false,$tok));
fwrite ($bf,full_tag("TYPE",6,false,$moduletype));
fwrite ($bf,full_tag("INSTANCE",6,false,$course_module[$tok]->instance));
fwrite ($bf,full_tag("ADDED",6,false,$course_module[$tok]->added));
fwrite ($bf,full_tag("DELETED",6,false,$course_module[$tok]->deleted));
fwrite ($bf,full_tag("SCORE",6,false,$course_module[$tok]->score));
fwrite ($bf,full_tag("VISIBLE",6,false,$course_module[$tok]->visible));
fwrite ($bf,end_tag("MOD",5,true));
}
//check for next
$tok = strtok(",");
}
//Si ha habido modulos, final de MODS
if (!$first_record) {
$status =fwrite ($bf,end_tag("MODS",4,true));
}
return $status;
}
//Print users to xml
//Only users previously calculated in backup_ids will output
//
function backup_user_info ($bf,$preferences) {
global $CFG;
$status = true;
$users = get_records_sql("SELECT u.old_id, u.table_name,u.info
FROM {$CFG->prefix}backup_ids u
WHERE u.backup_code = '$preferences->backup_unique_code' AND
u.table_name = 'user'");
//If we have users to backup
if ($users) {
//Begin Users tag
fwrite ($bf,start_tag("USERS",2,true));
//With every user
foreach ($users as $user) {
//Get user data from table
$user_data = get_record("user","id",$user->old_id);
//Begin User tag
fwrite ($bf,start_tag("USER",3,true));
//Output all user data
fwrite ($bf,full_tag("ID",4,false,$user_data->id));
fwrite ($bf,full_tag("CONFIRMED",4,false,$user_data->confirmed));
fwrite ($bf,full_tag("DELETED",4,false,$user_data->deleted));
fwrite ($bf,full_tag("USERNAME",4,false,$user_data->username));
fwrite ($bf,full_tag("PASSWORD",4,false,$user_data->password));
fwrite ($bf,full_tag("IDNUMBER",4,false,$user_data->idnumber));
fwrite ($bf,full_tag("FIRSTNAME",4,false,$user_data->firstname));
fwrite ($bf,full_tag("LASTNAME",4,false,$user_data->lastname));
fwrite ($bf,full_tag("EMAIL",4,false,$user_data->email));
fwrite ($bf,full_tag("ICQ",4,false,$user_data->icq));
fwrite ($bf,full_tag("PHONE1",4,false,$user_data->phone1));
fwrite ($bf,full_tag("PHONE2",4,false,$user_data->phone2));
fwrite ($bf,full_tag("INSTITUTION",4,false,$user_data->institution));
fwrite ($bf,full_tag("DEPARTMENT",4,false,$user_data->department));
fwrite ($bf,full_tag("ADDRESS",4,false,$user_data->address));
fwrite ($bf,full_tag("CITY",4,false,$user_data->city));
fwrite ($bf,full_tag("COUNTRY",4,false,$user_data->country));
fwrite ($bf,full_tag("LANG",4,false,$user_data->lang));
fwrite ($bf,full_tag("TIMEZONE",4,false,$user_data->timezone));
fwrite ($bf,full_tag("FIRSTACCESS",4,false,$user_data->firstaccess));
fwrite ($bf,full_tag("LASTACCESS",4,false,$user_data->lastaccess));
fwrite ($bf,full_tag("LASTLOGIN",4,false,$user_data->lastlogin));
fwrite ($bf,full_tag("CURRENTLOGIN",4,false,$user_data->currentlogin));
fwrite ($bf,full_tag("LASTIP",4,false,$user_data->lastIP));
fwrite ($bf,full_tag("SECRET",4,false,$user_data->secret));
fwrite ($bf,full_tag("PICTURE",4,false,$user_data->picture));
fwrite ($bf,full_tag("URL",4,false,$user_data->url));
fwrite ($bf,full_tag("DESCRIPTION",4,false,$user_data->description));
fwrite ($bf,full_tag("MAILFORMAT",4,false,$user_data->mailformat));
fwrite ($bf,full_tag("MAILDISPLAY",4,false,$user_data->maildisplay));
fwrite ($bf,full_tag("HTMLEDITOR",4,false,$user_data->htmleditor));
fwrite ($bf,full_tag("AUTOSUBSCRIBE",4,false,$user_data->autosubscribe));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$user_data->timemodified));
//Output every user role (with its associated info)
$user->isadmin = strpos($user->info,"admin");
$user->iscoursecreator = strpos($user->info,"coursecreator");
$user->isteacher = strpos($user->info,"teacher");
$user->isstudent = strpos($user->info,"student");
if ($user->isadmin!==false or
$user->iscoursecreator!==false or
$user->isteacher!==false or
$user->isstudent!==false) {
//Begin ROLES tag
fwrite ($bf,start_tag("ROLES",4,true));
//PRINT ROLE INFO
//Admins
if ($user->isadmin!==false) {
//Print ROLE start
fwrite ($bf,start_tag("ROLE",5,true));
//Print Role info
fwrite ($bf,full_tag("TYPE",6,false,"admin"));
//Print ROLE end
fwrite ($bf,end_tag("ROLE",5,true));
}
//CourseCreator
if ($user->iscoursecreator!==false) {
//Print ROLE start
fwrite ($bf,start_tag("ROLE",5,true));
//Print Role info
fwrite ($bf,full_tag("TYPE",6,false,"coursecreator"));
//Print ROLE end
fwrite ($bf,end_tag("ROLE",5,true));
}
//Teacher
if ($user->isteacher!==false) {
//Print ROLE start
fwrite ($bf,start_tag("ROLE",5,true));
//Print Role info
fwrite ($bf,full_tag("TYPE",6,false,"teacher"));
//Get specific info for teachers
$tea = get_record("user_teachers","userid",$user->old_id,"course",$preferences->backup_course);
fwrite ($bf,full_tag("AUTHORITY",6,false,$tea->authority));
fwrite ($bf,full_tag("TEA_ROLE",6,false,$tea->role));
//Print ROLE end
fwrite ($bf,end_tag("ROLE",5,true));
}
//Student
if ($user->isstudent!==false) {
//Print ROLE start
fwrite ($bf,start_tag("ROLE",5,true));
//Print Role info
fwrite ($bf,full_tag("TYPE",6,false,"student"));
//Get specific info for students
$stu = get_record("user_students","userid",$user->old_id,"course",$preferences->backup_course);
fwrite ($bf,full_tag("TIMESTART",6,false,$stu->timestart));
fwrite ($bf,full_tag("TIMEEND",6,false,$stu->timeend));
fwrite ($bf,full_tag("TIME",6,false,$stu->time));
//Print ROLE end
fwrite ($bf,end_tag("ROLE",5,true));
}
//End ROLES tag
fwrite ($bf,end_tag("ROLES",4,true));
}
//End User tag
fwrite ($bf,end_tag("USER",3,true));
}
//End Users tag
fwrite ($bf,end_tag("USERS",2,true));
} else {
//There isn't users. Impossible !!
$status = false;
}
return $status;
}
//Backup log info (time ordered)
function backup_log_info($bf,$preferences) {
global $CFG;
$status = true;
$logs = get_records ("log","course",$preferences->backup_course,"time");
//We have logs
if ($logs) {
//Pring logs header
fwrite ($bf,start_tag("LOGS",2,true));
//Iterate
foreach ($logs as $log) {
//See if it is a valid module to backup
if ($log->module == "course" or
$log->module == "user" or
$preferences->mods[$log->module]->backup == 1) {
//Begin log tag
fwrite ($bf,start_tag("LOG",3,true));
//Output log tag
fwrite ($bf,full_tag("ID",4,false,$log->id));
fwrite ($bf,full_tag("TIME",4,false,$log->time));
fwrite ($bf,full_tag("USERID",4,false,$log->userid));
fwrite ($bf,full_tag("IP",4,false,$log->ip));
fwrite ($bf,full_tag("MODULE",4,false,$log->module));
fwrite ($bf,full_tag("ACTION",4,false,$log->action));
fwrite ($bf,full_tag("URL",4,false,$log->url));
fwrite ($bf,full_tag("INFO",4,false,$log->info));
//End log tag
fwrite ($bf,end_tag("LOG",3,true));
}
}
//End logs tag
$status = fwrite ($bf,end_tag("LOGS",2,true));
}
return $status;
}
//Start the modules tag
function backup_modules_start ($bf,$preferences) {
return fwrite ($bf,start_tag("MODULES",2,true));
}
//End the modules tag
function backup_modules_end ($bf,$preferences) {
return fwrite ($bf,end_tag("MODULES",2,true));
}
//This function makes all the necesary calls to every mod
//to export itself and its files !!!
function backup_module($bf,$preferences,$module) {
global $CFG;
$status = true;
//First, re-check if necessary functions exists
$modbackup = $module."_backup_mods";
if (function_exists($modbackup)) {
//Call the function
$status = $modbackup($bf,$preferences);
} else {
//Something was wrong. Function should exist.
$status = false;
}
return $status;
}
//This function copies all the needed files under the "users" directory to the "user_files"
//directory under temp/backup
function backup_copy_user_files ($preferences) {
global $CFG;
$status = true;
//First we check to "user_files" exists and create it as necessary
//in temp/backup/$backup_code dir
$status = check_and_create_user_files_dir($preferences->backup_unique_code);
//Now iterate over directories under "users" to check if that user must be
//copied to backup
$rootdir = $CFG->dataroot."/users";
//Check if directory exists
if (is_dir($rootdir)) {
$list = list_directories ($rootdir);
if ($list) {
//Iterate
foreach ($list as $dir) {
//Look for dir like username in backup_ids
$data = get_record ("backup_ids","backup_code",$preferences->backup_unique_code,
"table_name","user",
"old_id",$dir);
//If exists, copy it
if ($data) {
$status = backup_copy_file($rootdir."/".$dir,
$CFG->dataroot."/temp/backup/".$preferences->backup_unique_code."/user_files/".$dir);
}
}
}
}
return $status;
}
//This function copies all the course files under the course directory (except the moddata
//directory to the "course_files" directory under temp/backup
function backup_copy_course_files ($preferences) {
global $CFG;
$status = true;
//First we check to "course_files" exists and create it as necessary
//in temp/backup/$backup_code dir
$status = check_and_create_course_files_dir($preferences->backup_unique_code);
//Now iterate over files and directories except $CFG->moddata and get_string("backupdir") to be
//copied to backup
$rootdir = $CFG->dataroot."/".$preferences->backup_course;
$name_moddata = $CFG->moddata;
$name_backupdata = get_string("backupdir");
//Check if directory exists
if (is_dir($rootdir)) {
$list = list_directories_and_files ($rootdir);
if ($list) {
//Iterate
foreach ($list as $dir) {
if ($dir !== $name_moddata and $dir !== $name_backupdata) {
$status = backup_copy_file($rootdir."/".$dir,
$CFG->dataroot."/temp/backup/".$preferences->backup_unique_code."/course_files/".$dir);
}
}
}
}
return $status;
}
//This function creates the zip file containing all the backup info
//moodle.xml, moddata, user_files, course_files.
//The zipped file is created in the backup directory and named with
//the "oficial" name of the backup
//It uses "pclzip" if available or system "zip" (unix only)
function backup_zip ($preferences,$moodle_home) {
global $CFG;
$status = true;
//Base dir where everything happens
$basedir = $CFG->dataroot."/temp/backup/".$preferences->backup_unique_code;
//Backup zip file name
$name = $preferences->backup_name;
//List base_dir files and directories
$filelist = list_directories_and_files ($basedir);
if (empty($CFG->zip)) { // Use built-in php-based zip function
$files = array();
foreach ($filelist as $file) {
//If directory, append "/"
if (is_dir($basedir."/".$file)) {
$file = $file."/";
}
//Include into array
$files[] = $basedir."/".$file;
}
include_once($moodle_home."/lib/pclzip/pclzip.lib.php");
$archive = new PclZip("$basedir/$name");
if (($list = $archive->create($files,PCLZIP_OPT_REMOVE_PATH,$basedir)) == 0) {
error($archive->errorInfo(true));
$status = false;
}
} else { // Use external zip program
$files = "";
foreach ($filelist as $file) {
$files .= basename($file);
$files .= " ";
}
$command = "cd $basedir ; $CFG->zip -r $name $files";
$status = Exec($command);
}
return $status;
}
//This function copies the final zip to the course dir
function copy_zip_to_course_dir ($preferences) {
global $CFG;
//Backup zip file name
$from_zip_file = $CFG->dataroot."/temp/backup/".$preferences->backup_unique_code."/".$preferences->backup_name;
$to_zip_file = $CFG->dataroot."/".$preferences->backup_course."/".get_string("backupdir")."/".$preferences->backup_name;
//Check to directory
$status = check_dir_exists(dirname($to_zip_file),true);
//Copy zip file
if ($status) {
$status = backup_copy_file ($from_zip_file,$to_zip_file);
}
return $status;
}
?>
+69
View File
@@ -0,0 +1,69 @@
<?PHP //$Id$
//
// This file keeps track of upgrades to Moodle's
// backup/restore utility.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
//
// This file is tailored to MySQL
function backup_upgrade($oldversion=0) {
global $CFG;
$result = true;
if ($oldversion < 2003050300 and $result) {
$result = execute_sql("CREATE TABLE `{$CFG->prefix}backup_ids` (
`backup_code` INT(12) UNSIGNED NOT NULL,
`table_name` VARCHAR(30) NOT NULL,
`old_id` INT(10) UNSIGNED NOT NULL,
`new_id` INT(10) UNSIGNED,
PRIMARY KEY (`backup_code`, `table_name`, `old_id`)
)
COMMENT = 'To store and convert ids in backup/restore'");
}
if ($oldversion < 2003050301 and $result) {
$result = execute_sql("ALTER TABLE `{$CFG->prefix}backup_ids`
ADD `info` VARCHAR(30)");
}
if ($oldversion < 2003050400 and $result) {
$result = execute_sql("ALTER TABLE `{$CFG->prefix}backup_ids`
MODIFY `info` VARCHAR(255)");
}
if ($oldversion < 2003050401 and $result) {
$result = execute_sql("CREATE TABLE `{$CFG->prefix}backup_files` (
`backup_code` INT( 10 ) UNSIGNED NOT NULL ,
`file_type` VARCHAR( 10 ) NOT NULL ,
`path` VARCHAR( 255 ) NOT NULL ,
`old_id` INT( 10 ) UNSIGNED,
`new_id` INT( 10 ) UNSIGNED,
PRIMARY KEY ( `backup_code` , `file_type` , `path` )
) COMMENT = 'To store and recode ids to user & course files.'");
}
if ($oldversion < 2003052000 and $result) {
$result = execute_sql("ALTER TABLE `{$CFG->prefix}backup_ids`
MODIFY `info` TEXT");
}
//Finally, return result
return $result;
}
?>
+351
View File
@@ -0,0 +1,351 @@
<?PHP //$Id$
//This file contains all the general function needed (file manipulation...)
//not directly part of the backup/restore utility
//Delete old data in backup tables (if exists)
//Two days seems to be apropiate
function backup_delete_old_data() {
global $CFG;
//Change this if you want !!
$days = 2;
//End change this
$seconds = $days * 24 * 60 * 60;
$delete_from = time()-$seconds;
//Now delete from tables
$status = execute_sql("DELETE FROM {$CFG->prefix}backup_ids
WHERE backup_code < '$delete_from'",false);
if ($status) {
$status = execute_sql("DELETE FROM {$CFG->prefix}backup_files
WHERE backup_code < '$delete_from'",false);
}
//Now, delete old directory (if exists)
if ($status) {
$status = backup_delete_old_dirs($delete_from);
}
return($status);
}
//Function to delete dirs/files into temp/backup directory
//older than $delete_from
function backup_delete_old_dirs($delete_from) {
global $CFG;
$status = true;
$list = get_directory_list($CFG->dataroot."/temp/backup", "", false);
foreach ($list as $file) {
$file_path = $CFG->dataroot."/temp/backup/".$file;
$moddate = filemtime($file_path);
if ($status and $moddate < $delete_from) {
//If directory, recurse
if (is_dir($file_path)) {
$status = delete_dir_contents($file_path);
//There is nothing, delete the directory itself
if ($status) {
$status = rmdir($file_path);
}
//If file
} else {
unlink("$file_path");
}
}
}
return $status;
}
//Function to check if a directory exists
//and, optionally, create it
function check_dir_exists($dir,$create=false) {
global $CFG;
$status = true;
if(!is_dir($dir)) {
if (!$create) {
$status = false;
} else {
umask(0000);
$status = mkdir ($dir,$CFG->directorypermissions);
}
}
return $status;
}
//Function to check and create the needed dir to
//save all the backup
function check_and_create_backup_dir($backup_unique_code) {
global $CFG;
$status = check_dir_exists($CFG->dataroot."/temp",true);
if ($status) {
$status = check_dir_exists($CFG->dataroot."/temp/backup",true);
}
if ($status) {
$status = check_dir_exists($CFG->dataroot."/temp/backup/".$backup_unique_code,true);
}
return $status;
}
//Function to delete all the directory contents recursively
//Copied from admin/delete.php
function delete_dir_contents ($rootdir) {
$dir = opendir($rootdir);
$status = true;
while ($file = readdir($dir)) {
if ($file != "." and $file != "..") {
$fullfile = "$rootdir/$file";
if (filetype($fullfile) == "dir") {
delete_dir_contents($fullfile);
if (!rmdir($fullfile)) {
$status = false;
}
} else {
if (!unlink("$fullfile")) {
$status = false;
}
}
}
}
closedir($dir);
return $status;
}
//Function to clear (empty) the contents of the backup_dir
//Copied from admin/delete.php
function clear_backup_dir($backup_unique_code) {
global $CFG;
$rootdir = $CFG->dataroot."/temp/backup/".$backup_unique_code;
//Delete recursively
$status = delete_dir_contents($rootdir);
return $status;
}
//Returns the module type of a course_module's id in a course
function get_module_type ($courseid,$moduleid) {
global $CFG;
$results = get_records_sql ("SELECT cm.id, m.name
FROM {$CFG->prefix}course_modules cm,
{$CFG->prefix}modules m
WHERE cm.course = '$courseid' AND
cm.id = '$moduleid' AND
m.id = cm.module");
if ($results) {
$name = $results[$moduleid]->name;
} else {
$name = false;
}
return $name;
}
//This function return the names of all directories under a give directory
//Not recursive
function list_directories ($rootdir) {
$dir = opendir($rootdir);
while ($file=readdir($dir)) {
if ($file=="." || $file=="..") {
continue;
}
if (is_dir($rootdir."/".$file)) {
$results[$file] = $file;
}
}
closedir($dir);
return $results;
}
//This function return the names of all directories and files under a give directory
//Not recursive
function list_directories_and_files ($rootdir) {
$dir = opendir($rootdir);
while ($file=readdir($dir)) {
if ($file=="." || $file=="..") {
continue;
}
$results[$file] = $file;
}
closedir($dir);
return $results;
}
//This function clean data from backup tables and
//delete all temp files used
function clean_temp_data ($preferences) {
global $CFG;
$status = true;
//true->do it, false->don't do it. To debug if necessary.
if (true) {
//Now delete from tables
$status = execute_sql("DELETE FROM {$CFG->prefix}backup_ids
WHERE backup_code = '$preferences->backup_unique_code'",false);
if ($status) {
$status = execute_sql("DELETE FROM {$CFG->prefix}backup_files
WHERE backup_code = '$preferences->backup_unique_code'",false);
}
//Now, delete temp directory (if exists)
$file_path = $CFG->dataroot."/temp/backup/".$preferences->backup_unique_code;
if (is_dir($file_path)) {
$status = delete_dir_contents($file_path);
//There is nothing, delete the directory itself
if ($status) {
$status = rmdir($file_path);
}
}
}
return $status;
}
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//This functions are used to copy any file or directory ($from_file)
//to a new file or directory ($to_file). It works recursively and
//mantains file perms.
//I've copied it from: http://www.php.net/manual/en/function.copy.php
//Little modifications done
function backup_copy_file ($from_file,$to_file) {
if (is_file($from_file)) {
$perms=fileperms($from_file);
return copy($from_file,$to_file) && chmod($to_file,$perms);
}
else if (is_dir($from_file)) {
return backup_copy_dir($from_file,$to_file);
}
else{
return false;
}
}
function backup_copy_dir($from_file,$to_file) {
if (!is_dir($to_file)) {
mkdir($to_file);
chmod("$to_file",0777);
}
$dir = opendir($from_file);
while ($file=readdir($dir)) {
if ($file=="." || $file=="..") {
continue;
}
$status = backup_copy_file ("$from_file/$file","$to_file/$file");
}
closedir($dir);
return $status;
}
///Ends copy file/dirs functions
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//This function upgrades, if necesary, the backup-restore tables
//It's called from backup.php and restore.php
function upgrade_backup_db($updgradeto,$backup_release,$continueto) {
global $CFG,$db;
//Check backup_version
if ($CFG->backup_version) {
if ($updgradeto > $CFG->backup_version) { // upgrade
$a->oldversion = $CFG->backup_version;
$a->newversion = $updgradeto;
$strdatabasechecking = get_string("databasechecking", "", $a);
$strdatabasesuccess = get_string("databasesuccess");
print_header($strdatabasechecking, $strdatabasechecking, $strdatabasechecking);
print_heading($strdatabasechecking);
$db->debug=true;
if (backup_upgrade($a->oldversion)) {
$db->debug=false;
if (set_config("backup_version", $a->newversion)) {
notify($strdatabasesuccess, "green");
notify("You are running Backup/Recovery version ".$backup_release,"black");
print_continue($continueto);
die;
} else {
notify("Upgrade failed! (Could not update version in config table)");
die;
}
} else {
$db->debug=false;
notify("Upgrade failed! See backup_version.php");
die;
}
} else if ($updgradeto < $CFG->backup_version) {
notify("WARNING!!! The code you are using is OLDER than the version that made these databases!");
}
//Not exists. Starting installation
} else {
$strdatabaseupgrades = get_string("databaseupgrades");
print_header($strdatabaseupgrades, $strdatabaseupgrades, $strdatabaseupgrades);
if (set_config("backup_version", "2003010100")) {
print_heading("You are currently going to install the needed structures to Backup/Recover");
print_continue($continue_to);
die;
}
}
}
//This function is used to insert records in the backup_ids table
function backup_putid ($backup_unique_code, $table, $old_id, $new_id, $info="") {
global $CFG;
$status = true;
//First delete to avoid PK duplicates
$status = backup_delid($backup_unique_code, $table, $old_id);
$status = execute_sql("INSERT INTO {$CFG->prefix}backup_ids
(backup_code, table_name, old_id, new_id, info)
VALUES
($backup_unique_code, '$table', '$old_id', '$new_id', '$info')",false);
return $status;
}
//This function is used to delete recods from the backup_ids table
function backup_delid ($backup_unique_code, $table, $old_id) {
global $CFG;
$status = true;
$status = execute_sql("DELETE FROM {$CFG->prefix}backup_ids
WHERE backup_code = $backup_unique_code AND
table_name = '$table' AND
old_id = '$old_id'",false);
return $status;
}
//This function is used to get a record from the backup_ids table
function backup_getid ($backup_unique_code, $table, $old_id) {
global $CFG;
$status = true;
$status = get_record ("backup_ids","backup_code",$backup_unique_code,
"table_name",$table,
"old_id", $old_id);
return $status;
}
?>
+171
View File
@@ -0,0 +1,171 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//assignment mods
//This is the "graphical" structure of the assignment mod:
//
// assignment
// (CL,pk->id)
// |
// |
// |
// assignment_submisions
// (UL,pk->id, fk->assignment,files)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files)
//
//-----------------------------------------------------------
//This function executes all the backup procedure about this mod
function assignment_backup_mods($bf,$preferences) {
global $CFG;
$status = true;
//Iterate over assignment table
$assignments = get_records ("assignment","course",$preferences->backup_course,"id");
if ($assignments) {
foreach ($assignments as $assignment) {
//Start mod
fwrite ($bf,start_tag("MOD",3,true));
//Print assignment data
fwrite ($bf,full_tag("ID",4,false,$assignment->id));
fwrite ($bf,full_tag("MODTYPE",4,false,"assignment"));
fwrite ($bf,full_tag("NAME",4,false,$assignment->name));
fwrite ($bf,full_tag("DESCRIPTION",4,false,$assignment->description));
fwrite ($bf,full_tag("FORMAT",4,false,$assignment->format));
fwrite ($bf,full_tag("RESUBMIT",4,false,$assignment->resubmit));
fwrite ($bf,full_tag("TYPE",4,false,$assignment->type));
fwrite ($bf,full_tag("MAXBYTES",4,false,$assignment->maxbytes));
fwrite ($bf,full_tag("TIMEDUE",4,false,$assignment->timedue));
fwrite ($bf,full_tag("GRADE",4,false,$assignment->grade));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$assignment->timemodified));
//if we've selected to backup users info, then execute backup_assignment_submisions
if ($preferences->mods["assignment"]->userinfo) {
$status = backup_assignment_submissions($bf,$preferences,$assignment->id);
}
//End mod
$status =fwrite ($bf,end_tag("MOD",3,true));
}
}
//if we've selected to backup users info, then backup files too
if ($preferences->mods["assignment"]->userinfo) {
$status = backup_assignment_files($bf,$preferences);
}
return $status;
}
//Backup assignment_submissions contents (executed from assignment_backup_mods)
function backup_assignment_submissions ($bf,$preferences,$assignment) {
global $CFG;
$status = true;
$assignment_submissions = get_records("assignment_submissions","assignment",$assignment,"id");
//If there is submissions
if ($assignment_submissions) {
//Write start tag
$status =fwrite ($bf,start_tag("SUBMISSIONS",4,true));
//Iterate over each submission
foreach ($assignment_submissions as $ass_sub) {
//Start submission
$status =fwrite ($bf,start_tag("SUBMISSION",5,true));
//Print submission contents
fwrite ($bf,full_tag("ID",6,false,$ass_sub->id));
fwrite ($bf,full_tag("USERID",6,false,$ass_sub->userid));
fwrite ($bf,full_tag("TIMECREATED",6,false,$ass_sub->timecreated));
fwrite ($bf,full_tag("TIMEMODIFIED",6,false,$ass_sub->timemodified));
fwrite ($bf,full_tag("NUMFILES",6,false,$ass_sub->numfiles));
fwrite ($bf,full_tag("GRADE",6,false,$ass_sub->grade));
fwrite ($bf,full_tag("COMMENT",6,false,$ass_sub->comment));
fwrite ($bf,full_tag("TEACHER",6,false,$ass_sub->teacher));
fwrite ($bf,full_tag("TIMEMARKED",6,false,$ass_sub->timemarked));
fwrite ($bf,full_tag("MAILED",6,false,$ass_sub->mailed));
//End submission
$status =fwrite ($bf,end_tag("SUBMISSION",5,true));
}
//Write end tag
$status =fwrite ($bf,end_tag("SUBMISSIONS",4,true));
}
return $status;
}
//Backup assignment files because we've selected to backup user info
//and files are user info's level
function backup_assignment_files($bf,$preferences) {
global $CFG;
$status = true;
//First we check to moddata exists and create it as necessary
//in temp/backup/$backup_code dir
$status = check_and_create_moddata_dir($preferences->backup_unique_code);
//Now copy the assignment dir
if ($status) {
$status = backup_copy_file($CFG->dataroot."/".$preferences->backup_course."/".$CFG->moddata."/assignment",
$CFG->dataroot."/temp/backup/".$preferences->backup_unique_code."/moddata/assignment");
}
return $status;
}
//Return an array of info (name,value)
function assignment_check_backup_mods($course,$user_data=false,$backup_unique_code) {
//First the course data
$info[0][0] = get_string("modulenameplural","assignment");
if ($ids = assignment_ids ($course)) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
//Now, if requested, the user_data
if ($user_data) {
$info[1][0] = get_string("submissions","assignment");
if ($ids = assignment_submission_ids_by_course ($course)) {
$info[1][1] = count($ids);
} else {
$info[1][1] = 0;
}
}
return $info;
}
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
//Returns an array of assignments id
function assignment_ids ($course) {
global $CFG;
return get_records_sql ("SELECT a.id, a.course
FROM {$CFG->prefix}assignment a
WHERE a.course = '$course'");
}
//Returns an array of assignment_submissions id
function assignment_submission_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT s.id , s.assignment
FROM {$CFG->prefix}assignment_submissions s,
{$CFG->prefix}assignment a
WHERE a.course = '$course' AND
s.assignment = a.id");
}
?>
+64
View File
@@ -0,0 +1,64 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//assignment mods
//This is the "graphical" structure of the assignment mod:
//
// assignment
// (CL,pk->id)
// |
// |
// |
// assignment_submisions
// (UL,pk->id, fk->assignment,files)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files)
//
//-----------------------------------------------------------
//This function executes all the backup procedure about this mod
function assignment_restore_mods($bf,$preferences) {
global $CFG;
$status = true;
//Iterate over assignment table
$assignments = get_records ("assignment","course",$preferences->backup_course,"id");
if ($assignments) {
foreach ($assignments as $assignment) {
//Start mod
fwrite ($bf,start_tag("MOD",3,true));
//Print assignment data
fwrite ($bf,full_tag("ID",4,false,$assignment->id));
fwrite ($bf,full_tag("MODTYPE",4,false,"assignment"));
fwrite ($bf,full_tag("NAME",4,false,$assignment->name));
fwrite ($bf,full_tag("DESCRIPTION",4,false,$assignment->description));
fwrite ($bf,full_tag("FORMAT",4,false,$assignment->format));
fwrite ($bf,full_tag("RESUBMIT",4,false,$assignment->resubmit));
fwrite ($bf,full_tag("TYPE",4,false,$assignment->type));
fwrite ($bf,full_tag("MAXBYTES",4,false,$assignment->maxbytes));
fwrite ($bf,full_tag("TIMEDUE",4,false,$assignment->timedue));
fwrite ($bf,full_tag("GRADE",4,false,$assignment->grade));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$assignment->timemodified));
//if we've selected to backup users info, then execute backup_assignment_submisions
if ($preferences->mods["assignment"]->userinfo) {
$status = backup_assignment_submissions($bf,$preferences,$assignment->id);
}
//End mod
$status =fwrite ($bf,end_tag("MOD",3,true));
}
}
//if we've selected to backup users info, then backup files too
if ($preferences->mods["assignment"]->userinfo) {
$status = backup_assignment_files($bf,$preferences);
}
return $status;
}
?>
+141
View File
@@ -0,0 +1,141 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//choice mods
//This is the "graphical" structure of the choice mod:
//
// choice
// (CL,pk->id)
// |
// |
// |
// choice_answers
// (UL,pk->id, fk->choice)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files)
//
//-----------------------------------------------------------
function choice_backup_mods($bf,$preferences) {
global $CFG;
$status = true;
//Iterate over choice table
$choices = get_records ("choice","course",$preferences->backup_course,"id");
if ($choices) {
foreach ($choices as $choice) {
//Start mod
fwrite ($bf,start_tag("MOD",3,true));
//Print choice data
fwrite ($bf,full_tag("ID",4,false,$choice->id));
fwrite ($bf,full_tag("MODTYPE",4,false,"choice"));
fwrite ($bf,full_tag("NAME",4,false,$choice->name));
fwrite ($bf,full_tag("TEXT",4,false,$choice->text));
fwrite ($bf,full_tag("FORMAT",4,false,$choice->format));
fwrite ($bf,full_tag("ANSWER1",4,false,$choice->answer1));
fwrite ($bf,full_tag("ANSWER2",4,false,$choice->answer2));
fwrite ($bf,full_tag("ANSWER3",4,false,$choice->answer3));
fwrite ($bf,full_tag("ANSWER4",4,false,$choice->answer4));
fwrite ($bf,full_tag("ANSWER5",4,false,$choice->answer5));
fwrite ($bf,full_tag("ANSWER6",4,false,$choice->answer6));
fwrite ($bf,full_tag("PUBLISH",4,false,$choice->publish));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$choice->timemodified));
//if we've selected to backup users info, then execute backup_choice_answers
if ($preferences->mods["choice"]->userinfo) {
$status = backup_choice_answers($bf,$preferences,$choice->id);
}
//End mod
$status =fwrite ($bf,end_tag("MOD",3,true));
}
}
return $status;
}
//Backup choice_answers contents (executed from choice_backup_mods)
function backup_choice_answers ($bf,$preferences,$choice) {
global $CFG;
$status = true;
$choice_answers = get_records("choice_answers","choice",$choice,"id");
//If there is submissions
if ($choice_answers) {
//Write start tag
$status =fwrite ($bf,start_tag("ANSWERS",4,true));
//Iterate over each answer
foreach ($choice_answers as $cho_ans) {
//Start answer
$status =fwrite ($bf,start_tag("ANSWER",5,true));
//Print submission contents
fwrite ($bf,full_tag("ID",6,false,$cho_ans->id));
fwrite ($bf,full_tag("USERID",6,false,$cho_ans->userid));
fwrite ($bf,full_tag("CHOICE_ANSWER",6,false,$cho_ans->answer));
fwrite ($bf,full_tag("TIMEMODIFIED",6,false,$cho_ans->timemodified));
//End answer
$status =fwrite ($bf,end_tag("ANSWER",5,true));
}
//Write end tag
$status =fwrite ($bf,end_tag("ANSWERS",4,true));
}
return $status;
}
////Return an array of info (name,value)
function choice_check_backup_mods($course,$user_data=false,$backup_unique_code) {
//First the course data
$info[0][0] = get_string("modulenameplural","choice");
if ($ids = choice_ids ($course)) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
//Now, if requested, the user_data
if ($user_data) {
$info[1][0] = get_string("responses","choice");
if ($ids = choice_answer_ids_by_course ($course)) {
$info[1][1] = count($ids);
} else {
$info[1][1] = 0;
}
}
return $info;
}
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
//Returns an array of choices id
function choice_ids ($course) {
global $CFG;
return get_records_sql ("SELECT a.id, a.course
FROM {$CFG->prefix}choice a
WHERE a.course = '$course'");
}
//Returns an array of choice_answers id
function choice_answer_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT s.id , s.choice
FROM {$CFG->prefix}choice_answers s,
{$CFG->prefix}choice a
WHERE a.course = '$course' AND
s.choice = a.id");
}
?>
+61
View File
@@ -0,0 +1,61 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//choice mods
//This is the "graphical" structure of the choice mod:
//
// choice
// (CL,pk->id)
// |
// |
// |
// choice_answers
// (UL,pk->id, fk->choice)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files)
//
//-----------------------------------------------------------
function choice_restore_mods($bf,$preferences) {
global $CFG;
$status = true;
//Iterate over choice table
$choices = get_records ("choice","course",$preferences->backup_course,"id");
if ($choices) {
foreach ($choices as $choice) {
//Start mod
fwrite ($bf,start_tag("MOD",3,true));
//Print choice data
fwrite ($bf,full_tag("ID",4,false,$choice->id));
fwrite ($bf,full_tag("MODTYPE",4,false,"choice"));
fwrite ($bf,full_tag("NAME",4,false,$choice->name));
fwrite ($bf,full_tag("TEXT",4,false,$choice->text));
fwrite ($bf,full_tag("FORMAT",4,false,$choice->format));
fwrite ($bf,full_tag("ANSWER1",4,false,$choice->answer1));
fwrite ($bf,full_tag("ANSWER2",4,false,$choice->answer2));
fwrite ($bf,full_tag("ANSWER3",4,false,$choice->answer3));
fwrite ($bf,full_tag("ANSWER4",4,false,$choice->answer4));
fwrite ($bf,full_tag("ANSWER5",4,false,$choice->answer5));
fwrite ($bf,full_tag("ANSWER6",4,false,$choice->answer6));
fwrite ($bf,full_tag("PUBLISH",4,false,$choice->publish));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$choice->timemodified));
//if we've selected to backup users info, then execute backup_choice_answers
if ($preferences->mods["choice"]->userinfo) {
$status = backup_choice_answers($bf,$preferences,$choice->id);
}
//End mod
$status =fwrite ($bf,end_tag("MOD",3,true));
}
}
return $status;
}
?>
+152
View File
@@ -0,0 +1,152 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//forum mods
//This is the "graphical" structure of the forum mod:
//
// forum
// (CL,pk->id)
// |
// -----------------------------------
// | |
// subscriptions forum_discussions
// (UL,pk->id, fk->forum) (UL,pk->id, fk->forum)
// |
// |
// |
// forum_posts
// (UL,pk->id,fk->discussion,nt->parent,files)
// |
// |
// |
// forum_ratings
// (UL,pk->id,fk->post)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files)
//
//-----------------------------------------------------------
function forum_backup_mods() {
print "hola";
}
////Return an array of info (name,value)
function NO_forum_check_backup_mods($course,$user_data=false,$backup_unique_code) {
//First the course data
$info[0][0] = get_string("modulenameplural","forum");
if ($ids = forum_ids ($course)) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
//Now, if requested, the user_data
if ($user_data) {
//Subscriptions
$info[1][0] = get_string("subscriptions","forum");
if ($ids = forum_subscription_ids_by_course ($course)) {
$info[1][1] = count($ids);
} else {
$info[1][1] = 0;
}
//Discussions
$info[2][0] = get_string("discussions","forum");
if ($ids = forum_discussion_ids_by_course ($course)) {
$info[2][1] = count($ids);
} else {
$info[2][1] = 0;
}
//Posts
$info[3][0] = get_string("posts","forum");
if ($ids = forum_post_ids_by_course ($course)) {
$info[3][1] = count($ids);
} else {
$info[3][1] = 0;
}
//Ratings
$info[4][0] = get_string("ratings","forum");
if ($ids = forum_rating_ids_by_course ($course)) {
$info[4][1] = count($ids);
} else {
$info[4][1] = 0;
}
}
return $info;
}
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
//Returns an array of forums id
function forum_ids ($course) {
global $CFG;
return get_records_sql ("SELECT a.id, a.course
FROM {$CFG->prefix}forum a
WHERE a.course = '$course'");
}
//Returns an array of forum subscriptions id
function forum_subscription_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT s.id , s.forum
FROM {$CFG->prefix}forum_subscriptions s,
{$CFG->prefix}forum a
WHERE a.course = '$course' AND
s.forum = a.id");
}
//Returns an array of forum discussions id
function forum_discussion_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT s.id , s.forum
FROM {$CFG->prefix}forum_discussions s,
{$CFG->prefix}forum a
WHERE a.course = '$course' AND
s.forum = a.id");
}
//Returns an array of forum posts id
function forum_post_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT p.id , p.discussion, s.forum
FROM {$CFG->prefix}forum_posts p,
{$CFG->prefix}forum_discussions s,
{$CFG->prefix}forum a
WHERE a.course = '$course' AND
s.forum = a.id AND
p.discussion = s.id");
}
//Returns an array of ratings posts id
function forum_rating_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT r.id, r.post, p.discussion, s.forum
FROM {$CFG->prefix}forum_ratings r,
{$CFG->prefix}forum_posts p,
{$CFG->prefix}forum_discussions s,
{$CFG->prefix}forum a
WHERE a.course = '$course' AND
s.forum = a.id AND
p.discussion = s.id AND
r.post = p.id");
}
?>
+78
View File
@@ -0,0 +1,78 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//journal mods
//This is the "graphical" structure of the journal mod:
//
// journal
// (CL,pk->id)
// |
// |
// |
// journal_entries
// (UL,pk->id, fk->journal)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files)
//
//-----------------------------------------------------------
function journal_backup_mods($course,$user_data=false,$backup_unique_code) {
print "hola";
}
////Return an array of info (name,value)
function NO_journal_check_backup_mods($course,$user_data=false,$backup_unique_code) {
//First the course data
$info[0][0] = get_string("modulenameplural","journal");
if ($ids = journal_ids ($course)) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
//Now, if requested, the user_data
if ($user_data) {
$info[1][0] = get_string("entries","journal");
if ($ids = journal_entry_ids_by_course ($course)) {
$info[1][1] = count($ids);
} else {
$info[1][1] = 0;
}
}
return $info;
}
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
//Returns an array of journals id
function journal_ids ($course) {
global $CFG;
return get_records_sql ("SELECT a.id, a.course
FROM {$CFG->prefix}journal a
WHERE a.course = '$course'");
}
//Returns an array of journal entries id
function journal_entry_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT s.id , s.journal
FROM {$CFG->prefix}journal_entries s,
{$CFG->prefix}journal a
WHERE a.course = '$course' AND
s.journal = a.id");
}
?>
+125
View File
@@ -0,0 +1,125 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//pgassignment mods
//This is the "graphical" structure of the pgassignment mod:
//
// pgassignment
// (CL,pk->id)
// |
// -----------------------------------
// | |
// pgassignment_elements pgassignment_submissions
// (CL,pk->id, fk->pgassignment) (UL,pk->id, fk->pgassignment,files)
// |
// |
// |
// pgasignments_grades
// (UL,pk->id,fk->submission)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files)
//
//-----------------------------------------------------------
function NO_pgassignment_backup_mods($course,$user_data=false,$backup_unique_code) {
print "hola";
}
////Return an array of info (name,value)
function pgassignment_check_backup_mods($course,$user_data=false,$backup_unique_code) {
//First the course data
$info[0][0] = get_string("modulenameplural","pgassignment");
if ($ids = pgassignment_ids ($course)) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
//Elements
$info[1][0] = get_string("elements","pgassignment");
if ($ids = pgassignment_element_ids_by_course ($course)) {
$info[1][1] = count($ids);
} else {
$info[1][1] = 0;
}
//Now, if requested, the user_data
if ($user_data) {
//Submissions
$info[2][0] = get_string("submissions","pgassignment");
if ($ids = pgassignment_submission_ids_by_course ($course)) {
$info[2][1] = count($ids);
} else {
$info[2][1] = 0;
}
//Grades
$info[3][0] = get_string("grades","pgassignment");
if ($ids = pgassignment_grade_ids_by_course ($course)) {
$info[3][1] = count($ids);
} else {
$info[3][1] = 0;
}
}
return $info;
}
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
//Returns an array of pgassignments id
function pgassignment_ids ($course) {
global $CFG;
return get_records_sql ("SELECT a.id, a.course
FROM {$CFG->prefix}pgassignment a
WHERE a.course = '$course'");
}
//Returns an array of pgassignment elements id
function pgassignment_element_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT s.id , s.pgassignment
FROM {$CFG->prefix}pgassignment_elements s,
{$CFG->prefix}pgassignment a
WHERE a.course = '$course' AND
s.pgassignment = a.id");
}
//Returns an array of pgassignment submissions id
function pgassignment_submission_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT s.id , s.pgassignment
FROM {$CFG->prefix}pgassignment_submissions s,
{$CFG->prefix}pgassignment a
WHERE a.course = '$course' AND
s.pgassignment = a.id");
}
//Returns an array of pgassignment grades id
function pgassignment_grade_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT g.id , g.submission, s.pgassignment
FROM {$CFG->prefix}pgassignment_grades g,
{$CFG->prefix}pgassignment_submissions s,
{$CFG->prefix}pgassignment a
WHERE a.course = '$course' AND
s.pgassignment = a.id AND
g.submission = s.id");
}
?>
+148
View File
@@ -0,0 +1,148 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//quiz mods
//To see, put your terminal to 132cc
//This is the "graphical" structure of the quiz mod:
//
// quiz quiz_categories
// (CL,pk->id) (CL,pk->id)
// | |
// ----------------------------------------------- |
// | | | |
// | | | |
// | | | |
// quiz_attemps quiz_grades quiz_question_grades |
// (UL,pk->id, fk->quiz) (UL,pk->id,fk->quiz) (UL,pk->id,fk->quiz) |
// | | |
// | | |
// | | |
// quiz_responses | quiz_questions
// (UL,pk->id, fk->attempt)----------------------------------------------------(CL,pk->id,fk->category,files)
// |
// |
// |
// ------------------------------------------------------------------------------------------------------
// | | | |
// | | | |
// | | | | quiz_randomsamatch
// quiz_truefalse quiz_shortanswer quiz_multichoice |---------(CL,pl->id,fk->question)
// (CL,pl->id,fk->question) (CL,pl->id,fk->question) (CL,pl->id,fk->question) |
// . . . |
// . . . |
// . . . | quiz_match
// .................................................... |---------(CL,pl->id,fk->question)
// . | .
// . | .
// . | .
// quiz_answers | quiz_match_sub
// (CL,pk->id,fk->question)----------------------------|---------(CL,pl->id,fk->question)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files
//
//-----------------------------------------------------------
//THIS MOD BACKUP NEEDS TO USE THE mdl_backup_ids TABLE
function quiz_backup_mods($course,$user_data=false,$backup_unique_code) {
print "hola";
}
////Return an array of info (name,value)
function NO_quiz_check_backup_mods($course,$user_data=false,$backup_unique_code) {
//Deletes data from mdl_backup_ids (categories section)
delete_category_ids ($backup_unique_code);
//Create date into mdl_backup_ids (categories section)
insert_category_ids ($course,$backup_unique_code);
//First the course data
$info[0][0] = get_string("modulenameplural","quiz");
if ($ids = quiz_ids ($course)) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
//Categories
$info[1][0] = get_string("categories","quiz");
if ($ids = quiz_category_ids_by_backup ($backup_unique_code)) {
$info[1][1] = count($ids);
} else {
$info[1][1] = 0;
}
//Questions
$info[2][0] = get_string("questions","quiz");
if ($ids = quiz_question_ids_by_backup ($backup_unique_code)) {
$info[2][1] = count($ids);
} else {
$info[2][1] = 0;
}
//Now, if requested, the user_data
if ($user_data) {
//Grades
$info[3][0] = get_string("grades","quiz");
if ($ids = quiz_grade_ids_by_course ($course)) {
$info[3][1] = count($ids);
} else {
$info[3][1] = 0;
}
}
return $info;
}
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
//Returns an array of quiz id
function quiz_ids ($course) {
global $CFG;
return get_records_sql ("SELECT a.id, a.course
FROM {$CFG->prefix}quiz a
WHERE a.course = '$course'");
}
//Returns an array of categories id
function quiz_category_ids_by_backup ($backup_unique_code) {
global $CFG;
return get_records_sql ("SELECT a.old_id, a.backup_code
FROM {$CFG->prefix}backup_ids a
WHERE a.backup_code = '$backup_unique_code'");
}
function quiz_question_ids_by_backup ($backup_unique_code) {
global $CFG;
return get_records_sql ("SELECT q.id, q.category
FROM {$CFG->prefix}backup_ids a,
{$CFG->prefix}quiz_questions q
WHERE a.backup_code = '$backup_unique_code' and
q.category = a.old_id");
}
function quiz_grade_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT g.id, g.quiz
FROM {$CFG->prefix}quiz a,
{$CFG->prefix}quiz_grades g
WHERE a.course = '$course' and
g.quiz = a.id");
}
?>
+77
View File
@@ -0,0 +1,77 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//resource mods
//This is the "graphical" structure of the resource mod:
//
// resource
// (CL,pk->id,files)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files)
//
//-----------------------------------------------------------
//This function executes all the backup procedure about this mod
function resource_backup_mods($bf,$preferences) {
global $CFG;
$status = true;
////Iterate over resource table
$resources = get_records ("resource","course",$preferences->backup_course,"id");
if ($resources) {
foreach ($resources as $resource) {
//Start mod
fwrite ($bf,start_tag("MOD",3,true));
//Print assignment data
fwrite ($bf,full_tag("ID",4,false,$resource->id));
fwrite ($bf,full_tag("MODTYPE",4,false,"resource"));
fwrite ($bf,full_tag("NAME",4,false,$resource->name));
fwrite ($bf,full_tag("TYPE",4,false,$resource->type));
fwrite ($bf,full_tag("REFERENCE",4,false,$resource->reference));
fwrite ($bf,full_tag("SUMMARY",4,false,$resource->summary));
fwrite ($bf,full_tag("ALLTEXT",4,false,$resource->alltext));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$resource->timemodified));
//End mod
$status = fwrite ($bf,end_tag("MOD",3,true));
}
}
return $status;
}
////Return an array of info (name,value)
function resource_check_backup_mods($course,$user_data=false,$backup_unique_code) {
//First the course data
$info[0][0] = get_string("modulenameplural","resource");
if ($ids = resource_ids ($course)) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
return $info;
}
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
//Returns an array of resources id
function resource_ids ($course) {
global $CFG;
return get_records_sql ("SELECT a.id, a.course
FROM {$CFG->prefix}resource a
WHERE a.course = '$course'");
}
?>
+47
View File
@@ -0,0 +1,47 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//resource mods
//This is the "graphical" structure of the resource mod:
//
// resource
// (CL,pk->id,files)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files)
//
//-----------------------------------------------------------
//This function executes all the restore procedure about this mod
function resource_restore_mods($bf,$preferences) {
global $CFG;
$status = true;
////Iterate over resource table
$resources = get_records ("resource","course",$preferences->backup_course,"id");
if ($resources) {
foreach ($resources as $resource) {
//Start mod
fwrite ($bf,start_tag("MOD",3,true));
//Print assignment data
fwrite ($bf,full_tag("ID",4,false,$resource->id));
fwrite ($bf,full_tag("MODTYPE",4,false,"resource"));
fwrite ($bf,full_tag("NAME",4,false,$resource->name));
fwrite ($bf,full_tag("TYPE",4,false,$resource->type));
fwrite ($bf,full_tag("REFERENCE",4,false,$resource->reference));
fwrite ($bf,full_tag("SUMMARY",4,false,$resource->summary));
fwrite ($bf,full_tag("ALLTEXT",4,false,$resource->alltext));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$resource->timemodified));
//End mod
$status = fwrite ($bf,end_tag("MOD",3,true));
}
}
return $status;
}
?>
+174
View File
@@ -0,0 +1,174 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//survey mods
//This is the "graphical" structure of the survey mod:
// --------------------
// survey | survey_questions |
// (CL,pk->id) |(CL,pk->id,?????) |
// | --------------------
// |
// -----------------------------------
// | |
// survey_analysis survey_answers
// (UL,pk->id, fk->survey) (UL,pk->id, fk->survey)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files)
//
//-----------------------------------------------------------
function survey_backup_mods($bf,$preferences) {
global $CFG;
$status = true;
//Iterate over survey table
$surveys = get_records ("survey","course",$preferences->backup_course,"id");
if ($surveys) {
foreach ($surveys as $survey) {
//Start mod
fwrite ($bf,start_tag("MOD",3,true));
//Print choice data
fwrite ($bf,full_tag("ID",4,false,$survey->id));
fwrite ($bf,full_tag("MODTYPE",4,false,"survey"));
fwrite ($bf,full_tag("TEMPLATE",4,false,$survey->template));
fwrite ($bf,full_tag("DAYS",4,false,$survey->days));
fwrite ($bf,full_tag("TIMECREATED",4,false,$survey->timecreated));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$survey->timemodified));
fwrite ($bf,full_tag("NAME",4,false,$survey->name));
fwrite ($bf,full_tag("INTRO",4,false,$survey->intro));
fwrite ($bf,full_tag("QUESTIONS",4,false,$survey->questions));
//if we've selected to backup users info, then execute backup_survey_answers and
//backup_survey_analysis
if ($preferences->mods["survey"]->userinfo) {
$status = backup_survey_answers($bf,$preferences,$survey->id);
$status = backup_survey_analysis($bf,$preferences,$survey->id);
}
//End mod
$status =fwrite ($bf,end_tag("MOD",3,true));
}
}
return $status;
}
//Backup survey_answers contents (executed from survey_backup_mods)
function backup_survey_answers ($bf,$preferences,$survey) {
global $CFG;
$status = true;
$survey_answers = get_records("survey_answers","survey",$survey,"id");
//If there is answers
if ($survey_answers) {
//Write start tag
$status =fwrite ($bf,start_tag("ANSWERS",4,true));
//Iterate over each answer
foreach ($survey_answers as $sur_ans) {
//Start answer
$status =fwrite ($bf,start_tag("ANSWER",5,true));
//Print survey_answers contents
fwrite ($bf,full_tag("ID",6,false,$sur_ans->id));
fwrite ($bf,full_tag("USERID",6,false,$sur_ans->userid));
fwrite ($bf,full_tag("QUESTION",6,false,$sur_ans->question));
fwrite ($bf,full_tag("TIME",6,false,$sur_ans->time));
fwrite ($bf,full_tag("ANSWER1",6,false,$sur_ans->answer1));
fwrite ($bf,full_tag("ANSWER2",6,false,$sur_ans->answer2));
//End answer
$status =fwrite ($bf,end_tag("ANSWER",5,true));
}
//Write end tag
$status =fwrite ($bf,end_tag("ANSWERS",4,true));
}
return $status;
}
//Backup survey_analysis contents (executed from survey_backup_mods)
function backup_survey_analysis ($bf,$preferences,$survey) {
global $CFG;
$status = true;
$survey_analysis = get_records("survey_analysis","survey",$survey,"id");
//If there is analysis
if ($survey_analysis) {
//Write start tag
$status =fwrite ($bf,start_tag("ANALYSIS",4,true));
//Iterate over each analysis
foreach ($survey_analysis as $sur_ana) {
//Start answer
$status =fwrite ($bf,start_tag("ANALYS",5,true));
//Print survey_analysis contents
fwrite ($bf,full_tag("ID",6,false,$sur_ana->id));
fwrite ($bf,full_tag("USERID",6,false,$sur_ana->userid));
fwrite ($bf,full_tag("NOTES",6,false,$sur_ana->notes));
//End answer
$status =fwrite ($bf,end_tag("ANALYS",5,true));
}
//Write end tag
$status =fwrite ($bf,end_tag("ANALYSIS",4,true));
}
return $status;
}
////Return an array of info (name,value)
function survey_check_backup_mods($course,$user_data=false,$backup_unique_code) {
//First the course data
$info[0][0] = get_string("modulenameplural","survey");
if ($ids = survey_ids ($course)) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
//Now, if requested, the user_data
if ($user_data) {
//Subscriptions
$info[1][0] = get_string("answers","survey");
if ($ids = survey_answer_ids_by_course ($course)) {
$info[1][1] = count($ids);
} else {
$info[1][1] = 0;
}
}
return $info;
}
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
//Returns an array of surveys id
function survey_ids ($course) {
global $CFG;
return get_records_sql ("SELECT a.id, a.course
FROM {$CFG->prefix}survey a
WHERE a.course = '$course'");
}
//Returns an array of survey answer id
function survey_answer_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT s.id , s.survey
FROM {$CFG->prefix}survey_answers s,
{$CFG->prefix}forum a
WHERE a.course = '$course' AND
s.survey = a.id");
}
?>
+90
View File
@@ -0,0 +1,90 @@
<?PHP //$Id$
//This script is used to configure and execute the restore proccess.
//Define some globals for all the script
//MUST CHANGE WITH FINAL BACKUP LOCATION !! WITHOUT TRAILING SLASH !!
//ALL RELATIVE FROM THE LOCATION OF THE restore.php SCRIPT !!!
$moodle_home = "../../..";
$mods_home = "mod";
//END MUST CHANGE
//Units used
require_once ("$moodle_home/config.php");
require_once ("$moodle_home/version.php");
require_once ("backup_version.php");
require_once ("db/backup_$CFG->dbtype.php");
require_once ("lib.php");
require_once ("restorelib.php");
//Optional
optional_variable($file);
//Check login
require_login();
//Check admin
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
//Check site
if (!$site = get_site()) {
error("Site not found!");
}
//Check backup_version
upgrade_backup_db($backup_version,$backup_release,"restore.php");
//Get strings
$strcourserestore = get_string("courserestore");
$stradministration = get_string("administration");
//If no file has been selected from the FileManager, inform and end
if (!$file) {
print_header("$site->shortname: $strcourserestore", $site->fullname,
"<A HREF=\"$moodle_home/$CFG->admin/index.php\">$stradministration</A> -> $strcourserestore");
print_heading(get_string("nofilesselected"));
print_continue("$moodle_home/$CFG->admin/index.php");
print_footer();
exit;
}
//If cancel has been selected, inform and end
if ($cancel) {
print_header("$site->shortname: $strcourserestore", $site->fullname,
"<A HREF=\"$moodle_home/$CFG->admin/index.php\">$stradministration</A> -> $strcourserestore");
print_heading(get_string("restorecancelled"));
print_continue("$moodle_home/$CFG->admin/index.php");
print_footer();
exit;
}
//We are here, so me have a file.
//Print header
print_header("$site->shortname: $strcourserestore", $site->fullname,
"<A HREF=\"$moodle_home/$CFG->admin/index.php\">$stradministration</A> ->
$strcourserestore -> ".basename($file));
//Print form
print_heading("$strcourserestore: ".basename($file));
print_simple_box_start("center", "", "$THEME->cellheading");
//Call the form, depending the step we are
if (!$launch) {
include_once("restore_precheck.html");
} else if ($launch == "form") {
include_once("restore_form.html");
} else if ($launch == "check") {
include_once("restore_check.html");
} else if ($launch == "execute") {
include_once("restore_execute.html");
}
print_simple_box_end();
//Print footer
print_footer();
?>
+171
View File
@@ -0,0 +1,171 @@
<?PHP //$Id$
//This page receive all the restore_form data. Then, if existing course
//has been selected, shows a list of courses to select one.
//It cheks that the parammeter from restore_form are coherent.
//It puts all the restore info in the session.
//Finally, it calls restore_execute to do the hard work
//Get objects from session
if ($SESSION) {
$info = $SESSION->info;
$course_header = $SESSION->course_header;
$restore = $SESSION->restore;
}
//If restore session info exists, but we are posting parameters
//manually, this has prioriry
if ($restore and isset($restore_restoreto)) {
unset($restore);
}
//Check required objects from session
//info
require_variable($info);
//course_header
require_variable($course_header);
//If the restore object doesn't exist, we are going
//to check every variable individually and create it
if (!$restore) {
//Check that we have all we need
//backup_unique_code
require_variable($backup_unique_code);
//file
require_variable($file);
//Checks for the required restoremod parameters
if ($allmods = get_records("modules")) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$var = "restore_".$modname;
require_variable($$var);
$var = "restore_user_info_".$modname;
require_variable($$var);
}
}
//restoreto
require_variable($restore_restoreto);
//restore_users
require_variable($restore_users);
//restore_logs
require_variable($restore_logs);
//restore_user_files
require_variable($restore_user_files);
//restore_course_files
require_variable($restore_course_files);
//restore_course_files
require_variable($restore_course_files);
//Check we've selected a course
if (!isset($course_id)) {
$course_id = 0;
}
//We are here, having all we need !!
//Create the restore object and put it in the session
$restore->backup_unique_code = $backup_unique_code;
$restore->file = $file;
if ($allmods = get_records("modules")) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$var = "restore_".$modname;
$restore->mods[$modname]->restore=$$var;
$var = "restore_user_info_".$modname;
$restore->mods[$modname]->userinfo=$$var;
}
}
$restore->restoreto=$restore_restoreto;
$restore->users=$restore_users;
$restore->logs=$restore_logs;
$restore->user_files=$restore_user_files;
$restore->course_files=$restore_course_files;
$restore->course_id=$course_id;
} else {
//We have the object, so check if we have a new course_id
//passed as parammeter
if ($course_id) {
$restore->course_id=$course_id;
}
}
//We have the object with data, put it in the session
$SESSION->restore = $restore;
//From here to the wnd of the script, only use the $restore object
//Check login
require_login();
//Check admin
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
//Check site
if (!$site = get_site()) {
error("Site not found!");
}
//Depending the selected restoreto:
// 0-Existing course: Select the destination course and launch the check again.
// 1-New course: Create the restore object (checking everything) and launch the execute.
//Select course
if (($restore->restoreto == 0) and ($restore->course_id == 0)) {
if ($courses = get_courses()) {
print_heading(get_string("choosecourse"));
print_simple_box_start("CENTER");
foreach ($courses as $course) {
echo "<A HREF=\"restore.php?course_id=$course->id&launch=check&file=$file\">$course->fullname ($course->shortname)</A><BR>";
}
print_simple_box_end();
} else {
print_heading(get_string("nocoursesyet"));
print_continue("$moodle_home/$CFG->admin/index.php");
}
//Checks everything and execute restore
} else if ((($restore->restoreto == 0) and ($restore->course_id != 0)) or ($restore->restoreto == 1)) {
$show_continue_button = true;
//Check if we've selected any mod's user info and restore->users
//is set to none. Change it to course and inform.
if ($restore->users == 2) {
$changed = false;
$mods = $restore->mods;
foreach ($mods as $mod) {
if ($mod->userinfo) {
$changed = true;
}
}
if ($changed) {
echo get_string ("noteuserschangednonetocourse");
echo "<hr noshade size=\"1\">";
$restore->users = 1;
}
}
//Save the restore session object
$SESSION->restore = $restore;
if ($show_continue_button) {
//Print the continue button to execute the restore NOW !!!!
//All is prepared !!!
echo "<CENTER>";
echo get_string("presscontinuetolaunchrestore");
echo "<br>";
$hidden["launch"] = "execute";
$hidden["file"] = $file;
print_single_button("restore.php", $hidden, get_string("continue"),"post");
echo "</CENTER>";
} else {
//Show error
error ("Something was wrong checking restore preferences");
}
//If we are here. Something must be wrong. Debug !!!
} else {
print_object($restore);
print_object($info);
print_object($course_header);
error ("Something must be wrong");
}
?>
+195
View File
@@ -0,0 +1,195 @@
<?PHP //$Id$
//This page receives the required info and executes the restore
//with the parameters suplied. Whe finished, delete temporary
//data from backup_tables and temp directory
//Get objects from session
if ($SESSION) {
$info = $SESSION->info;
$course_header = $SESSION->course_header;
$restore = $SESSION->restore;
}
//Check login
require_login();
//Check admin
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
//Check site
if (!$site = get_site()) {
error("Site not found!");
}
//Start the main table
echo "<table cellpadding=5>";
echo "<tr><td>";
//Start the main ul
echo "<ul>";
//Init status
$status = true;
//Localtion of the xml file
$xml_file = $CFG->dataroot."/temp/backup/".$restore->backup_unique_code."/moodle.xml";
//If we've selected to restore into new course
//create it (course)
//Saving conversion id variables into backup_tables
if ($restore->restoreto ==1) {
echo "<li>Creating new course";
$status = restore_create_new_course($restore,&$course_header);
//Print course fullname and shortname and category
if ($status) {
echo "<ul>";
echo "<li>".$course_header->course_fullname." (".$course_header->course_shortname.")";
echo "<li>".get_string("category").": ".$course_header->category->name;
echo "</ul>";
//Put the destination course_id
$restore->course_id = $course_header->course_id;
}
} else {
$course = get_record("course","id",$restore->course_id);
if ($course) {
echo "<li>Using existing course";
echo "<ul>";
echo "<li>From: ".$course_header->course_fullname." (".$course_header->course_shortname.")";
echo "<li>To: ".$course->fullname." (".$course->shortname.")";
echo "</ul>";
}
}
//Now create the course_sections and their associated course_modules
if ($status) {
if ($restore->restoreto == 1) {
echo "<li>Creating sections";
$status = restore_create_sections($restore,$xml_file);
} else if ($restore->restoreto == 0) {
echo "<li>Checking sections";
$status = restore_create_sections($restore,$xml_file);
} else {
$status = false;
}
}
//Now create users as needed
if ($status and ($restore->users == 0 or $restore->users == 1)) {
echo "<li>Creating users";
$status = restore_create_users($restore,$xml_file);
//Now print info about the work done
if ($status) {
$recs = get_records_sql("select old_id, info from {$CFG->prefix}backup_ids
where backup_code = '$restore->backup_unique_code' and
table_name = 'user'");
//We've records
if ($recs) {
$new_count = 0;
$exists_count = 0;
$student_count = 0;
$teacher_count = 0;
$coursecreator_count = 0;
$admin_count = 0;
$other_count = 0;
//Iterate, filling counters
foreach ($recs as $rec) {
if (strpos($rec->info,"new") !== false) {
$new_count++;
}
if (strpos($rec->info,"exists") !== false) {
$exists_count++;
}
if (strpos($rec->info,"admin")) {
$admin_count++;
} else if (strpos($rec->info,"coursecreator")) {
$coursecreator_count++;
} else if (strpos($rec->info,"teacher")) {
$teacher_count++;
} else if (strpos($rec->info,"student")) {
$student_count++;
} else if ($rec->info == "new" or $rec->info == "exists") {
$other_count++;
}
}
//Now print information gathered
echo " (new: ".$new_count.", existing: ".$exists_count.")";
echo "<ul>";
echo "<li>Students: ".$student_count;
echo "<li>Teachers: ".$teacher_count;
echo "<li>Course Creators: ".$coursecreator_count;
echo "<li>Admins: ".$admin_count;
echo "<li>Other: ".$other_count;
echo "</ul>";
} else {
//Something is wrong. There is no users !!
$status = false;
}
}
}
//Now create user_files as needed
if ($status and ($restore->user_files)) {
echo "<li>Copying User Files";
$status = restore_user_files($restore);
//If all is ok (and we have a counter)
if ($status and ($status !== true)) {
//Inform about user dirs created from backup
echo "<ul>";
echo "<li>User Zones: ".$status;
echo "</ul>";
}
}
//Now create course files as needed
if ($status and ($restore->course_files)) {
echo "<li>Copying Course Files";
$status = restore_course_files($restore);
//If all is ok (and we have a counter)
if ($status and ($status !== true)) {
//Inform about user dirs created from backup
echo "<ul>";
echo "<li>Main Files/Folders: ".$status;
echo "</ul>";
}
}
//Now create log entries as needed
if ($status and ($restore->logs)) {
echo "<li>Creating Log Entries <b>(not implemented)</b>. Execute after everything...";
}
//Now, if all is OK, adjust the instance field in course_modules !!
//Now if all is OK, update course modinfo field !!
//End the main ul
echo "</ul>";
//End the main table
echo "</tr></td>";
echo "</table>";
if (!$status) {
error ("An error has ocurred");
}
?>
+226
View File
@@ -0,0 +1,226 @@
<?PHP //$Id$
//This page prints the restore form to select everything yo want
//to restore. Form is dinamically buid, depending of "info" object
//that contains the backup contents and depending of every mod
//capabilities.
//Get objects from session
$info = $SESSION->info;
$course_header = $SESSION->course_header;
//Check that we have all we need
//backup_unique_code
require_variable($backup_unique_code);
//file
require_variable($file);
//info
require_variable($info);
//course_header
require_variable($course_header);
//Check login
require_login();
//Check admin
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
//Check site
if (!$site = get_site()) {
error("Site not found!");
}
//Checks for the required files/functions to restore every mod
$count = 0;
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$modfile = "$mods_home/$modname/restorelib.php";
$modrestore = $modname."_restore_mods";
if (file_exists($modfile)) {
include_once($modfile);
if (function_exists($modrestore)) {
$var = "exists_".$modname;
$$var = true;
$count++;
}
}
//Check data
//Check module info
$var = "restore_".$modname;
if (!isset($$var)) {
$$var = 1;
}
//Check include user info
$var = "restore_user_info_".$modname;
if (!isset($$var)) {
$$var = 1;
}
}
}
//Check other parameters
if (!isset($restore_users)) {
$restore_users = 1;
}
if (!isset($restore_logs)) {
$restore_logs = 1;
}
if (!isset($restore_user_files)) {
$restore_user_files = 1;
}
if (!isset($restore_course_files)) {
$restore_course_files = 1;
}
if (!isset($restore_restoreto)) {
$restore_restoreto = 1;
}
if ($count == 0) {
notice("No restorable modules are installed!");
}
?>
<form name="form" method="post" <?=$onsubmit ?> action="<?=$ME ?>">
<table cellpadding=5>
<?
//First, course destination
//Print the full tr
echo "<tr>";
echo "<td align=\"right\"><P><b>";
echo get_string("restoreto").":</b>";
echo "</td><td>";
$restore_restoreto_options[0] = get_string("existingcourse");
$restore_restoreto_options[1] = get_string("newcourse");
choose_from_menu($restore_restoreto_options, "restore_restoreto", $restore_restoreto, "");
echo "</td></tr>";
//Line
echo "<tr><td colspan=\"2\"><hr noshade size=\"1\"></td></tr>";
//Now, check modules and info and show posibilities
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$modrestore = $modname."_restore_mods";
//If exists the lib & function
$exist = "exists_".$modname;
$restore_var = "restore_".$modname;
$user_info_var = "restore_user_info_".$modname;
if ($$exist) {
//Now check that we have that module info in the backup file
if ($info->mods[$modname]->backup == "true") {
//Print the full tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string("include")." ". get_string("modulenameplural",$modname).":";
echo "</td><td>";
$restore_options[0] = get_string("no");
$restore_options[1] = get_string("yes");
choose_from_menu($restore_options, $restore_var, $$restore_var, "");
//If backup contains user data, then show menu, else fix it to
//without user data
if ($info->mods[$modname]->userinfo == "true") {
$restore_user_options[0] = get_string("withoutuserdata");
$restore_user_options[1] = get_string("withuserdata");
choose_from_menu($restore_user_options, $user_info_var, $$user_info_var, "");
} else {
//Module haven't userdata
echo get_string("withoutuserdata");
echo "<input type=\"hidden\" name=\"$user_info_var\" value=\"0\">";
}
echo "</td></tr>";
} else {
//Module isn't restorable
echo "<input type=\"hidden\" name=\"$restore_var\" value=\"0\">";
echo "<input type=\"hidden\" name=\"$user_info_var\" value=\"0\">";
}
} else {
//Module isn't restorable
echo "<input type=\"hidden\" name=\"$restore_var\" value=\"0\">";
echo "<input type=\"hidden\" name=\"$user_info_var\" value=\"0\">";
}
}
//Line
echo "<tr><td colspan=\"2\"><hr noshade size=\"1\"></td></tr>";
//Now print the Users tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string("users").":";
echo "</td><td>";
//If all users are in the backup file
if ($info->backup_users == "all") {
$user_options[0] = get_string("all");
}
$user_options[1] = get_string("course");
$user_options[2] = get_string("none");
//$user_options[2] = get_string("needed");-->NOT IMPLEMENTED
choose_from_menu($user_options, "restore_users", $restore_users, "");
echo "</td></tr>";
//Now print the Logs tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string("logs").":";
echo "</td><td>";
//If logs are in the backup file, show menu, else fixed to no
if ($info->backup_logs == "true") {
$log_options[0] = get_string("no");
$log_options[1] = get_string("yes");
choose_from_menu($log_options, "restore_logs", $restore_logs, "");
} else {
echo get_string("no");
echo "<input type=\"hidden\" name=\"restore_logs\" value=\"0\">";
}
echo "</td></tr>";
//Now print the User Files tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string ("userfiles").":";
echo "</td><td>";
//If user files are in the backup file, show menu, else fixed to no
if ($info->backup_user_files == "true") {
$user_file_options[0] = get_string("no");
$user_file_options[1] = get_string("yes");
choose_from_menu($user_file_options, "restore_user_files", $restore_user_files, "");
} else {
echo get_string("no");
echo "<input type=\"hidden\" name=\"restore_user_files\" value=\"0\">";
}
echo "</td></tr>";
//Now print the Course Files tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string ("coursefiles").":";
echo "</td><td>";
//If course files are in the backup file, show menu, else fixed to no
if ($info->backup_course_files == "true") {
$course_file_options[0] = get_string("no");
$course_file_options[1] = get_string("yes");
choose_from_menu($course_file_options, "restore_course_files", $restore_course_files, "");
} else {
echo get_string("no");
echo "<input type=\"hidden\" name=\"restore_course_files\" value=\"0\">";
}
echo "</td></tr>";
echo "<input type=\"hidden\" name=\"backup_unique_code\" value=\"$backup_unique_code\">";
echo "<input type=\"hidden\" name=\"file\" value=\"$file\">";
}
?>
</table>
<BR>
<CENTER>
<input type="hidden" name=id value="<? p($id) ?>">
<input type="hidden" name=launch value="check">
<input type="submit" value="<? print_string("continue") ?>">
<input type="submit" name=cancel value="<? print_string("cancel") ?>">
</CENTER>
</FORM>
+130
View File
@@ -0,0 +1,130 @@
<?PHP // $Id$
//This page copies th zip to the temp directory,
//unzip it, check that it is a valid backup file
//inform about its contents and fill all the necesary
//variables to continue with the restore.
//Checks we have the file variable
if (!isset($file)) {
error ("File not specified");
}
//Check login
require_login();
//Check admin
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
//Check site
if (!$site = get_site()) {
error("Site not found!");
}
//Prepend dataroot to variable to have the absolute path
$file = $CFG->dataroot."/".$file;
//Start the main table
echo "<table cellpadding=5>";
echo "<tr><td>";
//Start the mail ul
echo "<ul>";
//Check the file exists
if (!is_file($file)) {
error ("File not exists ($file)");
}
//Check the file name ends with .zip
if (!substr($file,-4) == ".zip") {
error ("File has an incorrect extension");
}
//Now calculate the unique_code for this restore
$backup_unique_code = time();
//Now check and create the backup dir (if it doesn't exist)
$status = check_and_create_backup_dir($backup_unique_code);
//Empty dir
if ($status) {
echo "<li>Creating temp dir";
$status = clear_backup_dir($backup_unique_code);
}
//Now delete old data and directories under dataroot/temp/backup
if ($status) {
echo "<li>Cleaning old data";
$status = backup_delete_old_data();
}
//Now copy he zip file to dataroot/temp/backup/backup_unique_code
if ($status) {
$status = backup_copy_file($file,$CFG->dataroot."/temp/backup/".$backup_unique_code."/".basename($file));
}
//Now unzip the file
if ($status) {
echo "<li>Retrieving backup file";
$status = restore_unzip ($CFG->dataroot."/temp/backup/".$backup_unique_code."/".basename($file),$moodle_home);
}
//Now check for the moodle.xml file
if ($status) {
$xml_file = $CFG->dataroot."/temp/backup/".$backup_unique_code."/moodle.xml";
echo "<li>Checking backup file";
$status = restore_check_moodle_file ($xml_file);
}
$info = "";
$course_header = "";
//Now read the info tag (all)
if ($status) {
echo "<li>Reading info from file";
//Reading info from file
$info = restore_read_xml_info ($xml_file);
//Reading course_header from file
$course_header = restore_read_xml_course_header ($xml_file);
}
//End the main ul
echo "</ul>";
//End the main table
echo "</tr></td>";
echo "</table>";
//Now we print in other table, the backup and the course it contains info
if ($info and $course_header and $status) {
//First, the course info
$status = restore_print_course_header($course_header);
//Now, the backup info
if ($status) {
$status = restore_print_info($info);
}
}
//Save course header and info into php session
if ($status) {
$SESSION->info = $info;
$SESSION->course_header = $course_header;
}
//Finally, a little form to continue
//with some hidden fields
if ($status) {
echo "<br><CENTER>";
$hidden["backup_unique_code"] = $backup_unique_code;
$hidden["launch"] = "form";
$hidden["file"] = $file;
print_single_button("restore.php", $hidden, get_string("continue"),"post");
echo "</CENTER>";
}
if (!$status) {
error ("An error has ocurred");
}
?>
File diff suppressed because it is too large Load Diff
+61 -26
View File
@@ -28,6 +28,7 @@
// //
///////////////////////////////////////////////////////////////////////////
unset($CFG); // Ignore this line
//=========================================================================
// 1. DATABASE SETUP
@@ -38,68 +39,102 @@
// //
// mysql - the prefix is optional, but useful when installing //
// into databases that already contain tables. //
//
// postgres7 - the prefix is REQUIRED, regardless of whether the //
// database is empty of not. //
// database already contains tables. //
$CFG->dbtype = "mysql"; // mysql or postgres7 (for now)
$CFG->dbhost = "localhost"; // eg localhost or db.isp.com
$CFG->dbname = "moodle"; // database name, eg moodle
$CFG->dbuser = "username"; // your database username
$CFG->dbpass = "password"; // your database password
$CFG->dbtype = 'mysql'; // mysql or postgres7 (for now)
$CFG->dbhost = 'localhost'; // eg localhost or db.isp.com
$CFG->dbname = 'moodle'; // database name, eg moodle
$CFG->dbuser = 'username'; // your database username
$CFG->dbpass = 'password'; // your database password
$CFG->prefix = "mdl_"; // Prefix to use for all table names
$CFG->dbpersist = true; // Use persistent database connection?
// (should be 'true' for 99% of sites)
$CFG->prefix = 'mdl_'; // Prefix to use for all table names
//=========================================================================
// 2. WEB SITE LOCATION
//=========================================================================
// Now you need to tell Moodle where it is located. Specify the full
// web address where moodle has been installed (without trailing slash)
// web address to where moodle has been installed. If your web site
// is accessible via multiple URLs then choose the most natural one
// that your students would use. Do not include a trailing slash.
$CFG->wwwroot = "http://example.com/moodle";
$CFG->wwwroot = 'http://example.com/moodle';
//=========================================================================
// 3. SERVER FILES LOCATION
//=========================================================================
// Next, specify the full OS directory path to this same location
// For Windows this might be something like "C:\apache\htdocs\moodle"
// Make sure the upper/lower case is correct. Some examples:
//
// $CFG->dirroot = 'C:\FoxServ\www\moodle'; // Windows
// $CFG->dirroot = '/var/www/html/moodle'; // Redhat Linux
$CFG->dirroot = "/web/moodle";
$CFG->dirroot = '/var/www/html/moodle';
//=========================================================================
// 4. DATA FILES LOCATION
//=========================================================================
// Now you need a place where Moodle can save uploaded files. This
// directory should be writeable by the web server user (usually 'nobody'
// or 'apache'), but it should not be accessible directly via the web.
// directory should be readable AND WRITEABLE by the web server user
// (usually 'nobody' or 'apache'), but it should not be accessible
// directly via the web.
//
// - On hosting systems you might need to make sure that your "group" has
// no permissions at all, but that "others" have full permissions.
// - On Windows systems you might specify something like "C:\moodledata"
//
// - On Windows systems you might specify something like 'C:\moodledata'
$CFG->dataroot = "/home/moodledata";
$CFG->dataroot = '/home/moodledata';
//=========================================================================
// 5. TROUBLESHOOTING (most people can just ignore this setting)
// 5. DATA FILES PERMISSIONS
//=========================================================================
// A very small percentage of servers have a bug which causes HTTP_REFERER
// not to work. The symptoms of this are that you fill out the configure
// form during Moodle setup but when hit save you find yourself on the
// same form, unable to progress. If this happens to you, come back here
// and set the following to true. Otherwise this should always be false.
// The following parameter sets the permissions of new directories
// created by Moodle within the data directory. The format is in
// octal format (as used by the Unix utility chmod, for example).
// The default is usually OK, but you may want to change it to 0750
// if you are concerned about world-access to the files (you will need
// to make sure the web server process (eg Apache) can access the files.
// NOTE: the prefixed 0 is important, and don't use quotes.
$CFG->buggy_referer = false;
$CFG->directorypermissions = 0777;
//=========================================================================
// 6. ALL DONE! To continue your setup, visit your Moodle web page.
// 6. DIRECTORY LOCATION (most people can just ignore this setting)
//=========================================================================
// A very few webhosts use /admin as a special URL for you to access a
// control panel or something. Unfortunately this conflicts with the
// standard location for the Moodle admin pages. You can fix this by
// renaming the admin directory in your installation, and putting that
// new name here. eg "moodleadmin". This will fix admin links in Moodle.
$CFG->admin = 'admin';
//=========================================================================
// ALL DONE! To continue installation, visit your main page with a browser
//=========================================================================
$CFG->libdir = "$CFG->dirroot/lib"; // Do not change this
require_once("$CFG->libdir/setup.php"); // Do not change this
if (! @include_once("$CFG->dirroot/lib/setup.php")) { // Do not edit
if ($CFG->dirroot == dirname(__FILE__)) {
echo "<p>Could not find this file: $CFG->dirroot/lib/setup.php</p>";
echo "<p>Are you sure all your files have been uploaded?</p>";
} else {
echo "<p>Error detected in config.php</p>";
echo "<p>Error in: \$CFG->dirroot = '$CFG->dirroot';</p>";
echo "<p>Try this: \$CFG->dirroot = '".dirname(__FILE__)."';</p>";
}
die;
}
// MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES,
// RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE.
+26 -8
View File
@@ -4,6 +4,8 @@
require_once("../config.php");
require_once("lib.php");
require_login();
if (!isadmin()) {
error("Only administrators can use this course!");
}
@@ -25,7 +27,7 @@
$stradd = get_string("add");
print_header("$site->shortname: $strcategories", "$site->fullname",
"<A HREF=\"$CFG->wwwroot/admin/\">$stradministration</A> -> $strcategories");
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A> -> $strcategories");
print_heading($strcategories);
@@ -37,17 +39,33 @@
// Peel out all the data from variable names.
foreach ($form as $key => $val) {
if ($key == "new" and $val != "") {
$cat->name = $val;
if (!insert_record("course_categories", $cat)) {
error("Could not insert the new category '$val'");
} else {
notify(get_string("categoryadded", "", $val));
if ($key == "new") {
if (!empty($val)) {
if (get_records("course_categories", "name", $val)) {
notify(get_string("categoryduplicate", "", $val));
} else {
$cat->name = $val;
if (!insert_record("course_categories", $cat)) {
error("Could not insert the new category '$val'");
} else {
notify(get_string("categoryadded", "", $val));
}
}
}
} else {
$cat->id = substr($key,1);
$cat->id = substr($key,1);
$cat->name = $val;
if ($existingcats = get_records("course_categories", "name", $val)) {
foreach($existingcats as $existingcat) {
if ($existingcat->id != $cat->id) {
notify(get_string("categoryduplicate", "", $val));
continue 2;
}
}
}
if (!update_record("course_categories", $cat)) {
error("Could not update the category '$val'");
}
+6 -6
View File
@@ -21,18 +21,18 @@
if (!$id) {
print_header("$site->shortname: $strdeletecourse", $site->fullname,
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> -> $strdeletecourse");
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A> -> $strdeletecourse");
if ($courses = get_courses()) {
print_heading(get_string("choosecourse"));
print_simple_box_start("CENTER");
foreach ($courses as $course) {
echo "<A HREF=\"delete.php?id=$course->id\">$course->fullname</A><BR>";
echo "<A HREF=\"delete.php?id=$course->id\">$course->fullname ($course->shortname)</A><BR>";
}
print_simple_box_end();
} else {
print_heading(get_string("nocoursesyet"));
print_continue("$CFG->wwwroot/admin/");
print_continue("../$CFG->admin/index.php");
}
print_footer();
exit;
@@ -46,10 +46,10 @@
$strdeletecheck = get_string("deletecheck", "", $course->shortname);
$strdeletecoursecheck = get_string("deletecoursecheck");
print_header("$site->shortname: $strdeletecheck", $site->fullname,
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> ->
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A> ->
<A HREF=\"delete.php\">$strdeletecourse</A> -> $strdeletecheck");
notice_yesno("$strdeletecoursecheck<BR><BR>$course->fullname",
notice_yesno("$strdeletecoursecheck<BR><BR>$course->fullname ($course->shortname)",
"delete.php?id=$course->id&delete=".md5($course->timemodified),
"delete.php");
exit;
@@ -63,7 +63,7 @@
$strdeletingcourse = get_string("deletingcourse", "", $course->shortname);
print_header("$site->shortname: $strdeletingcourse", $site->fullname,
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> ->
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A> ->
<A HREF=\"delete.php\">$strdeletecourse</A> -> $strdeletingcourse");
print_heading($strdeletingcourse);
+7 -7
View File
@@ -2,14 +2,14 @@
<table cellpadding=9 cellspacing=0 >
<tr valign=top>
<td><P><? print_string("fullname") ?>:</td>
<td><input type="text" name="fullname" size=50 value="<? p($form->fullname) ?>">
<td><input type="text" name="fullname" maxlength="254" size=50 value="<? p($form->fullname) ?>">
<? helpbutton("coursefullname", get_string("fullname")) ?>
<? if (isset($err["fullname"])) formerr($err["fullname"]); ?>
</td>
</tr>
<tr valign=top>
<td><P><? print_string("shortname") ?>:</td>
<td><input type="text" name="shortname" size=10 value="<? p($form->shortname) ?>">
<td><input type="text" name="shortname" maxlength="15" size="10" value="<? p($form->shortname) ?>">
<? helpbutton("courseshortname", get_string("shortname")) ?>
<? if (isset($err["shortname"])) formerr($err["shortname"]); ?>
</td>
@@ -105,28 +105,28 @@
</tr>
<tr valign=top>
<td><P><? print_string("wordforteacher") ?>:</td>
<td><input type="text" name="teacher" size=25 value="<? p($form->teacher) ?>">
<td><input type="text" name="teacher" maxlength="100" size=25 value="<? p($form->teacher) ?>">
(<? print_string("wordforteachereg") ?>)
<? if (isset($err["teacher"])) formerr($err["teacher"]); ?>
</td>
</tr>
<tr valign=top>
<td><P><? print_string("wordforteachers") ?>:</td>
<td><input type="text" name="teachers" size=25 value="<? p($form->teachers) ?>">
<td><input type="text" name="teachers" maxlength="100" size=25 value="<? p($form->teachers) ?>">
(<? print_string("wordforteacherseg") ?>)
<? if (isset($err["teachers"])) formerr($err["teachers"]); ?>
</td>
</tr>
<tr valign=top>
<td><P><? print_string("wordforstudent") ?>:</td>
<td><input type="text" name="student" size=25 value="<? p($form->student) ?>">
<td><input type="text" name="student" maxlength="100" size=25 value="<? p($form->student) ?>">
(<? print_string("wordforstudenteg") ?>)
<? if (isset($err["student"])) formerr($err["student"]); ?>
</td>
</tr>
<tr valign=top>
<td><P><? print_string("wordforstudents") ?>:</td>
<td><input type="text" name="students" size=25 value="<? p($form->students) ?>">
<td><input type="text" name="students" maxlength="100" size=25 value="<? p($form->students) ?>">
(<? print_string("wordforstudentseg") ?>)
<? if (isset($err["students"])) formerr($err["students"]); ?>
</td>
@@ -135,5 +135,5 @@
<td></td>
<td><input type="submit" value="<? print_string("savechanges") ?>"></td>
</TABLE>
<INPUT type="hidden" name="id" value="<?=$course->id ?>">
<INPUT type="hidden" name="id" value="<?=$form->id ?>">
</FORM>
+54 -15
View File
@@ -6,29 +6,32 @@
optional_variable($id, 0); // course id
require_login();
if ($id) {
if (! $course = get_record("course", "id", $id)) {
error("Course ID was incorrect");
}
require_login($course->id);
if (!isteacher($course->id)) {
error("Only teachers can edit the course!");
}
} else { // Admin is creating a new course
require_login();
if (!isadmin()) {
error("Only administrators can use this page");
if (!iscreator()) {
error("Only administrators and teachers can use this page");
}
$course = NULL;
}
if (! $site = get_site()) {
redirect("$CFG->wwwroot/admin/");
redirect("$CFG->wwwroot/$CFG->admin/index.php");
}
/// If data submitted, then process and store.
if ($form = data_submitted()) {
@@ -41,7 +44,7 @@
$form->timemodified = time();
if ($course) {
if (!empty($course)) {
if (update_record("course", $form)) {
add_to_log($course->id, "course", "update", "edit.php?id=$id", "");
redirect("view.php?id=$course->id", get_string("changessaved"));
@@ -51,14 +54,33 @@
} else {
$form->timecreated = time();
if ($newid = insert_record("course", $form)) { // Set up new course
$section->course = $newid; // Create a default section.
if ($newcourseid = insert_record("course", $form)) { // Set up new course
$section = NULL;
$section->course = $newcourseid; // Create a default section.
$section->section = 0;
$section->timemodified = time();
$section->id = insert_record("course_sections", $section);
add_to_log($newid, "course", "new", "view.php?id=$newid", "");
redirect("teacher.php?id=$newid", get_string("changessaved"));
add_to_log($newcourseid, "course", "new", "view.php?id=$newcourseid", "");
if (isadmin()) { // Redirect admin to add teachers
redirect("../$CFG->admin/teacher.php?id=$newcourseid", get_string("changessaved"));
} else { // Add current teacher and send to course
$newteacher = NULL;
$newteacher->userid = $USER->id;
$newteacher->course = $newcourseid;
$newteacher->authority = 1; // First teacher is the main teacher
if (!$newteacher->id = insert_record("user_teachers", $newteacher)) {
error("Could not add you to this new course!");
}
$USER->teacher[$newcourseid] = true;
redirect("view.php?id=$newcourseid", get_string("changessaved"));
}
} else {
error("Serious Error! Could not create the new course!");
}
@@ -75,7 +97,7 @@
/// Otherwise fill and print the form.
if (empty($form)) {
if ($course) {
if (!empty($course)) {
$form = $course;
} else {
$form->startdate = time() + 3600 * 24;
@@ -87,10 +109,13 @@
$form->students = get_string("defaultcoursestudents");
$form->summary = get_string("defaultcoursesummary");
$form->format = "weeks";
$form->password = "";
$form->guest = 0;
$form->numsections = 10;
$form->newsitems = 5;
$form->showrecent = 1;
$form->category = 1;
$form->id = "";
}
}
@@ -110,13 +135,13 @@
$straddnewcourse = get_string("addnewcourse");
$stradministration = get_string("administration");
if (isset($course)) {
if (!empty($course)) {
print_header($streditcoursesettings, "$course->fullname",
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>
-> $streditcoursesettings", $focus);
} else {
print_header("$site->shortname: $straddnewcourse", "$site->fullname",
"<A HREF=\"$CFG->wwwroot/admin/\">$stradministration</A>
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A>
-> $straddnewcourse", $focus);
}
@@ -139,6 +164,20 @@ function validate_form($course, &$form, &$err) {
if (empty($form->shortname))
$err["shortname"] = get_string("missingshortname");
if ($foundcourses = get_records("course", "shortname", $form->shortname)) {
if (!empty($course->id)) {
unset($foundcourses[$course->id]);
}
if (!empty($foundcourses)) {
foreach ($foundcourses as $foundcourse) {
$foundcoursenames[] = $foundcourse->fullname;
}
$foundcoursenamestring = addslashes(implode(',', $foundcoursenames));
$err["shortname"] = get_string("shortnametaken", "", $foundcoursenamestring);
}
}
if (empty($form->summary))
$err["summary"] = get_string("missingsummary");
+26 -2
View File
@@ -1,7 +1,26 @@
<BLOCKQUOTE>
<FORM name="form" method="post" action="editsection.php">
<FORM name="theform" method="post" <?=$onsubmit ?> action="editsection.php">
<TABLE BORDER=0 cellpadding=0 cellspacing=0>
<TR>
<TD align=top>
<P><B><? print_string("summaryof", "", "$sectionname $form->section") ?></B></P>
<TEXTAREA NAME=summary COLS=60 ROWS=4 WRAP=virtual><?=$form->summary ?></TEXTAREA>
</TD>
<TD align=top width=100>
&nbsp;
</TD>
<TD align=top>
<FONT SIZE=-1>
<? helpbutton("summaries", get_string("helpsummaries"), "moodle", true, true);
if ($usehtmleditor) {
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
} else {
helpbutton("text", get_string("helptext"), "moodle", true, true);
}
?>
</FONT>
</TD>
</TR></TABLE>
<? print_textarea($usehtmleditor, 4, 60, 595, 200, "summary", $form->summary); ?>
<P>
<INPUT type="hidden" name=id value="<?=$form->id ?>">
<INPUT type="submit" value="<? print_string("savechanges") ?>">
@@ -9,3 +28,8 @@
</P>
</FORM>
</BLOCKQUOTE>
<?
if ($usehtmleditor) {
print_richedit_javascript("theform", "summary", "no");
}
?>
+11 -3
View File
@@ -6,6 +6,8 @@
require_variable($id); // Week ID
require_login();
if (! $section = get_record("course_sections", "id", $id)) {
error("Course section is incorrect");
}
@@ -14,8 +16,6 @@
error("Could not find the course!");
}
require_login($course->id);
if (!isteacher($course->id)) {
error("Only teachers can edit this!");
}
@@ -43,10 +43,18 @@
$form = $section;
}
if ($usehtmleditor = can_use_richtext_editor()) {
$onsubmit = "onsubmit=\"copyrichtext(theform.summary);\"";
} else {
$onsubmit = "";
}
$sectionname = get_string("name$course->format");
$stredit = get_string("edit", "", " $sectionname $section->section");
print_header($stredit, $stredit, "", "form.summary");
print_header("$course->shortname: $stredit", "$course->fullname",
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>
-> $stredit", "form.summary");
include("editsection.html");
+4 -6
View File
@@ -4,9 +4,10 @@
require_once("../config.php");
require_once("lib.php");
require_login();
require_variable($id);
require_login();
if (! $course = get_record("course", "id", $id) ) {
error("That's an invalid course id");
}
@@ -18,7 +19,8 @@
if (isguest()) {
add_to_log($course->id, "course", "guest", "view.php?id=$course->id", "$REMOTE_ADDR, $REMOTE_HOST");
} else {
} else if (!record_exists("user_students", "userid", $USER->id, "course", $course->id)) {
if (! enrol_student($USER->id, $course->id)) {
error("An error occurred while trying to enrol you.");
}
@@ -38,12 +40,10 @@
}
$USER->student["$id"] = true;
save_session("USER");
if ($SESSION->wantsurl) {
$destination = $SESSION->wantsurl;
unset($SESSION->wantsurl);
save_session("SESSION");
} else {
$destination = "$CFG->wwwroot/course/view.php?id=$id";
}
@@ -72,12 +72,10 @@
}
$USER->student["$id"] = true;
save_session("USER");
if ($SESSION->wantsurl) {
$destination = $SESSION->wantsurl;
unset($SESSION->wantsurl);
save_session("SESSION");
} else {
$destination = "$CFG->wwwroot/course/view.php?id=$id";
}
+29 -27
View File
@@ -40,35 +40,37 @@
$sectionmods = explode(",", $section->sequence);
foreach ($sectionmods as $sectionmod) {
$mod = $mods[$sectionmod];
$instance = get_record("$mod->modname", "id", "$mod->instance");
$libfile = "$CFG->dirroot/mod/$mod->modname/lib.php";
if (file_exists($libfile)) {
require_once($libfile);
$gradefunction = $mod->modname."_grades";
if (function_exists($gradefunction)) { // Skip modules without grade function
if ($modgrades = $gradefunction($mod->instance)) {
if ($mod->visible) {
$instance = get_record("$mod->modname", "id", "$mod->instance");
$libfile = "$CFG->dirroot/mod/$mod->modname/lib.php";
if (file_exists($libfile)) {
require_once($libfile);
$gradefunction = $mod->modname."_grades";
if (function_exists($gradefunction)) { // Skip modules without grade function
if ($modgrades = $gradefunction($mod->instance)) {
$image = "<A HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\"".
" TITLE=\"$mod->modfullname\">".
"<IMG BORDER=0 VALIGN=absmiddle SRC=\"../mod/$mod->modname/icon.gif\" ".
"HEIGHT=16 WIDTH=16 ALT=\"$mod->modfullname\"></A>";
$columnhtml[] = "$image ".
"<A HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">".
"$instance->name".
"</A>";
$image = "<A HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\"".
" TITLE=\"$mod->modfullname\">".
"<IMG BORDER=0 VALIGN=absmiddle SRC=\"../mod/$mod->modname/icon.gif\" ".
"HEIGHT=16 WIDTH=16 ALT=\"$mod->modfullname\"></A>";
$columnhtml[] = "$image ".
"<A HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">".
"$instance->name".
"</A>";
if (empty($modgrades->grades[$USER->id])) {
$grades[] = "";
} else {
$grades[] = $modgrades->grades[$USER->id];
$totalgrade += (float)$modgrades->grades[$USER->id];
}
if (empty($modgrades->grades[$USER->id])) {
$grades[] = "";
} else {
$grades[] = $modgrades->grades[$USER->id];
$totalgrade += (float)$modgrades->grades[$USER->id];
}
if (empty($modgrades->maxgrade)) {
$maxgrades[] = "";
} else {
$maxgrades[] = $modgrades->maxgrade;
$totalmaxgrade += $modgrades->maxgrade;
if (empty($modgrades->maxgrade)) {
$maxgrades[] = "";
} else {
$maxgrades[] = $modgrades->maxgrade;
$totalmaxgrade += $modgrades->maxgrade;
}
}
}
}
+45 -18
View File
@@ -8,12 +8,12 @@
require_variable($id); // course id
optional_variable($download, ""); // to download data
require_login();
if (! $course = get_record("course", "id", $id)) {
error("Course ID was incorrect");
}
require_login($course->id);
if (!isteacher($course->id)) {
error("Only teachers can use this page!");
}
@@ -26,7 +26,7 @@
/// Get a list of all students
if (!$students = get_course_students($course->id)) {
if (!$students = get_course_students($course->id, "u.lastname ASC")) {
print_header("$course->shortname: $strgrades", "$course->fullname",
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>
-> $strgrades");
@@ -37,6 +37,7 @@
foreach ($students as $student) {
$grades[$student->id] = array(); // Collect all grades in this array
$gradeshtml[$student->id] = array(); // Collect all grades html formatted in this array
$totals[$student->id] = array(); // Collect all totals in this array
}
$columns = array(); // Accumulate column names in this array.
@@ -64,26 +65,52 @@
if (function_exists($gradefunction)) { // Skip modules without grade function
if ($modgrades = $gradefunction($mod->instance)) {
if ($modgrades->maxgrade) {
$maxgrade = "<BR>$strmax: $modgrades->maxgrade";
if (!empty($modgrades->maxgrade)) {
if ($mod->visible) {
$maxgrade = "$strmax: $modgrades->maxgrade";
$maxgradehtml = "<BR>$strmax: $modgrades->maxgrade";
} else {
$maxgrade = "$strmax: $modgrades->maxgrade";
$maxgradehtml = "<BR><FONT class=\"dimmed_text\">$strmax: $modgrades->maxgrade</FONT>";
}
} else {
$maxgrade = "";
$maxgradehtml = "";
}
$image = "<A HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\"".
" TITLE=\"$mod->modfullname\">".
"<IMG BORDER=0 VALIGN=absmiddle SRC=\"../mod/$mod->modname/icon.gif\" ".
"HEIGHT=16 WIDTH=16 ALT=\"$mod->modfullname\"></A>";
$columnhtml[] = "$image ".
"<A HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">".
"$instance->name".
"</A>$maxgrade";
$columns[] = "$mod->modfullname: $instance->name - $modgrades->maxgrade";
if ($mod->visible) {
$columnhtml[] = "$image ".
"<A HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">".
"$instance->name".
"</A>$maxgradehtml";
} else {
$columnhtml[] = "$image ".
"<A CLASS=\"dimmed\" HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">".
"$instance->name".
"</A>$maxgradehtml";
}
$columns[] = "$mod->modfullname: $instance->name - $maxgrade";
foreach ($students as $student) {
$grades[$student->id][] = $modgrades->grades[$student->id]; // may be empty, that's ok
if ($modgrades->maxgrade) {
$totals[$student->id] = (float)($totals[$student->id]) + (float)($modgrades->grades[$student->id]);
if (!empty($modgrades->grades[$student->id])) {
$grades[$student->id][] = $currentstudentgrade = $modgrades->grades[$student->id];
if ($mod->visible) {
$gradeshtml[$student->id][] = $modgrades->grades[$student->id];
} else {
$gradeshtml[$student->id][] = "<FONT class=\"dimmed_text\">".
$modgrades->grades[$student->id].
"</FONT>";
}
} else {
$grades[$student->id][] = $currentstudentgrade = "";
$gradeshtml[$student->id][] = "";
}
if (!empty($modgrades->maxgrade)) {
$totals[$student->id] = (float)($totals[$student->id]) + (float)($currentstudentgrade);
} else {
$totals[$student->id] = (float)($totals[$student->id]) + 0;
}
@@ -175,9 +202,9 @@
print_heading($strgrades);
$table->head = array_merge(array ("", get_string("name")), $columnhtml, get_string("total"));
$table->head = array_merge(array ("", get_string("firstname"), get_string("lastname")), $columnhtml, get_string("total"));
$table->width = array(35, "");
$table->align = array("LEFT", "LEFT");
$table->align = array("LEFT", "RIGHT", "LEFT");
foreach ($columns as $column) {
$table->width[] = "";
$table->align[] = "CENTER";
@@ -185,10 +212,10 @@
$table->width[] = "";
$table->align[] = "CENTER";
foreach ($grades as $studentid => $studentgrades) {
$student = $students[$studentid];
foreach ($students as $key => $student) {
$studentgrades = $gradeshtml[$student->id];
$picture = print_user_picture($student->id, $course->id, $student->picture, false, true);
$name = array ("$picture", "<A TITLE=\"$stractivityreport\" HREF=\"user.php?id=$course->id&user=$student->id\">$student->firstname&nbsp;$student->lastname</A>");
$name = array ("$picture", "$student->firstname", "$student->lastname");
$total = array ($totals[$student->id]);
$table->data[] = array_merge($name, $studentgrades, $total);
+372 -184
View File
@@ -2,13 +2,18 @@
// Library of useful functions
$COURSE_MAX_LOG_DISPLAY = 150; // days
if (defined('COURSE_MAX_LOG_DISPLAY')) { // Being included again - should never happen!!
return;
}
$COURSE_MAX_LOGS_PER_PAGE = 1000; // records
define('COURSE_MAX_LOG_DISPLAY', 150); // days
$COURSE_TEACHER_COLOR = "#990000"; // To hilight certain items that are teacher-only
define('COURSE_MAX_LOGS_PER_PAGE', 1000); // records
define('COURSE_LIVELOG_REFRESH', 60); // Seconds
define('COURSE_MAX_RECENT_PERIOD', 604800); // A week, in seconds
$COURSE_LIVELOG_REFRESH = 60; // Seconds
function print_log_selector_form($course, $selecteduser=0, $selecteddate="today") {
@@ -42,6 +47,10 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate="today"
asort($courses);
}
$strftimedate = get_string("strftimedate");
$strftimedaydate = get_string("strftimedaydate");
asort($users);
// Get all the possible dates
@@ -54,7 +63,7 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate="today"
$timemidnight = $today = usergetmidnight($timenow);
// Put today up the top of the list
$dates = array("$timemidnight" => get_string("today").", ".userdate($timenow, "%d %B %Y") );
$dates = array("$timemidnight" => get_string("today").", ".userdate($timenow, $strftimedate) );
if (! $course->startdate) {
$course->startdate = $course->timecreated;
@@ -64,7 +73,7 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate="today"
while ($timemidnight > $course->startdate and $numdates < 365) {
$timemidnight = $timemidnight - 86400;
$timenow = $timenow - 86400;
$dates["$timemidnight"] = userdate($timenow, "%A, %d %B %Y");
$dates["$timemidnight"] = userdate($timenow, $strftimedaydate);
$numdates++;
}
@@ -109,7 +118,7 @@ function print_log($course, $user=0, $date=0, $order="ORDER BY l.time ASC") {
// It is assumed that $date is the GMT time of midnight for that day,
// and so the next 86400 seconds worth of logs are printed.
global $CFG, $COURSE_MAX_LOGS_PER_PAGE;
global $CFG;
if ($course->category) {
$selector = "WHERE l.course='$course->id' AND l.userid = u.id";
@@ -132,6 +141,8 @@ function print_log($course, $user=0, $date=0, $order="ORDER BY l.time ASC") {
$selector .= " AND l.time > '$date' AND l.time < '$enddate'";
}
$order = $order." LIMIT ".COURSE_MAX_LOGS_PER_PAGE; // To keep it manageable
if (!$logs = get_logs($selector, $order)) {
notify("No logs found!");
print_footer($course);
@@ -141,50 +152,45 @@ function print_log($course, $user=0, $date=0, $order="ORDER BY l.time ASC") {
$count=0;
$tt = getdate(time());
$today = mktime (0, 0, 0, $tt["mon"], $tt["mday"], $tt["year"]);
if (($totalcountlogs = count($logs)) > $COURSE_MAX_LOGS_PER_PAGE) {
$totalcountlogs = "$COURSE_MAX_LOGS_PER_PAGE/$totalcountlogs";
if (($totalcountlogs = count($logs)) == COURSE_MAX_LOGS_PER_PAGE) {
$totalcountlogs = "$totalcountlogs (+)";
}
echo "<P ALIGN=CENTER>";
$strftimedatetime = get_string("strftimedatetime");
echo "<p align=center>";
print_string("displayingrecords", "", $totalcountlogs);
echo "</P>";
echo "</p>";
$countlogs = 0;
echo "<TABLE BORDER=0 ALIGN=center CELLPADDING=3 CELLSPACING=3>";
echo "<table border=0 align=center cellpadding=3 cellspacing=3>";
foreach ($logs as $log) {
$countlogs++;
if ($countlogs > $COURSE_MAX_LOGS_PER_PAGE) {
break;
}
if ($ld = get_record("log_display", "module", "$log->module", "action", "$log->action")) {
$log->info = get_field($ld->mtable, $ld->field, "id", $log->info);
}
echo "<TR NOWRAP>";
echo "<tr nowrap>";
if (! $course->category) {
echo "<TD NOWRAP><FONT SIZE=2><A HREF=\"view.php?id=$log->course\">".$courses[$log->course]."</A></TD>";
echo "<td nowrap><font size=2><a href=\"view.php?id=$log->course\">".$courses[$log->course]."</a></td>";
}
echo "<TD NOWRAP ALIGN=right><FONT SIZE=2>".userdate($log->time, "%A")."</TD>";
echo "<TD NOWRAP><FONT SIZE=2>".userdate($log->time, "%d %B %Y, %I:%M %p")."</TD>";
echo "<TD NOWRAP><FONT SIZE=2>";
echo "<td nowrap align=right><font size=2>".userdate($log->time, "%a")."</td>";
echo "<td nowrap><font size=2>".userdate($log->time, $strftimedatetime)."</td>";
echo "<td nowrap><font size=2>";
link_to_popup_window("/lib/ipatlas/plot.php?address=$log->ip&user=$log->userid", "ipatlas","$log->ip", 400, 700);
echo "</TD>";
echo "<TD NOWRAP><FONT SIZE=2><A HREF=\"../user/view.php?id=$log->userid&course=$log->course\"><B>$log->firstname $log->lastname</B></TD>";
echo "<TD NOWRAP><FONT SIZE=2>";
echo "</td>";
echo "<td nowrap><font size=2><a href=\"../user/view.php?id=$log->userid&course=$log->course\"><b>$log->firstname $log->lastname</b></td>";
echo "<td nowrap><font size=2>";
link_to_popup_window( make_log_url($log->module,$log->url), "fromloglive","$log->module $log->action", 400, 600);
echo "</TD>";
echo "<TD NOWRAP><FONT SIZE=2>$log->info</TD>";
echo "</TR>";
echo "</td>";
echo "<td nowrap><font size=2>$log->info</td>";
echo "</tr>";
}
echo "</TABLE>";
echo "</table>";
}
function print_all_courses($category="all", $style="full", $maxcount=999, $width=180) {
global $CFG, $USER;
global $CFG, $THEME, $USER;
if ($category == "all") {
$courses = get_courses();
@@ -206,16 +212,20 @@ function print_all_courses($category="all", $style="full", $maxcount=999, $width
if ($style == "minimal") {
$count = 0;
$icon = "<IMG SRC=\"pix/i/course.gif\" HEIGHT=16 WIDTH=16 ALT=\"".get_string("course")."\">";
if (empty($THEME->custompix)) {
$icon = "<img src=\"$CFG->wwwroot/pix/i/course.gif\" height=16 width=16 alt=\"".get_string("course")."\">";
} else {
$icon = "<img src=\"$CFG->wwwroot/theme/$CFG->theme/pix/i/course.gif\" height=16 width=16 alt=\"".get_string("course")."\">";
}
if ($courses) {
foreach ($courses as $course) {
$moddata[]="<A TITLE=\"$course->shortname\" HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</A>";
$moddata[]="<a title=\"$course->shortname\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</a>";
$modicon[]=$icon;
if ($count++ >= $maxcount) {
break;
}
}
$fulllist = "<P><A HREF=\"$CFG->wwwroot/course/\">".get_string("fulllistofcourses")."</A>...";
$fulllist = "<p><a href=\"$CFG->wwwroot/course/\">".get_string("fulllistofcourses")."</a>...";
} else {
$moddata = array();
$modicon = array();
@@ -226,23 +236,29 @@ function print_all_courses($category="all", $style="full", $maxcount=999, $width
} else if ($courses) {
foreach ($courses as $course) {
print_course($course);
echo "<BR>\n";
echo "<br />\n";
}
} else {
echo "<P>".get_string("nocoursesyet")."</P>";
echo "<p>".get_string("nocoursesyet")."</p>";
}
}
function print_course($course) {
global $CFG;
global $CFG, $THEME;
if (! $site = get_site()) {
error("Could not find a site!");
}
if (empty($THEME->custompix)) {
$pixpath = "$CFG->wwwroot/pix";
} else {
$pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix";
}
print_simple_box_start("CENTER", "100%");
echo "<TABLE WIDTH=100%>";
@@ -265,12 +281,12 @@ function print_course($course) {
if ($course->guest) {
$strallowguests = get_string("allowguests");
echo "<A TITLE=\"$strallowguests\" HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
echo "<IMG VSPACE=4 ALT=\"$strallowguests\" HEIGHT=16 WIDTH=16 BORDER=0 SRC=\"$CFG->wwwroot/user/user.gif\"></A>&nbsp;&nbsp;";
echo "<IMG VSPACE=4 ALT=\"$strallowguests\" HEIGHT=16 WIDTH=16 BORDER=0 SRC=\"$pixpath/i/user.gif\"></A>&nbsp;&nbsp;";
}
if ($course->password) {
$strrequireskey = get_string("requireskey");
echo "<A TITLE=\"$strrequireskey\" HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
echo "<IMG VSPACE=4 ALT=\"$strrequireskey\" HEIGHT=16 WIDTH=16 BORDER=0 SRC=\"$CFG->wwwroot/pix/i/key.gif\"></A>";
echo "<IMG VSPACE=4 ALT=\"$strrequireskey\" HEIGHT=16 WIDTH=16 BORDER=0 SRC=\"$pixpath/i/key.gif\"></A>";
}
@@ -291,22 +307,24 @@ function print_recent_activity($course) {
// This function trawls through the logs looking for
// anything new since the user's last login
global $CFG, $USER, $COURSE_TEACHER_COLOR;
global $CFG, $USER;
if (! $USER->lastlogin ) {
echo "<P ALIGN=CENTER><FONT SIZE=1>";
echo "<p align=center><font size=1>";
print_string("welcometocourse", "", $course->shortname);
echo "</FONT></P>";
echo "</font></p>";
return;
} else {
echo "<P ALIGN=CENTER><FONT SIZE=1>";
echo "<p align=center><font size=1>";
echo get_string("yourlastlogin").":<BR>";
echo userdate($USER->lastlogin, "%A, %d %b %Y, %H:%M");
echo "</FONT></P>";
echo userdate($USER->lastlogin, get_string("strftimerecentfull"));
echo "</font></p>";
}
if (! $logs = get_records_select("log", "time > '$USER->lastlogin' AND course = '$course->id'", "time ASC")) {
return;
$timestart = $USER->lastlogin;
$timemaxrecent = time() - COURSE_MAX_RECENT_PERIOD;
if ($timestart < $timemaxrecent) {
$timestart = $timemaxrecent;
}
@@ -314,8 +332,12 @@ function print_recent_activity($course) {
$heading = false;
$content = false;
foreach ($logs as $log) {
if ($log->module == "course" and $log->action == "enrol") {
$logs = get_records_select("log", "time > '$timestart' AND course = '$course->id' AND
module = 'course' AND action = 'enrol'", "time ASC");
if ($logs) {
foreach ($logs as $key => $log) {
if (! $heading) {
print_headline(get_string("newusers").":");
$heading = true;
@@ -323,23 +345,32 @@ function print_recent_activity($course) {
}
$user = get_record("user", "id", $log->info);
if (isstudent($course->id, $user->id)) {
echo "<P><FONT SIZE=1><A HREF=\"../user/view.php?id=$user->id&course=$course->id\">$user->firstname $user->lastname</A></FONT></P>";
echo "<p><font size=1><a href=\"../user/view.php?id=$user->id&course=$course->id\">$user->firstname $user->lastname</a></font></p>";
}
}
}
// Next, have there been any changes to the course structure?
// Next, have there been any modifications to the course structure?
foreach ($logs as $log) {
if ($log->module == "course") {
if ($log->action == "add mod" or $log->action == "update mod" or $log->action == "delete mod") {
$info = split(" ", $log->info);
$modname = get_field($info[0], "name", "id", $info[1]);
$logs = get_records_select("log", "time > '$timestart' AND course = '$course->id' AND
module = 'course' AND action LIKE '% mod'", "time ASC");
if ($logs) {
foreach ($logs as $key => $log) {
$info = split(" ", $log->info);
$modname = get_field($info[0], "name", "id", $info[1]);
//Create a temp valid module structure (course,id)
$tempmod->course = $log->course;
$tempmod->id = $info[1];
//Obtain the visible property from the instance
$modvisible = instance_is_visible($info[0],$tempmod);
//Only if the mod is visible
if ($modvisible) {
switch ($log->action) {
case "add mod":
$stradded = get_string("added", "moodle", get_string("modulename", $info[0]));
$changelist["$log->info"] = array ("operation" => "add", "text" => "$stradded:<BR><A HREF=\"$CFG->wwwroot/course/$log->url\">$modname</A>");
$stradded = get_string("added", "moodle", get_string("modulename", $info[0]));
$changelist["$log->info"] = array ("operation" => "add", "text" => "$stradded:<BR><A HREF=\"$CFG->wwwroot/course/$log->url\">$modname</A>");
break;
case "update mod":
$strupdated = get_string("updated", "moodle", get_string("modulename", $info[0]));
@@ -348,7 +379,8 @@ function print_recent_activity($course) {
}
break;
case "delete mod":
if ($changelist["$log->info"]["operation"] == "add") {
if (!empty($changelist["$log->info"]["operation"]) and
$changelist["$log->info"]["operation"] == "add") {
$changelist["$log->info"] = NULL;
} else {
$strdeleted = get_string("deletedactivity", "moodle", get_string("modulename", $info[0]));
@@ -370,30 +402,30 @@ function print_recent_activity($course) {
print_headline(get_string("courseupdates").":");
$content = true;
foreach ($changes as $changeinfo => $change) {
echo "<P><FONT SIZE=1>".$change["text"]."</FONT></P>";
echo "<p><font size=1>".$change["text"]."</font></p>";
}
}
}
// Now display new things from each module
$mods = get_list_of_plugins("mod");
foreach ($mods as $mod) {
$isteacher = isteacher($course->id);
foreach ($mods as $mod) { // Each module gets it's own logs and prints them
include_once("$CFG->dirroot/mod/$mod/lib.php");
$print_recent_activity = $mod."_print_recent_activity";
if (function_exists($print_recent_activity)) {
$modcontent = $print_recent_activity($logs, isteacher($course->id));
$modcontent = $print_recent_activity($course, $isteacher, $timestart);
if ($modcontent) {
$content = true;
}
}
}
if (! $content) {
echo "<FONT SIZE=2>".get_string("nothingnew")."</FONT>";
echo "<font size=2>".get_string("nothingnew")."</font>";
}
}
@@ -405,6 +437,7 @@ function get_array_of_activities($courseid) {
// mod - name of the module (eg forum)
// section - the number of the section (eg week or topic)
// name - the name of the instance
// visible - is the instance visible or not
$mod = array();
@@ -414,13 +447,17 @@ function get_array_of_activities($courseid) {
if ($sections = get_records("course_sections", "course", $courseid, "section ASC")) {
foreach ($sections as $section) {
if ($section->sequence) {
if (!empty($section->sequence)) {
$sequence = explode(",", $section->sequence);
foreach ($sequence as $seq) {
if (empty($rawmods[$seq])) {
continue;
}
$mod[$seq]->cm = $rawmods[$seq]->id;
$mod[$seq]->mod = $rawmods[$seq]->modname;
$mod[$seq]->section = $section->section;
$mod[$seq]->name = urlencode(get_field($rawmods[$seq]->modname, "name", "id", $rawmods[$seq]->instance));
$mod[$seq]->visible = $rawmods[$seq]->visible;
}
}
}
@@ -441,8 +478,10 @@ function get_all_mods($courseid, &$mods, &$modnames, &$modnamesplural, &$modname
if ($allmods = get_records("modules")) {
foreach ($allmods as $mod) {
$modnames[$mod->name] = get_string("modulename", "$mod->name");
$modnamesplural[$mod->name] = get_string("modulenameplural", "$mod->name");
if ($mod->visible) {
$modnames[$mod->name] = get_string("modulename", "$mod->name");
$modnamesplural[$mod->name] = get_string("modulenameplural", "$mod->name");
}
}
asort($modnames);
} else {
@@ -453,9 +492,13 @@ function get_all_mods($courseid, &$mods, &$modnames, &$modnamesplural, &$modname
foreach($rawmods as $mod) { // Index the mods
$mods[$mod->id] = $mod;
$mods[$mod->id]->modfullname = $modnames[$mod->modname];
$modnamesused[$mod->modname] = $modnames[$mod->modname];
if ($mod->visible or isteacher($courseid)) {
$modnamesused[$mod->modname] = $modnames[$mod->modname];
}
}
if ($modnamesused) {
asort($modnamesused);
}
asort($modnamesused);
}
}
@@ -463,9 +506,49 @@ function get_all_mods($courseid, &$mods, &$modnames, &$modnamesplural, &$modname
function get_all_sections($courseid) {
return get_records("course_sections", "course", "$courseid", "section",
"section, id, course, summary, sequence");
"section, id, course, summary, sequence, visible");
}
function course_set_display($courseid, $display=0) {
global $USER;
if (empty($USER)) {
return false;
}
if ($display == "all" or empty($display)) {
$display = 0;
}
if (record_exists("course_display", "userid", $USER->id, "course", $courseid)) {
set_field("course_display", "display", $display, "userid", $USER->id, "course", $courseid);
} else {
$record->userid = $USER->id;
$record->course = $courseid;
$record->display = $display;
if (!insert_record("course_display", $record)) {
notify("Could not save your course display!");
}
}
return $USER->display[$courseid] = $display; // Note: = not ==
}
function set_section_visible($courseid, $sectionnumber, $visibility) {
/// For a given course section, markes it visible or hidden,
/// and does the same for every activity in that section
if ($section = get_record("course_sections", "course", $courseid, "section", $sectionnumber)) {
set_field("course_sections", "visible", "$visibility", "id", $section->id);
if (!empty($section->sequence)) {
$modules = explode(",", $section->sequence);
foreach ($modules as $moduleid) {
set_field("course_modules", "visible", "$visibility", "id", $moduleid);
}
}
rebuild_course_cache($courseid);
}
}
function print_section_block($heading, $course, $section, $mods, $modnames, $modnamesused,
$absolute=true, $width="100%", $isediting=false) {
@@ -477,24 +560,31 @@ function print_section_block($heading, $course, $section, $mods, $modnames, $mod
$modicon = array();
$editbuttons = "";
if ($section->sequence) {
if (!empty($section->sequence)) {
$sectionmods = explode(",", $section->sequence);
foreach ($sectionmods as $modnumber) {
$mod = $mods[$modnumber];
if ($isediting) {
$editbuttons = make_editing_buttons($mod->id, $absolute);
$editbuttons = make_editing_buttons($mod->id, $absolute, $mod->visible);
}
if ($mod->visible or isteacher($course->id)) {
$instancename = urldecode($modinfo[$modnumber]->name);
if ($mod->visible) {
$link_css = "";
} else {
$link_css = " class=\"dimmed\" ";
}
$modicon[] = "<img src=\"$CFG->wwwroot/mod/$mod->modname/icon.gif\" height=\"16\" width=\"16\" alt=\"$mod->modfullname\">";
$moddata[] = "<a title=\"$mod->modfullname\" $link_css href=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">$instancename</a><BR>$editbuttons";
}
$instancename = urldecode($modinfo[$modnumber]->name);
$modicon[] = "<img src=\"$CFG->wwwroot/mod/$mod->modname/icon.gif\" height=\"16\" width=\"16\" alt=\"$mod->modfullname\">";
$moddata[] = "<a title=\"$mod->modfullname\" href=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">$instancename</a><BR>$editbuttons";
}
}
if ($isediting) {
$editmenu = popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$section->section&add=",
$modnames, "section0", "", get_string("add")."...", "mods", get_string("activities"), true);
$editmenu = "<DIV ALIGN=right>$editmenu</DIV>";
$editmenu = "<div align=right>$editmenu</div>";
} else {
$editmenu = "";
}
@@ -508,27 +598,61 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
$modinfo = unserialize($course->modinfo);
echo "<TABLE WIDTH=\"$width\"><TR><TD>\n";
if ($section->sequence) {
echo "<table width=\"$width\"><tr><td>\n";
if (!empty($section->sequence)) {
$sectionmods = explode(",", $section->sequence);
foreach ($sectionmods as $modnumber) {
if (empty($mods[$modnumber])) {
continue;
}
$mod = $mods[$modnumber];
$instancename = urldecode($modinfo[$modnumber]->name);
echo "<IMG SRC=\"$CFG->wwwroot/mod/$mod->modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"$mod->modfullname\">";
echo " <FONT SIZE=2><A TITLE=\"$mod->modfullname\"";
echo " HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">$instancename</A></FONT>";
if ($mod->visible or isteacher($course->id)) {
$instancename = urldecode($modinfo[$modnumber]->name);
if ($mod->visible) {
$link_css = "";
} else {
$link_css = " class=\"dimmed\" ";
}
echo "<img src=\"$CFG->wwwroot/mod/$mod->modname/icon.gif\" height=16 width=16 alt=\"$mod->modfullname\">";
echo " <font size=2><a title=\"$mod->modfullname\" $link_css";
echo " href=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">$instancename</a></font>";
}
if (isediting($course->id)) {
echo "&nbsp;&nbsp;";
echo make_editing_buttons($mod->id, $absolute);
echo make_editing_buttons($mod->id, $absolute, $mod->visible);
}
if ($mod->visible or isteacher($course->id)) {
echo "<br />\n";
}
echo "<BR>\n";
}
}
echo "</TD></TR></TABLE><BR>\n\n";
echo "</td></tr></table><br />\n\n";
}
function rebuild_course_cache($courseid=0) {
// Rebuilds the cached list of course activities stored in the database
// If a courseid is not specified, then all are rebuilt
if ($courseid) {
$select = "id = '$courseid'";
} else {
$select = "";
}
if ($courses = get_records_select("course", $select)) {
foreach ($courses as $course) {
$modinfo = serialize(get_array_of_activities($course->id));
if (!set_field("course", "modinfo", $modinfo, "id", $course->id)) {
notify("Could not cache module information for course '$course->fullname'!");
}
}
}
}
function print_heading_block($heading, $width="100%", $class="headingblock") {
global $THEME;
@@ -589,91 +713,120 @@ function print_side_block_start($heading="", $width=180, $class="sideblockmain")
function print_side_block_end() {
echo "</td></tr>";
echo "</table><br \>";
echo "</table><br />";
}
function print_admin_links ($siteid, $width=180) {
global $CFG;
global $CFG, $THEME;
$icon = "<IMG SRC=\"$CFG->wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/config.php\">".get_string("configvariables")."</A>";
$modicon[]=$icon;
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/site.php\">".get_string("sitesettings")."</A>";
$modicon[]=$icon;
$moddata[]="<A HREF=\"$CFG->wwwroot/course/log.php?id=$siteid\">".get_string("sitelogs")."</A>";
$modicon[]=$icon;
$moddata[]="<A HREF=\"$CFG->wwwroot/theme/index.php\">".get_string("choosetheme")."</A>";
$modicon[]=$icon;
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/lang.php\">".get_string("checklanguage")."</A>";
$modicon[]=$icon;
if (file_exists("$CFG->dirroot/admin/$CFG->dbtype")) {
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/$CFG->dbtype/frame.php\">".get_string("managedatabase")."</A>";
$modicon[]=$icon;
if (empty($THEME->custompix)) {
$icon = "<img src=\"$CFG->wwwroot/pix/i/settings.gif\" height=16 width=16 alt=\"\">";
} else {
$icon = "<img src=\"$CFG->wwwroot/theme/$CFG->theme/pix/i/settings.gif\" height=16 width=16 alt=\"\">";
}
if (isadmin()) {
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/config.php\">".get_string("configvariables")."</a>";
$modicon[]=$icon;
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/site.php\">".get_string("sitesettings")."</a>";
$modicon[]=$icon;
$moddata[]="<a href=\"$CFG->wwwroot/course/log.php?id=$siteid\">".get_string("sitelogs")."</a>";
$modicon[]=$icon;
$moddata[]="<a href=\"$CFG->wwwroot/theme/index.php\">".get_string("choosetheme")."</a>";
$modicon[]=$icon;
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/lang.php\">".get_string("checklanguage")."</a>";
$modicon[]=$icon;
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/modules.php\">".get_string("managemodules")."</a>";
$modicon[]=$icon;
if (file_exists("$CFG->dirroot/$CFG->admin/$CFG->dbtype")) {
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/$CFG->dbtype/frame.php\">".get_string("managedatabase")."</a>";
$modicon[]=$icon;
}
$moddata[]="<hr>";
$modicon[]="";
}
if (iscreator()) {
$moddata[]="<a href=\"$CFG->wwwroot/course/edit.php\">".get_string("addnewcourse")."</a>";
$modicon[]=$icon;
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/teacher.php\">".get_string("assignteachers")."</a>";
$modicon[]=$icon;
$fulladmin = "";
}
if (isadmin()) {
$moddata[]="<a href=\"$CFG->wwwroot/course/categories.php\">".get_string("categories")."</a>";
$modicon[]=$icon;
$moddata[]="<a href=\"$CFG->wwwroot/course/delete.php\">".get_string("deletecourse")."</a>";
$modicon[]=$icon;
$moddata[]="<hr>";
$modicon[]="";
if($CFG->auth == "email" || $CFG->auth == "none" || $CFG->auth == "manual"){
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/user.php?newuser=true\">".get_string("addnewuser")."</a>";
$modicon[]=$icon;
}
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/user.php\">".get_string("edituser")."</a>";
$modicon[]=$icon;
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/admin.php\">".get_string("assignadmins")."</a>";
$modicon[]=$icon;
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/creators.php\">".get_string("assigncreators")."</a>";
$modicon[]=$icon;
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/auth.php\">".get_string("authentication")."</a>";
$modicon[]=$icon;
$fulladmin = "<p><a href=\"$CFG->wwwroot/$CFG->admin/\">".get_string("admin")."</a>...";
}
$moddata[]="<HR>";
$modicon[]="";
$moddata[]="<A HREF=\"$CFG->wwwroot/course/edit.php\">".get_string("addnewcourse")."</A>";
$modicon[]=$icon;
$moddata[]="<A HREF=\"$CFG->wwwroot/course/categories.php\">".get_string("categories")."</A>";
$modicon[]=$icon;
$moddata[]="<A HREF=\"$CFG->wwwroot/course/teacher.php\">".get_string("assignteachers")."</A>";
$modicon[]=$icon;
$moddata[]="<A HREF=\"$CFG->wwwroot/course/delete.php\">".get_string("deletecourse")."</A>";
$modicon[]=$icon;
$moddata[]="<HR>";
$modicon[]="";
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/user.php?newuser=true\">".get_string("addnewuser")."</A>";
$modicon[]=$icon;
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/user.php\">".get_string("edituser")."</A>";
$modicon[]=$icon;
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/admin.php\">".get_string("assignadmins")."</A>";
$modicon[]=$icon;
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/auth.php\">".get_string("authentication")."</A>";
$modicon[]=$icon;
$fulladmin = "<P><A HREF=\"$CFG->wwwroot/admin/\">".get_string("admin")."</A>...";
print_side_block(get_string("administration"), "", $moddata, $modicon, $fulladmin, $width);
echo "<IMG SRC=\"$CFG->wwwroot/pix/spacer.gif\" WIDTH=\"$width\" HEIGHT=1><BR>";
echo "<img src=\"$CFG->wwwroot/pix/spacer.gif\" width=\"$width\" height=1><br>";
}
function print_course_admin_links($course, $width=180) {
global $USER, $CFG;
global $USER, $CFG, $THEME;
if (isguest()) {
return true;
}
if (empty($THEME->custompix)) {
$pixpath = "$CFG->wwwroot/pix";
$modpixpath = "$CFG->wwwroot/mod";
} else {
$pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix";
$modpixpath = "$CFG->wwwroot/theme/$CFG->theme/pix/mod";
}
if (isteacher($course->id)) {
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/edit.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$adminicon[]="<img src=\"$pixpath/i/edit.gif\" height=16 width=16 alt=\"\">";
if (isediting($course->id)) {
$admindata[]="<A HREF=\"view.php?id=$course->id&edit=off\">".get_string("turneditingoff")."</A>";
$admindata[]="<a href=\"view.php?id=$course->id&edit=off\">".get_string("turneditingoff")."</a>";
} else {
$admindata[]="<A HREF=\"view.php?id=$course->id&edit=on\">".get_string("turneditingon")."</A>";
$admindata[]="<a href=\"view.php?id=$course->id&edit=on\">".get_string("turneditingon")."</a>";
}
$admindata[]="<A HREF=\"edit.php?id=$course->id\">".get_string("settings")."...</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$admindata[]="<a href=\"edit.php?id=$course->id\">".get_string("settings")."...</a>";
$adminicon[]="<img src=\"$pixpath/i/settings.gif\" height=16 width=16 alt=\"\">";
if (!$course->teachers) {
$course->teachers = get_string("defaultcourseteachers");
}
$admindata[]="<A HREF=\"teachers.php?id=$course->id\">$course->teachers...</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$admindata[]="<a href=\"teachers.php?id=$course->id\">$course->teachers...</a>";
$adminicon[]="<img src=\"$pixpath/i/settings.gif\" height=16 width=16 alt=\"\">";
$admindata[]="<A HREF=\"grades.php?id=$course->id\">".get_string("grades")."...</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/grades.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$admindata[]="<a href=\"grades.php?id=$course->id\">".get_string("grades")."...</a>";
$adminicon[]="<img src=\"$pixpath/i/grades.gif\" height=16 width=16 alt=\"\">";
$admindata[]="<A HREF=\"log.php?id=$course->id\">".get_string("logs")."...</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/log.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$admindata[]="<A HREF=\"$CFG->wwwroot/files/index.php?id=$course->id\">".get_string("files")."...</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/files/pix/files.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$admindata[]="<a href=\"log.php?id=$course->id\">".get_string("logs")."...</a>";
$adminicon[]="<img src=\"$pixpath/i/log.gif\" height=16 width=16 alt=\"\">";
$admindata[]="<a href=\"$CFG->wwwroot/files/index.php?id=$course->id\">".get_string("files")."...</a>";
$adminicon[]="<img src=\"$pixpath/i/files.gif\" height=16 width=16 alt=\"\">";
$admindata[]="<A HREF=\"$CFG->wwwroot/doc/view.php?id=$course->id&file=teacher.html\">".get_string("help")."...</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/mod/resource/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$admindata[]="<a href=\"$CFG->wwwroot/doc/view.php?id=$course->id&file=teacher.html\">".get_string("help")."...</a>";
$adminicon[]="<img src=\"$modpixpath/resource/icon.gif\" height=16 width=16 alt=\"\">";
if ($teacherforum = forum_get_course_forum($course->id, "teacher")) {
$admindata[]="<A HREF=\"$CFG->wwwroot/mod/forum/view.php?f=$teacherforum->id\">".get_string("nameteacher", "forum")."</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/mod/forum/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$admindata[]="<a href=\"$CFG->wwwroot/mod/forum/view.php?f=$teacherforum->id\">".get_string("nameteacher", "forum")."</a>";
$adminicon[]="<img src=\"$modpixpath/forum/icon.gif\" height=16 width=16 alt=\"\">";
}
} else {
$admindata[]="<A HREF=\"grade.php?id=$course->id\">".get_string("grades")."...</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/grades.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$admindata[]="<a href=\"grade.php?id=$course->id\">".get_string("grades")."...</a>";
$adminicon[]="<img src=\"$pixpath/i/grades.gif\" height=16 width=16 alt=\"\">";
}
print_side_block(get_string("administration"), "", $admindata, $adminicon, "", $width);
@@ -685,53 +838,59 @@ function print_course_categories($categories, $selected="none", $width=180) {
$strallowguests = get_string("allowguests");
$strrequireskey = get_string("requireskey");
if (empty($THEME->custompix)) {
$pixpath = "$CFG->wwwroot/pix";
} else {
$pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix";
}
if ($selected == "index") { // Print comprehensive index of categories with courses
if ($courses = get_courses()) {
if (isset($USER->id) and !isadmin()) {
print_simple_box_start("CENTER", "100%", $THEME->cellheading);
print_heading("<A HREF=\"course/index.php?category=my\">".get_string("mycourses")."</A>", "LEFT");
print_heading("<a href=\"course/index.php?category=my\">".get_string("mycourses")."</a>", "left");
$some = false;
echo "<UL>";
echo "<ul>";
foreach ($courses as $key => $course) {
if (isteacher($course->id) or isstudent($course->id)) {
echo "<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</A>";
echo "<BR>";
echo "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</a>";
echo "<br />";
$some = true;
}
}
if (!$some) {
print_string("nocoursesyet");
}
echo "</UL>";
echo "</ul>";
print_simple_box_end();
print_spacer(8,1);
}
foreach ($categories as $category) {
print_simple_box_start("CENTER", "100%");
print_heading("<A HREF=\"course/index.php?category=$category->id\">$category->name</A>", "LEFT");
print_heading("<a href=\"course/index.php?category=$category->id\">$category->name</a>", "left");
$some = false;
echo "<UL>";
echo "<ul>";
foreach ($courses as $key => $course) {
if ($course->category == $category->id) {
echo "<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</A>";
echo "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</a>";
echo "&nbsp;&nbsp;";
unset($courses[$key]);
if ($course->guest ) {
echo "<A TITLE=\"$strallowguests\" HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
echo "<IMG ALT=\"\" HEIGHT=16 WIDTH=16 BORDER=0 SRC=\"$CFG->wwwroot/user/user.gif\"></A>";
echo "<a title=\"$strallowguests\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
echo "<img alt=\"\" height=16 width=16 border=0 src=\"$pixpath/i/user.gif\"></a>";
}
if ($course->password) {
echo "<A TITLE=\"$strrequireskey\" HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
echo "<IMG ALT=\"\" HEIGHT=16 WIDTH=16 BORDER=0 SRC=\"$CFG->wwwroot/pix/i/key.gif\"></A>";
echo "<a title=\"$strrequireskey\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
echo "<img alt=\"\" height=16 width=16 border=0 src=\"$pixpath/i/key.gif\"></a>";
}
echo "<BR>";
echo "<br />";
$some = true;
}
}
if (!$some) {
print_string("nocoursesyet");
}
echo "</UL>";
echo "</ul>";
print_simple_box_end();
print_spacer(8,1);
}
@@ -739,18 +898,20 @@ function print_course_categories($categories, $selected="none", $width=180) {
} else { // Print short list of categories only
foreach ($categories as $cat) {
$caticon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/course.gif\" HEIGHT=16 WIDTH=16>";
$caticon[]="<img src=\"$pixpath/i/course.gif\" height=16 width=16>";
if ($cat->id == $selected) {
$catdata[]="$cat->name";
} else {
$catdata[]="<A HREF=\"$CFG->wwwroot/course/index.php?category=$cat->id\">$cat->name</A>";
$catdata[]="<a href=\"$CFG->wwwroot/course/index.php?category=$cat->id\">$cat->name</a>";
}
}
$catdata[] = "<A HREF=\"$CFG->wwwroot/course/index.php?category=all\">".get_string("fulllistofcourses")."</A>";
$catdata[] = "<a href=\"$CFG->wwwroot/course/index.php?category=all\">".get_string("fulllistofcourses")."</a>";
$caticon[] = "";
if (isset($USER->id)) {
$catdata[] = "<A HREF=\"$CFG->wwwroot/course/index.php?category=my\">".get_string("mycourses")."</A>";
$catdata[] = "<a href=\"$CFG->wwwroot/course/index.php?category=my\">".get_string("mycourses")."</a>";
$caticon[] = "";
}
print_side_block(get_string("categories"), "", $catdata, $caticon, $showall.$mine, $width);
print_side_block(get_string("categories"), "", $catdata, $caticon, "", $width);
}
}
@@ -780,7 +941,7 @@ function add_mod_to_section($mod) {
GLOBAL $db;
if ($section = get_record("course_sections", "course", "$mod->course", "section", "$mod->section")) {
if ($section->sequence) {
if (!empty($section->sequence)) {
$newsequence = "$section->sequence,$mod->coursemodule";
} else {
$newsequence = "$mod->coursemodule";
@@ -800,6 +961,14 @@ function add_mod_to_section($mod) {
}
}
function hide_course_module($mod) {
return set_field("course_modules", "visible", 0, "id", $mod);
}
function show_course_module($mod) {
return set_field("course_modules", "visible", 1, "id", $mod);
}
function delete_course_module($mod) {
return set_field("course_modules", "deleted", 1, "id", $mod);
}
@@ -866,7 +1035,7 @@ function move_module($cm, $move) {
error("Previous section ($prevsection->id) doesn't exist");
}
if ($prevsection->sequence) {
if (!empty($prevsection->sequence)) {
$newsequence = "$prevsection->sequence,$cm->id";
} else {
$newsequence = "$cm->id";
@@ -908,7 +1077,7 @@ function move_module($cm, $move) {
if ($nextsection = get_record("course_sections", "course", "$thissection->course",
"section", "$nextsectionnumber")) {
if ($nextsection->sequence) {
if (!empty($nextsection->sequence)) {
$newsequence = "$cm->id,$nextsection->sequence";
} else {
$newsequence = "$cm->id";
@@ -947,27 +1116,46 @@ function move_module($cm, $move) {
}
}
function make_editing_buttons($moduleid, $absolute=false) {
global $CFG;
function make_editing_buttons($moduleid, $absolute=false, $visible=true, $str=NULL) {
global $CFG, $THEME;
$delete = get_string("delete");
$moveup = get_string("moveup");
$movedown = get_string("movedown");
$update = get_string("update");
if (empty($str)) {
$str->delete = get_string("delete");
$str->moveup = get_string("moveup");
$str->movedown = get_string("movedown");
$str->update = get_string("update");
$str->hide = get_string("hide");
$str->show = get_string("show");
}
if ($absolute) {
$path = "$CFG->wwwroot/course/";
$path = "$CFG->wwwroot/course";
} else {
$path = "";
$path = ".";
}
return "<A TITLE=\"$delete\" HREF=\"".$path."mod.php?delete=$moduleid\"><IMG
SRC=".$path."../pix/t/delete.gif BORDER=0></A>
<A TITLE=\"$moveup\" HREF=\"".$path."mod.php?id=$moduleid&move=-1\"><IMG
SRC=".$path."../pix/t/up.gif BORDER=0></A>
<A TITLE=\"$movedown\" HREF=\"".$path."mod.php?id=$moduleid&move=1\"><IMG
SRC=".$path."../pix/t/down.gif BORDER=0></A>
<A TITLE=\"$update\" HREF=\"".$path."mod.php?update=$moduleid\"><IMG
SRC=".$path."../pix/t/edit.gif BORDER=0></A>";
if (empty($THEME->custompix)) {
$pixpath = "$path/../pix";
} else {
$pixpath = "$path/../theme/$CFG->theme/pix";
}
if ($visible) {
$hideshow = " <a title=\"$str->hide\" href=\"$path/mod.php?hide=$moduleid\"><img
src=\"$pixpath/t/hide.gif\" hspace=2 height=11 width=11 border=0></a>";
} else {
$hideshow = " <a title=\"$str->show\" href=\"$path/mod.php?show=$moduleid\"><img
src=\"$pixpath/t/show.gif\" hspace=2 height=11 width=11 border=0></a>";
}
return "<a title=\"$str->delete\" href=\"$path/mod.php?delete=$moduleid\"><img
src=\"$pixpath/t/delete.gif\" height=11 width=11 border=0></a>
<a title=\"$str->moveup\" href=\"$path/mod.php?id=$moduleid&move=-1\"><img
src=\"$pixpath/t/up.gif\" height=11 width=11 border=0></a>
<a title=\"$str->movedown\" href=\"$path/mod.php?id=$moduleid&move=1\"><img
src=\"$pixpath/t/down.gif\" height=11 width=11 border=0></a>
<a title=\"$str->update\" href=\"$path/mod.php?update=$moduleid\"><img
src=\"$pixpath/t/edit.gif\" height=11 width=11 border=0></a> $hideshow";
}
?>
+4 -4
View File
@@ -8,7 +8,7 @@
optional_variable($user, 0); // User to display
optional_variable($date, 0); // Date to display
require_login($id);
require_login();
if (! $course = get_record("course", "id", $id) ) {
error("That's an invalid course id");
@@ -40,7 +40,7 @@
$userinfo = "$u->firstname $u->lastname";
}
if ($date) {
$dateinfo = userdate($date, "%A, %d %B %Y");
$dateinfo = userdate($date, get_string("strftimedaydate"));
}
if ($course->category) {
@@ -49,7 +49,7 @@
<A HREF=\"log.php?id=$course->id\">$strlogs</A> -> $userinfo, $dateinfo", "");
} else {
print_header("$course->shortname: $strlogs", "$course->fullname",
"<A HREF=\"$CFG->wwwroot/admin/\">$stradministration</A> ->
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A> ->
<A HREF=\"log.php?id=$course->id\">$strlogs</A> -> $userinfo, $dateinfo", "");
}
@@ -65,7 +65,7 @@
"<A HREF=\"view.php?id=$course->id\">$course->shortname</A> -> $strlogs", "");
} else {
print_header("$course->shortname: $strlogs", "$course->fullname",
"<A HREF=\"$CFG->wwwroot/admin/\">$stradministration</A> -> $strlogs", "");
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A> -> $strlogs", "");
}
print_heading(get_string("chooselogs").":");
+3 -3
View File
@@ -34,9 +34,9 @@
switch ($type) {
case "usercourse.png":
$COURSE_MAX_LOG_DISPLAY = $COURSE_MAX_LOG_DISPLAY * 3600 * 24; // seconds
if ($timenow - $course->startdate > $COURSE_MAX_LOG_DISPLAY) {
$course->startdate = $timenow - $COURSE_MAX_LOG_DISPLAY;
$maxseconds = COURSE_MAX_LOG_DISPLAY * 3600 * 24; // seconds
if ($timenow - $course->startdate > $maxseconds) {
$course->startdate = $timenow - $maxseconds;
}
$timestart = $coursestart = usergetmidnight($course->startdate);
-2
View File
@@ -18,7 +18,6 @@
$USER = get_user_info_from_db("id", $USER->realuser);
$USER->loggedin = true;
$USER->site = $CFG->wwwroot;
save_session("USER");
redirect($_SERVER["HTTP_REFERER"]);
exit;
}
@@ -42,7 +41,6 @@
$USER->loggedin = true;
$USER->site = $CFG->wwwroot;
$USER->realuser = $teacher_id;
save_session("USER");
set_moodle_cookie($USER->username);
$student_name = "$USER->firstname $USER->lastname";
+5 -3
View File
@@ -4,7 +4,9 @@
require_once("../config.php");
require_once("lib.php");
require_login($id);
require_variable($id);
require_login();
if (! $course = get_record("course", "id", $id) ) {
error("That's an invalid course id");
@@ -15,10 +17,10 @@
}
$strlivelogs = get_string("livelogs");
$strupdatesevery = get_string("updatesevery", "moodle", $COURSE_LIVELOG_REFRESH);
$strupdatesevery = get_string("updatesevery", "moodle", COURSE_LIVELOG_REFRESH);
print_header("$strlivelogs ($strupdatesevery)", "$strlivelogs", "", "",
"<META HTTP-EQUIV='Refresh' CONTENT='$COURSE_LIVELOG_REFRESH; URL=loglive.php?id=$id'>");
"<META HTTP-EQUIV='Refresh' CONTENT='".COURSE_LIVELOG_REFRESH."; URL=loglive.php?id=$id'>");
$user=0;
$date=time() - 3600;
+80 -22
View File
@@ -5,11 +5,12 @@
require("../config.php");
require("lib.php");
require_login();
if (isset($cancel)) {
if (!empty($SESSION->returnpage)) {
$return = $SESSION->returnpage;
unset($SESSION->returnpage);
save_session("SESSION");
redirect($return);
} else {
redirect("view.php?id=$mod->course");
@@ -22,13 +23,10 @@
if (isset($SESSION->modform)) { // Variables are stored in the session
$mod = $SESSION->modform;
unset($SESSION->modform);
save_session("SESSION");
} else {
$mod = (object)$_POST;
}
require_login($mod->course);
if (!isteacher($mod->course)) {
error("You can't modify this course!");
}
@@ -48,7 +46,9 @@
if (! $updateinstancefunction($mod)) {
error("Could not update the $mod->modulename");
}
add_to_log($mod->course, "course", "update mod", "../mod/$mod->modulename/view.php?id=$mod->coursemodule", "$mod->modulename $mod->instance");
add_to_log($mod->course, "course", "update mod",
"../mod/$mod->modulename/view.php?id=$mod->coursemodule",
"$mod->modulename $mod->instance");
break;
case "add":
@@ -67,7 +67,9 @@
if (! set_field("course_modules", "section", $sectionid, "id", $mod->coursemodule)) {
error("Could not update the course module with the correct section");
}
add_to_log($mod->course, "course", "add mod", "../mod/$mod->modulename/view.php?id=$mod->coursemodule", "$mod->modulename $mod->instance");
add_to_log($mod->course, "course", "add mod",
"../mod/$mod->modulename/view.php?id=$mod->coursemodule",
"$mod->modulename $mod->instance");
break;
case "delete":
if (! $deleteinstancefunction($mod->instance)) {
@@ -79,22 +81,20 @@
if (! delete_mod_from_section($mod->coursemodule, "$mod->section")) {
notify("Could not delete the $mod->modulename from that section");
}
add_to_log($mod->course, "course", "delete mod", "view.php?id=$mod->course", "$mod->modulename $mod->instance");
add_to_log($mod->course, "course", "delete mod",
"view.php?id=$mod->course",
"$mod->modulename $mod->instance");
break;
default:
error("No mode defined");
}
$modinfo = serialize(get_array_of_activities($mod->course));
if (!set_field("course", "modinfo", $modinfo, "id", $mod->course)) {
error("Could not cache module information!");
}
rebuild_course_cache($mod->course);
if (!empty($SESSION->returnpage)) {
$return = $SESSION->returnpage;
unset($SESSION->returnpage);
save_session("SESSION");
redirect($return);
} else {
redirect("view.php?id=$mod->course");
@@ -110,15 +110,75 @@
if (! $cm = get_record("course_modules", "id", $id)) {
error("This course module doesn't exist");
}
if (!isteacher($cm->course)) {
error("You can't modify this course!");
}
move_module($cm, $move);
$modinfo = serialize(get_array_of_activities($cm->course));
if (!set_field("course", "modinfo", $modinfo, "id", $cm->course)) {
error("Could not cache module information!");
rebuild_course_cache($cm->course);
$site = get_site();
if ($site->id == $cm->course) {
redirect($CFG->wwwroot);
} else {
redirect("view.php?id=$cm->course");
}
exit;
} else if (isset($hide)) {
if (! $cm = get_record("course_modules", "id", $hide)) {
error("This course module doesn't exist");
}
redirect($_SERVER["HTTP_REFERER"]);
if (!isteacher($cm->course)) {
error("You can't modify this course!");
}
hide_course_module($cm->id);
rebuild_course_cache($cm->course);
$site = get_site();
if ($site->id == $cm->course) {
redirect($CFG->wwwroot);
} else {
redirect("view.php?id=$cm->course");
}
exit;
} else if (isset($show)) {
if (! $cm = get_record("course_modules", "id", $show)) {
error("This course module doesn't exist");
}
if (!isteacher($cm->course)) {
error("You can't modify this course!");
}
if (! $section = get_record("course_sections", "id", $cm->section)) {
error("This module doesn't exist");
}
if (! $module = get_record("modules", "id", $cm->module)) {
error("This module doesn't exist");
}
$site = get_site();
if ($module->visible and ($section->visible or ($site->id == $cm->course))) {
show_course_module($cm->id);
rebuild_course_cache($cm->course);
}
if ($site->id == $cm->course) {
redirect($CFG->wwwroot);
} else {
redirect("view.php?id=$cm->course");
}
exit;
} else if (isset($delete)) { // value = course module
@@ -131,8 +191,6 @@
error("This course doesn't exist");
}
require_login($course->id);
if (!isteacher($course->id)) {
error("You can't modify this course!");
}
@@ -178,6 +236,10 @@
error("This course doesn't exist");
}
if (!isteacher($course->id)) {
error("You can't modify this course!");
}
if (! $module = get_record("modules", "id", $cm->module)) {
error("This module doesn't exist");
}
@@ -192,7 +254,6 @@
if (isset($return)) {
$SESSION->returnpage = "$CFG->wwwroot/mod/$module->name/view.php?id=$cm->id";
save_session("SESSION");
}
$form->coursemodule = $cm->id;
@@ -256,8 +317,6 @@
error("No action was specfied");
}
require_login($course->id);
if (!isteacher($course->id)) {
error("You can't modify this course!");
}
@@ -276,7 +335,6 @@
}
unset($SESSION->modform); // Clear any old ones that may be hanging around.
save_session("SESSION");
$modform = "../mod/$module->name/mod.html";
+23 -19
View File
@@ -1,4 +1,4 @@
<? // $Id$
<?php // $Id$
// social.php - course format featuring social forum
// included from view.php
@@ -8,20 +8,20 @@
$leftwidth = 210;
?>
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
<TR>
<TD WIDTH="<?=$leftwidth?>" VALIGN="TOP">
<?
$moddata[]="<A TITLE=\"".get_string("listofallpeople")."\" HREF=\"../user/index.php?id=$course->id\">".get_string("participants")."</A>";
$modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$editmyprofile = "<A TITLE=\"$USER->firstname $USER->lastname\" HREF=\"../user/view.php?id=$USER->id&course=$course->id\">".
<table width="100%" border="0" cellspacing="5" cellpadding="5">
<tr>
<td width="<?php echo $leftwidth?>" valign="top">
<?php
$moddata[]="<a title=\"".get_string("listofallpeople")."\" href=\"../user/index.php?id=$course->id\">".get_string("participants")."</a>";
$modicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
$editmyprofile = "<a title=\"$USER->firstname $USER->lastname\" href=\"../user/edit.php?id=$USER->id&course=$course->id\">".
get_string("editmyprofile")."</A>";
if ($USER->description) {
$moddata[]= $editmyprofile;
} else {
$moddata[]= $editmyprofile." <BLINK>*</BLINK>";
$moddata[]= $editmyprofile." <blink>*</blink>";
}
$modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$modicon[]="<img src=\"$pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
print_side_block(get_string("people"), "", $moddata, $modicon, "", $leftwidth);
@@ -42,32 +42,36 @@
/// Print a form to search forums
$searchform = forum_print_search_form($course, "", true);
$searchform = "<DIV ALIGN=\"CENTER\">$searchform</DIV>";
$searchform = "<div align=\"center\">$searchform</div>";
print_side_block(get_string("search","forum"), $searchform, "", "", "", $leftwidth);
/// Admin links and controls
print_course_admin_links($course);
echo "</TD>";
echo "</td>";
echo "<TD WIDTH=\"*\" VALIGN=\"TOP\">";
echo "<td width=\"*\" valign=\"top\">";
if ($social = forum_get_course_forum($course->id, "social")) {
if (forum_is_subscribed($USER->id, $social->id)) {
$subtext = get_string("unsubscribe", "forum");
} else {
$subtext = get_string("subscribe", "forum");
}
$headertext = "<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR><TD>".get_string("socialheadline")."</TD><TD ALIGN=RIGHT><FONT SIZE=1><A HREF=\"../mod/forum/subscribe.php?id=$social->id\">$subtext</A></TD></TR></TABLE>";
$headertext = "<table border=0 width=100% cellpadding=0 cellspacing=0><tr><td>".
get_string("socialheadline").
"</td><td align=right><font size=1>".
"<a href=\"../mod/forum/subscribe.php?id=$social->id\">$subtext</a></td>".
"</tr></table>";
print_heading_block($headertext);
echo "<IMG ALT=\"\" HEIGHT=7 SRC=\"../pix/spacer.gif\"><BR>";
echo "<img alt=\"\" height=7 src=\"../pix/spacer.gif\"><br>";
forum_print_latest_discussions($social->id, 10, "plain", "DESC", false);
forum_print_latest_discussions($social->id, 10, "plain", "", false);
} else {
notify("Could not find or create a social forum here");
}
?>
</TD>
</TR>
</TABLE>
</td>
</tr>
</table>
-188
View File
@@ -1,188 +0,0 @@
<?PHP // $Id$
// Admin-only script to assign teachers to courses
require_once("../config.php");
require_once("../user/lib.php");
optional_variable($id); // course id
if (! $site = get_site()) {
redirect("$CFG->wwwroot/admin/");
}
require_login();
if (!isadmin()) {
error("You must be an administrator to use this page.");
}
$strassignteachers = get_string("assignteachers");
$stradministration = get_string("administration");
$strexistingteachers = get_string("existingteachers");
$strnoexistingteachers = get_string("noexistingteachers");
$strpotentialteachers = get_string("potentialteachers");
$strnopotentialteachers = get_string("nopotentialteachers");
$straddteacher = get_string("addteacher");
$strremoveteacher = get_string("removeteacher");
$strsearch = get_string("search");
$strsearchagain = get_string("searchagain");
$strtoomanytoshow = get_string("toomanytoshow");
if (!$id) {
print_header("$site->shortname: $strassignteachers", "$site->fullname",
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> -> $strassignteachers");
if ($courses = get_courses()) {
print_heading(get_string("choosecourse"));
print_simple_box_start("CENTER");
foreach ($courses as $course) {
echo "<A HREF=\"teacher.php?id=$course->id\">$course->fullname</A><BR>";
}
print_simple_box_end();
} else {
print_heading(get_string("nocoursesyet"));
print_continue("$CFG->wwwroot/admin/");
}
print_footer();
exit;
}
if (! $course = get_record("course", "id", $id)) {
error("Course ID was incorrect (can't find it)");
}
print_header("$site->shortname: $course->shortname: $strassignteachers",
"$site->fullname",
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> ->
<A HREF=\"teacher.php\">$strassignteachers</A> ->
$course->shortname", "");
print_heading("<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</A>");
/// Get all existing teachers for this course.
$teachers = get_course_teachers($course->id);
/// Add a teacher if one is specified
if (!empty($add)) {
if (! $user = get_record("user", "id", $add)) {
error("That teacher (id = $add) doesn't exist", "teacher.php?id=$course->id");
}
if (!empty($teachers)) {
foreach ($teachers as $tt) {
if ($tt->id == $user->id) {
error("That user is already a teacher for this course.", "teacher.php?id=$course->id");
}
}
}
$teacher->userid = $user->id;
$teacher->course = $course->id;
if (!empty($teachers)) {
$teacher->authority = 2;
} else {
$teacher->authority = 1; // First teacher is the main teacher
}
$teacher->id = insert_record("user_teachers", $teacher);
if (empty($teacher->id)) {
error("Could not add that teacher to this course!");
}
$teachers[] = $user;
}
/// Remove a teacher if one is specified.
if (!empty($remove)) {
if (! $user = get_record("user", "id", $remove)) {
error("That teacher (id = $remove) doesn't exist", "teacher.php?id=$course->id");
}
if (!empty($teachers)) {
foreach ($teachers as $key => $tt) {
if ($tt->id == $user->id) {
remove_teacher($user->id, $course->id);
unset($teachers[$key]);
}
}
}
}
/// Print the lists of existing and potential teachers
echo "<TABLE CELLPADDING=2 CELLSPACING=10 ALIGN=CENTER>";
echo "<TR><TH WIDTH=50%>$strexistingteachers</TH><TH WIDTH=50%>$strpotentialteachers</TH></TR>";
echo "<TR><TD WIDTH=50% NOWRAP VALIGN=TOP>";
/// First, show existing teachers for this course
if (empty($teachers)) {
echo "<P ALIGN=CENTER>$strnoexistingteachers</A>";
} else {
foreach ($teachers as $teacher) {
echo "<P ALIGN=right>$teacher->firstname $teacher->lastname, $teacher->email &nbsp;&nbsp; <A HREF=\"teacher.php?id=$course->id&remove=$teacher->id\" TITLE=\"$strremoveteacher\"><IMG SRC=\"../pix/t/right.gif\" BORDER=0></A></P>";
}
}
echo "<TD WIDTH=50% NOWRAP VALIGN=TOP>";
/// Print list of potential teachers
if (!empty($search)) {
$users = get_users_search($search);
} else {
$users = get_users_confirmed();
}
if (!empty($users)) {
foreach ($users as $user) { // Remove users who are already teachers
if (!empty($teachers)) {
foreach ($teachers as $teacher) {
if ($teacher->id == $user->id) {
continue 2;
}
}
}
$potential[] = $user;
}
}
if (empty($potential)) {
echo "<P ALIGN=CENTER>$strnopotentialteachers</A>";
if ($search) {
echo "<FORM ACTION=teacher.php METHOD=GET>";
echo "<INPUT TYPE=hidden NAME=id VALUE=\"$course->id\">";
echo "<INPUT TYPE=text NAME=search SIZE=20>";
echo "<INPUT TYPE=submit VALUE=\"$strsearchagain\">";
echo "</FORM>";
}
} else {
if (!empty($search)) {
echo "<P ALIGN=CENTER>($strsearchresults)</P>";
}
if (count($potential) <= 20) {
foreach ($potential as $user) {
echo "<P ALIGN=LEFT><A HREF=\"teacher.php?id=$course->id&add=$user->id\" TITLE=\"$straddteacher\"><IMG SRC=\"../pix/t/left.gif\" BORDER=0></A>&nbsp;&nbsp;$user->firstname $user->lastname, $user->email";
}
} else {
echo "<P ALIGN=CENTER>There are too many users to show.<BR>";
echo "Enter a search word here.";
echo "<FORM ACTION=teacher.php METHOD=GET>";
echo "<INPUT TYPE=hidden NAME=id VALUE=\"$course->id\">";
echo "<INPUT TYPE=text NAME=search SIZE=20>";
echo "<INPUT TYPE=submit VALUE=\"$strsearch\">";
echo "</FORM>";
}
}
echo "</TR></TABLE>";
print_footer();
?>
+2 -2
View File
@@ -6,12 +6,12 @@
require_variable($id); // course id
require_login();
if (! $course = get_record("course", "id", $id)) {
error("Course ID was incorrect");
}
require_login($course->id);
if (!isteacher($course->id)) {
error("Only teachers can edit the course!");
}
+125 -85
View File
@@ -9,12 +9,13 @@
require_once("$CFG->dirroot/mod/forum/lib.php");
if (isset($topic)) {
if ($topic == "all") {
unset($USER->topic);
$displaysection = course_set_display($course->id, $topic);
} else {
if (isset($USER->display[$course->id])) { // for admins, mostly
$displaysection = $USER->display[$course->id];
} else {
$USER->topic = $topic;
$displaysection = course_set_display($course->id, 0);
}
save_session("USER");
}
if (isteacher($course->id) and isset($marker)) {
@@ -31,25 +32,33 @@
$streditsummary = get_string("editsummary");
$stradd = get_string("add");
$stractivities = get_string("activities");
$strshowalltopics = get_string("showalltopics");
if (isediting($course->id)) {
$strstudents = moodle_strtolower($course->students);
$strtopichide = get_string("topichide", "", $strstudents);
$strtopicshow = get_string("topicshow", "", $strstudents);
$strmarkthistopic = get_string("markthistopic");
$strmarkedthistopic = get_string("markedthistopic");
}
/// Layout the whole page as three big columns.
echo "<TABLE BORDER=0 CELLPADDING=3 CELLSPACING=0 WIDTH=100%>";
echo "<table border=0 cellpadding=3 cellspacing=0 width=100%>";
/// The left column ...
echo "<TR VALIGN=top><TD VALIGN=top WIDTH=180>";
echo "<tr valign=top><td valign=top width=180>";
/// Links to people
$moddata[]="<A TITLE=\"".get_string("listofallpeople")."\" HREF=\"../user/index.php?id=$course->id\">".get_string("participants")."</A>";
$modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$editmyprofile = "<A TITLE=\"$USER->firstname $USER->lastname\" HREF=\"../user/view.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile")."</A>";
$moddata[]="<a title=\"".get_string("listofallpeople")."\" href=\"../user/index.php?id=$course->id\">".get_string("participants")."</a>";
$modicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
$editmyprofile = "<a title=\"$USER->firstname $USER->lastname\" href=\"../user/edit.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile")."</a>";
if ($USER->description) {
$moddata[]= $editmyprofile;
} else {
$moddata[]= $editmyprofile." <BLINK>*</BLINK>";
$moddata[]= $editmyprofile." <blink>*</blink>";
}
$modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$modicon[]="<img src=\"$pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
print_side_block(get_string("people"), "", $moddata, $modicon);
@@ -58,22 +67,22 @@
$modicon = array();
if ($modnamesused) {
foreach ($modnamesused as $modname => $modfullname) {
$moddata[] = "<A HREF=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</A>";
$modicon[] = "<IMG SRC=\"../mod/$modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$moddata[] = "<a href=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</a>";
$modicon[] = "<img src=\"$modpixpath/$modname/icon.gif\" height=16 width=16 alt=\"\">";
}
}
print_side_block($stractivities, "", $moddata, $modicon);
/// Print a form to search forums
$searchform = forum_print_search_form($course, "", true);
$searchform = "<DIV ALIGN=\"CENTER\">$searchform</DIV>";
$searchform = "<div align=\"center\">$searchform</div>";
print_side_block(get_string("search","forum"), $searchform);
/// Admin links and controls
print_course_admin_links($course);
/// Start main column
echo "</TD><TD WIDTH=\"*\">";
echo "</td><td width=\"*\">";
print_heading_block(get_string("topicoutline"), "100%", "outlineheadingblock");
print_spacer(8, 1, true);
@@ -82,36 +91,35 @@
/// Print Section 0
$topic = 0;
$thistopic = $sections[$topic];
$section = 0;
$thissection = $sections[$section];
if ($thistopic->summary or $thistopic->sequence or isediting($course->id)) {
echo "<TR>";
echo "<TD NOWRAP BGCOLOR=\"$THEME->cellheading\" class=\"topicsoutlineside\" VALIGN=top WIDTH=20>&nbsp;</TD>";
echo "<TD VALIGN=top BGCOLOR=\"$THEME->cellcontent\" class=\"topicsoutlinecontent\" WIDTH=\"100%\">";
if ($thissection->summary or $thissection->sequence or isediting($course->id)) {
echo "<tr>";
echo "<td nowrap bgcolor=\"$THEME->cellheading\" class=\"topicsoutlineside\" valign=top width=20>&nbsp;</td>";
echo "<td valign=top bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontent\" width=\"100%\">";
if (isediting($course->id)) {
$thistopic->summary .= "&nbsp;<A TITLE=\"$streditsummary\" ".
"HREF=\"editsection.php?id=$thistopic->id\"><IMG SRC=\"../pix/t/edit.gif\" ".
"BORDER=0 ALT=\"$streditsummary\"></A></P>";
$thissection->summary .= " <a title=\"$streditsummary\" ".
"href=\"editsection.php?id=$thissection->id\"><img src=\"$pixpath/t/edit.gif\" ".
"height=11 width=11 border=0 alt=\"$streditsummary\"></a></p>";
}
echo text_to_html($thistopic->summary);
echo text_to_html($thissection->summary);
print_section($course, $thistopic, $mods, $modnamesused);
print_section($course, $thissection, $mods, $modnamesused);
if (isediting($course->id)) {
echo "<DIV ALIGN=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$topic&add=",
$modnames, "section$topic", "", "$stradd...", "mods", $stractivities);
echo "</DIV>";
echo "<div align=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$section&add=",
$modnames, "section$section", "", "$stradd...", "mods", $stractivities);
echo "</div>";
}
echo "</TD>";
echo "<TD NOWRAP BGCOLOR=\"$THEME->cellheading\" class=\"topicsoutlineside\" VALIGN=top ALIGN=CENTER WIDTH=10>&nbsp;";
echo "</TD>";
echo "</TR>";
echo "<TR><TD COLSPAN=3><IMG SRC=\"../pix/spacer.gif\" WIDTH=1 HEIGHT=1></TD></TR>";
echo "</td>";
echo "<td nowrap bgcolor=\"$THEME->cellheading\" class=\"topicsoutlineside\" valign=top align=center width=10>";
echo "&nbsp;</td></tr>";
echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
}
@@ -123,16 +131,31 @@
while ($section <= $course->numsections) {
if (isset($USER->topic)) { // Just display a single topic
if ($USER->topic != $section) {
$section++;
continue;
if (!empty($displaysection) and $displaysection != $section) {
$section++;
continue;
}
if (!empty($sections[$section])) {
$thissection = $sections[$section];
} else {
unset($thissection);
$thissection->course = $course->id; // Create a new section structure
$thissection->section = $section;
$thissection->summary = "";
$thissection->visible = 1;
if (!$thissection->id = insert_record("course_sections", $thissection)) {
notify("Error inserting new topic!");
}
}
$currenttopic = ($course->marker == $section);
if ($currenttopic) {
if (!$thissection->visible) {
$colorsides = "bgcolor=\"$THEME->hidden\" class=\"topicsoutlinesidehidden\"";
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontenthidden\"";
} else if ($currenttopic) {
$colorsides = "bgcolor=\"$THEME->cellheading2\" class=\"topicsoutlinesidehighlight\"";
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontenthighlight\"";
} else {
@@ -140,70 +163,87 @@
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontent\"";
}
echo "<TR>";
echo "<TD NOWRAP $colorsides VALIGN=top WIDTH=20>";
echo "<P ALIGN=CENTER><FONT SIZE=3><B>$section</B></FONT></P>";
echo "</TD>";
echo "<tr>";
echo "<td nowrap $colorsides valign=top width=20>";
echo "<p align=center><font size=3><b>$section</b></font></p>";
echo "</td>";
if (!isteacher($course->id) and !$thissection->visible) { // Hidden for students
echo "<td valign=top align=center $colormain width=\"100%\">";
echo get_string("notavailable");
echo "</td>";
echo "<TD VALIGN=top $colormain WIDTH=\"100%\">";
} else {
echo "<td valign=top $colormain width=\"100%\">";
if (! $thissection = $sections[$section]) {
$thissection->course = $course->id; // Create a new section structure
$thissection->section = $section;
$thissection->summary = "";
if (!$thissection->id = insert_record("course_sections", $thissection)) {
notify("Error inserting new topic!");
if (isediting($course->id)) {
$thissection->summary .= " <a title=\"$streditsummary\" href=editsection.php?id=$thissection->id>".
"<img src=\"$pixpath/t/edit.gif\" border=0 height=11 width=11></a>";
}
echo text_to_html($thissection->summary);
print_section($course, $thissection, $mods, $modnamesused);
if (isediting($course->id)) {
echo "<div align=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$section&add=",
$modnames, "section$section", "", "$stradd...");
echo "</div>";
}
echo "</td>";
}
echo "<td nowrap $colorsides valign=top align=center width=10>";
echo "<font size=1>";
if (isediting($course->id)) {
$thissection->summary .= "&nbsp;<A HREF=editsection.php?id=$thissection->id><IMG SRC=\"../pix/t/edit.gif\" BORDER=0 ALT=\"$streditsummary\"></A>";
}
echo text_to_html($thissection->summary);
print_section($course, $thissection, $mods, $modnamesused);
if (isediting($course->id)) {
echo "<DIV ALIGN=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$section&add=",
$modnames, "section$section", "", "$stradd...", "mods", $stractivities);
echo "</DIV>";
}
echo "</TD>";
echo "<TD NOWRAP $colorsides VALIGN=top ALIGN=CENTER WIDTH=10>";
echo "<FONT SIZE=1>";
if (isset($USER->topic)) {
$strshowalltopics = get_string("showalltopics");
echo "<A HREF=\"view.php?id=$course->id&topic=all\" TITLE=\"$strshowalltopics\"><IMG SRC=../pix/i/all.gif BORDER=0></A><BR><BR>";
if ($displaysection == $section) { // Show the zoom boxes
echo "<a href=\"view.php?id=$course->id&topic=all\" title=\"$strshowalltopics\">".
"<img src=\"$pixpath/i/all.gif\" height=25 width=16 border=0></a><br />";
} else {
$strshowonlytopic = get_string("showonlytopic", "", $section);
echo "<A HREF=\"view.php?id=$course->id&topic=$section\" TITLE=\"$strshowonlytopic\"><IMG SRC=../pix/i/one.gif BORDER=0></A><BR><BR>";
echo "<a href=\"view.php?id=$course->id&topic=$section\" title=\"$strshowonlytopic\">".
"<img src=\"$pixpath/i/one.gif\" height=16 width=16 border=0></a><br />";
}
if (isediting($course->id) and $course->marker != $section) {
$strmarkthistopic = get_string("markthistopic");
echo "<A HREF=\"view.php?id=$course->id&marker=$section\" TITLE=\"$strmarkthistopic\"><IMG SRC=../pix/i/marker.gif BORDER=0></A><BR><BR>";
if (isediting($course->id)) {
if ($course->marker == $section) { // Show the "light globe" on/off
echo "<a href=\"view.php?id=$course->id&marker=0\" title=\"$strmarkedthistopic\">".
"<img src=\"$pixpath/i/marked.gif\" vspace=3 height=16 width=16 border=0></a><br />";
} else {
echo "<a href=\"view.php?id=$course->id&marker=$section\" title=\"$strmarkthistopic\">".
"<img src=\"$pixpath/i/marker.gif\" vspace=3 height=16 width=16 border=0></a><br />";
}
if ($thissection->visible) { // Show the hide/show eye
echo "<a href=\"view.php?id=$course->id&hide=$section\" title=\"$strtopichide\">".
"<img src=\"$pixpath/i/hide.gif\" vspace=3 height=16 width=16 border=0></a><br />";
} else {
echo "<a href=\"view.php?id=$course->id&show=$section\" title=\"$strtopicshow\">".
"<img src=\"$pixpath/i/show.gif\" vspace=3 height=16 width=16 border=0></a><br />";
}
}
echo "</TD>";
echo "</TR>";
echo "<TR><TD COLSPAN=3><IMG SRC=\"../pix/spacer.gif\" WIDTH=1 HEIGHT=1></TD></TR>";
echo "</td>";
echo "</tr>";
echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
$section++;
}
echo "</TABLE>";
echo "</table>";
if ($news or $course->showrecent) {
echo "</TD><TD WIDTH=210>";
echo "</td><td width=210>";
/// Print all the news items.
if ($news) {
print_side_block_start(get_string("latestnews"), 210, "sideblocklatestnews");
echo "<FONT SIZE=\"-2\">";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
echo "</FONT>";
echo "<font size=\"-2\">";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "", false);
echo "</font>";
print_side_block_end();
}
@@ -217,6 +257,6 @@
print_spacer(1, 120, true);
}
echo "</TD></TR></TABLE>\n";
echo "</td></tr></table>\n";
?>
-1
View File
@@ -34,7 +34,6 @@
if ($user->id == $USER->id) {
unset($USER->student["$id"]);
save_session("USER");
redirect("$CFG->wwwroot");
}
+16 -13
View File
@@ -5,27 +5,26 @@
require_once("../config.php");
require_once("lib.php");
$modes = array("outline", "complete", "todaylogs", "alllogs");
require_variable($id); // course id
require_variable($user); // user id
optional_variable($mode, "outline");
$modes = array("outline", "complete", "todaylogs", "alllogs");
require_login();
if (! $course = get_record("course", "id", $id)) {
error("Course id is incorrect.");
}
require_login($course->id);
if (!isteacher($course->id)) {
error("You are not allowed to look at this page");
}
if (! $user = get_record("user", "id", $user)) {
error("User ID is incorrect");
}
if (!isteacher($course->id) and $user->id != $USER->id ) {
error("You are not allowed to look at this page");
}
add_to_log($course->id, "course", "user report", "user.php?id=$course->id&user=$user->id&mode=$mode", "$user->id");
$stractivityreport = get_string("activityreport");
@@ -49,17 +48,18 @@
}
print_heading("$user->firstname $user->lastname");
echo "<TABLE CELLPADDING=10 ALIGN=CENTER><TR>";
echo "<TD>Reports: </TD>";
echo "<table cellpadding=10 align=center><tr>";
echo "<td>reports: </td>";
foreach ($modes as $listmode) {
$strmode = get_string($listmode);
if ($mode == $listmode) {
echo "<TD><U>$strmode</U></TD>";
echo "<td><u>$strmode</u></td>";
} else {
echo "<TD><A HREF=user.php?id=$course->id&user=$user->id&mode=$listmode>$strmode</A></TD>";
echo "<td><a href=user.php?id=$course->id&user=$user->id&mode=$listmode>$strmode</a></td>";
}
}
echo "</TR></TABLE>";
echo "</tr></table>";
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);
@@ -107,6 +107,9 @@
$sectionmods = explode(",", $section->sequence);
foreach ($sectionmods as $sectionmod) {
if (empty($mods[$sectionmod])) {
continue;
}
$mod = $mods[$sectionmod];
$instance = get_record("$mod->modname", "id", "$mod->instance");
$libfile = "$CFG->dirroot/mod/$mod->modname/lib.php";
@@ -175,7 +178,7 @@ function print_outline_row($mod, $instance, $result) {
echo "<TD>&nbsp;&nbsp;&nbsp;</TD>";
if (isset($result->time)) {
$timeago = format_time(time() - $result->time);
echo "<TD VALIGN=top NOWRAP>".userdate($result->time)." ($timeago ago)</TD>";
echo "<TD VALIGN=top NOWRAP>".userdate($result->time)." ($timeago)</TD>";
}
echo "</TR>";
}
+31 -20
View File
@@ -22,54 +22,65 @@
}
}
require_login($id);
require_login($course->id);
add_to_log($course->id, "course", "view", "view.php?id=$course->id", "$course->id");
if (isset($edit)) {
if (isteacher($course->id)) {
if (isteacher($course->id)) {
if (isset($edit)) {
if ($edit == "on") {
$USER->editing = true;
} else if ($edit == "off") {
$USER->editing = false;
}
save_session("USER");
}
if (isset($hide)) {
set_section_visible($course->id, $hide, "0");
}
if (isset($show)) {
set_section_visible($course->id, $show, "1");
}
}
if (isset($help)) {
if ($help == "on") {
$USER->help = true;
} else if ($help == "off") {
$USER->help = false;
}
save_session("USER");
}
$SESSION->fromdiscussion = "$CFG->wwwroot/course/view.php?id=$course->id";
save_session("SESSION");
if (! $course->category) { // This course is not a real course.
redirect("$CFG->wwwroot/");
}
if (empty($THEME->custompix)) {
$pixpath = "../pix";
$modpixpath = "../mod";
} else {
$pixpath = "../theme/$CFG->theme/pix";
$modpixpath = "../theme/$CFG->theme/pix/mod";
}
$courseword = get_string("course");
$loggedinas = "<p class=\"logininfo\">".user_login_string($course, $USER)."</p>";
print_header("$courseword: $course->fullname", "$course->fullname", "$course->shortname", "search.search", "", true,
update_course_icon($course->id));
update_course_icon($course->id), $loggedinas);
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);
if (! $sections = get_all_sections($course->id)) {
$section->course = $course->id; // Create a default section.
$section->section = 0;
$section->id = insert_record("course_sections", $section);
if (! $sections = get_all_sections($course->id) ) {
if (! $sections = get_all_sections($course->id)) { // No sections found
// Double-check to be extra sure
if (! $section = get_record("course_sections", "course", $course->id, "section", 0)) {
$section->course = $course->id; // Create a default section.
$section->section = 0;
$section->visible = 1;
$section->id = insert_record("course_sections", $section);
}
if (! $sections = get_all_sections($course->id) ) { // Try again
error("Error finding or creating section structures for this course");
}
}
switch ($course->format) {
case "weeks":
include("weeks.php");
+137 -100
View File
@@ -6,40 +6,47 @@
if (isset($week)) {
if ($week == "all") {
unset($USER->section);
$displaysection = course_set_display($course->id, $week);
} else {
if (isset($USER->display[$course->id])) {
$displaysection = $USER->display[$course->id];
} else {
$USER->section = $week;
$displaysection = course_set_display($course->id, 0);
}
save_session("USER");
}
if ($course->newsitems) {
$news = forum_get_course_forum($course->id, "news");
}
$streditsummary = get_string("editsummary");
$stradd = get_string("add");
$stractivities = get_string("activities");
$streditsummary = get_string("editsummary");
$stradd = get_string("add");
$stractivities = get_string("activities");
$strshowallweeks = get_string("showallweeks");
if (isediting($course->id)) {
$strstudents = moodle_strtolower($course->students);
$strweekhide = get_string("weekhide", "", $strstudents);
$strweekshow = get_string("weekshow", "", $strstudents);
}
/// Layout the whole page as three big columns.
echo "<TABLE BORDER=0 CELLPADDING=3 CELLSPACING=0 WIDTH=100%>";
echo "<table border=0 cellpadding=3 cellspacing=0 width=100%>";
/// The left column ...
echo "<TR VALIGN=top><TD VALIGN=top WIDTH=180>";
echo "<tr valign=top><td valign=top width=180>";
/// Links to people
$moddata[]="<A TITLE=\"".get_string("listofallpeople")."\" HREF=\"../user/index.php?id=$course->id\">".get_string("participants")."</A>";
$modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$editmyprofile = "<A TITLE=\"$USER->firstname $USER->lastname\" HREF=\"../user/view.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile")."</A>";
$moddata[]="<a title=\"".get_string("listofallpeople")."\" href=\"../user/index.php?id=$course->id\">".get_string("participants")."</a>";
$modicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
$editmyprofile = "<a title=\"$USER->firstname $USER->lastname\" href=\"../user/edit.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile")."</a>";
if ($USER->description) {
$moddata[]= $editmyprofile;
} else {
$moddata[]= $editmyprofile." <BLINK>*</BLINK>";
$moddata[]= $editmyprofile." <blink>*</blink>";
}
$modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$modicon[]="<img src=\"$pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
print_side_block(get_string("people"), "", $moddata, $modicon);
@@ -48,15 +55,15 @@
$modicon = array();
if ($modnamesused) {
foreach ($modnamesused as $modname => $modfullname) {
$moddata[] = "<A HREF=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</A>";
$modicon[] = "<IMG SRC=\"../mod/$modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$moddata[] = "<a href=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</a>";
$modicon[] = "<img src=\"$modpixpath/$modname/icon.gif\" height=16 width=16 alt=\"\">";
}
}
print_side_block($stractivities, "", $moddata, $modicon);
/// Print a form to search forums
$searchform = forum_print_search_form($course, "", true);
$searchform = "<DIV ALIGN=\"CENTER\">$searchform</DIV>";
$searchform = "<div align=\"center\">$searchform</div>";
print_side_block(get_string("search","forum"), $searchform);
@@ -65,72 +72,87 @@
/// Start main column
echo "</TD><TD WIDTH=\"*\">";
echo "</td><td width=\"*\">";
print_heading_block(get_string("weeklyoutline"), "100%", "outlineheadingblock");
print_spacer(8, 1, true);
echo "<table class=\"weeklyoutline\" border=\"0\" cellpadding=\"8\" cellspacing=\"0\" width=\"100%\">";
/// Print Week 0 with general activities
/// Print Section 0 with general activities
$week = 0;
$thisweek = $sections[$week];
$section = 0;
$thissection = $sections[$section];
if ($thisweek->summary or $thisweek->sequence or isediting($course->id)) {
echo "<TR>";
echo "<TD NOWRAP BGCOLOR=\"$THEME->cellheading\" class=\"weeklyoutlineside\" VALIGN=top WIDTH=20>&nbsp;</TD>";
echo "<TD VALIGN=top BGCOLOR=\"$THEME->cellcontent\" class=\"weeklyoutlinecontent\" WIDTH=\"100%\">";
if ($thissection->summary or $thissection->sequence or isediting($course->id)) {
echo "<tr>";
echo "<td nowrap bgcolor=\"$THEME->cellheading\" class=\"weeklyoutlineside\" valign=top width=20>&nbsp;</td>";
echo "<td valign=top bgcolor=\"$THEME->cellcontent\" class=\"weeklyoutlinecontent\" width=\"100%\">";
if (isediting($course->id)) {
$thisweek->summary .= "&nbsp;<A TITLE=\"$streditsummary\" ".
"HREF=\"editsection.php?id=$thisweek->id\"><IMG SRC=\"../pix/t/edit.gif\" ".
"BORDER=0 ALT=\"$streditsummary\"></A></P>";
$thissection->summary .= " <a title=\"$streditsummary\" ".
"href=\"editsection.php?id=$thissection->id\"><img height=11 width=11 src=\"$pixpath/t/edit.gif\" ".
"border=0 alt=\"$streditsummary\"></a></p>";
}
echo text_to_html($thisweek->summary);
echo text_to_html($thissection->summary);
print_section($course, $thisweek, $mods, $modnamesused);
print_section($course, $thissection, $mods, $modnamesused);
if (isediting($course->id)) {
echo "<DIV ALIGN=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$week&add=",
$modnames, "section$week", "", "$stradd...", "mods", $stractivities);
echo "</DIV>";
echo "<div align=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$section&add=",
$modnames, "section$section", "", "$stradd...", "mods", $stractivities);
echo "</div>";
}
echo "</TD>";
echo "<TD NOWRAP BGCOLOR=\"$THEME->cellheading\" class=\"weeklyoutlineside\" VALIGN=top ALIGN=CENTER WIDTH=10>";
echo "&nbsp;</TD>";
echo "</TR>";
echo "<TR><TD COLSPAN=3><IMG SRC=\"../pix/spacer.gif\" WIDTH=1 HEIGHT=1></TD></TR>";
echo "</td>";
echo "<td nowrap bgcolor=\"$THEME->cellheading\" class=\"weeklyoutlineside\" valign=top align=center width=10>";
echo "&nbsp;</td></tr>";
echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
}
/// Now all the weekly sections
$timenow = time();
$weekdate = $course->startdate; // this should be 0:00 Monday of that week
$week = 1;
$section = 1;
$weekofseconds = 604800;
$course->enddate = $course->startdate + ($weekofseconds * $course->numsections);
$strftimedateshort = " ".get_string("strftimedateshort");
while ($weekdate < $course->enddate) {
$nextweekdate = $weekdate + ($weekofseconds);
$weekday = userdate($weekdate, $strftimedateshort);
$endweekday = userdate($weekdate+518400, $strftimedateshort);
if (isset($USER->section)) { // Just display a single week
if ($USER->section != $week) {
$week++;
$weekdate = $nextweekdate;
continue;
if (!empty($displaysection) and $displaysection != $section) { // Check this week is visible
$section++;
$weekdate = $nextweekdate;
continue;
}
if (!empty($sections[$section])) {
$thissection = $sections[$section];
} else {
unset($thissection);
$thissection->course = $course->id; // Create a new week structure
$thissection->section = $section;
$thissection->summary = "";
$thissection->visible = 1;
if (!$thissection->id = insert_record("course_sections", $thissection)) {
notify("Error inserting new week!");
}
}
$thisweek = (($weekdate <= $timenow) && ($timenow < $nextweekdate));
$currentweek = (($weekdate <= $timenow) && ($timenow < $nextweekdate));
$weekday = userdate($weekdate, " %d %B");
$endweekday = userdate($weekdate+518400, " %d %B");
if ($thisweek) {
if (!$thissection->visible) {
$colorsides = "bgcolor=\"$THEME->hidden\" class=\"weeklyoutlinesidehidden\"";
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"weeklyoutlinecontenthidden\"";
} else if ($currentweek) {
$colorsides = "bgcolor=\"$THEME->cellheading2\" class=\"weeklyoutlinesidehighlight\"";
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"weeklyoutlinecontenthighlight\"";
} else {
@@ -138,72 +160,87 @@
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"weeklyoutlinecontent\"";
}
echo "<TR>";
echo "<TD NOWRAP $colorsides VALIGN=top WIDTH=20>";
echo "<P ALIGN=CENTER><FONT SIZE=3><B>$week</B></FONT></P>";
echo "</TD>";
echo "<tr>";
echo "<td nowrap $colorsides valign=top width=20>";
echo "<p align=center><font size=3><b>$section</b></font></p>";
echo "</td>";
echo "<TD $colormain VALIGN=top WIDTH=\"100%\">";
echo "<P><FONT SIZE=3 COLOR=\"$THEME->cellheading2\">$weekday - $endweekday</FONT></P>";
echo "<td valign=top $colormain width=\"100%\">";
if (! $thisweek = $sections[$week]) {
$thisweek->course = $course->id; // Create a new week structure
$thisweek->section = $week;
$thisweek->summary = "";
if (!$thisweek->id = insert_record("course_sections", $thisweek)) {
notify("Error inserting new week!");
if (!isteacher($course->id) and !$thissection->visible) { // Hidden for students
echo "<p class=\"weeklydatetext\">$weekday - $endweekday ";
echo "(".get_string("notavailable").")";
echo "</p>";
echo "</td>";
} else {
echo "<p class=\"weeklydatetext\">$weekday - $endweekday</p>";
if (isediting($course->id)) {
$thissection->summary .= " <a title=\"$streditsummary\" href=\"editsection.php?id=$thissection->id\">".
"<img src=\"$pixpath/t/edit.gif\" height=11 width=11 border=0></a></p>";
}
echo text_to_html($thissection->summary);
print_section($course, $thissection, $mods, $modnamesused);
if (isediting($course->id)) {
echo "<div align=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$section&add=",
$modnames, "section$section", "", "$stradd...");
echo "</div>";
}
echo "</td>";
}
echo "<td nowrap $colorsides valign=top align=center width=10>";
echo "<font size=1>";
if ($displaysection == $section) {
echo "<a href=\"view.php?id=$course->id&week=all\" title=\"$strshowallweeks\">".
"<img src=\"$pixpath/i/all.gif\" height=25 width=16 border=0></a><br />";
} else {
$strshowonlyweek = get_string("showonlyweek", "", $section);
echo "<a href=\"view.php?id=$course->id&week=$section\" title=\"$strshowonlyweek\">".
"<img src=\"$pixpath/i/one.gif\" height=16 width=16 border=0></a><br />";
}
if (isediting($course->id)) {
if ($thissection->visible) { // Show the hide/show eye
echo "<a href=\"view.php?id=$course->id&hide=$section\" title=\"$strweekhide\">".
"<img src=\"$pixpath/i/hide.gif\" vspace=3 height=16 width=16 border=0></a><br />";
} else {
echo "<a href=\"view.php?id=$course->id&show=$section\" title=\"$strweekshow\">".
"<img src=\"$pixpath/i/show.gif\" vspace=3 height=16 width=16 border=0></a><br />";
}
}
if (isediting($course->id)) {
$thisweek->summary .= "&nbsp;<A TITLE=\"$streditsummary\" HREF=\"editsection.php?id=$thisweek->id\"><IMG SRC=\"../pix/t/edit.gif\" BORDER=0 ALT=\"$streditsummary\"></A></P>";
}
echo "</td>";
echo "</tr>";
echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
echo text_to_html($thisweek->summary);
print_section($course, $thisweek, $mods, $modnamesused);
if (isediting($course->id)) {
echo "<DIV ALIGN=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$week&add=",
$modnames, "section$week", "", "$stradd...");
echo "</DIV>";
}
echo "</TD>";
echo "<TD NOWRAP $colorsides VALIGN=top ALIGN=CENTER WIDTH=10>";
echo "<FONT SIZE=1>";
if (isset($USER->section)) {
$strshowallweeks = get_string("showallweeks");
echo "<A HREF=\"view.php?id=$course->id&week=all\" TITLE=\"$strshowallweeks\"><IMG SRC=../pix/i/all.gif BORDER=0></A></FONT>";
} else {
$strshowonlyweek = get_string("showonlyweek", "", $week);
echo "<A HREF=\"view.php?id=$course->id&week=$week\" TITLE=\"$strshowonlyweek\"><IMG SRC=../pix/i/one.gif BORDER=0></A></FONT>";
}
echo "</TD>";
echo "</TR>";
echo "<TR><TD COLSPAN=3><IMG SRC=\"../pix/spacer.gif\" WIDTH=1 HEIGHT=1></TD></TR>";
$week++;
$section++;
$weekdate = $nextweekdate;
}
echo "</TABLE>";
echo "</table>";
if ($news or $course->showrecent) {
echo "</TD><TD WIDTH=210>";
if (!empty($news) or !empty($course->showrecent)) {
echo "</td><td width=210>";
// Print all the news items.
if ($news) {
if (!empty($news)) {
print_side_block_start(get_string("latestnews"), 210, "sideblocklatestnews");
echo "<FONT SIZE=\"-2\">";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
echo "</FONT>";
echo "<font size=\"-2\">";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "", false);
echo "</font>";
print_side_block_end();
}
// Print all the recent activity
if ($course->showrecent) {
if (!empty($course->showrecent)) {
print_side_block_start(get_string("recentactivity"), 210, "sideblockrecentactivity");
print_recent_activity($course);
print_side_block_end();
@@ -212,6 +249,6 @@
print_spacer(1, 120, true);
}
echo "</TD></TR></TABLE>\n";
echo "</td></tr></table>\n";
?>
+1 -2
View File
@@ -8,8 +8,7 @@
optional_variable($lang, ""); // override current language
if (!empty($lang)) {
$SESSION->doclang = $lang;
save_session("SESSION");
$SESSION->lang = $lang;
}
if (!empty($sub)) {
+4 -5
View File
@@ -2,15 +2,14 @@
require("../config.php");
if (!empty($SESSION->doclang)) {
$currlang = $SESSION->doclang;
if (empty($CFG->langmenu)) {
$langmenu = "";
} else {
$currlang = current_language();
$langs = get_list_of_languages();
$langmenu = popup_form ("$CFG->wwwroot/doc/?lang=", $langs, "chooselang", $currlang, "", "", "", true);
}
$langs = get_list_of_languages();
$langmenu = popup_form ("$CFG->wwwroot/doc/?lang=", $langs, "chooselang", $currlang, "", "", "", true);
if (! $site = get_site()) {
error("Site is misconfigured");
}
+8 -6
View File
@@ -8,14 +8,16 @@
$lifetime = 86400;
if (isset($file)) { // workaround for situations where / syntax doesn't work
$PATH_INFO = $file;
$pathinfo = $file;
} else {
$pathinfo = get_slash_arguments("file.php");
}
if (!$PATH_INFO) {
error("This script DEPENDS on PATH_INFO being available. Read the README.");
if (!$pathinfo) {
error("No file parameters!");
}
if (! $args = get_slash_arguments()) {
if (! $args = parse_slash_arguments($pathinfo)) {
error("No valid arguments supplied");
}
@@ -30,7 +32,7 @@
// it's OK to get here if no course was specified
$pathname = "$CFG->dataroot$PATH_INFO";
$pathname = "$CFG->dataroot$pathinfo";
$filename = $args[$numargs-1];
$mimetype = mimeinfo("type", $filename);
@@ -47,7 +49,7 @@
header("Content-type: $mimetype");
readfile("$pathname");
} else {
error("Sorry, but the file you are looking for was not found", "course/view.php?id=$courseid");
error("Sorry, but the file you are looking for was not found ($pathname)", "course/view.php?id=$courseid");
}
exit;
+144 -29
View File
@@ -24,14 +24,6 @@
error("Only teachers can edit files");
}
if (!$CFG->zip) {
$CFG->zip = "/usr/bin/zip";
}
if (!$CFG->unzip) {
$CFG->unzip = "/usr/bin/unzip";
}
function html_footer() {
global $course;
echo "</td></tr></table></body></html>";
@@ -105,6 +97,7 @@
if ($userfile_name) {
$newfile = "$basedir$wdir/$userfile_name";
if (move_uploaded_file($userfile['tmp_name'], $newfile)) {
chmod($newfile, 0666);
$a = NULL;
$a->file = "$userfile_name (".$userfile['type'].")";
$a->directory = $wdir;
@@ -184,7 +177,6 @@
if ($count = setfilelist($_POST)) {
$USER->fileop = $action;
$USER->filesource = $wdir;
save_session("USER");
echo "<P align=center>$count files selected for moving. Now go to the destination and press \"Move files to here\".</P>";
}
displaydir($wdir);
@@ -247,9 +239,9 @@
if (!empty($name)) {
html_header($course, $wdir);
$name = clean_filename($name);
if (file_exists($basedir.$wdir."/".$name)) {
if (file_exists("$basedir$wdir/$name")) {
echo "Error: $name already exists!";
} else if (!mkdir($basedir.$wdir."/".$name, 0750)) {
} else if (! make_upload_directory("$course->id/$wdir/$name")) {
echo "Error: could not create $name";
}
displaydir($wdir);
@@ -336,13 +328,25 @@
if (!empty($name)) {
html_header($course, $wdir);
$name = clean_filename($name);
$files = "";
foreach ($USER->filelist as $file) {
$files .= basename($file);
$files .= " ";
if (empty($CFG->zip)) { // Use built-in php-based zip function
$files = array();
foreach ($USER->filelist as $file) {
$files[] = "$basedir/$wdir$file";
}
include_once('../lib/pclzip/pclzip.lib.php');
$archive = new PclZip("$basedir/$wdir/$name");
if (($list = $archive->create($files,'',"$basedir/$wdir/")) == 0) {
error($archive->errorInfo(true));
}
} else { // Use external zip program
$files = "";
foreach ($USER->filelist as $file) {
$files .= basename($file);
$files .= " ";
}
$command = "cd $basedir/$wdir ; $CFG->zip -r $name $files";
Exec($command);
}
$command = "cd $basedir/$wdir ; $CFG->zip -r $name $files";
Exec($command);
clearfilelist();
displaydir($wdir);
@@ -382,19 +386,59 @@
case "unzip":
html_header($course, $wdir);
if (!empty($file)) {
echo "<P ALIGN=CENTER>Unzipping $file:</P>";
print_simple_box_start("center");
echo "<PRE>";
$strname = get_string("name");
$strsize = get_string("size");
$strmodified = get_string("modified");
$strstatus = get_string("status");
$strok = get_string("ok");
$strunpacking = get_string("unpacking", "", $file);
echo "<P ALIGN=CENTER>$strunpacking:</P>";
$file = basename($file);
$command = "cd $basedir/$wdir ; $CFG->unzip -o $file 2>&1";
passthru($command);
echo "</PRE>";
print_simple_box_end();
if (empty($CFG->unzip)) { // Use built-in php-based unzip function
include_once('../lib/pclzip/pclzip.lib.php');
$archive = new PclZip("$basedir/$wdir/$file");
if (!$list = $archive->extract("$basedir/$wdir")) {
error($archive->errorInfo(true));
} else { // print some output
echo "<table cellpadding=\"4\" cellspacing=\"2\" border=\"0\" width=640>";
echo "<tr><th align=left>$strname</th>";
echo "<th align=right>$strsize</th>";
echo "<th align=right>$strmodified</th>";
echo "<th align=right>$strstatus</th></tr>";
foreach ($list as $item) {
echo "<tr>";
$item['filename'] = str_replace("$basedir/$wdir/", "", $item['filename']);
print_cell("left", $item['filename']);
if (! $item['folder']) {
print_cell("right", display_size($item['size']));
} else {
echo "<td>&nbsp;</td>";
}
$filedate = userdate($item['mtime'], get_string("strftimedatetime"));
print_cell("right", $filedate);
print_cell("right", $item['status']);
echo "</tr>";
}
echo "</table>";
}
} else { // Use external unzip program
print_simple_box_start("center");
echo "<PRE>";
$command = "cd $basedir/$wdir ; $CFG->unzip -o $file 2>&1";
passthru($command);
echo "</PRE>";
print_simple_box_end();
}
echo "<CENTER><FORM ACTION=index.php METHOD=get>";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
echo " <INPUT TYPE=submit VALUE=\"OK\">";
echo " <INPUT TYPE=submit VALUE=\"$strok\">";
echo "</FORM>";
echo "</CENTER>";
} else {
@@ -403,6 +447,73 @@
html_footer();
break;
case "listzip":
html_header($course, $wdir);
if (!empty($file)) {
$strname = get_string("name");
$strsize = get_string("size");
$strmodified = get_string("modified");
$strok = get_string("ok");
$strlistfiles = get_string("listfiles", "", $file);
echo "<P ALIGN=CENTER>$strlistfiles:</P>";
$file = basename($file);
include_once('../lib/pclzip/pclzip.lib.php');
$archive = new PclZip("$basedir/$wdir/$file");
if (!$list = $archive->listContent("$basedir/$wdir")) {
notify($archive->errorInfo(true));
} else {
echo "<table cellpadding=\"4\" cellspacing=\"2\" border=\"0\" width=640>";
echo "<tr><th align=left>$strname</th><th align=right>$strsize</th><th align=right>$strmodified</th></tr>";
foreach ($list as $item) {
echo "<tr>";
print_cell("left", $item['filename']);
if (! $item['folder']) {
print_cell("right", display_size($item['size']));
} else {
echo "<td>&nbsp;</td>";
}
$filedate = userdate($item['mtime'], get_string("strftimedatetime"));
print_cell("right", $filedate);
echo "</tr>";
}
echo "</table>";
}
echo "<br><center><form action=index.php method=get>";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
echo " <INPUT TYPE=submit VALUE=\"$strok\">";
echo "</FORM>";
echo "</CENTER>";
} else {
displaydir($wdir);
}
html_footer();
break;
case "restore":
html_header($course, $wdir);
if (!empty($file)) {
echo "<P ALIGN=CENTER>".get_string("youaregoingtorestorefrom")."</P>";
print_simple_box_start("center");
echo $file;
print_simple_box_end();
echo "<BR>";
//MODIFY RELATIVE PATH TO restore.php
$restore_path = "../contrib/stronk7/backup/restore.php";
//END MODIFY
notice_yesno (get_string("areyousuretorestorethis"),
$restore_path."?file=".$id.$wdir."/".$file,
"index.php?id=$id&wdir=$wdir&action=cancel");
} else {
displaydir($wdir);
}
html_footer();
break;
case "cancel";
clearfilelist();
@@ -462,7 +573,6 @@ function setfilelist($VARS) {
$USER->filelist[] = rawurldecode($val);
}
}
save_session("USER");
return $count;
}
@@ -471,7 +581,6 @@ function clearfilelist() {
$USER->filelist = array ();
$USER->fileop = "";
save_session("USER");
}
@@ -543,6 +652,8 @@ function displaydir ($wdir) {
$strrename = get_string("rename");
$stredit = get_string("edit");
$strunzip = get_string("unzip");
$strlist = get_string("list");
$strrestore= get_string("restore");
echo "<FORM ACTION=\"index.php\" METHOD=post NAME=dirform>";
@@ -623,7 +734,11 @@ function displaydir ($wdir) {
if ($icon == "text.gif" || $icon == "html.gif") {
$edittext = "<A HREF=\"index.php?id=$id&wdir=$wdir&file=$fileurl&action=edit\">$stredit</A>";
} else if ($icon == "zip.gif") {
$edittext = "<A HREF=\"index.php?id=$id&wdir=$wdir&file=$fileurl&action=unzip\">$strunzip</A>";
$edittext = "<A HREF=\"index.php?id=$id&wdir=$wdir&file=$fileurl&action=unzip\">$strunzip</A>&nbsp;";
$edittext .= "<A HREF=\"index.php?id=$id&wdir=$wdir&file=$fileurl&action=listzip\">$strlist</A> ";
if (!empty($CFG->backup_version) && isadmin()) {
$edittext .= "<A HREF=\"index.php?id=$id&wdir=$wdir&file=$filesafe&action=restore\">$strrestore</A> ";
}
} else {
$edittext = "";
}
@@ -654,7 +769,7 @@ function displaydir ($wdir) {
echo "</FORM>";
echo "<TD ALIGN=center>";
if (($USER->fileop == "move") && $USER->filesource <> $wdir) {
if (!empty($USER->fileop) and ($USER->fileop == "move") and ($USER->filesource <> $wdir)) {
echo "<FORM ACTION=index.php METHOD=get>";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\">";
+5 -3
View File
@@ -4,6 +4,7 @@ function mimeinfo($element, $filename) {
$mimeinfo = array (
"xxx" => array ("type"=>"document/unknown", "icon"=>"unknown.gif"),
"zip" => array ("type"=>"application/zip", "icon"=>"zip.gif"),
"jpe" => array ("type"=>"image/jpeg", "icon"=>"image.gif"),
"jpeg" => array ("type"=>"image/jpeg", "icon"=>"image.gif"),
"jpg" => array ("type"=>"image/jpeg", "icon"=>"image.gif"),
"gif" => array ("type"=>"image/gif", "icon"=>"image.gif"),
@@ -16,18 +17,19 @@ function mimeinfo($element, $filename) {
"wav" => array ("type"=>"audio/wav", "icon"=>"audio.gif"),
"mp3" => array ("type"=>"audio/mp3", "icon"=>"audio.gif"),
"au" => array ("type"=>"audio/au", "icon"=>"audio.gif"),
"swf" => array ("type"=>"application/x-shockwave-flash", "icon"=>"image.gif"),
"swf" => array ("type"=>"application/x-shockwave-flash", "icon"=>"flash.gif"),
"pdf" => array ("type"=>"application/pdf", "icon"=>"pdf.gif"),
"doc" => array ("type"=>"application/msword", "icon"=>"word.gif"),
"ppt" => array ("type"=>"application/vnd.ms-powerpoint", "icon"=>"powerpoint.gif"),
"xls" => array ("type"=>"application/vnd.ms-excel", "icon"=>"excel.gif")
"xls" => array ("type"=>"application/vnd.ms-excel", "icon"=>"excel.gif"),
"avi" => array ("type"=>"video/x-ms-wm", "icon"=>"avi.gif")
);
if (eregi("\.([a-z0-9]+)$", $filename, $match)) {
$result = $mimeinfo[strtolower($match[1])][$element];
}
if ($result) {
if (!empty($result)) {
return $result;
} else {
return $mimeinfo["xxx"][$element]; // By default
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 910 B

After

Width:  |  Height:  |  Size: 159 B

+7 -7
View File
@@ -14,8 +14,8 @@
print_header();
if (ereg("\\.\\.", $file)) {
error("Filenames can not contain \"..\"");
if (detect_munged_arguments("$module/$file")) {
error("Filenames contain illegal characters!");
}
if ($file) {
@@ -28,7 +28,7 @@
if (file_exists("$filepath")) {
require_once("$filepath"); // Chosen language
} else { // Fall back to English
} else { // Fall back to English
if ($module == "moodle") {
$filepath = "$CFG->dirroot/lang/en/help/$file";
} else {
@@ -43,13 +43,13 @@
}
}
} else {
echo "<P>";
echo "<p>";
echo $text;
echo "</P>";
echo "</p>";
}
close_window_button();
?>
</BODY>
</HTML>
</body>
</html>
+42 -29
View File
@@ -14,17 +14,25 @@
if (moodle_needs_upgrading()) {
redirect("$CFG->wwwroot/admin/index.php");
}
$headerbutton = update_course_icon($site->id);
} else {
if (isset($USER->id)) {
$headerbutton = "<FONT SIZE=2><A HREF=\"$CFG->wwwroot/login/logout.php\">".get_string("logout")."</A></FONT>";
} else {
$headerbutton = "<FONT SIZE=2><A HREF=\"$CFG->wwwroot/login/index.php\">".get_string("login")."</A></FONT>";
}
}
if (empty($USER->id)) {
$loginstring = "<font size=2><a href=\"$CFG->wwwroot/login/index.php\">".get_string("login")."</a></font>";
} else {
$loginstring = "<font size=1>".user_login_string($site)."</font>";
}
if (empty($CFG->langmenu)) {
$langmenu = "";
} else {
$currlang = current_language();
$langs = get_list_of_languages();
$langmenu = popup_form ("$CFG->wwwroot/?lang=", $langs, "chooselang", $currlang, "", "", "", true);
}
print_header("$site->fullname", "$site->fullname", "home", "",
"<META NAME=\"Description\" CONTENT=\"".stripslashes(strip_tags($site->summary))."\">",
true, "", $headerbutton);
"<meta name=\"description\" content=\"".s(strip_tags($site->summary))."\">",
true, "", "<div align=right>$loginstring$langmenu</div>");
$firstcolumn = false; // for now
$side = 175;
@@ -32,14 +40,14 @@
?>
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
<TR>
<table width="100%" border="0" cellspacing="5" cellpadding="5">
<tr>
<?PHP
$sections = get_all_sections($site->id);
if ($site->newsitems > 0 or $sections[0]->sequence or isediting($site->id)) {
if ($site->newsitems > 0 or $sections[0]->sequence or isediting($site->id) or isadmin()) {
echo "<TD WIDTH=\"$side\" VALIGN=TOP NOWRAP>";
echo "<td width=\"$side\" valign=top nowrap>";
$firstcolumn=true;
if ($sections[0]->sequence or isediting($site->id)) {
@@ -48,6 +56,11 @@
$mods, $modnames, $modnamesused, true, $side, isediting($site->id));
}
if (isadmin()) {
echo "<div align=\"center\">".update_course_icon($site->id)."</div>";
echo "<br />";
}
if ($site->newsitems > 0 ) {
$categories = get_categories();
if (count($categories) > 1) {
@@ -60,17 +73,18 @@
print_spacer(1,$side);
}
if (isadmin()) {
if (iscreator()) {
if (!$firstcolumn) {
echo "<TD WIDTH=\"$side\" VALIGN=TOP NOWRAP>"; $firstcolumn=true;
echo "<td width=\"$side\" valign=top nowrap>";
$firstcolumn=true;
}
print_admin_links($site->id, $side);
}
if ($firstcolumn) {
echo "</TD>";
echo "</td>";
}
echo "<TD WIDTH=70% VALIGN=TOP>";
echo "<td width=\"70%\" valign=\"top\">";
if ($site->newsitems == 0 ) {
print_heading_block(get_string("availablecourses"));
@@ -89,17 +103,16 @@
if (isset($USER->id)) {
$SESSION->fromdiscussion = "$CFG->wwwroot";
save_session("SESSION");
if (forum_is_subscribed($USER->id, $newsforum->id)) {
$subtext = get_string("unsubscribe", "forum");
} else {
$subtext = get_string("subscribe", "forum");
}
$headertext = "<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR>
<TD>$newsforum->name</TD>
<TD ALIGN=RIGHT><FONT SIZE=1>
<A HREF=\"mod/forum/subscribe.php?id=$newsforum->id\">$subtext</A>
</TD></TR></TABLE>";
$headertext = "<table border=0 width=100% cellpadding=0 cellspacing=0><tr>
<td>$newsforum->name</td>
<td align=right><font size=1>
<a href=\"mod/forum/subscribe.php?id=$newsforum->id\">$subtext</a>
</td></tr></table>";
} else {
$headertext = $newsforum->name;
}
@@ -108,20 +121,20 @@
forum_print_latest_discussions($newsforum->id, $site->newsitems);
}
echo "</TD>";
echo "<TD WIDTH=30% VALIGN=TOP>";
echo "</td>";
echo "<td width=30% valign=top>";
if (isediting($site->id)) {
$site->summary .= "<BR><CENTER><A HREF=\"admin/site.php\"><IMG SRC=\"pix/i/edit.gif\" BORDER=0></A>";
$site->summary .= "<br><center><a href=\"admin/site.php\"><img src=\"pix/i/edit.gif\" border=0></a>";
}
print_simple_box($site->summary, "", "100%", $THEME->cellcontent2, 5, "siteinfo");
print_spacer(1,$side);
echo "</TD>";
echo "</td>";
?>
</TR>
</TABLE>
</tr>
</table>
<?PHP print_footer("home"); // Please do not modify this line ?>
+2 -2
View File
@@ -1,9 +1,9 @@
This directory contains language packages that define all
the text to render Moodle in a particular language.
Each directory is named according to the standard 2-letter
Each language is named according to the standard 2-letter
language name, as defined in:
lib/languages.php
Some languages have an added "locale" added to them.
+8
View File
@@ -401,6 +401,14 @@ $string['someerrorswerefound'] = "
$string['someerrorswerefound'] = "بعض المعلومات فقدت أو غير صحيحة، لذا يرجى النظر تاليه للحصول على مزيد من التفاصيل.";
$string['startdate'] = "تاريخ بدء المنهج الدراسي";
$string['startsignup'] = "إنشاء اشتراك جديد";
$string['status'] = "الحالة";
$string['strftimedate'] = "%%d %%B %%Y";
$string['strftimedateshort'] = "%%d %%B";
$string['strftimedatetime'] = "%%d %%B %%Y, %%I:%%M %%p";
$string['strftimedaydate'] = "%%A, %%d %%B %%Y";
$string['strftimedaydatetime'] = "%%A, %%d %%B %%Y, %%I:%%M %%p";
$string['strftimerecent'] = "%%d %%b, %%H:%%M";
$string['strftimerecentfull'] = "%%a, %%d %%b %%Y, %%I:%%M %%p";
$string['strftimetime'] = "%%I:%%M %%p";
$string['stringsnotset'] = "لم يتم تعريف الإعدادات التالية في \$a";
$string['studentnotallowed'] = "عفوا! لا يمكنك الدخول على هذه الحلقة الدراسية بصفة '\$a'";
+2 -2
View File
@@ -100,7 +100,7 @@ $string['type'] = "
$string['category'] = "ÊÕäíÝ";
$string['viewallanswers'] = "ÚÑÖ \$a ÇáÇãÊÍÇäÇÊ ÇáãäÌÒÉ";
$string['yourfinalgradeis'] = "ÊÕäíÝß ÇáäåÇÆí Úä åÐÇ ÇáÇãÊÍÇä åæ \$a";
$string[answersingleno] = "íÓãÍ ÈÊÚÏÏ ÇáÃÓÆáÉ";
$string[readytosend] = "ÃäÊ ÈÕÏÏ ÅÑÓÇá ÇÎÊÈÇÑß ÈÇáßÇãá ááÊÞííã. åá ÃäÊ ãÊÃßÏ æÊÑíÏ ÇáÇÓÊãÑÇÑ¿";
$string['answersingleno'] = "íÓãÍ ÈÊÚÏÏ ÇáÃÓÆáÉ";
$string['readytosend'] = "ÃäÊ ÈÕÏÏ ÅÑÓÇá ÇÎÊÈÇÑß ÈÇáßÇãá ááÊÞííã. åá ÃäÊ ãÊÃßÏ æÊÑíÏ ÇáÇÓÊãÑÇÑ¿";
?>
+8
View File
@@ -428,6 +428,14 @@ $string['someerrorswerefound'] = "Falta informaci
$string['startdate'] = "Data d'inici del curs";
$string['startsignup'] = "Comença creant-te un compte d'usuari nou!";
$string['status'] = "Estatus";
$string['strftimedate'] = "%%d %%B %%Y";
$string['strftimedateshort'] = "%%d %%B";
$string['strftimedatetime'] = "%%d %%B %%Y, %%H:%%M";
$string['strftimedaydate'] = "%%A, %%d %%B %%Y";
$string['strftimedaydatetime'] = "%%A, %%d %%B %%Y, %%H:%%M";
$string['strftimerecent'] = "%%d %%b, %%H:%%M";
$string['strftimerecentfull'] = "%%a, %%d %%b %%Y, %%H:%%M";
$string['strftimetime'] = "%%H:%%M";
$string['stringsnotset'] = "Les cadenes següents no estan definides en \$a";
$string['studentnotallowed'] = "Ho lamentem, no pots entrar en aquest curs com a '\$a'";
$string['success'] = "Èxit";
Executable
+1
View File
@@ -0,0 +1 @@
From Søren Vinther Hansen <info@thenavigator.dk>
+42
View File
@@ -0,0 +1,42 @@
<?PHP // $Id$
// assignment.php - created with Moodle 1.0.8.1 (2003011200)
$string['allowresubmit'] = "Tillad gentagelser";
$string['assignmentdetails'] = "Opgave detaljer";
$string['assignmentname'] = "Opgave navn";
$string['assignmenttype'] = "Opgave type";
$string['description'] = "Beskrivelse";
$string['duedate'] = "Afleveringsdato";
$string['early'] = "\$a for tidlig";
$string['failedupdatefeedback'] = "Mislykkedes at opdatere feedback på aflevering for bruger \$a";
$string['feedback'] = "Feedback";
$string['feedbackupdated'] = "Afleverings feedback opdateret for \$a ";
$string['late'] = "\$a for sent";
$string['maximumgrade'] = "Maximum karakterer";
$string['maximumsize'] = "Maximum størrelse";
$string['modulename'] = "Opgave";
$string['modulenameplural'] = "Opgaver";
$string['newsubmissions'] = "Opgaver afleveret";
$string['notsubmittedyet'] = "Ikke afleveret endnu";
$string['overwritewarning'] = "Advarsel: hvis du uploader igen, vil det erstatte den nuværende version";
$string['saveallfeedback'] = "Gem alt mit feedback";
$string['submissionfeedback'] = "Afleverings feedback";
$string['submissions'] = "Afleveringer";
$string['submitassignment'] = "Aflevér din opgave ved hjælp af denne formular";
$string['submitted'] = "Afleveret";
$string['typeoffline'] = "Offline aktivitet";
$string['typeuploadsingle'] = "Upload en enkelt fil";
$string['uploadbadname'] = "Dette filnavn indeholdt ugyldige tegn og kunne ikke uploades";
$string['uploadedfiles'] = "uploaded filer";
$string['uploaderror'] = "Fejl mens filen blev gemt på serveren";
$string['uploadfailnoupdate'] = "Filen var OK uploaded, men din aflevering blev ikke opdateret";
$string['uploadfiletoobig'] = "Beklager, men filen er for stor (grænse er \$a bytes)";
$string['uploadnofilefound'] = "Ingen filer fundet, er du sikker på at du har valgt at uploade en ";
$string['uploadnotregistered'] = "'\$a' blev uploaded OK, men afleveringen blev ikke registreret";
$string['uploadsuccess'] = "Uploaded '\$a' korrekt";
$string['viewfeedback'] = "Se opgave karakterer og feedback";
$string['viewsubmissions'] = "Se \$a afleverede opgaver";
$string['yoursubmission'] = "Din aflevering";
?>
+59
View File
@@ -0,0 +1,59 @@
<?PHP // $Id$
// auth.php - created with Moodle 1.0.8.1 (2003011200)
$string['auth_dbdescription'] = "Denne metode bruger en ekstern database for at kontrollere om et givet username og password er gyldigt. Hvis konto'en er ny, kan oplysninger fra andre felter også kopieres ind i Moodle.";
$string['auth_dbextrafields'] = "Disse felter er optional. Du kan vælge at for-udfylde nogle Moodle bruger felter fra <B>den eksterne database</B>, som du har specificeret her.<P> Hvis du ikke skriver noget her, vil default værdierne blive brugt.<P> I alle tilfælde vil brugeren være i stand til at skrive i alle felterne, når de er logget ind.";
$string['auth_dbfieldpass'] = "Navn på feltet der indeholder password";
$string['auth_dbfielduser'] = "Navnet på feltet der indeholder usernames";
$string['auth_dbhost'] = "Computeren der hoster database serveren.";
$string['auth_dbname'] = "Navnet på databasen";
$string['auth_dbpass'] = "Password der matcher ovennævnte username";
$string['auth_dbpasstype'] = "Angiv hvilket format password feltet anvender. MD5 kryptering er anvendeligt når der connectes til almindelige web applikationer som PostNuke";
$string['auth_dbtable'] = "Navnet på tabellen i databasen";
$string['auth_dbtitle'] = "Brug en ekstern database";
$string['auth_dbtype'] = "Database typen(Se <A HREF=../lib/adodb/readme.htm#drivers>ADOdb documentation</A> for detaljer)";
$string['auth_dbuser'] = "Username med læserrettigheder til databasen";
$string['auth_emaildescription'] = "Email bekræftigelse er default godkendelsesmetode. Når brugerne melder sig ind og vælger deres username og password, vil en bekræftigelses email blive sendt til brugerens emailaddresse. Denne email indeholder et sikkert link til en side, hvor brugeren kan bekræftige sine oplysninger. Fremtidige logins kontrolleres ved sammenligning af det username og password, som der er gemt i databasen.";
$string['auth_emailtitle'] = "Email-baseret godkendelse";
$string['auth_imapdescription'] = "Denne metode bruger en IMAP server for at kontrollere om usernam og password er gyldigt.";
$string['auth_imaphost'] = "IMAP server addressen. Brug IP nummeret, ikke DNS navn.";
$string['auth_imapport'] = "IMAP server port nummer. Sædvanligvis er det 143 eller 993.";
$string['auth_imaptitle'] = "Brug en IMAP server";
$string['auth_imaptype'] = "IMAP server typen. IMAP servere kan have forskellige typer godkendelser.";
$string['auth_ldap_bind_dn'] = "Hvis du bruger bind-user til søgning, skal det angives her. Noget med 'cn=ldapuser,ou=public,o=org'";
$string['auth_ldap_bind_pw'] = "Password for bind-user.";
$string['auth_ldap_contexts'] = "Liste med indhold over brugere. deldifferent indhold med ';'. For example: 'ou=users,o=org; ou=others,o=org'";
$string['auth_ldap_host_url'] = "Angiv LDAP host i URL-form f.eks. 'ldap://ldap.myorg.com/' eller 'ldaps://ldap.myorg.com/' ";
$string['auth_ldap_search_sub'] = "Sæt værdi &lt;&gt; 0 hvis du vil søge efter brugere ud fra underemner.";
$string['auth_ldap_update_userinfo'] = "Updater bruger information (fornavn, efternavn, addresse..) fra LDAP til Moodle. Se /auth/ldap/attr_mappings.php for information";
$string['auth_ldap_user_attribute'] = "Attributten til navngivning/søgning af brugere. Sædvanligvis 'cn'.";
$string['auth_ldapdescription'] = "Denne metode kræver godkendelse op mod en ekstern LDAP server.
Hvis det givne username/password er gyldige opretter Moodle en ny bruger i databasen Dette modul kan læse bruger attributter fra en LDAP server og udfylde ønskede felter i Moodle
For følgende logins bliver kun username og
password kontrolleret.";
$string['auth_ldapextrafields'] = "Disse felter er optional. Du kan vælge at udfylde Moodle felter på forhånd fra <B>LDAP felterne</B> som du angiver her. <P>Hvis du ikke skriver noget her, vil intet overføres fra LDAP og Moodle defaults'ene vil blive brugt i stedet.<P>I alle tilfælde vil brugeren være i stand ændre i felterne efter de har logget ind.";
$string['auth_ldaptitle'] = "Brug en LDAP server";
$string['auth_nntpdescription'] = "Denne metode bruger en NNTP server for at kontrollere om de givne username og password er gyldige.";
$string['auth_nntphost'] = "NNTP server addressen. Brug IP nummeret, ikke DNS navn.";
$string['auth_nntpport'] = "Server port (119 er den mest almindelige)";
$string['auth_nntptitle'] = "Brug en NNTP server";
$string['auth_nonedescription'] = "Brugerne kan oprette sig selv og lave gyldige konti med det samme, uden godkendelse op mod en ekstern server og uden bekræftigelse via e-mail. Vær forsigtig med at bruge denne mulighed - tænk administrationsproblemerne!";
$string['auth_nonetitle'] = "No godkendelse";
$string['auth_pop3description'] = "Denne metode bruger en POP3 server til at kontrollere om de givne username og password er gyldige";
$string['auth_pop3host'] = "POP3 server addressen. Brug IP nummeret, ikke DNS navn.";
$string['auth_pop3port'] = "Server port (110 er mest almindelig)";
$string['auth_pop3title'] = "Brug en POP3 server";
$string['auth_pop3type'] = "Server type. Hvis din server anvender certificate security, vælg pop3cert.";
$string['authenticationoptions'] = "Godkendelses options";
$string['authinstructions'] = "Her kan du komme med anvisninger til dine brugere om, hvordan de skal oprette username og password. Teksten du skriver her, vil blive vist på login siden. Hvis du ikke skriver noget her, vil der ikke vises noget på login siden.";
$string['changepassword'] = "Lav password URL om";
$string['changepasswordhelp'] = "Her kan du angive et sted, hvor dine brugere kan finde eller ændre deres username/password, hvis de har glemt det. Brugerne vil få vist en knap på login siden. Hvis du ikke skriver noget her, vil knappen ikke blive vist.";
$string['chooseauthmethod'] = "Vælg en godkendelses metode";
$string['guestloginbutton'] = "Gæste login knap";
$string['instructions'] = "Instruktioner";
$string['md5'] = "MD5 kryptering";
$string['plaintext'] = "Alm. text";
$string['showguestlogin'] = "Du kan vise eller gemme gæste login knappen på login-siden.";
?>
+21
View File
@@ -0,0 +1,21 @@
<?PHP // $Id$
// choice.php - created with Moodle 1.0.8.1 (2003011200)
$string['answered'] = "Besvaret";
$string['choice'] = "Spørgsmål \$a";
$string['choicename'] = "Spørgsmål navn";
$string['choicetext'] = "Spørgsmål tekst";
$string['modulename'] = "Spørgsmål";
$string['modulenameplural'] = "Spørgsmål";
$string['notanswered'] = "Ikke besvaret endnu";
$string['publish'] = "Vis resultater";
$string['publishanonymous'] = "Vis anonyme resultater uden at angive de studerendes navne";
$string['publishnames'] = "Vis alle resultataer, med navne og spørgsmål";
$string['publishnot'] = "Vis ikke resultaterne til de studerende";
$string['responses'] = "Besvarelser";
$string['responsesto'] = "Besvarelser til\$a";
$string['savemychoice'] = "Gem mit spørgsmål";
$string['viewallresponses'] = "Se \$a besvarelser";
?>
+104
View File
@@ -0,0 +1,104 @@
<?PHP // $Id$
// forum.php - created with Moodle 1.0.8.1 (2003011200)
$string['addanewdiscussion'] = "Tilføj et nyt emne";
$string['allowchoice'] = "Tillad alle at vælge";
$string['allowdiscussions'] = "Kan en \$a skrive i dette forum?";
$string['allowratings'] = "Tillad ratings af indlæg?";
$string['allowsdiscussions'] = "Dette forum tillader hver person at starte en diskussion.";
$string['anyfile'] = "Alle filer";
$string['attachment'] = "Vedhæftet fil";
$string['bynameondate'] = "ved \$a->name - \$a->date";
$string['couldnotadd'] = "Kunne ikke tilføje dit indlæg pga en ukendt fejl";
$string['couldnotdeleteratings'] = "Beklager, kan ikke slettes da andre allerede har rated det.";
$string['couldnotdeletereplies'] = "Beklager, kan ikke slettes, da andre allerede har svaret på det.";
$string['couldnotupdate'] = "Kunne ikke opdatere dit indlæg pga en ukendt fejl.";
$string['delete'] = "Slet";
$string['deleteddiscussion'] = "Emnet er slettet";
$string['deletedpost'] = "Indlægget er slettet";
$string['deletesure'] = "Er du sikker på, at du vil slette dette indlæg?";
$string['discussion'] = "Diskussion";
$string['discussions'] = "Diskussioner";
$string['discussionsstartedby'] = "Diskussioner startet af \$a";
$string['discussthistopic'] = "Diskutér dette emne";
$string['eachuserforum'] = "Hver person starter én diskussion";
$string['edit'] = "Redigér";
$string['editing'] = "Redigerer";
$string['emptymessage'] = "Noget er galt med dit indlæg. Måske har du ikke skrevet noget eller er den vedhæftede fil for stor. Dine ændringer er IKKE blevet gemt.";
$string['everyonecanchoose'] = "Alle kan vælge at blive meldt til";
$string['everyoneissubscribed'] = "Alle er meldt til dette forum";
$string['forcesubscribe'] = "Tilmeld alle";
$string['forcesubscribeq'] = "Skal alle tilmeldes?";
$string['forum'] = "Forum";
$string['forumintro'] = "Forum intro";
$string['forumname'] = "Forum navn";
$string['forums'] = "Forum";
$string['forumtype'] = "Forum type";
$string['generalforum'] = "Standard forum til almindeligt brug";
$string['generalforums'] = "Standard forums";
$string['inforum'] = "i \$a";
$string['intronews'] = "Nyheder og meddelelser";
$string['introsocial'] = "Et åbent forum med det emne, som du har lyst til at få diskuteret.";
$string['introteacher'] = "Et forum kun for lærer noter og diskussioner";
$string['learningforums'] = "Forum til læring";
$string['maxtimehaspassed'] = "Beklager, men tiden er gået (\$a) og du kan ikke redigere i indlægget mere! ";
$string['message'] = "Meddelelse";
$string['modeflatnewestfirst'] = "Viser svar i flad struktur med den nyeste først";
$string['modeflatoldestfirst'] = "Viser svar i flad struktur med den ældste først";
$string['modenested'] = "Viser svar i trinvis struktur";
$string['modethreaded'] = "Viser svar i trådet struktur";
$string['modulename'] = "Forum";
$string['modulenameplural'] = "Forum";
$string['more'] = "mere";
$string['namenews'] = "Nyheds forum";
$string['namesocial'] = "Social forum";
$string['nameteacher'] = "Lærer forum";
$string['newforumposts'] = "Nyt indlæg";
$string['nodiscussions'] = "Der er endnu ingen emner i dette forum";
$string['noguestpost'] = "Beklager, gæster kan ikke skrive indlæg.";
$string['noposts'] = "Ingen indlæg";
$string['nopostscontaining'] = "Ingen indlæg indeholdende '\$a' blev fundet";
$string['nosubscribers'] = "Der er endnu ingen tilmeldte i dette forum";
$string['nownotsubscribed'] = "\$a->name vil ikke modtage kopier af'\$a->forum' pr. email.";
$string['nowsubscribed'] = "\$a->name vil modtage kopier af'\$a->forum' pr. email.";
$string['numposts'] = "\$a indlæg";
$string['olderdiscussions'] = "Tidligere diskussioner";
$string['openmode0'] = "Ingen diskussioner, ingen svar";
$string['openmode1'] = "Ingen diskussioner, men svar er tilladte";
$string['openmode2'] = "Diskussioner og svar er tilladte";
$string['parentofthispost'] = "Første indlæg";
$string['postadded'] = "Dit indlæg er tilføjet.<P>Du har \$a til at redigere i det, hvis du vil ændre noget.";
$string['postincontext'] = "Se dette indlægs indhold";
$string['postmailinfo'] = "Dette er en kopi af en meddelelse fra \$a websted.
For at give et svar via webstedet, klik på følgende link:";
$string['postrating1'] = "Viser som regel INDIVIDUEL viden";
$string['postrating2'] = "Hver individuel og sammenhængende";
$string['postrating3'] = "Viser som regel sammenhængende viden";
$string['postupdated'] = "Dit indlæg er opdateret";
$string['processingpost'] = "Behandler indlæg \$a";
$string['rate'] = "Rate";
$string['ratings'] = "Ratings";
$string['ratingssaved'] = "Ratings gemt";
$string['re'] = "Ang:";
$string['readtherest'] = "Læs resten af dette emne";
$string['repliesmany'] = "\$a svar indtil videre";
$string['repliesone'] = "\$a svar indtil videre";
$string['reply'] = "Svar";
$string['search'] = "Søg";
$string['searchforums'] = "Søg i forum";
$string['searchresults'] = "Søge resultater";
$string['sendinratings'] = "Indsend mine sidste ratings";
$string['showsubscribers'] = "Vis deltagere";
$string['singleforum'] = "En simpel diskussion";
$string['subject'] = "Emne";
$string['subscribe'] = "Tilmeld dig dette forum";
$string['subscribed'] = "Tilmeldt";
$string['subscribers'] = "Tilmeldte";
$string['subscribersto'] = "Tilmeldte til '\$a'";
$string['unsubscribe'] = "Frameld dig dette forum";
$string['youratedthis'] = "Du har rated dette";
$string['yournewtopic'] = "Dit nye diskussionsemne";
$string['yourreply'] = "Your svar";
?>
+29
View File
@@ -0,0 +1,29 @@
<?PHP // $Id$
// journal.php - created with Moodle 1.0.8.1 (2003011200)
$string['alwaysopen'] = "Altid åben";
$string['blankentry'] = "Tomt indlæg";
$string['daysavailable'] = "Dage til rådighed";
$string['editingended'] = "Redigerings perioden er slut";
$string['editingends'] = "Redigeringsperioden slutter";
$string['feedbackupdated'] = "Feedback opdateret for \$a indlæg";
$string['journalname'] = "Logbog navn";
$string['journalquestion'] = "Logbog spørgsmål";
$string['journalrating1'] = "Ikke tilfredsstillende";
$string['journalrating2'] = "Tilfredsstillende";
$string['journalrating3'] = "Fantastisk";
$string['modulename'] = "Logbog";
$string['modulenameplural'] = "Logbøger";
$string['newjournalentries'] = "Nyt indlæg i logbog";
$string['noentry'] = "Intet indlæg";
$string['noratinggiven'] = "Bedømmelse ikke givet";
$string['notopenuntil'] = "Denne logbog åbner ikke førend";
$string['notstarted'] = "Du har ikke begyndt på denne logbog endnu";
$string['overallrating'] = "Endelig bedømmelse";
$string['rate'] = "Bedøm";
$string['saveallfeedback'] = "Gem alle mine feedback";
$string['startoredit'] = "Start eller rediger i min logbog";
$string['viewallentries'] = "Se \$a indlæg i logbogen";
?>
+517
View File
@@ -0,0 +1,517 @@
<?PHP // $Id$
// moodle.php - created with Moodle 1.0.8.1 (2003011200)
$string['action'] = "Hændelse";
$string['activities'] = "Aktiviteter";
$string['activity'] = "Aktivitet";
$string['activityreport'] = "Aktivitets rapport";
$string['add'] = "Tilføj";
$string['addadmin'] = "Tilføj admin";
$string['added'] = "Tilføjet \$a";
$string['addinganew'] = "Tilføje en/et ny(t) \$a";
$string['addinganewto'] = "Tilføje en/et ny(t)\$a->hvad til \$a->til";
$string['addnewcourse'] = "Tilføj et nyt kursus";
$string['addnewuser'] = "Tilføj en ny bruger";
$string['address'] = "Addresse";
$string['addteacher'] = "Tilføj lærer";
$string['admin'] = "Admin";
$string['administration'] = "Administration";
$string['again'] = "igen";
$string['all'] = "All";
$string['alldays'] = "Alle dage";
$string['allfieldsrequired'] = "Alle felter skal udfyldes";
$string['alllogs'] = "Alle logs";
$string['allow'] = "Tillad";
$string['allowguests'] = "Dette kursus tillader gæster";
$string['allownot'] = "Tillad ikke";
$string['allparticipants'] = "Alle deltagere";
$string['alphanumerical'] = "Kan kun indeholde bogstaver eller tal";
$string['alreadyconfirmed'] = "Registrering er allerede bekræftet";
$string['answer'] = "Svar";
$string['assessment'] = "Opgave";
$string['assignadmins'] = "Tilføj administratorer";
$string['assignteachers'] = "Tilføj instruktører";
$string['authentication'] = "Validering";
$string['availablecourses'] = "Tilgængelige kurser";
$string['cancel'] = "Slet";
$string['categories'] = "Kursus kategorier";
$string['category'] = "Kategori";
$string['categoryadded'] = "Kategorien'\$a' blev tilføjet";
$string['categorydeleted'] = "Kategorien'\$a' blev slettet";
$string['changedpassword'] = "Ændret password";
$string['changepassword'] = "Ændre password";
$string['changessaved'] = "Ændringer gemt";
$string['checklanguage'] = "Sprogindstillinger";
$string['choose'] = "Vælg";
$string['choosecourse'] = "Vælg et kursus";
$string['chooselivelogs'] = "Eller vælg igangværende aktivitet";
$string['chooselogs'] = "Vælg hvilke logs du vil se";
$string['choosetheme'] = "Vælg tema";
$string['chooseuser'] = "Vælg en bruger";
$string['city'] = "By";
$string['closewindow'] = "Luk dette vindue";
$string['comparelanguage'] = "Sammenlign og redigér i sprog";
$string['complete'] = "Færdiggør";
$string['configcountry'] = "Hvis du vælger et land her, vil dette land blive valgt som default af nye brugere. For at tvinge brugere til at vælge land, skal du ikke vælge noget her.";
$string['configdebug'] = "Hvis du sætter denne til, vil PHP's fejlmeldinger øges og der vil printes flere af dem. Dette er kun for udviklere.";
$string['configerrorlevel'] = "Vælg mængden af PHP advarsler, som du vil have vist. Normal er som regel det bedste valg.";
$string['configgdversion'] = "Indikerer hvilken version af GD, som er valgt. Versionen, der vises som default, er den, som er blevet autodetected. Du skal ikke ændre den, med mindre du ved, hvad du gør.";
$string['confightmleditor'] = "Vælg om du vil tillade brug af den tilhørende HTML editor. Selv om du vælger \"tillad\", vil denne editor kun komme frem, hvis brugeren bruger en kompatibel browser (IE 5.5 eller senere versioner). Brugere kan også vælge ikke at bruge den.";
$string['configintro'] = "På denne side kan du vælge et antal variabler til konfiguration, som få Moodle til at virke bedre på din server. Normalt vil default indstillingerne virke fint og du kan altid vende tilbage til denne side og ændre indstillingerne. ";
$string['configlang'] = "Vælg et default sprog for hele sitet. Brugere kan override dette senere";
$string['configlangdir'] = "De fleste sprog skrives fra venstre til højre, men nogle, som arabisk og hebræisk, skrives fra højre til venstre.";
$string['configlocale'] = "Lokalindstillinger for dit site. Det vil have indflydelse på format og sprog med hensyn til datoer. Du skal have disse lokalindstillinger installeret på din operativ system (f.eks. en_US eller en_ES). Hvis du ikke ved, hvad du skal vælge, så lad feltet stå tomt.";
$string['configlongtimenosee'] = "Hvis kursisterne ikke har været logget på i lang tid, så bliver de automatisk slettet fra kurset. Denne indstilling sætter tidsbegrænsningen.";
$string['configmaxeditingtime'] = "Denne angiver hvor lang tid brugerne har til editere i deres indlæg i et forum, logbog etc. Normalt er 30 minutter en god værdi.";
$string['configproxyhost'] = "Hvis denne<B>server</B> skal bruge en proxy computer (f.eks. en firewall) for at komme på Internettet, så skriv proxy hostnavn og port her.";
$string['configslasharguments'] = "Filer (billeder, dokumenter etc.) tilføjes et script (anden option her), som gør at filen lettere hentes i webbrowsere, proxyservere etc. Uheldigvis tillader nogle PHP servere ikke denne metode, så hvis du har problemer med at få vist uploadede filer eller billeder (f.eks. billeder af brugerne), skal du vælge den første option.";
$string['configsmtphosts'] = "Angiv fuld navn til en eller flere STMP servere som Moodle skal bruge til at sende mail (f.eks. mail.a.com, mail.b.com etc.) Hvis du intet angiver vil Moodle bruge PHP default metoden til at sende mail.";
$string['configsmtpuser'] = "Hvis du har angivet en STMP server herover, og serveren kræver brugernavn og password, så indtast det her.";
$string['configunzip'] = "Indikerer placeringen af dit unzip program (kun for Unix). Dette for at kunne unzippe filer til serveren.";
$string['configvariables'] = "Instillinger af variabler";
$string['configzip'] = "Indikerer placeringen af dit zip program ( kun for Unix). Dette for at kunne zippe filer på serveren.
";
$string['confirmed'] = "Registreringen er blevet bekræftet";
$string['continue'] = "Fortsæt";
$string['cookiesenabled'] = "Du skal slå cookies til i din browser";
$string['copyrightnotice'] = "Copyright notice";
$string['country'] = "Land";
$string['course'] = "Kursus";
$string['courseformats'] = "Kursus format";
$string['courses'] = "Kurser";
$string['courseupdates'] = "Kursus opdateringer";
$string['createaccount'] = "Opret min nye konto";
$string['createuserandpass'] = "Opret et nyt username og password";
$string['createziparchive'] = "Opret zip arkiv";
$string['currentlanguage'] = "Sprogvalg";
$string['currentlocaltime'] = "Din lokal tid";
$string['databasechecking'] = "Opgraderer Moodle database fra version\$a->oldversion til \$a->newversion...";
$string['databasesetup'] = "Opsætning af database";
$string['databasesuccess'] = "Databasen opgraderet og OK";
$string['databaseupgrades'] = "Opgraderer database";
$string['day'] = "dag";
$string['days'] = "dage";
$string['defaultcoursefullname'] = "Kursus 101";
$string['defaultcourseshortname'] = "K101";
$string['defaultcoursestudent'] = "Studerende";
$string['defaultcoursestudents'] = "Studerende";
$string['defaultcoursesummary'] = "Giv her en præcis og klar beskrivelse af dette kursus.";
$string['defaultcourseteacher'] = "Lærer";
$string['defaultcourseteachers'] = "Lærere";
$string['delete'] = "Slet";
$string['deletecheck'] = "Slet \$a ?";
$string['deletecheckfull'] = "Er du helt sikker på at du vil slette \$a ?";
$string['deletecompletely'] = "Slet alt";
$string['deletecourse'] = "Slet et kursus";
$string['deletecoursecheck'] = "Er du helt sikker på at du vil slette dette kursus og alt indhold?";
$string['deleted'] = "Slettet";
$string['deletedactivity'] = "Slettet \$a";
$string['deletedcourse'] = "\$a er fuldstændigt slettet";
$string['deletednot'] = "Kunne ikke slette \$a !";
$string['deletingcourse'] = "Slette \$a";
$string['department'] = "Afdeling";
$string['description'] = "Beskrivelse";
$string['displayingrecords'] = "Viser \$a registreinger";
$string['displayingusers'] = "Viser brugere \$a->start til \$a->slut";
$string['documentation'] = "Moodle Dokumentation";
$string['downloadexcel'] = "Download i Excel format";
$string['downloadtext'] = "Download i text format";
$string['doyouagree'] = "Har du læst og forstået disse betingelser?";
$string['edit'] = "Rediger \$a";
$string['editcoursesettings'] = "Rediger kursusindstillinger";
$string['editinga'] = "Redigerer en \$a";
$string['editmyprofile'] = "Rediger profil";
$string['editsummary'] = "Rediger tekst";
$string['editthisactivity'] = "Rediger denne aktivitet";
$string['edituser'] = "Rediger bruger konti";
$string['email'] = "Email addresse";
$string['emailconfirm'] = "Bekræft din konto";
$string['emailconfirmation'] = "Hej \$a->firstname,
En ny konto er oprettet på'\$a->sitename'
med din email addresse.
For at bekræfte din oprettelse gå til følgende web addresse:
\$a->link
I de fleste mail programmer kommer linket med blå skrift
som du kan klikke på. Hvis det ikke virker,
så kan du \"cut and paste\" addressen i addresse feltet i toppen af dit browservindue.
Cheers fra '\$a->sitename' administrator,
\$a->admin";
$string['emailconfirmsent'] = " <P>En email addresse skulle være sendt til din addresse <B>\$a</B>
<P>Den indeholder anvisninger på, hvordan du kan blive registreret.
<P>Hvis du stadig har problemer, så kontakt web administratoren.";
$string['emaildisplay'] = "Vis Email ";
$string['emaildisplaycourse'] = "Tillad kun andre kursusdeltagere at se min email addresse";
$string['emaildisplayno'] = "Gem min rigtige email addresse fra alle";
$string['emaildisplayyes'] = "Tillad alle at se min email addresse";
$string['emailexists'] = "Denne email addresse er allerede registreret.";
$string['emailformat'] = "Email format";
$string['emailmustbereal'] = "OBS: Din email addresse skal udfyldes rigtigt";
$string['enrolmentkey'] = "Kursus nøgle";
$string['enrolmentkeyfrom'] = "Dette kursus kræver en kursusnøgle' - et en-gangs<BR>
password som du skulle have fået fra \$a";
$string['enrolmentkeyhint'] = "Forkert kursusnøgle - prøv igen<BR>
(Her er et hint - det starter med '\$a')";
$string['entercourse'] = "Klik for at komme ind på kurset";
$string['enteremailaddress'] = "Indtast din email addresse for at re-sette dit
password og du får et nyt password sendt med en email";
$string['error'] = "Fejl";
$string['errortoomanylogins'] = "Beklager, du har oversteget antallet af gange, hvor du kan prøve at logge ind. Restart din browser";
$string['existingadmins'] = "Oprettede administratorer";
$string['existingteachers'] = "Oprettede lærere";
$string['feedback'] = "Feedback";
$string['filemissing'] = "\$a mangler";
$string['files'] = "Filer";
$string['filloutallfields'] = "Udfyld venligst alle felter i denne formular";
$string['firstname'] = "Fornavn(e)";
$string['firsttime'] = "Er det dit første besøg?";
$string['followingoptional'] = "Følgende er frivilligt at udfylde";
$string['followingrequired'] = "Følgende SKAL udfyldes";
$string['forgotten'] = "Har du glemt dit username og password?";
$string['format'] = "Format";
$string['formathtml'] = "HTML format";
$string['formatsocial'] = "Social format";
$string['formattext'] = "Moodle auto-format";
$string['formattexttype'] = "Formattering";
$string['formattopics'] = "Emne format";
$string['formatweeks'] = "Uge format";
$string['frontpagedescription'] = "Forside beskrivelse";
$string['frontpageformat'] = "Forside format";
$string['fulllistofcourses'] = "Alle kurser";
$string['fullname'] = "Fulde navn";
$string['fullprofile'] = "Fulde profil";
$string['fullsitename'] = "Fulde site navn";
$string['gd1'] = "GD 1.x er installeret";
$string['gd2'] = "GD 2.x er installeret";
$string['gdneed'] = "GD skal installeres for at kunne se denne graf";
$string['gdnot'] = "GD er ikke installeret";
$string['gpl'] = "Copyright (C) 2001-2002 Martin Dougiamas (http://dougiamas.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details:
http://www.gnu.org/copyleft/gpl.html";
$string['grade'] = "Karakter";
$string['grades'] = "Karakterer";
$string['guestskey'] = "Tillad at gæster får nøglen";
$string['guestsno'] = "Tillad ikke gæster";
$string['guestsnotallowed'] = "Beklager, '\$a' tillader ikke gæsteadgang.";
$string['guestsyes'] = "Tillad gæster uden nøgle";
$string['guestuser'] = "Gæst";
$string['guestuserinfo'] = "Denne bruger tillades kun læseadgang til nogle kurser.";
$string['help'] = "Hjælp";
$string['helphtml'] = "Hvordan skriver man html";
$string['helppicture'] = "Hvordan uploader man et billede";
$string['helpquestions'] = "Stil gode spørgsmål";
$string['helpreading'] = "Læs omhyggeligt";
$string['helprichtext'] = "Om Richtext editor";
$string['helptext'] = "Hvordan skriver man tekst";
$string['helpwriting'] = "Skriv omhyggeligt";
$string['hide'] = "Gem";
$string['hits'] = "Hits";
$string['hitsoncourse'] = "Hits på \$a->coursename af \$a->username";
$string['hitsoncoursetoday'] = "Dagens hits på \$a->coursename af \$a->username";
$string['home'] = "Home";
$string['hour'] = "time";
$string['hours'] = "timer";
$string['howtomakethemes'] = "Hvordan laver man nye temaer";
$string['htmleditor'] = "Brug Richtext HTML editor (Kun IE, 5.5 eller senere)";
$string['htmleditoravailable'] = "Richtext editor'en er tilgængelig";
$string['htmleditordisabled'] = "Du har slået Richtext editor'en fra i din brugerprofil";
$string['htmleditordisabledadmin'] = "Administratoren har slået Richtext editor'en fra på dette site";
$string['htmleditordisabledbrowser'] = "Richtext editor'en kan ikke bruges, da du ikke bruger Internet Explorer 5.5 eller senere udgaver";
$string['htmlformat'] = "Pretty HTML format";
$string['icqnumber'] = "ICQ nummer";
$string['idnumber'] = "ID nummer";
$string['invalidemail'] = "Invalid email addresse";
$string['invalidlogin'] = "Invalid login, prøv igen";
$string['jumpto'] = "Gå til...";
$string['langltr'] = "Sprog fra ventre mod højre";
$string['langrtl'] = "Sprog fra højre mod venstre";
$string['language'] = "Sprog";
$string['languagegood'] = "Denne sprogpakke er up-to-date! :-)";
$string['lastaccess'] = "Sidst set";
$string['lastedited'] = "Sidst redigeret";
$string['lastmodified'] = "Sidst ændret";
$string['lastname'] = "Efternavn";
$string['latestnews'] = "Sidste nyt";
$string['leavetokeep'] = "For at beholde nuværende password: skriv ikke noget i dette felt";
$string['license'] = "GPL License";
$string['listofallpeople'] = "Liste over alle";
$string['livelogs'] = "Live logs fra den sidste time";
$string['locale'] = "da_DK";
$string['location'] = "Sted";
$string['loggedinas'] = "Du er logget ind som \$a ";
$string['loggedinnot'] = "Du er ikke logget ind";
$string['login'] = "Login";
$string['loginas'] = "Login som";
$string['loginguest'] = "Login som gæst";
$string['loginsite'] = "Login til dette site";
$string['loginsteps'] = "Hej! For at få fuld adgang til dette kursus skal du lige bruge lidt tid til at lave en ny konto.
Hvert enkelt kursus kan også have en &quot;kursusnøgle&quot;, den skal du først bruge senere. Sådan gør du:
<OL size=2>
<LI>Udfyld <A HREF=\$a>Ny Konto</A> formularen med dine oplysninger.
<LI>En email vil derefter blive sendt til din email addresse.
<LI>Læs din email og klik på det medfølgende link.
<LI>Din konto bliver bekræftet og du bliver logget ind.
<LI>Vælg derefter det kursus, som du vil deltage i.
<LI>Hvis du bliver bedt om en &quot;kursusnøgle&quot; - brug den, som du har fået tilsendt. Det vil &quot;give dig adgang&quot; til kurset. <LI>Du har nu fuld adgang til kurset og fra nu af behøver du kun at bruge username og password for at logge dig ind på kurset.
</OL>";
$string['loginstepsnone'] = "Hej!<P>For at få fuld adgang til kurset er du nødt til at lave dig en ny konto.<P>Det du skal gøre, er at lave dig et username og et password og indsætte det i formularen på denne side.<P>Hvis andre allerede har valgt dit username, er du nødt til at prøve igen med et andet.";
$string['loginto'] = "Login til \$a";
$string['loginusing'] = "Login her med username og password";
$string['logout'] = "Log ud";
$string['logs'] = "Logs";
$string['mainmenu'] = "Hovedmenu";
$string['makeafolder'] = "Lav en folder";
$string['makeeditable'] = "Hvis du gør at '\$a' kan redigeres af web serveren (f.eks. apache) så kan du redigere file direkte fra denne side.";
$string['managedatabase'] = "Database management";
$string['markthistopic'] = "Marker dette emne som det igangværende";
$string['maximumchars'] = "Maximum af \$a karakterer";
$string['maximumgrade'] = "Maximum karakter";
$string['maximumshort'] = "Max";
$string['maxsize'] = "Max størrelse: \$a";
$string['min'] = "min";
$string['mins'] = "mins";
$string['miscellaneous'] = "Andre";
$string['missingcategory'] = "Du skal vælge en kategori";
$string['missingcity'] = "Mangler by";
$string['missingcountry'] = "Mangler land";
$string['missingdescription'] = "Mangler beskrivelse";
$string['missingemail'] = "Mangler email addresse";
$string['missingfirstname'] = "Mangler fornavn";
$string['missingfullname'] = "Mangler fulde navn";
$string['missinglastname'] = "Mangler efternavn";
$string['missingnewpassword'] = "Mangler nyt password";
$string['missingpassword'] = "Mangler password";
$string['missingshortname'] = "Mangler kort navn";
$string['missingshortsitename'] = "Mangler kort site navn";
$string['missingsitedescription'] = "Mangler site beskrivelse";
$string['missingsitename'] = "Mangler site navn";
$string['missingstrings'] = "Check for manglende strings";
$string['missingstudent'] = "Du skal vælge noget";
$string['missingsummary'] = "Mangler beskrivelse";
$string['missingteacher'] = "Du skal vælge noget";
$string['missingusername'] = "Mangler username";
$string['modified'] = "Ændret";
$string['modulesetup'] = "Sætter modul tabeller op";
$string['modulesuccess'] = "\$a tabeller er sat op ";
$string['mostrecently'] = "sidste";
$string['movedown'] = "Flyt ned";
$string['movefilestohere'] = "Flyt filer hertil";
$string['movetoanotherfolder'] = "Flyt til en anden folder";
$string['moveup'] = "Flyt op";
$string['mustconfirm'] = "Du skal bekræfte din login";
$string['mycourses'] = "Mine kurser";
$string['name'] = "Navn";
$string['namesocial'] = "sektion";
$string['nametopics'] = "emne";
$string['nameweeks'] = "uge";
$string['never'] = "Aldrig";
$string['new'] = "Ny";
$string['newaccount'] = "Ny konto";
$string['newpassword'] = "Nyt password";
$string['newpasswordtext'] = "Hi \$a->firstname,
Dit password til '\$a->sitename' er ændret og du har fået et nyt midlertidigt password.
Dine login info er nu:
username: \$a->username
password: \$a->newpassword
Gå til denne side for at ændre dit password:
\$a->link
I de fleste mailprogrammer kommer det op som et blåt link, som du kan klikke på. Hvis det ikke virker, kan du cut and paste addressen op i addressefeltet i toppen af din.
Cheers fra '\$a->sitename' administrator,
\$a->signoff
";
$string['newpicture'] = "Nyt billede";
$string['newsitem'] = "nyhed";
$string['newsitems'] = "nyheder";
$string['newsitemsnumber'] = "Vis nyheder";
$string['newuser'] = "Ny bruger";
$string['newusers'] = "Nye brugere";
$string['no'] = "Nej";
$string['nocoursesyet'] = "Ingen kurser i denne kategori";
$string['noexistingadmins'] = "Ingen eksisterende administratorer. En alvorlig fejl og du burde ikke have sendt denne meddelelse.";
$string['noexistingteachers'] = "Ingen eksisterende lærere";
$string['nofilesyet'] = "Ingen filer er uploaded til dit kursus endnu";
$string['nograde'] = "Ingen karakter";
$string['noimagesyet'] = "Ingen billeder er uploaded til dit kursus endnu";
$string['none'] = "Ingen";
$string['nopotentialadmins'] = "In potentielle administratorer";
$string['nopotentialteachers'] = "Ingen potentielle lærere";
$string['normal'] = "Normal";
$string['nostudentsyet'] = "Ingen studerende endnu";
$string['nosuchemail'] = "email addresse eksisterer ikke";
$string['noteachersyet'] = "Ingen lærere endnu";
$string['notenrolled'] = "\$a er ikke deltager på dette kursus endnu.";
$string['nothingnew'] = "Intet nyt siden din sidste login.";
$string['nousersyet'] = "Ingen brugere endnu";
$string['now'] = "nu";
$string['numberweeks'] = "Antal af uger/emner";
$string['numdays'] = "\$a dage";
$string['numminutes'] = "\$a minutter";
$string['numviews'] = "set \$a gange";
$string['numweeks'] = "\$a uger";
$string['numwords'] = "\$a ord";
$string['numyears'] = "\$a år";
$string['ok'] = "OK";
$string['opentoguests'] = "Gæste adgang";
$string['optional'] = "optional";
$string['order'] = "Bestil";
$string['outline'] = "Beskrivelse";
$string['participants'] = "Deltagere";
$string['password'] = "Password";
$string['passwordchanged'] = "Password er ændret";
$string['passwordrecovery'] = "Ja, hjælp mig med at logge ind";
$string['passwordsdiffer'] = "Disse passwords matcher ikke";
$string['passwordsent'] = "Password er sendt";
$string['passwordsenttext'] = " <P>An email has been sent to your address at \$a->email.
<P><B>Check din email for nyt password</B>
<P>Det nye password er genereret automatisk, så du vil måske
<A HREF=\$a->link>ændre det til noget, som du nemmere kan huske</A>.";
$string['people'] = "Deltagere";
$string['personalprofile'] = "Personlig profil";
$string['phone'] = "Telefon nr.";
$string['potentialadmins'] = "Potentielle administratorer";
$string['potentialteachers'] = "Potentielle lærere";
$string['preferredlanguage'] = "Valgte sprog";
$string['preview'] = "Preview";
$string['previeworchoose'] = "Preview eller vælg et tema";
$string['question'] = "Spørgsmål";
$string['readme'] = "README";
$string['recentactivity'] = "Sidste aktivitet(er)";
$string['removeadmin'] = "Fjern administrator";
$string['removeteacher'] = "Fjern lærer";
$string['rename'] = "Omdøb";
$string['requireskey'] = "Dette kursus kræver en kursusnøgle";
$string['resources'] = "Materiale";
$string['returningtosite'] = "Har du besøgt os før?";
$string['revert'] = "Vend tilbage";
$string['role'] = "Rolle";
$string['savechanges'] = "Gem ændringer";
$string['search'] = "Søg";
$string['searchagain'] = "Søg igen";
$string['searchresults'] = "Søgeresultater";
$string['sec'] = "sekunder";
$string['secs'] = "sekunder";
$string['section'] = "Sektion";
$string['selectacountry'] = "Vælg et land";
$string['senddetails'] = "Send mine oplysninger via email";
$string['separateandconnected'] = "Separate and tilknyttede måder at vide";
$string['serverlocaltime'] = "Server's lokal tid";
$string['settings'] = "Indstillinger";
$string['shortname'] = "Kort navn";
$string['shortsitename'] = "Kort navn til dette site(f.eks. et enkelt ord)";
$string['show'] = "Vis";
$string['showallcourses'] = "Vis alle kurser";
$string['showalltopics'] = "Vis alle emner";
$string['showallweeks'] = "Vis alle uger";
$string['showlistofcourses'] = "Vis en kursusliste";
$string['showonlytopic'] = "Vis kun emne \$a";
$string['showonlyweek'] = "Vis kun uge \$a";
$string['showrecent'] = "Vis sidste aktivitet(er)";
$string['showtheselogs'] = "Vis disse logs";
$string['site'] = "Site";
$string['sitelogs'] = "Site logs";
$string['sitenews'] = "Site nyheder";
$string['sites'] = "Sites";
$string['sitesettings'] = "Site settings";
$string['size'] = "Størrelse";
$string['socialheadline'] = "Social forum - sidste emner";
$string['someallowguest'] = "Nogle kurser tillader gæste adgang";
$string['someerrorswerefound'] = "Nogle af oplysningerne manglede eller var forkerte. Se nedenfor for detaljer";
$string['startdate'] = "Kursus start dato";
$string['startsignup'] = "Start nu med at oprette en ny konto!";
$string['status'] = "Status";
$string['stringsnotset'] = "De følgende strings er ikke definerede i \$a";
$string['studentnotallowed'] = "Beklager, du kan ikke deltage i dette kursus med '\$a'";
$string['success'] = "Success";
$string['summary'] = "Referat";
$string['summaryof'] = "Referat af \$a";
$string['supplyinfo'] = "Venligst udfyld oplysninger om dig";
$string['teacheronly'] = "kun for \$a ";
$string['textediting'] = "Når tekst redigeres";
$string['texteditor'] = "Brug standard web formularer";
$string['textformat'] = "ren text format";
$string['thanks'] = "Tak";
$string['theme'] = "Tema";
$string['themesaved'] = "Gemt nyt tema";
$string['thischarset'] = "iso-8859-1";
$string['thislanguage'] = "Dansk";
$string['timezone'] = "Tidszone";
$string['today'] = "Idag";
$string['todaylogs'] = "Dagens logs";
$string['toomanytoshow'] = "Der er for mange brugere";
$string['topic'] = "Emne";
$string['topicoutline'] = "Beskrivelse af emne";
$string['total'] = "Total";
$string['turneditingoff'] = "Slå redigering fra";
$string['turneditingon'] = "Rediger";
$string['undecided'] = "Ubestemt";
$string['unenrol'] = "Fjern";
$string['unenrolme'] = "Fjern mig fra \$a";
$string['unenrolsure'] = "Er du sikker på at du vil fjerne \$a fra dette kursus?";
$string['unsafepassword'] = "Usikkert password - prøv et andet";
$string['unusedaccounts'] = "Kontoer der ikke har været brugt i \$a dage, bliver automatisk fjernet";
$string['unzip'] = "Unzip";
$string['update'] = "Opdater";
$string['updated'] = "Opdateret \$a";
$string['updatemyprofile'] = "Opdater profil";
$string['updatesevery'] = "Opdater hver \$a sekund";
$string['updatethis'] = "Opdater dette \$a";
$string['updatethiscourse'] = "Opdater dette kursus";
$string['updatinga'] = "Opdaterer \$a";
$string['updatingain'] = "Opdaterer \$a->hvad i \$a->i";
$string['upload'] = "Upload";
$string['uploadafile'] = "Upload en fil";
$string['uploadedfileto'] = "Uploaded \$a->fil til \$a->bibliotek";
$string['uploadnofilefound'] = "Ingen fil fundet- er du sikker på at du har uploaded én?";
$string['uploadproblem'] = "En ukendt fejl opstod mens filen '\$a' blev uploaded (måske var den for stor?)";
$string['uploadthisfile'] = "Upload denne fil";
$string['userdeleted'] = "Denne bruger konto er slettet";
$string['userdescription'] = "Beskrivelse";
$string['username'] = "Username";
$string['usernameexists'] = "Dette username eksisterer allerede, venligst vælg et andet";
$string['userprofilefor'] = "Bruger profil for \$a";
$string['users'] = "Brugere";
$string['webpage'] = "Web side";
$string['week'] = "Uge";
$string['weeklyoutline'] = "Ugebeskrivelse";
$string['welcometocourse'] = "Velkommen til \$a";
$string['welcometocoursetext'] = "Velkommen til \$a->coursename!
En af de første ting du bør gøre, er at skrive i din brugerprofil i kurset, så vi kan læse lidt om, hvad du er for én:
\$a->profileurl";
$string['withchosenfiles'] = "Med valgte filer";
$string['wordforstudent'] = "Dit ord for studerende";
$string['wordforstudenteg'] = "f.eks. Studerende, Deltager, Kursist etc";
$string['wordforstudents'] = "Dit ord for studerende";
$string['wordforstudentseg'] = "f.eks. Studerende, Deltagere, Kursister etc";
$string['wordforteacher'] = "Dit ord for lærer";
$string['wordforteachereg'] = "f.eks. Lærer, Instruktør, Facilitator etc";
$string['wordforteachers'] = "Dit ord for lærere";
$string['wordforteacherseg'] = "f.eks. Lærere, Instruktører, Facilitators etc";
$string['wrongpassword'] = "Ikke korrekt password til dette username";
$string['yes'] = "Ja";
$string['yourlastlogin'] = "Sidste login var";
$string['yourself'] = "Dig";
$string['yourteacher'] = "din \$a";
?>
+108
View File
@@ -0,0 +1,108 @@
<?PHP // $Id$
// quiz.php - created with Moodle 1.0.8.1 (2003011200)
$string['addselectedtoquiz'] = "Tiføj det markerede til quizzen";
$string['allowreview'] = "Tillad at se igen";
$string['alreadysubmitted'] = "Du har sandsynligvis allerede sendt dette forsøg";
$string['alwaysavailable'] = "Altid tilgængelig";
$string['answer'] = "Svar";
$string['answerhowmany'] = "Et eller flere svar?";
$string['answersingleno'] = "Flere svar tilladt";
$string['answersingleyes'] = "Kun et svar";
$string['attempt'] = "Forsøg \$a";
$string['attemptfirst'] = "Første forsøg";
$string['attemptlast'] = "Sidste forsøg";
$string['attemptquiznow'] = "Lav quizzen nu";
$string['attempts'] = "Forsøg";
$string['attemptsallowed'] = "Forsøg tilladt";
$string['attemptsunlimited'] = "Ingen begrænsniger yi antal forsøg";
$string['backtoquiz'] = "Tilbage til redigering i quiz";
$string['bestgrade'] = "Bedste bedømmelse";
$string['caseno'] = "Nej, ingen case sensitivity";
$string['casesensitive'] = "Case sensitivity";
$string['caseyes'] = "Ja, der er case sensitivity";
$string['categories'] = "Kategorier";
$string['category'] = "Kategori";
$string['categoryinfo'] = "Info om kategori";
$string['categorymove'] = "Kategorien '\$a->name' indeholder \$a->count spørgsmål. Vælg venligst at flytte dem til en anden kategori";
$string['categorymoveto'] = "Flyt dem til denne kategori";
$string['choice'] = "Choice";
$string['choices'] = "Mulige choices";
$string['correctanswer'] = "Korrekt svar";
$string['correctanswers'] = "Korrekte svar";
$string['createnewquestion'] = "Lav et nyt spørgsmål";
$string['daysavailable'] = "Dage til rådighed";
$string['default'] = "Default";
$string['defaultinfo'] = "Default kategorien for spørgsmål.";
$string['deletequestioncheck'] = "Er du helt sikker på at du vil slette '\$a'?";
$string['editcategories'] = "Rediger kategorier";
$string['editingmultichoice'] = "Redigerer et multiple choice spørgsmål";
$string['editingquestion'] = "Redigerer et spørgsmål";
$string['editingquiz'] = "Redigerer en quiz";
$string['editingshortanswer'] = "Redigerer et \"kort svar\" spørgsmål";
$string['editingtruefalse'] = "Redigerer et sandt/falsk spørgsmål";
$string['false'] = "Falsk";
$string['feedback'] = "Feedback";
$string['filloutoneanswer'] = "Du skal give mindst et muligt svar. Blanke felter vil ikke blive bedømt.";
$string['fillouttwochoices'] = "Du skal give mindst to svar. Blanke felter vil ikke blive bedømt.";
$string['fractionsaddwrong'] = "De positive bedømmelser giver ikke sammenlagt 100%%
<BR>I stedet giver de \$a%%
<BR>Vil du vende tilbage og lave det om?";
$string['fractionsnomax'] = "Et eller flere svar skal give 100%%, så det er <BR>få fuld bedømmelse for dette spørgsmål<BR>Vil du vende tilbage og lave det om?";
$string['gradeaverage'] = "Gennemsnitlig bedømmelse";
$string['gradehighest'] = "Højeste bedømmelse";
$string['grademethod'] = "Bedømmelsesmetode";
$string['guestsno'] = "Beklager, gæster kan ikke deltage i quizzen";
$string['imagedisplay'] = "Billede";
$string['introduction'] = "Introduktion";
$string['marks'] = "Markeringer";
$string['missingname'] = "Mangler navn på spørgsmål";
$string['missingquestiontext'] = "Mangler tekst til spørgsmål";
$string['modulename'] = "Quiz";
$string['modulenameplural'] = "Quizzer";
$string['multichoice'] = "Multiple Choice";
$string['noanswers'] = "Der er ikke valgt et svar!";
$string['noattempts'] = "Ingen har forsøgt sig med denn quiz";
$string['nomoreattempts'] = "Der er ikke tilladt flere forsøg";
$string['noquestions'] = "Der er ikke tilføjet spørgsmål endnu";
$string['noreview'] = "Du kan ikke se quizzen igen";
$string['noreviewuntil'] = "Du kan se quizzen igen indtil \$a";
$string['publish'] = "Publicér";
$string['question'] = "Spørgsmål";
$string['questioninuse'] = "Spørgsmålet '\$a' er foreløbigt brugt:";
$string['questionname'] = "NAvn på spørgsmål";
$string['questions'] = "Spørgsmål";
$string['quizavailable'] = "Quizzen er åben indtil: \$a";
$string['quizclose'] = "Luk quizzen";
$string['quizclosed'] = "Quizzen lukkede \$a";
$string['quiznotavailable'] = "Quizzen er ikke tilgængelig før end: \$a";
$string['quizopen'] = "Åbn quizzen";
$string['random'] = "Tilfældig valg";
$string['readytosend'] = "Du er ved at sende dine svar ind til bedømmelse. Er du sikker på at du vil fortsætte?";
$string['regrade'] = "Bedøm alle forsøg om";
$string['regradecomplete'] = "Alle forsøg er bedømt om";
$string['regradecount'] = "\$a->changed ud af \$a->attempt bedømmelser blev ændret";
$string['rename'] = "Omdøb";
$string['report'] = "Rapporter";
$string['save'] = "Gem";
$string['savegrades'] = "Gem bedømmelser";
$string['savemyanswers'] = "Gem mine svar";
$string['savequiz'] = "Gem hele quizzen";
$string['score'] = "High score";
$string['select'] = "Vælg";
$string['selectcategoryabove'] = "Vælg en kategori ovenfor";
$string['shortanswer'] = "Kort Svar";
$string['show'] = "Vis";
$string['showcorrectanswer'] = "Skal korrekte svar vises i feedback?";
$string['showfeedback'] = "Skal feedback vises efter besvarelserne?";
$string['time'] = "Tid";
$string['timecompleted'] = "Færdig";
$string['timetaken'] = "Tidsforbrug";
$string['true'] = "Sandt";
$string['truefalse'] = "Sandt/Falsk";
$string['type'] = "Type";
$string['viewallanswers'] = "Se \$a færdige quizzer";
$string['yourfinalgradeis'] = "Din endelige bedømmelse for denne quiz er \$a";
?>
+28
View File
@@ -0,0 +1,28 @@
<?PHP // $Id$
// resource.php - created with Moodle 1.0.8.1 (2003011200)
$string['addresource'] = "Tilføj materiale";
$string['editingaresource'] = "Rediger i materialet";
$string['example'] = "Eksempel";
$string['examplereference'] = "Tobin, K. & Tippins, D (1993) Constructivism as a Referent for Teaching and Learning. In: K. Tobin (Ed) The Practice of Constructivism in Science Education, pp 3-21, Lawrence-Erlbaum, Hillsdale, NJ.";
$string['exampleurl'] = "http://www.eksempel.com/enmappe/enfil.html";
$string['filename'] = "Filnavn";
$string['fulltext'] = "Fuld tekst";
$string['htmlfragment'] = "HTML del";
$string['modulename'] = "Materiale";
$string['modulenameplural'] = "Materialer";
$string['neverseen'] = "Ikke set endnu";
$string['note'] = "Note";
$string['notefile'] = "For at uploade filer til kurset(så de vises i denne liste) brug<A HREF=\$a >File Manager</A>.";
$string['notypechosen'] = "Du skal vælge en type. Brug tilbage knappen og prøv igen";
$string['resourcetype'] = "Materiale type";
$string['resourcetype1'] = "Reference";
$string['resourcetype2'] = "Web Sted";
$string['resourcetype3'] = "Uploaded Fil";
$string['resourcetype4'] = "Alm. tekst";
$string['resourcetype5'] = "Web Link";
$string['resourcetype6'] = "HTML tekst";
$string['resourcetype7'] = "Program";
?>
+196
View File
@@ -0,0 +1,196 @@
<?PHP // $Id$
// survey.php - created with Moodle 1.0.8.1 (2003011200)
$string['actual'] = "Aktuel";
$string['actualclass'] = "Aktuel klasse";
$string['actualstudent'] = "\$a aktuel";
$string['allquestions'] = "Alle spørgsmål i nr. orden, alle studerende";
$string['allscales'] = "Alle svar, alle studerende";
$string['alreadysubmitted'] = "Du har allerede indgivet svar på denne evaluering";
$string['analysisof'] = "Analyse af \$a";
$string['attls1'] = "Når jeg bedømmer hvad andre siger, fokuserer jeg på kvaliteten af det siger og ikke på persone, der siger det.";
$string['attls10'] = "Det er vigtigt for mig at forblive objektiv, når jeg analyserer noget.";
$string['attls10short'] = "forblive objektiv";
$string['attls11'] = "Jeg prøver at tænke med andre istedet for mod andre.";
$string['attls11short'] = "tænk MED andre";
$string['attls12'] = "Jeg vurderer argumenter ud fra bestemte kriterier.";
$string['attls12short'] = "brug kriterier i evalueringer";
$string['attls13'] = "Jeg prøver på at forstå andre meninger istedet for at vurdere på dem.";
$string['attls13short'] = "prøv at forstå";
$string['attls14'] = "Jeg fokuserer på svagheder i andres argumenter i stedet for at hjælpe dem ved at klargøre argumenterne.";
$string['attls14short'] = "fokuserer på svagheder";
$string['attls15'] = "Jeg sætter mig i andres sted, når jeg diskuterer kontroversielle emner med dem, for at forstå hvorfor de tænker, som de gør";
$string['attls15short'] = "sætter mig i andres sted";
$string['attls16'] = "Måden, jeg analyserer udsagn, kan sammenlignes med at 'slæbe folk for retten', fordi jeg overvejer alle facts. ";
$string['attls16short'] = "slæbe for retten";
$string['attls17'] = "Jeg værdsætter at bruge logik og fornuft, førend mine egne overvejelser, når jeg løser problemer.";
$string['attls17short'] = "jeg værdsætter logik";
$string['attls18'] = "Jeg kan opnå indsigt i meninger, som der er forskellige fra mine gennem indlevelse.";
$string['attls18short'] = "indsigt gennem indlevelse";
$string['attls19'] = "Når jeg møder mennesker med meninger fremmede for mig, gør jeg et forsøg på at nå ind til vedkommende, for at få et indblik i deres meninger ";
$string['attls19short'] = "prøver at nå ind til";
$string['attls1short'] = "fokuserer på kvaliteten i argumenterne";
$string['attls2'] = "Jeg kan li' at spille 'djævelens advokat' - argumentere med det modsatte af andres meninger";
$string['attls20'] = "Jeg bruger tid på at finde ud af, hvad der er galt. F.eks. så bruger jeg tid på at finde dårlig argumentation i ting jeg læser. ";
$string['attls20short'] = "Hvad er der galt?";
$string['attls2short'] = "spiller djævelens advokat";
$string['attls3'] = "Jeg vil gerne vide, hvor folk kommer fra, hvad der har fået dem til at føle det, de gør.";
$string['attls3short'] = "hvor folk kommer fra";
$string['attls4'] = "Den vigtigste del af min uddannelse har været det at lære at forstå mennesker, som er forskellige fra mig.";
$string['attls4short'] = "forstå forskellige mennesker";
$string['attls5'] = "Jeg mener, at måden at finde sin egen identitet sker ved omgang med andre mennesker.";
$string['attls5short'] = "omgang med andre";
$string['attls6'] = "Jeg kan lide at høre meninger fra folk, som kommer med en baggrund forskellig fra min - det får mig til at se, hvordan ting kan ses fra flere sider.";
$string['attls6short'] = "kan lide at høre meninger";
$string['attls7'] = "Jeg kan styrke min egen position ved at argumentere med folk, som er uenige med mig.";
$string['attls7short'] = "styrke ved argumentation";
$string['attls8'] = "Jeg er altid interesseret i at vide, hvorfor folk tror og siger, hvad de gør";
$string['attls8short'] = "vide hvad folk gør";
$string['attls9'] = "Jeg oplever ofte, at jeg argumenterer med forfatterere til de bøger, jeg læser - prøver på en logisk måde at finde ud af, hvorfor de ikke har ret.";
$string['attls9short'] = "argumenterer med forfattere";
$string['attlsintro'] = "Meningen med denne evaluering er at finde ud af dine holdninger til det at tænke og lære.
Der er ikke rigtige og forkerte svar, Vi er interesserede i dine meninger. Dine svar vil blive behandlet fortroligt og vil ikke blive brugt i nogen bedømmelse af dig.";
$string['attlsm1'] = "Holdninger til det at Tænke og Lære";
$string['attlsm2'] = "Læring med andre";
$string['attlsm3'] = "Individuel læring";
$string['attlsmintro'] = "I diskussion...";
$string['attlsname'] = "ATTLS (20 item version)";
$string['clicktocontinue'] = "Klik her for at fortsætte";
$string['clicktocontinuecheck'] = "Klik her for at markere og fortsæt";
$string['colles1'] = "Min læring fokuserer på ting der interesserer mig.";
$string['colles10'] = "Jeg beder andre studerende om at forklare deres ideer.";
$string['colles10short'] = "jeg beder om forklaringer";
$string['colles11'] = "andre studerende beder mig om at forklare mine ideer.";
$string['colles11short'] = "jeg bliver bedt om forklaringer";
$string['colles12'] = "andre studerende reagerer på mine ideer.";
$string['colles12short'] = "studerende reagerer på mig";
$string['colles13'] = "læreren stimulerer min tænkeproces.";
$string['colles13short'] = "læreren stimulerer min tænkeproces";
$string['colles14'] = "læreren får mig til at deltage aktivt.";
$string['colles14short'] = "læreren aktiverer mig";
$string['colles15'] = "læreren opfordrer til gode samtaler.";
$string['colles15short'] = "tlæreren opfordrer til samtaler";
$string['colles16'] = "læreren ansporer til kritisk selv refleksion.";
$string['colles16short'] = "læreren ansporer til selv refleksion";
$string['colles17'] = "andre studerende støtter min deltagelse.";
$string['colles17short'] = "andre studerende støtter mig";
$string['colles18'] = "andre studerende anderkender mine bidrag.";
$string['colles18short'] = "andre studerende anderkender mig";
$string['colles19'] = "andre studerende værdsætter mine bidrag.";
$string['colles19short'] = "jeg er værdsat af andre studerende";
$string['colles1short'] = "ffokus på interessante emner";
$string['colles2'] = "Det, jeg lærer, har betydning for mine praktiske færdigheder.";
$string['colles20'] = "andre studerende har indlevelse i at, at jeg forsøger at lære.";
$string['colles20short'] = "indlevende studerende";
$string['colles21'] = "Jeg forstår, hvad de andre studerende skriver.";
$string['colles21short'] = "jeg forstår andre studerende";
$string['colles22'] = "andre studerende forstår, hvad jeg skriver.";
$string['colles22short'] = "studerende forstår mig";
$string['colles23'] = "jeg forstår det, som læreren skriver.";
$string['colles23short'] = "jeg forstår læreren";
$string['colles24'] = "læreren forstår, hvad jeg skriver.";
$string['colles24short'] = "læreren forstår mig";
$string['colles2short'] = "vigtigt for mine færdigheder";
$string['colles3'] = "Jeg lærer at forbedre mine praktiske færdigheder.";
$string['colles3short'] = "forbedrer mine færdigheder";
$string['colles4'] = "Det jeg lærer, hænger godt sammen med min virkelighed (den praktiske).";
$string['colles4short'] = "har sammenhæng med virkeligheden";
$string['colles5'] = "Jeg er kritisk over for min egen læring.";
$string['colles5short'] = "Jeg er kritisk over for min egen læring";
$string['colles6'] = "Jeg er kritisk over for mine egne ideer.";
$string['colles6short'] = "Jeg er kritisk over for mig selv";
$string['colles7'] = "Jeg er kritisk over for andre studerendes ideer.";
$string['colles7short'] = "Jeg er kritisk overfor andre studerende";
$string['colles8'] = "Jeg er kritisk overfor det, jeg læser.";
$string['colles8short'] = "Jeg er kritisk over for det, jeg læser";
$string['colles9'] = "Jeg forklarer mine ideer for andre studerende.";
$string['colles9short'] = "Jeg forklarer mine ideer";
$string['collesaintro'] = "Formålet med disse spørgsmål er, at vi gerne vil undersøge, hvor meget du har lært ved at følge dette online modul.
Hver af de 24 udsagne nedenfor giver dig mulighed for at komme med dine erfaringer med dette modul.
Der er ingen 'rigtige' eller 'forkerte' svar; vi er interesserede i din mening. Dine svar vil blive behandlet fortroligt og , vil ikke have indflydelse på bedømmelsen af dig.
Dine omhyggelige besvarelser vil hjælpe os med at forbedre online undervisningen senere hen.
På forhånd tak.";
$string['collesaname'] = "COLLES (Aktuelle)";
$string['collesapintro'] = "Formålet med disse spørgsmål er, at vi gerne vil undersøge, hvor meget du har lært ved at følge dette online modul.
Hver af de 24 udsagn nedenfor vil få dig til at sammneligne <B>foretrukne</B> (ideelle) og <B>aktuelle</B> oplevelse i dette modul.
Der er ingen 'rigtige' eller 'forkerte' svar; vi er interesserede i din mening. Dine svar vil blive behandlet fortroligt og , vil ikke have indflydelse på bedømmelsen af dig.
Dine omhyggelige besvarelser vil hjælpe os med at forbedre online undervisningen senere hen.
På forhånd tak.";
$string['collesapname'] = "COLLES (Foretrukket og aktuelle)";
$string['collesm1'] = "Relevans";
$string['collesm1short'] = "Relevans";
$string['collesm2'] = "Refleksion";
$string['collesm2short'] = "Refleksion";
$string['collesm3'] = "Interaktivitet";
$string['collesm3short'] = "Interaktivitet";
$string['collesm4'] = "Support fra læreren";
$string['collesm4short'] = "Support fra læreren";
$string['collesm5'] = "Support fra andre";
$string['collesm5short'] = "Support fra andre";
$string['collesm6'] = "Fortolkning";
$string['collesm6short'] = "Fortolkning";
$string['collesmintro'] = "I dette online modul...";
$string['collespintro'] = "Formålet med denne undersøgelse er at finde ud af, hvad du mener om denne online læringsoplevelse.
Hver af de 24 sætninger nedenunder kan bruges til at angive din <B>foretrukne</B> (ideelle) oplevelse med dette modul.
Der er ingen 'rigtige' eller 'forkerte' svar; vi er interesserede i din mening. Dine svar vil blive behandlet fortroligt og , vil ikke have indflydelse på bedømmelsen af dig.
Dine omhyggelige besvarelser vil hjælpe os med at forbedre online undervisningen senere hen.
På forhånd tak.";
$string['collespname'] = "COLLES (Foretrukket)";
$string['done'] = "Færdig";
$string['download'] = "Download";
$string['downloadexcel'] = "Download data i Excel format";
$string['downloadinfo'] = "Du kan downloade de rå data for denne undersøgelse så du kan sætte dem ind i Excel, SPSS eller et andet program.";
$string['downloadtext'] = "Download en tekst fil";
$string['editingasurvey'] = "Ændrer en undersøgelse";
$string['helpsurveys'] = "Hjælp til de forskellige undersøgelser";
$string['howlong'] = "Hvor lang tid har du været om at færdiggøre denne undersøgelse??";
$string['howlongoptions'] = "under 1 min,1-2 min,2-3 min,3-4 min,4-5-min,5-10 min,mere end 10";
$string['ifoundthat'] = "Jeg finder at";
$string['introtext'] = "Introduktion til tekst";
$string['ipreferthat'] = "Jeg foretrækker at";
$string['modulename'] = "Undersøgelse";
$string['modulenameplural'] = "Undersøgelser";
$string['name'] = "Navn";
$string['newsurveyresponses'] = "Nye svar på undersøgelsen";
$string['nobodyyet'] = "Ingen har endnu svaret på undersøgelsen";
$string['notdone'] = "Endnu ikke færdig";
$string['notes'] = "Dine private kommentarer og noter";
$string['othercomments'] = "Har du andre kommentarer?";
$string['peoplecompleted'] = "\$a har foreløbigt svaret på undersøgelsen";
$string['preferred'] = "Foretrukket";
$string['preferredclass'] = "Foretrukket klasse";
$string['preferredstudent'] = "\$a foretrukket";
$string['question'] = "Spørgsmål";
$string['questions'] = "Spørgsmål";
$string['questionsnotanswered'] = "Nogle af multiple choice spørgsmålene er ikke besvaret.";
$string['report'] = "Undersøgelse rapport";
$string['savednotes'] = "Dine noter er gemt";
$string['scaleagree5'] = "Meget uenig,Noget uenig,Ikke enig eller uenig,Næsten enig,Meget enig";
$string['scales'] = "Vurderinger";
$string['scaletimes5'] = "Næsten aldrig,Sjældent,Nogle gange,Ofte,Næsten altid";
$string['seemoredetail'] = "Klik her for detaljer";
$string['selectedquestions'] = "Udvalgte spørgsmål, alle studenterende";
$string['summary'] = "Opsummering";
$string['surveycompleted'] = "Du er færdig med undersøgelsen. Grafen nedenunder viser dine svar i forhold til klassens gennemsnit";
$string['surveyname'] = "Undersøgelse navn";
$string['surveysaved'] = "Undersøgelse gemt";
$string['surveytype'] = "Undersøgelse type";
$string['thanksforanswers'] = "Tak for dine besvarelser på undersøgelsen, \$a";
$string['time'] = "Tid";
$string['viewsurveyresponses'] = "Se \$a svar";
?>
+24 -25
View File
@@ -1,42 +1,41 @@
<?PHP // $Id$
// assignment.php - created with Moodle 1.0.8 dev (2002122301)
<?php
$string['allowresubmit'] = "Erneutes Einreichen erlauben";
$string['assignmentdetails'] = "Aufgabendetails";
$string['assignmentname'] = "Aufgabenname";
$string['assignmenttype'] = "Aufgabentyp";
$string['description'] = "Beschreibung ";
$string['duedate'] = "Abgabefrist";
$string['duedate'] = "Abgabedatum";
$string['early'] = "\$a früh";
$string['failedupdatefeedback'] = "Keine Aktualisierung der Eintragsmeldung für Benutzer \$a";
$string['feedback'] = "Meldung";
$string['feedbackupdated'] = "Eintragsmeldung aktualisiert für \$a Leute ";
$string['failedupdatefeedback'] = "Keine Aktualisierung der Rückmeldung für Benutzer \$a";
$string['feedback'] = "Rückmeldung";
$string['feedbackupdated'] = "Rückmeldung aktualisiert für \$a Leute ";
$string['late'] = "\$a spät ";
$string['maximumgrade'] = "Höchster Grad ";
$string['maximumgrade'] = "Höchste Bewertung ";
$string['maximumsize'] = "Maximale Größe";
$string['modulename'] = "Aufgabe";
$string['modulenameplural'] = "Aufgaben";
$string['newsubmissions'] = "Aufgaben eingetragen";
$string['notsubmittedyet'] = "Noch nicht eingetragen";
$string['newsubmissions'] = "Aufgaben eingereicht";
$string['notsubmittedyet'] = "Noch nichts eingereicht";
$string['overwritewarning'] = "Hinweis: erneutes Hochladen ERSETZT Ihren gegenwärtigen Eintrag ";
$string['saveallfeedback'] = "Alle meine Meldungen speichern";
$string['submissionfeedback'] = "Eintragsmeldung";
$string['submissions'] = "Einträge";
$string['submitassignment'] = "Tragen Sie Ihre Aufgabe ein unter Verwendung dieses Formulars";
$string['submitted'] = "Eingetragen";
$string['typeoffline'] = "Offlineaktivität ";
$string['typeuploadsingle'] = "Laden Sie einzige Datei hoch, Wert zwischen 0 - 100 Punkten";
$string['uploadbadname'] = "Dieser Dateiname enthält unzulässige Zeichen und kann nicht hochgeladen erden.";
$string['saveallfeedback'] = "Alle meine Rückmeldungen speichern";
$string['submissionfeedback'] = "Rückmeldung zu den eingereichten Aufgaben";
$string['submissions'] = "Eingereichte Aufgaben";
$string['submitassignment'] = "Tragen Sie Ihre Aufgabe unter Verwendung dieses Formulars ein";
$string['submitted'] = "Eingereicht";
$string['typeoffline'] = "Offline Aktivität ";
$string['typeuploadsingle'] = "Eine einzige Datei hochladen";
$string['uploadbadname'] = "Dieser Dateiname enthält unzulässige Zeichen und kann nicht hochgeladen werden.";
$string['uploadedfiles'] = "hochgeladene Dateien";
$string['uploaderror'] = "Beim Hochladen der Datei trat ein Fehler auf";
$string['uploadfailnoupdate'] = "Die Datei wurde korrekt hochgeladen, aber Ihr Eintrag kann nicht aktualisiert werden!";
$string['uploadfiletoobig'] = "Entschuldigung, aber diese Datei ist zu groß (Die Begrenzung ist \$a Bytes)";
$string['uploadnofilefound'] = "Es wurke keine Datei gefunden . Sind Sie sicher, dass Sie eine für das Hochladen ausgewählt haben?";
$string['uploadnotregistered'] = "'\$a' wurde korrekt hochgeladen, aber der Eintrag nicht registriert'";
$string['uploadsuccess'] = "'\$a' wurde erfolgreich hochgeladen";
$string['viewfeedback'] = "Aufgabengrad und Rückmeldung anzeigen ";
$string['viewsubmissions'] = "Zeige \$a eingetragen Aufgaben ";
$string['yoursubmission'] = "Ihre Eintrag";
$string['uploadnofilefound'] = "Es wurde keine Datei gefunden. Sind Sie sicher, dass Sie eine für das Hochladen ausgewählt haben?";
$string['uploadnotregistered'] = "\'\$a\' wurde korrekt hochgeladen, aber der Eintrag wurde nicht registriert!";
$string['uploadsuccess'] = "\'\$a\' wurde erfolgreich hochgeladen";
$string['viewfeedback'] = "Aufgabenbewertung und Rückmeldung anzeigen ";
$string['viewsubmissions'] = "Zeige \$a eingereichte Aufgaben ";
$string['yoursubmission'] = "Ihre eingereichten Aufgaben";
?>
?>
+19 -10
View File
@@ -3,17 +3,18 @@
$string['auth_dbdescription'] = "This method uses an external database table to check whether a given username and password is valid. If the account is a new one, then information from other fields may also be copied across into Moodle.";
$string['auth_dbextrafields'] = "These fields are optional. You can choose to pre-fill some Moodle user fields with information from the <B>external database fields</B> that you specify here. <P>If you leave these blank, then defaults will be used.<P>In either case, the user will be able to edit all of these fields after they log in.";
$string['auth_dbfieldpass'] = "Name of the field containing passwords";
$string['auth_dbfielduser'] = "Name of the field containing usernames";
$string['auth_dbhost'] = "The computer hosting the database server.";
$string['auth_dbname'] = "Name of the database itself";
$string['auth_dbpass'] = "Password matching the above username";
$string['auth_dbextrafields'] = "Diese Felder sind optional. Sie können auswählen, einige Moodle Nutzer-Felder mit Informationen des <b>externen Datenbank-Feldes</b> vorauszufüllen, das Sie hier angeben.
<p>Wenn Sie dieses leer lassen, dann werden Standardwerte benutzt.<P>Im anderen Fall wird der Nutzer befähigt, alle diese Felder nach der Anmeldung zu bearbeiten.";
$string['auth_dbfieldpass'] = "Name des Feldes, das das Kennwort enthält";
$string['auth_dbfielduser'] = "Name des Feldes, das den Nutzernamen enthält";
$string['auth_dbhost'] = "Der Computer, der die Datenbank bereitstellt";
$string['auth_dbname'] = "Name der Datenbank selbst";
$string['auth_dbpass'] = "Das Passwort, das zum Nutzernamen gehört";
$string['auth_dbpasstype'] = "Spezifizieren Sie das Format, das das Kennwortfeld benutzt. MD5-Verschlüsselung ist nützlich dafür, mit anderen üblichen Netzanwendungen Verbindung aufzunehmen wie z.B. PostNuke";
$string['auth_dbtable'] = "Name of the table in the database";
$string['auth_dbtitle'] = "Use an external database";
$string['auth_dbtype'] = "The database type (See the <A HREF=../lib/adodb/readme.htm#drivers>ADOdb documentation</A> for details)";
$string['auth_dbuser'] = "Username with read access to the database";
$string['auth_dbtitle'] = "Eine externe Datenbank benutzen";
$string['auth_dbtype'] = "Der Datenbank-Typ (Siehe <A HREF=../lib/adodb/readme.htm#drivers>ADOdb Anleitung</A> für Einzelheiten)";
$string['auth_dbuser'] = "Nutzername mit Schreibzugriff auf die Datenbank";
$string['auth_emaildescription'] = "Email confirmation is the default authentication method. When the user signs up, choosing their own new username and password, a confirmation email is sent to the user's email address. This email contains a secure link to a page where the user can confirm their account. Future logins just check the username and password against the stored values in the Moodle database.";
$string['auth_emailtitle'] = "Email-based authentication";
$string['auth_imapdescription'] = "This method uses an IMAP server to check whether a given username and password is valid.";
@@ -24,7 +25,10 @@ $string['auth_imaptype'] = "The IMAP server type. IMAP servers can have differe
$string['auth_ldap_bind_dn'] = "If you want to use bind-user to search users, specify it here. Someting like 'cn=ldapuser,ou=public,o=org'";
$string['auth_ldap_bind_pw'] = "Password for bind-user.";
$string['auth_ldap_contexts'] = "List of contexts where users are located. Separate different contexts with ';'. For example: 'ou=users,o=org; ou=others,o=org'";
$string['auth_ldap_host_url'] = "Specify LDAP host in URL-form like 'ldap://ldap.myorg.com/' or 'ldaps://ldap.myorg.com/' ";
$string['auth_ldap_create_context'] = "Wenn Sie die Nutzer-Erstellung mit Email-Bestätigung aktivieren, geben Sie die Umgebung an, wo die Nutzer erstellt werden sollen. Diese Umgebung sollte sich von der anderere Nutzer unterscheiden, um Sicherheitsrisiken zu vermeiden. Sie brauchen diese Umgebung nicht zur ldap_context Variable hinzuzufügen, Moodle sucht in dieser Umgebung automatisch nach Nutzern ";
$string['auth_ldap_creators'] = "Einen Liste von Gruppen, denen es erlaubt ist, neue Kurse zu erstellen. Trennen Sie mehrere Gruppen durch ';'. Normalerweise etwas wie 'cn=teachers,ou=staff, o=myorg'";
$string['auth_ldap_host_url'] = "Geben Sie einen ldap Server in URL-form an wie 'ldap://ldap.myorg.de/' oder 'ldaps://ldap.myorg.de/' ";
$string['auth_ldap_memberattribute'] = "Geben Sie die Mitgliedsoptionen an, wenn Nutzer zu einer Gruppe gehören. Normalereise 'member'";
$string['auth_ldap_search_sub'] = "Put value &lt;&gt; 0 if you like to search users from subcontexts.";
$string['auth_ldap_update_userinfo'] = "Update user information (firstname, lastname, address..) from LDAP to Moodle. Look at /auth/ldap/attr_mappings.php for mapping information";
$string['auth_ldap_user_attribute'] = "The attribute used to name/search users. Usually 'cn'.";
@@ -35,6 +39,8 @@ $string['auth_ldapdescription'] = "This method provides authentication against a
password are checked.";
$string['auth_ldapextrafields'] = "These fields are optional. You can choose to pre-fill some Moodle user fields with information from the <B>LDAP fields</B> that you specify here. <P>If you leave these fields blank, then nothing will be transferred from LDAP and Moodle defaults will be used instead.<P>In either case, the user will be able to edit all of these fields after they log in.";
$string['auth_ldaptitle'] = "Use an LDAP server";
$string['auth_manualdescription'] = "Diese Methode verhindert, dass Nutzer Ihre eigenen Zugänge anlegen können. Jeder Zugang muss manuell vom Administrator selbst eingerichtet werden.";
$string['auth_manualtitle'] = "Nur manuelle Zugänge";
$string['auth_nntpdescription'] = "This method uses an NNTP server to check whether a given username and password is valid.";
$string['auth_nntphost'] = "The NNTP server address. Use the IP number, not DNS name.";
$string['auth_nntpport'] = "Server port (119 is the most common)";
@@ -46,6 +52,9 @@ $string['auth_pop3host'] = "The POP3 server address. Use the IP number, not DNS
$string['auth_pop3port'] = "Server port (110 is the most common)";
$string['auth_pop3title'] = "Use a POP3 server";
$string['auth_pop3type'] = "Server type. If your server uses certificate security, choose pop3cert.";
$string['auth_user_create'] = "Nutzer-Erstellung aktivieren";
$string['auth_user_creation'] = "Neue (anonyme) Nutzer können Nutzer-Accounts erstellen außerhalb der Autentisierungsquelle und per Email bestätigen. Sofern Sie dies aktivieren, achten Sie darauf, ebenso modulspezifische optionen für die Modulerstellung zu konfigurieren.";
$string['auth_usernameexists'] = "Ausgewählter Nutzername existiert bereits. Bitte wählen Sie einen neuen.";
$string['authenticationoptions'] = "Authentication options";
$string['authinstructions'] = "Here you can provide instructions for your users, so they know which username and password they should be using. The text you enter here will appear on the login page. If you leave this blank then no instructions will be printed.";
$string['changepassword'] = "Kennwort-URL ändern";

Some files were not shown because too many files have changed in this diff Show More