Compare commits

..

2448 Commits

Author SHA1 Message Date
moodler 43000582c0 OK, this is IT. 2004-03-25 15:53:08 +00:00
moodler 9564b02393 Added release notes for Moodle 1.2.1 2004-03-25 15:52:43 +00:00
moodler 92be8db8be Fixed just a tiny typo 2004-03-25 15:34:23 +00:00
moodler 1265952149 - Fixed timezone calculations when user isn't present, and
- format_float now defaults to one decimal place
2004-03-25 15:29:40 +00:00
moodler 151ee2bc70 Removed a very odd line ... probably left over from testing or something
bug 1156    Thanks Eloy!
2004-03-25 15:22:51 +00:00
moodler 95e42912a7 Fix to detect the different ANSWER format used for Shortanswers bug 1182 2004-03-25 15:07:14 +00:00
moodler e02bd4a191 After an error on import, come back to this page 2004-03-25 14:55:04 +00:00
moodler 9421aca0cd WebCT import can now deal with escaped colons in the text bug 1182 2004-03-25 14:50:25 +00:00
moodler b4ac9780fe Don't create a warning for missing images. See Bug 1181 2004-03-25 13:53:30 +00:00
martignoni 18e3b74270 Changed french name of "survey" activity to "consultation" to avoid confusion 2004-03-25 12:40:31 +00:00
adamtpaw 4350202847 Few new files 2004-03-25 11:30:57 +00:00
moodler 9d996871bb Use the data_submitted() function to get POST data ... allows checking etc 2004-03-25 08:14:24 +00:00
moodler 8dcd43f3fe Checking in Eloy's Javascript/smiley fixes from bug 1185 Thanks! 2004-03-25 06:31:44 +00:00
moodler 9a11957599 SOme fixes for formatting from Koen in bug 1183 2004-03-25 05:43:36 +00:00
moodler 0eb59ce623 Better handling of single forums when secureforms is on. bug 1189 2004-03-25 05:29:38 +00:00
moodler 7028b23fa3 Updates 2004-03-25 04:05:03 +00:00
stronk7 39e7e1abf8 One more day... 2004-03-24 23:27:09 +00:00
julmis 85334fdc0a Adding missing slash in tr -tag line 258 2004-03-24 23:14:20 +00:00
koenr 65c0f4de09 translated by koen roggemans 2004-03-24 18:41:39 +00:00
koenr 4aa6c61150 final modifications 2004-03-24 17:23:07 +00:00
mits e7e967aef2 Polished. 2004-03-24 17:22:25 +00:00
paca70 33b10c6e6c Updates from Jussi Kurikka 2004-03-24 15:05:01 +00:00
moodler b85806454b Multichoice defaults to a single answer 2004-03-24 14:36:52 +00:00
moodler ead6351e85 OK, this'll do for now. Nothing too serious remains, I think. 2004-03-24 13:03:43 +00:00
moodler d0ec93fbd6 Guests can no longer see email addresses if "show only to course participants"
has been set by that user
2004-03-24 12:23:43 +00:00
andreabix 8a39753a5d Theme update: modified the .autolink class in order to obtain a question mark cursor when mouse hovers the glossary link. 2004-03-24 10:58:26 +00:00
koenr 430360c8b7 hmm, typo 2004-03-24 10:05:21 +00:00
koenr ca433c0170 pollished some ugly and unclear translations, based on various usercomments 2004-03-24 09:56:10 +00:00
koenr f42cd726f1 Updated a verry outdated helpfile 2004-03-24 09:54:57 +00:00
moodler 427fdf6669 Primary admin is now the lowest-numbered entry in user_admins, rather than
the admin with the lowest userid.  This makes it easier to change the
primary admin.
2004-03-24 09:38:47 +00:00
adamtpaw de861fe3cb Few corrections and removing of not translated files. 2004-03-24 08:55:42 +00:00
adamtpaw 6fb4ced553 removing of not translated files. 2004-03-24 08:54:07 +00:00
mits 62302b6481 Polished 2004-03-24 04:06:16 +00:00
stronk7 3241e2c583 Small typo. Now Bug 1179 is closed.
(http://moodle.org/bugs/bug.php?op=show&bugid=1179)
2004-03-24 00:28:38 +00:00
stronk7 dadbd7586b Changed border=1 to border=0. Included in previous version to test a bug. Sorry. 2004-03-23 23:58:09 +00:00
stronk7 340ccd3e8d Small typo. Detected by aroberti. Bug 1178. Closed now. 2004-03-23 23:53:05 +00:00
mits 79e80e982f Polished 2004-03-23 21:35:42 +00:00
martignoni 67259f1cff Fixed some missing backslashes 2004-03-23 16:40:10 +00:00
giro123 68d04a4c33 Pedro Benito 2004-03-23 14:47:27 +00:00
moodler 61b9cd063e Tinkered with this a bit to improve brightness of Play button on
darker screens
2004-03-23 04:13:35 +00:00
koenr df849f0cd5 Initial translation by Evelien Roos 2004-03-22 23:31:22 +00:00
koenr 5c52c13309 ugly translation 2004-03-22 22:47:16 +00:00
stronk7 2147cbda7e preparing for micro-release in a day or two. Bump to 1.2.1 2004-03-22 19:42:46 +00:00
paca70 52248cff83 Updates 2004-03-22 17:02:59 +00:00
moodler 53f689833f Preparing for micro-release in a day or two 2004-03-22 16:48:38 +00:00
moodler 10c6c6063b Even safer implementation of the temporary $USER variable 2004-03-22 16:39:40 +00:00
moodler b346b424d6 Prevent glossary etc from adding links to activity names that are
about to be turned into links (using <nolink> tags)
2004-03-22 16:16:49 +00:00
bobopinna bb978ef02f Translated by Luca Arese 2004-03-22 15:56:38 +00:00
moodler 98bac2d044 Fixed some missing backslashes 2004-03-22 14:49:08 +00:00
moodler e80a8db7e0 Fixed GHEIGHT, GWIDTH typos ... thanks Prince Eloy! 2004-03-22 07:48:38 +00:00
moodler 8575cd3233 Most of the time, don't rely on HTTP_REFERER 2004-03-22 05:59:43 +00:00
moodler 840c178193 Fix from Bernard Boucher for situation when no groups members defined
http://moodle.org/mod/forum/discuss.php?d=6335#29657
2004-03-22 02:57:27 +00:00
moodler 01f2900014 Better checking of admin user stuff 2004-03-22 01:58:40 +00:00
moodler cae86de785 Unset $USER variable 2004-03-22 00:59:24 +00:00
koenr 9bac9e18f9 typo 2004-03-21 21:35:59 +00:00
martignoni 3ede87d978 Small correction 2004-03-21 12:35:55 +00:00
martignoni 709760080f Logs are now fully restored 2004-03-21 11:43:19 +00:00
martignoni bbc4d23fa8 Added 'removelink' and some corrections 2004-03-21 11:40:29 +00:00
stronk7 1163776529 Bump to 1.2 + :-) 2004-03-21 10:46:05 +00:00
paca70 3fa7a026f7 Updates 2004-03-21 10:36:40 +00:00
koenr 2ec96b0538 missing string 2004-03-21 06:34:09 +00:00
moodler 35ed9b2f2b Moving right along 2004-03-21 03:34:34 +00:00
moodler 20439c700b Add idnumber to list of course students 2004-03-21 03:30:27 +00:00
moodler c8d63a00e4 Added 'removelink' 2004-03-21 01:55:01 +00:00
moodler d9ed37f2f4 Logs are restored! 2004-03-21 01:35:13 +00:00
koenr 07e61bb603 initialtranslation by Koen Roggemans 2004-03-20 19:01:42 +00:00
martignoni 4e66ab82c1 Some major cleanups 2004-03-20 19:01:15 +00:00
koenr e52fb99b48 adding missing links 2004-03-20 19:00:28 +00:00
martignoni 057b5f5afa Updates 2004-03-20 18:55:34 +00:00
koenr 4e9bca6d18 and WebCT 2004-03-20 18:51:52 +00:00
martignoni 7845101287 Various fixes 2004-03-20 18:48:58 +00:00
koenr 2e096fa1f9 adding cloze link 2004-03-20 18:47:03 +00:00
koenr d2c84650ab missing string 2004-03-20 18:34:54 +00:00
martignoni 47b9d48544 Added "notavailable" string 2004-03-20 17:14:35 +00:00
mits 5a85115df7 added a new translated help file. 2004-03-20 16:55:16 +00:00
moodler b1847bce93 Slight wording change 2004-03-20 15:57:46 +00:00
moodler 72b7272126 Slight tweaking 2004-03-20 15:23:14 +00:00
moodler d1290a7db9 OK, well, this is pretty much it. 2004-03-20 15:04:21 +00:00
moodler 5eada3cef3 Kiled whitespace 2004-03-20 15:03:14 +00:00
moodler 3f459f966f Updates 2004-03-20 15:01:27 +00:00
moodler 78b41e5cb3 A few more fixes 2004-03-20 14:56:46 +00:00
moodler 4951cb3743 SOme major cleanups :-) 2004-03-20 14:48:35 +00:00
moodler 86fc8f85a5 SOme fixes 2004-03-20 13:52:44 +00:00
moodler d79666a916 Various fixes 2004-03-20 13:47:41 +00:00
moodler 9ef4f2323d Fix up some old Beta sites that may have lessons 2004-03-20 13:16:04 +00:00
moodler e0d4440f1c Fleshed out WebCT dox a bit 2004-03-20 12:47:52 +00:00
moodler 65c56bbf53 Added references to WebCT format 2004-03-20 12:40:58 +00:00
moodler b7db889494 Added link to Cloze 2004-03-20 12:35:59 +00:00
moodler 7d06579ea2 Bump! 2004-03-20 12:25:05 +00:00
moodler 92c26858ed FIxed some holes with hidden categories bug 1093 2004-03-20 12:21:08 +00:00
moodler e8d768968e Make sure backup page is hidden from sub menu too 2004-03-20 09:50:52 +00:00
moodler ba163fa231 Cleaner pages when there are no responses yet 2004-03-20 09:39:17 +00:00
moodler ee02c13d91 Table columns retain current search parameters 2004-03-20 07:03:46 +00:00
moodler 488acd1be9 Some fixes to the functions for fetching users (some of it is backing
out Scott's changes, sorry Scott!) and some fixes to the interface
for the admin user page.
2004-03-20 06:58:52 +00:00
moodler 1579586ced Some blank index.html files to prevent browsing 2004-03-20 04:10:26 +00:00
moodler 6670a7f214 Dummy index to prevent browsing 2004-03-20 04:08:19 +00:00
moodler 36ec6afea6 Added a small security check 2004-03-20 04:04:15 +00:00
koenr 4dfdf6bc6b typo 2004-03-19 19:39:44 +00:00
julmis d5a55d2388 Styles enabled on table-operations dialogs 2004-03-19 19:09:35 +00:00
moodler d396ba798f Multianswer cloze questions now show feedback (you need to hover
your mouse over the answers)
2004-03-19 14:51:29 +00:00
moodler 5f8505882e To avoid some unpleasant stuff with filters etc, I made slight changes
to separate the printing of the summary text from the edit button ...

Might need some testing because people have adjusted old texts to
work the old way ...   if anyone complains I'll put it back ...
2004-03-19 08:18:13 +00:00
moodler f31bc4d3e6 Latest version for Moodle 1.2 from wim 2004-03-19 06:30:20 +00:00
selliott 5a4aa257c1 On second thought, let's display the lastaccess in the lastaccess column of admin/user.php ;) 2004-03-19 04:39:20 +00:00
selliott 6c2ae454a5 Modified to be more consistent with user/index.php for paging, sorting and searching 2004-03-19 04:29:00 +00:00
selliott 73fc8c1af7 Added search parameter to get_course_students.
Modified get_course_students and count_course_students to handle a request for course 0 (will get all users, even if they are in no other course).
Changes done to for admin/user.php, should be compatible with all previous function calls.
2004-03-19 04:26:35 +00:00
moodler ae20afd889 Fixed some bad text 2004-03-19 03:41:11 +00:00
stronk7 75c83282ff Bump to update possible release date. 2004-03-18 22:55:26 +00:00
koenr 86a59aa1f0 typo 2004-03-18 21:22:32 +00:00
mits c3996b3fd2 Polished some. New translation & files added. 2004-03-18 19:10:06 +00:00
martignoni 0dfd208184 Small correction 2004-03-18 10:06:26 +00:00
paca70 598be1325b Updates from Jussi Kurikka 2004-03-17 14:59:01 +00:00
mits ff9f2f955a polished. 2004-03-17 03:49:51 +00:00
julmis 1e77b7122e table-operations file that seems to only working... 2004-03-16 23:22:50 +00:00
julmis 825c4c8878 makefile.xml 2004-03-16 23:21:47 +00:00
julmis 63830e903d Fixing typos :-( sorry!!! 2004-03-16 23:00:45 +00:00
koenr 3a78c4785f filling in missing strings 2004-03-16 21:49:11 +00:00
julmis 723ee6a111 Removelink feature added 2004-03-16 21:40:42 +00:00
julmis bc1e9d4590 Updates 2004-03-16 21:39:57 +00:00
julmis a9c48ae08d Removelink image 2004-03-16 21:39:18 +00:00
julmis bf5f1e7676 TableOperations enabled on fullscreen mode, finally :-) 2004-03-16 21:21:21 +00:00
mits a50d60d69d one help file translated 2004-03-16 18:47:34 +00:00
stronk7 661c23469a Bump to update possible release date. 2004-03-16 17:53:01 +00:00
moodler fc8bc7e516 Fixed some newly-introduced bugs caused by recent function name change 2004-03-16 14:02:30 +00:00
moodler 9fa8271283 Fixes for displaying numbers of assignment submissions when
groups are active
2004-03-16 13:54:29 +00:00
martignoni b3f2aad71c Update to deleteunconfirmed feature 2004-03-16 13:26:48 +00:00
moodler d0e258b55b Updaed 2004-03-16 12:19:23 +00:00
moodler 6c61fd041e Whoops! Just realised I never fully finished the deleteunconfirmed
feature!   All done now.
2004-03-16 10:59:42 +00:00
moodler a4557331c9 Some security fixes with directory listing 2004-03-16 07:20:00 +00:00
moodler f038d9a313 Fixed bug with empty string 2004-03-16 07:11:14 +00:00
koenr 89dfb4c1f3 initial translation by koen roggemans 2004-03-15 20:59:04 +00:00
moodler a384809295 Handle '+' signs in short answers 2004-03-15 14:41:19 +00:00
moodler 34e934a97b Don't allow links within forum post subjects when filtering them 2004-03-15 05:23:19 +00:00
stronk7 13ae718937 Avoid one undefined THEME little problem in html_header() 2004-03-14 23:05:04 +00:00
mits 0dafd031df new translation. 2004-03-14 22:51:55 +00:00
paca70 d28e480a7b Typos, oh no typos again! 2004-03-14 21:09:09 +00:00
paca70 69a8774592 Added link to translation site 2004-03-14 17:55:04 +00:00
villate 6e7b4b6f04 Portuguese translation of the English version from Sep 9 2003 2004-03-14 14:18:34 +00:00
villate fca6318ce0 Completed the translation for version 1.2 2004-03-14 14:00:11 +00:00
paca70 601ae6c095 Updates 2004-03-14 09:15:55 +00:00
paca70 c77ce11179 Added default values 2004-03-14 08:59:25 +00:00
stronk7 54be24ecec Avoid login as himself to teachers. One missing USER
variable was the cause ;-)
2004-03-14 02:17:26 +00:00
stronk7 e47543451e Avoid some division by 9 warnings when showing anonymously
and no answers have been introduced.
2004-03-14 01:22:28 +00:00
stronk7 2e89715bc2 Small typo causing some warnings. $theme ----> $THEME 2004-03-14 01:18:54 +00:00
stronk7 5cc875eb9e Upgrade to new release day 2004-03-14 00:17:59 +00:00
martignoni e2612ab906 Suppression of "work in progress" warning 2004-03-13 19:39:39 +00:00
koenr adb0158041 found a shorter word: now it fits the frame :-) 2004-03-13 19:37:44 +00:00
martignoni a2a9f74092 Tweaks to dates 2004-03-13 19:32:29 +00:00
martignoni 68bd12a490 Option to control whether uploaded files are parsed by filters. 2004-03-13 19:29:08 +00:00
martignoni 44da444d07 Additional String, couple of minor changes. 2004-03-13 19:25:55 +00:00
martignoni 6fbfecd5e4 Missing string added. 2004-03-13 19:22:19 +00:00
martignoni 8803bbe759 Updated help file for shortanswers explaining the wildcards 2004-03-13 19:19:44 +00:00
martignoni 80c115f579 Forgotten help file translated 2004-03-13 19:04:21 +00:00
martignoni 522ed87231 Update to 1.2 final. French is ready for release. Youpi ! 2004-03-13 18:55:09 +00:00
martignoni 52cf604332 Update to 'en' version 1.264 2004-03-13 18:51:06 +00:00
ralf-bonn 831fbe1465 Neue Felder eingearbeitet 2004-03-13 18:22:27 +00:00
moodler 19a2731137 Bumping it up 2004-03-13 17:10:53 +00:00
koenr 0be5186369 missing string 2004-03-13 16:15:17 +00:00
moodler d5a2ccadb9 New function journal_count_entries() and more accurate counting of
journal entries for different grouping scenarios
2004-03-13 16:15:02 +00:00
moodler 06b1db82d2 Decalre some globals so debugging works better 2004-03-13 16:04:52 +00:00
moodler 38ff09a83a New string for groups 2004-03-13 15:30:42 +00:00
moodler b1d530d202 Cleanups for bug 1117 2004-03-13 15:22:33 +00:00
moodler 4e3a60929c Finally fixed those annoying 'loginas' links on the main user listing 2004-03-13 14:34:32 +00:00
moodler 6f5a792f1d Grades page now supports groups 2004-03-13 14:26:09 +00:00
moodler 60b025d1cc Function name change ... hope it doesn't break any third-party code,
sorry if it does!

  get_users_in_group --->  get_group_users

... to be more consistent with other functions

Also a new function:  get_group_students()
2004-03-13 14:25:27 +00:00
moodler a12f686b62 Function name change ... hope it doesn't break any third-party code,
sorry if it does!

  get_users_in_group --->  get_group_users

  ... more consistent with other functions
2004-03-13 14:24:34 +00:00
moodler fcc69042e9 The menu when moving discussions now has section markers 2004-03-13 13:56:29 +00:00
moodler ca1388dac7 Non-editing teachers shouldn't be able to assign students 2004-03-13 13:43:06 +00:00
moodler dd050b3320 Non-editing teachers should not be able to assign students 2004-03-13 13:42:21 +00:00
moodler 6d18d87382 Too many bugs, not enough time! 2004-03-13 13:36:41 +00:00
moodler a30f997e4c Some fixes for display of survey reports 2004-03-13 13:33:20 +00:00
moodler 5151ae66e3 Full paths when including pclzip bug 1139 2004-03-13 12:08:28 +00:00
moodler bd83d0a3a8 OK that should fix the access problem, as well as a bug with organising the data 2004-03-13 12:01:28 +00:00
moodler 5b5f2971f1 Some fixes to counting, still need to fix some access issues 2004-03-13 11:26:29 +00:00
koenr 0d677409d7 forgot to review it: fixed some typo's 2004-03-13 11:00:21 +00:00
moodler a0a4a3c964 Some fixes. :-} 2004-03-13 10:56:38 +00:00
koenr 3e0d46ec36 initial translation by Koen Roggemans 2004-03-13 10:51:57 +00:00
mits 9a91764210 Added Paul Shew's translation. 2004-03-13 10:41:56 +00:00
moodler ecc8403ea2 OK, so the forums listing is revamped with different logic and it should now
correctly show the number of discussions for separate forums.

I'm checking this in so I can do testing on various servers.
2004-03-13 10:41:07 +00:00
moodler 9bf45e0036 Add a count of the number of activites using a particular module 2004-03-13 10:40:01 +00:00
mits 364525e7ec polished. 2004-03-13 10:23:17 +00:00
mits 9086aae9d4 polished & translated some. 2004-03-13 10:00:10 +00:00
koenr 7edcf6a1dc filling in missing strings 2004-03-13 09:58:17 +00:00
koenr 2de4073e85 added help about the use of the * in shortanswer 2004-03-13 09:50:52 +00:00
mits 87da71438e translated some. 2004-03-13 09:26:14 +00:00
mits b73854ed9a Polished. 2004-03-13 09:07:08 +00:00
andersbe d489165285 All the strings in the php-files are translated as of 2004-03-12
php-files for standard modules as well for development modules like Calendar and HotPot. Some help-files are still missing e g for Lesson Module.

Alla str?ngar i php-filerna  ?r ?versatta t o m 2004-03-12
php-filer till standardmoduler liksom utvecklingsmoduler som Calendar och HotPot. N?gra hj?lpfiler saknas fortfarande t ex till Lesson modulen..
2004-03-13 08:36:15 +00:00
moodler 6b4c1848e8 OK, now I'm just wasting time. :-) Hand-tweaked some pixels 2004-03-13 08:23:34 +00:00
moodler 8c9474844b I shouldn't have sharpened the black border as well ... fixed. 2004-03-13 08:19:34 +00:00
moodler 44dc1d3a6d Slightly sharper edges on the small logo 2004-03-13 08:16:59 +00:00
moodler ba2cde498d WHen showing just course categories, then the title of the section
is now "Course categories" rather than "Available courses"
2004-03-13 00:53:17 +00:00
julmis 95c1bce09e Sections, create folder and fileupload enabled also on link dialog. 2004-03-13 00:14:54 +00:00
martignoni 3e3e3fe8da End of translation of Module lesson 2004-03-12 16:43:52 +00:00
rkingdon 4a2b560257 Missing string added. 2004-03-12 16:34:45 +00:00
moodler 4dcb35aa47 Updated help file for shortanswers explaining the wildcards 2004-03-12 15:54:14 +00:00
rkingdon b41bec3429 Couple of small changes. 2004-03-12 15:37:03 +00:00
rkingdon ae913cbd01 Missing help file added. 2004-03-12 15:36:03 +00:00
rkingdon 046e5a0509 Additional String, couple of minor changes. 2004-03-12 15:34:13 +00:00
rkingdon f3162d71a2 Fixed Bug 1132. 2004-03-12 15:32:41 +00:00
rkingdon d4966ef24a Fixed Bug #1083. 2004-03-12 15:31:04 +00:00
rkingdon b082b2c641 Fixed Bugs #1059 and #1061. 2004-03-12 15:28:52 +00:00
rkingdon 2f39268b3d Fixed Bug 1060: Error inserting second entry from the same input page.
Fixed bug #865.
2004-03-12 15:25:13 +00:00
moodler bded7f70b5 Get coursemodule so the groups checking works correctly 2004-03-12 13:29:33 +00:00
moodler 8c0f49667f In shortanswers you can now use \* (ie slash asterisk) to mean a real asterisk
Normally the asterisk is a wildcard
2004-03-12 13:03:51 +00:00
moodler 191ad6873c Latest ADOdb version (thanks Eloy) 2004-03-12 12:14:34 +00:00
carlesbellver 1d79bf7b37 *** empty log message *** 2004-03-12 11:25:14 +00:00
stronk7 5710554f12 After executing all my test courses, now everything seems to be ready.
So I BUMP to 1.2 final now!!  :-)
2004-03-12 08:00:09 +00:00
martignoni 2d3541895e Initial bit of translation 2004-03-12 07:53:38 +00:00
moodler 1e55ed2610 More details 2004-03-12 07:34:14 +00:00
moodler aebaf90462 Changed default value for DB persistence 2004-03-12 07:30:34 +00:00
moodler 68ddf8bc47 Make sure forcelogin is applied to forums at site level 2004-03-12 01:54:10 +00:00
stronk7 977070f9e8 Undo one line inserted by error in my previous commit
with one change I was trying some time ago...sorry :-(
But now all should be correct.
2004-03-11 23:50:05 +00:00
stronk7 da0fe63f91 Fixed some wrong call to pclzip.lib.php. See:
http://moodle.org/bugs/bug.php?op=show&bugid=1138
2004-03-11 23:47:18 +00:00
mits e1fc83a0ee Translated some. 2004-03-11 20:01:13 +00:00
martignoni f3684fd8c5 More help files translated 2004-03-11 19:14:18 +00:00
martignoni 95b5a227e5 Complete translation 2004-03-11 18:08:06 +00:00
selliott b934e7a342 Fixed to hide hidden activities from normal users and to display dimmed for teachers / admins.
Also fixed an off by 1 error when displaying topics.
2004-03-11 14:07:56 +00:00
moodler b643af5900 Y not? 2004-03-11 11:13:04 +00:00
carlesbellver b10f6e7388 *** empty log message *** 2004-03-11 08:38:43 +00:00
julmis 6e4c0f6164 Some fixes of students dialog's placement on the screen
and a little fix for event handling
2004-03-11 08:21:55 +00:00
stronk7 dc47f786f9 Bump. To be in sync with Moodle. 2004-03-11 07:26:38 +00:00
koenr 59678118dd filling in missing strings 2004-03-11 07:08:13 +00:00
moodler 4a6f5ff250 So I don't forget 2004-03-11 02:17:54 +00:00
moodler de0c05a02c Bump 2004-03-11 02:15:57 +00:00
moodler 3cf4ab978b Added an option on the filters page to control whether uploaded
files are parsed by filters.    bug 1128
2004-03-11 02:14:15 +00:00
ralf-bonn d64f6001e6 Neue Felder eingearbeitet und Verbesserungen 2004-03-10 20:19:03 +00:00
koenr 4c4a240b43 changed filter to search 2004-03-10 18:23:43 +00:00
stronk7 39564db029 Solved bug 1123 and two more bugs when restoring
users and scales. Solved !!. Bump.
2004-03-10 17:12:00 +00:00
stronk7 1a6c02faba Detected 2 bugs when restoring users and scales about
recoding the id field !!
2004-03-10 17:10:26 +00:00
stronk7 063a889557 Now user_files are restored if the user existed previously but he
doesn't have a dir under the users dir.
See bug 1123 (http://moodle.org/bugs/bug.php?op=show&bugid=1123)
2004-03-10 16:15:42 +00:00
villate 0c92a8656a Portuguese translation of the original of Dec 30, 2003 2004-03-10 15:49:50 +00:00
villate 2830fb92cb Portuguese translation of the original from Oct 31, 2003. 2004-03-10 15:27:18 +00:00
villate 51417807ab Portuguese translation of the original from Oct 6, 2003. 2004-03-10 15:14:42 +00:00
villate e9560e3f4f Initial Portuguese translation. 2004-03-10 15:03:23 +00:00
villate 54b75c2aab First translation into Portuguese 2004-03-10 14:44:51 +00:00
villate 5a8118b839 Updated the date. 2004-03-10 14:29:41 +00:00
villate 3cbec41b70 Updates for 1.2 2004-03-10 14:29:05 +00:00
moodler 84bbca5355 When unenrolling a student from ALL courses, delete group memberships 2004-03-10 13:45:23 +00:00
villate 17050991cd Upgrades for 1.2 2004-03-10 13:40:21 +00:00
moodler 9c08ad13de Hide hidden activities from students on Recent Activity page 2004-03-10 13:38:08 +00:00
moodler 9b8a519291 Avoiding the use of the word "filter" on the Recent Activity page as
it might be confusing ... search will do.
2004-03-10 13:35:12 +00:00
moodler adb979a227 FIxing year on Copyright 2004-03-10 13:33:08 +00:00
villate d2b75ad62b Uses "lingua" instead of "idioma" 2004-03-10 13:30:07 +00:00
moodler f1b9a9e388 Adjusted date 2004-03-10 13:27:25 +00:00
moodler 351aac92eb Tweaks to dates etc 2004-03-10 13:26:33 +00:00
moodler abc3b857a2 Fixed some copyrights 2004-03-10 13:23:00 +00:00
moodler c6b456f66d Fixed some years 2004-03-10 13:21:12 +00:00
villate 4aa5717177 Updates for 1.2 2004-03-10 12:22:15 +00:00
villate f5a3da93f8 Proofreading by FEUP colleagues. 2004-03-10 11:57:55 +00:00
villate 19c0e4bc61 Contributions by Manuel Padilha. 2004-03-10 11:43:55 +00:00
villate 108055e37c Contributions by Guida Querido and some typos corrected. 2004-03-10 11:37:03 +00:00
moodler 99674db811 If $CFG->loglifetime is active then use it make the log graphing nicer.
bug 1120
2004-03-10 11:29:35 +00:00
moodler a69ffecd9c Format intro on attempts as well. 2004-03-10 09:49:31 +00:00
moodler 9a5c745d92 Properly format Quiz text (filters etc) 2004-03-10 09:45:33 +00:00
stronk7 57946b6d47 Take out the "working on it" string when restoring logs 2004-03-10 08:35:48 +00:00
moodler d928d9085d Latest versions from http://moodle.org/course/view.php?id=27 2004-03-10 08:28:28 +00:00
moodler 2eef791f9c Make sure $CFG->debug is defined before using it 2004-03-10 07:59:32 +00:00
moodler dd506ec8e5 Removing a notice 2004-03-10 07:20:42 +00:00
moodler 82d0993215 Include now uses absolute path, not relative. Solved problem
on one Sun installation.
2004-03-10 07:13:57 +00:00
moodler 52a88a8726 More rubustness 2004-03-10 03:45:44 +00:00
moodler 589af000f2 New dependency 2004-03-10 02:21:54 +00:00
moodler db46e49c9d Use break_up_long_words 2004-03-10 02:19:34 +00:00
moodler 4a5644e51a New generic function to break up long words 2004-03-10 02:19:17 +00:00
koenr a3dac57f5c missing strings (the last ones for 1.2??) 2004-03-10 00:12:08 +00:00
anvergara 1fed52248e empty files removed 2004-03-09 23:25:48 +00:00
stronk7 dd780a3b4c Now, in SEPARATE groups courses, a user cannot access to the info about users
in other groups.

Please check !!
2004-03-09 23:07:35 +00:00
stronk7 bdad9dbae8 Added the group icon to cordoroyblue theme. 2004-03-09 22:37:57 +00:00
selliott 8516afd507 Added logic to allow confirmation of unconfirmed users. 2004-03-09 21:43:09 +00:00
selliott 31f9f60576 Added user confirmation language. 2004-03-09 21:38:09 +00:00
selliott 3beaa4b6a3 Added some user confirmation language. 2004-03-09 21:35:41 +00:00
selliott ea5d48ee8d Modified function get_users_listing to:
1. also return confirmed field from user table and
2. include users in dataset who have not confirmed
(Used to display unconfirmed users in admin/user.php)
2004-03-09 21:12:54 +00:00
stronk7 75c591dbb9 Leeson icon for cordoroyblue
(the standard one)
2004-03-09 16:32:24 +00:00
moodler 9c7fee6c21 Lots of error checking now on most database functions ... if debugging
is turned on then you get notifications printed in the web page.

Good for catching bad SQL.

Thanks to Howard Miller for the boot up the bum!  :-)
2004-03-09 16:32:24 +00:00
moodler 940fca1a36 Fixed a little bug when glossary filter called from front page or
anywhere else a course is not defined
2004-03-09 16:30:36 +00:00
moodler 15ba837b5b Don't enter loop with no data ... bug 1053 2004-03-09 15:39:55 +00:00
moodler 4855286e27 Use DISTINCT instead of GROUP BY in get_site_users 2004-03-09 15:35:07 +00:00
moodler 3a954ad47f Fix for PostgreSQL and user searching Thanks Ulrik! bug 1101 2004-03-09 12:46:03 +00:00
moodler dcf9cea2a1 Don't check the login for the site-level course 2004-03-09 12:40:30 +00:00
moodler 13d7ed45db No doubling up on get_site_users() bug 1110 2004-03-09 12:18:52 +00:00
stronk7 f49306f136 Bump... :-) 2004-03-09 11:38:10 +00:00
stronk7 097015895c When restoring to existing course, the list of
available courses was previously ordered by sortorder.
Now it's ordered by fullname. See bug 1108.
(http://moodle.org/bugs/bug.php?op=show&bugid=1108)
2004-03-09 11:35:14 +00:00
bobopinna 4c65dd7fb2 Updated to Moodle 1.2 Beta + 2004-03-09 11:02:01 +00:00
bobopinna 4634e6f53b Update to 1.2 Beta + release 2004-03-09 10:59:25 +00:00
moodler b20ee40745 POssible fix for bug 1109 2004-03-09 08:41:57 +00:00
moodler 39f34785c8 Removing the random assignation button for now ... needs work.
Bug 1107
2004-03-09 06:47:23 +00:00
moodler b7a3d3b24c Filter text files as well 2004-03-09 06:44:27 +00:00
moodler cb4287ea70 Reverting previous fix, since it's now done across the board by file.php 2004-03-09 06:28:31 +00:00
moodler f05070115c If the uploaded file is HTML, then put it through the filters 2004-03-09 06:28:01 +00:00
moodler e359234d0f Fix for bug 1106
When resource_filterexternalpages are turned on then uploaded HTML
files are also now filtered properly.
2004-03-09 06:20:11 +00:00
moodler a9f80673b6 SHortanswer field just a bit bigger 2004-03-09 05:56:43 +00:00
moodler a8d909c77b Fix case of printing shortanswers with quotes in them 2004-03-09 05:51:16 +00:00
ralf-bonn f17eb3e5bd Neue Felder eingearbeitet und Verbesserungen 2004-03-08 19:22:46 +00:00
giro123 6a49664032 *** empty log message *** 2004-03-08 19:17:15 +00:00
giro123 a09e5d42d5 Updated 2004-03-08 19:16:29 +00:00
moodler 898f04d9cf Allow cloze questions to contain quotes 2004-03-08 13:09:42 +00:00
anvergara c550cf2bd4 Revised someallowguest string 2004-03-07 23:14:03 +00:00
anvergara 80b3028ac0 Upgraded to 1.2 beta 2004-03-07 23:00:04 +00:00
julmis 9174b41dc6 removing resizeTo -functions from dialogs 2004-03-07 14:40:39 +00:00
julmis f662e56130 fixes for gecko based browsers dialogs behavior (jumpyness) 2004-03-07 14:39:43 +00:00
moodler b4443d8f34 Whoops 2004-03-07 14:15:53 +00:00
moodler 4bf586673f Err, this is better 2004-03-07 14:14:27 +00:00
moodler 7277e30684 Update Czech users and courses to use new language pack 2004-03-07 14:10:11 +00:00
moodler 3b395d7acb CZ is being renamed (back) to CS. :-/ 2004-03-07 14:00:43 +00:00
julmis dad2182e95 Javascript cleanups 2004-03-07 08:20:05 +00:00
julmis e7bc78936e Add Cleanup word HTML button and enabling Cut/Copy/Paste -buttons
on gecko based browsers
2004-03-07 07:03:05 +00:00
julmis 7996c056f5 Some cleanups :-) 2004-03-07 07:01:49 +00:00
moodler 86fb5ed596 Use emailstop 2004-03-07 06:32:36 +00:00
moodler c3862e8fda Use emailstop ;-) 2004-03-07 06:32:22 +00:00
julmis b88e650dff WordClean button 2004-03-07 05:40:52 +00:00
moodler 5d67c62017 Latest version ADOdb 4.20 2004-03-07 02:33:26 +00:00
moodler 20daa09bae Bump 2004-03-07 01:46:54 +00:00
moodler 58abc13554 Removed troublesome code - don't think it was helping much 2004-03-07 01:41:55 +00:00
moodler 5d93e4a421 Latest updates for 1.2 2004-03-06 12:17:42 +00:00
fiedorow a4668b510b mimeTeX buffer overrun vulnerability fixed for Windows and Linux 2004-03-06 11:58:07 +00:00
moodler 62b7ad7bf5 Slightly bigger input box for short answers
http://moodle.org/mod/forum/discuss.php?d=5909
2004-03-06 09:51:52 +00:00
moodler 6780cb4a2b Latest from Jean! 2004-03-06 03:34:42 +00:00
martignoni a0db7a3dba Some strings corrected 2004-03-05 18:39:23 +00:00
adamtpaw 85d9f6a4ff New files and updates Moodle v1.2 2004-03-05 14:08:00 +00:00
adamtpaw 44cd348070 New file 2004-03-05 13:44:27 +00:00
adamtpaw cff6690486 Few updates Moodle v 1.2 2004-03-05 13:40:53 +00:00
moodler 1b899e00a2 Small bump to fix a particular site 2004-03-05 13:38:41 +00:00
martignoni 645ac738f3 Typos corrected (Thanks JF Nadeau) 2004-03-05 08:07:44 +00:00
moodler 623799eb26 Just some cleanup formatting 2004-03-05 06:35:56 +00:00
koenr fd23d4f550 Changed classificaties to beoordeling
Changed the translated Connected and Separate Knowing back to the English terms (as in the helpfiles)
2004-03-04 20:14:01 +00:00
martignoni 7b9de57b1c Help files for module lesson translated (Thanks JF Nadeau) 2004-03-04 16:12:54 +00:00
andersbe 3733b47cdd All the strings in the php-files are translated as of 2004-02-27
Some help-files are still missing

Alla str?ngar i php-filerna  ?r ?versatta t o m 2004-02-27
N?gra hj?lpfiler saknas fortfarande.
2004-03-03 18:33:32 +00:00
gustav_delius 6ff27f32af fixed a typo in the URL produced by the group menu on forum/view.php 2004-03-02 22:11:48 +00:00
giro123 f7fcac8686 Updated 2004-03-02 18:18:30 +00:00
giro123 9ce83538eb Facundo Ortiz 2004-03-02 17:28:42 +00:00
giro123 d91fc81766 1.2 2004-03-02 17:09:20 +00:00
giro123 0d3b6f3c4e Pedro Benito 2004-03-02 17:02:05 +00:00
paca70 7e99e2655c Updates, thanks to Jussi Kurikka 2004-03-02 14:26:11 +00:00
julmis e418c553a6 Focus fix for gecko based browser dialogs 2004-03-01 23:59:11 +00:00
julmis f77b6706ac Image size fix if url is written manually 2004-03-01 23:56:17 +00:00
moodler c6c43ae9de $CFG->deleteunconfirmed can be used to specify the time period
within which a user must confirm by email  (default is still 7 days)
2004-03-01 22:53:58 +00:00
martignoni f8b2bb32ab Typos corrected 2004-03-01 19:44:33 +00:00
giro123 b3d8eda1cf Mauricio Latorre 2004-03-01 17:39:48 +00:00
koenr 469e3afdc6 Review of the Dutch translation: a lot of corrected typo's, bad translations, ugly sentences etc 2004-02-29 22:30:06 +00:00
martignoni f9be9b8047 Modification for the new WYSIWYG editor 2004-02-29 19:54:05 +00:00
martignoni 056b4085f9 More help files translated (Thanks Jean-Fran?ois Nadeau) 2004-02-29 19:25:53 +00:00
fiedorow ea3cf78190 Remove nolink tags in glossaries 2004-02-29 14:26:57 +00:00
martignoni ea512d90b6 Improvements to front page strings 2004-02-29 13:20:10 +00:00
martignoni 972686287a Suppression of translation note 2004-02-29 12:55:54 +00:00
martignoni 74adc85bb4 Better HTML formatting 2004-02-29 12:52:49 +00:00
martignoni 2a9d1fc844 Translation terminated 2004-02-29 12:51:21 +00:00
martignoni 61703d4e21 'plus anciennes' -> 'ant?rieures' 2004-02-29 11:40:47 +00:00
martignoni a528d23fc2 Translation improvements ('Afficher ...') 2004-02-29 11:38:52 +00:00
martignoni 3a473e0b61 More translation 2004-02-29 10:24:30 +00:00
martignoni 5f2a848914 More translated 2004-02-28 21:20:04 +00:00
koenr 6cfb7b8b3e final review (hopefully)
absentie -> aanwezigheid / aanwezigheden
2004-02-28 21:12:04 +00:00
martignoni 70dadbc7e7 Bulk assignment to groups 2004-02-28 19:15:06 +00:00
martignoni 8e1c2e2994 'La classe' -> 'Personnes' 2004-02-28 18:59:31 +00:00
martignoni 5e576418df Fix with backup update string 2004-02-28 16:59:57 +00:00
martignoni 0dcd9cdeb0 Change '\$' to single $, and some tweeks 2004-02-28 16:27:24 +00:00
martignoni aad15755dc First translation 2004-02-28 13:42:15 +00:00
koenr 588d3bb84b initial translation by Koen Roggemans.
All files form lesson translated (at the moment)
2004-02-28 11:56:24 +00:00
martignoni d7e22e4751 'Modifier le profil' -> 'Modifier mon profil' 2004-02-28 11:05:12 +00:00
martignoni ac30207d3f Change 'searchforums' string to something shorter 2004-02-28 10:20:48 +00:00
koenr e4669bcf10 special characters alinea inserted 2004-02-28 09:54:14 +00:00
koenr df56fd6837 Flash cards issue 2004-02-28 08:54:06 +00:00
koenr 80492e6072 initial translation by Koen Roggemans 2004-02-28 08:53:26 +00:00
adamtpaw 1e466f029a New versions for Moodle 1.2 2004-02-27 20:25:29 +00:00
koenr e30089c248 flash cards issue 2004-02-27 13:23:25 +00:00
koenr 42655a6ace typo 2004-02-27 13:22:31 +00:00
thetrinity 208fb2d327 minor clarification. 2004-02-27 12:02:41 +00:00
thetrinity 337b9e6fbc Changed Special Characters section: new code for escaping control characters with backslash. 2004-02-27 09:07:36 +00:00
thetrinity 8ec4b43554 Added code for escaping control characters with backslash. 2004-02-27 09:03:30 +00:00
koenr c253550a40 initial translation by Koen Roggemans 2004-02-27 08:28:54 +00:00
koenr 252b2fe126 typo 2004-02-27 07:54:19 +00:00
koenr dbc11edaae filling in missing strings 2004-02-27 07:49:08 +00:00
martignoni cda9f2b312 Correction of 'weeklyoutline' and 'topicoutline' 2004-02-26 22:05:21 +00:00
rkingdon c4f17346dd Corrected typo. 2004-02-26 17:19:00 +00:00
rkingdon 394c97c88b Support for extra question types added; Flash Card style lessons now an
option.
2004-02-26 16:54:47 +00:00
rkingdon a78e874f6b Help help for second release 2004-02-26 16:43:28 +00:00
rkingdon 1192a9ef6f String to support Mulitple Question types 2004-02-26 16:36:43 +00:00
martignoni 003c204214 Improve translation of terms related to logging 2004-02-26 10:12:34 +00:00
mits 4f682a063f polished & added some help files. 2004-02-26 03:28:12 +00:00
fiedorow aecc779ee7 Bug fix: is_executable not available in Windows PHP 4.x 2004-02-26 03:25:20 +00:00
koenr 026d711e26 initial translation by Koen Roggemans 2004-02-25 22:33:59 +00:00
martignoni db763c3810 New strings added 2004-02-25 21:08:37 +00:00
gniske dc648d41da Adding missing strings
Made som few corrections in existing translation
2004-02-25 00:40:34 +00:00
koenr 65b14fbe73 filling in missing strings at Moodle Speed 2004-02-24 22:16:27 +00:00
koenr acd4298d68 first translationattempt: please comment 2004-02-24 22:13:34 +00:00
koenr ddca860a84 missing group support added 2004-02-24 22:12:26 +00:00
koenr 820c1b0ecc missing string 2004-02-24 22:11:14 +00:00
fiedorow 3e2ac6a050 Bug fix: don't allow users to be inserted in several groups 2004-02-24 22:09:43 +00:00
fiedorow 499d1a4020 Bulk assignment to groups 2004-02-24 20:15:26 +00:00
stronk7 cc14c8bd42 Added backuplogdetailed string 2004-02-24 17:31:48 +00:00
stronk7 c95ca8f034 Now the detailed view is available for each course. Enjoy. 2004-02-24 17:31:26 +00:00
martignoni 7b7317232a Some tweeking 2004-02-24 16:04:54 +00:00
stronk7 89e399dcda Now message->groupid is supported in backup & restore. 2004-02-24 15:45:01 +00:00
stronk7 7a9e8dae46 Preliminary support of backup_logs included.
It doesn't show info yet but I need to commit it now
(traveling next two hours) :-)
2004-02-24 13:46:12 +00:00
stronk7 e39a04d573 First attempt to view scheduled backup logs.
Currently it shows laststatus only.
Detailed view comming this afternoon.
====
Note: As you have released 1.2beta and this is a new little functionality,
   please, let me know if I must "delete" it from CVS before 1.2 (although
   I think that we are on time to add this...)
2004-02-24 13:18:22 +00:00
martignoni 740f08cb01 Beginning translation of latest release notes 2004-02-24 13:14:00 +00:00
martignoni 32fe5d5443 File renamed to 'releaseold.html' 2004-02-24 13:09:46 +00:00
moodler d77b492283 Latest tags 2004-02-24 09:18:34 +00:00
moodler e5effc413f Fixed a typo 2004-02-24 08:45:58 +00:00
mits c837e4a577 translated few help files. 2004-02-24 08:20:41 +00:00
moodler e553bdecf7 Changed the logic around so that any binary called "mimetex" is used
in preference to any other pre-installed binary.

This makes me happier about the FAT binary, because a leaner binary
can be installed without interfering with CVS etc.
2004-02-24 08:04:49 +00:00
moodler 98d4782e8a Match backup version to main version 2004-02-24 07:51:10 +00:00
moodler eed6ad1d15 I'll be packaging this up in the next few hours 2004-02-24 07:50:18 +00:00
koenr ba7644c64d missing string 2004-02-24 07:37:32 +00:00
mits 862e37cd53 translated some. 2004-02-24 07:26:39 +00:00
moodler b46792fe1e Some fixes for delete groups sessions 2004-02-24 07:21:52 +00:00
moodler 4b6d8dd545 Better notice for people not in a group who are trying to see a
SEPARATE activity.
2004-02-24 07:12:56 +00:00
moodler a43b24985f Moving headings 2004-02-24 07:00:13 +00:00
moodler e9a551b341 Tidy up the menu a bit 2004-02-24 06:43:13 +00:00
moodler 743a92ff49 Slightly more correct terminology on groups menu 2004-02-24 06:38:26 +00:00
moodler 84a2fdd706 Preliminary support for groups in Chat.
It's not well tested yet - I'm hoping to do some testing on moodle.org
with some real people and get this refined enough for the Beta release
later today.
2004-02-24 06:35:57 +00:00
moodler 4c17698e77 Bump 2004-02-24 03:12:29 +00:00
moodler 0b2bff196e Fixed up some $a variables which were a$ 2004-02-24 02:57:30 +00:00
moodler 55d2bbbb4b More information 2004-02-24 02:49:13 +00:00
giro123 cde82169a7 *** empty log message *** 2004-02-23 23:53:57 +00:00
koenr f30823dedd missing strings 2004-02-23 23:23:23 +00:00
selliott 3819ed3115 Fixed incorrect display of time 2004-02-23 21:17:03 +00:00
selliott 1e23ed0aa4 Fixed url to activities 2004-02-23 20:41:54 +00:00
martignoni 0186d7e0e1 New file translated 2004-02-23 20:13:21 +00:00
martignoni 96225787c5 Update to last changes 2004-02-23 19:39:36 +00:00
moodler 602bde06e7 Added .3gp type 2004-02-23 19:10:00 +00:00
fiedorow e072c85e65 Displays file permissions for mimetex and uses md5_file if available 2004-02-23 18:48:55 +00:00
moodler 0f87cb1d09 1. Recent activity reports now activated!
2. Some cleanup of the reports, using boxes
2004-02-23 18:05:59 +00:00
giro123 6c90bfcc79 Ricardo Dalton 2004-02-23 17:57:00 +00:00
giro123 1e1df0b493 Facundo Ortiz 2004-02-23 17:42:24 +00:00
giro123 e7bb1c8e4f *** empty log message *** 2004-02-23 17:05:08 +00:00
giro123 ffe58bd967 *** empty log message *** 2004-02-23 17:04:28 +00:00
giro123 a92624488f Benito Arias 2004-02-23 17:03:32 +00:00
moodler 2842d324c8 FIxed title of Window 2004-02-23 16:13:12 +00:00
julmis 4a9d4e041f Dialog update for students view
Original smaller dialogs for students.
2004-02-23 15:33:32 +00:00
julmis ead61cb9d0 Insert link dialog for students.
Original smaller dialog for students instead of that
larger one that teachers are allowed to use.
2004-02-23 15:32:28 +00:00
julmis 0e60d11cdc Insert image dialog for students.
Original smaller dialog for students instead of that lager
one that teachers are allowed to use.
2004-02-23 15:31:24 +00:00
stronk7 7754a0df58 Added the firstdayofweek string (0-Sunday, 1-Monday,....6-Saturday).
Needed because this info isn't in locales. This can be used in
a lot of places showing weekly info (backup_scheduled, calendar...)
2004-02-23 12:03:39 +00:00
julmis 15153dc088 Filebrowser off for students :-) at the moment... 2004-02-23 11:05:36 +00:00
martignoni 145292a6e5 Forgotten semi-colon added at end of line 156. Thanks to Koen Roggemans. 2004-02-23 06:41:09 +00:00
moodler 6077ffdb23 Removing old string 2004-02-23 04:31:49 +00:00
moodler 198d132f90 Eloy's white-background version! 2004-02-23 03:06:37 +00:00
koenr 00310294be corrected some typo's and malformed sentences 2004-02-22 23:20:48 +00:00
stronk7 fb2c01fbb3 Solved two bugs when restoring and groups or events exists in destination
course.
2004-02-22 22:22:58 +00:00
koenr 63d383336f initial translation by Koen Roggemans 2004-02-22 21:59:23 +00:00
koenr 036f1b884a missing strings 2004-02-22 21:55:49 +00:00
ralf-bonn 08ace0d68f Neue Felder und Verbesserungen im Anmeldebildschirm 2004-02-22 21:46:49 +00:00
ralf-bonn 43f843d34f Erst?bersetzung 2004-02-22 21:20:41 +00:00
ralf-bonn 086dd78f11 Neue Felder ?bersetzt 2004-02-22 21:19:58 +00:00
martignoni b1025d7d86 More tweeks and corrected typos 2004-02-22 20:05:05 +00:00
stronk7 626daa72f7 Added to strings about backup & restore of events. 2004-02-22 19:43:26 +00:00
stronk7 63a3695bfa Now every all the logs are restored.
Please, test it !!
2004-02-22 19:22:05 +00:00
stronk7 8dad6a690f Opps, returning to version 1.3 (before I put two lines in CVS
by mistake). I'll inform Ray about that needed actions and let him
to decide. Sorry :-(
2004-02-22 19:19:02 +00:00
stronk7 c6c8272ae7 Now lesson logs are restored too!! 2004-02-22 19:11:09 +00:00
stronk7 e8ba6e6028 Some minor changes because the:
/mod/lesson/view.php?id=XXX&action=navigation&pageid=ZZZZZ
was not working fine.
I'm not really sure if the modifications I've done (basically removing
POST['pageid'] use has other implications.
So, Ray, if you can check it....
Ciao :-)
2004-02-22 19:10:23 +00:00
stronk7 6e773096a5 Added the lesson_get_participants() function
to properly detect all the needed users with data
in the activity in order to be able to backup them.
2004-02-22 18:15:45 +00:00
martignoni a1a163cef1 Update to new strings 2004-02-22 17:15:18 +00:00
moodler af648ddfec Taking the edges off a bit ... this might be a waste of time ... 2004-02-22 13:56:16 +00:00
moodler 2d8b2369c5 Trying a new logo on the home page ... hope it doesn't clash too much
with themes ...
2004-02-22 13:47:56 +00:00
fiedorow 8d311b2d48 Now ++ argument is optional 2004-02-22 13:12:05 +00:00
moodler 995f9f86e9 Fixes for IE 2004-02-22 12:41:50 +00:00
moodler c6c93ee66e Consistent capitals 2004-02-22 12:40:33 +00:00
moodler 7d4a57f648 Little fix 2004-02-22 12:38:45 +00:00
stronk7 744d723c2c Now forum logs are restored. 2004-02-22 12:34:07 +00:00
moodler a4dda51f43 Another fix for recent testers only I think 2004-02-22 12:27:52 +00:00
moodler d1fd642688 WHoops, forgot a bit 2004-02-22 12:24:39 +00:00
moodler 828aeff2d6 A proper GUI for filters :-)
Still needs work, but it works fine now.

Later I want to add config pages for each filter, like modules have.
2004-02-22 12:17:27 +00:00
moodler 677d1679fa Some new strings, including filter names 2004-02-22 12:14:37 +00:00
stronk7 b17333be71 In the delete discussion action, as the discussion no longer exists,
point the url to view the forum instead of the discussion.
2004-02-22 11:50:09 +00:00
stronk7 96d6fc8f14 Solved small bug in delete discussion action, where the
info field was storing the post->id rather of the discussion->id field
2004-02-22 11:40:44 +00:00
stronk7 454e72f7d4 Added the forum->id into the info field
for the "view subscribers" action. To make
this action easily recovereable and to show
forum name when displaying logs.
2004-02-22 11:25:09 +00:00
moodler 522e2249c6 More robustness when dealing with links that may have HTML tags
within the link.
2004-02-22 02:51:42 +00:00
julmis ce668c6531 Minor fix for $imagepath. 2004-02-22 00:49:13 +00:00
moodler 08df81a8e6 Renamed dynalink.php to filter.php for consistency with other filters 2004-02-22 00:20:14 +00:00
fiedorow ddea4cf070 Fix for case when $CFG->dirroot contains spaces, especially for Windows 2004-02-21 23:34:09 +00:00
willcast c9128b637b - Dealing with incompatibilities related to posgresql. 2004-02-21 13:21:35 +00:00
willcast a5e48d968d - Fixing come incompatilities with PostgreSQL.
THANKS TO ULRIK PETERSON!
2004-02-21 13:05:38 +00:00
martignoni 7a1cb2c12a Some more typos corrected 2004-02-21 10:48:37 +00:00
martignoni b1ffbf3e0e 'Mettre ? jour' -> 'Modifier' 2004-02-21 10:23:08 +00:00
martignoni e14d405263 Some typos corrected 2004-02-21 10:19:41 +00:00
thetrinity bf3c01535e GIFT: Proofreading and minor changes. Cleaned up HTML and dded Special-Characters section to formatgift.html 2004-02-21 09:20:34 +00:00
moodler a87491c1d0 Many updates from Janne.
I've done a basic review and fixed a few things, but there will need
to be a lot more testing and cleanup over this weekend.
2004-02-21 05:49:31 +00:00
moodler e081f299f5 Renamed a variable to fix display when different languages are mixed together 2004-02-21 03:26:04 +00:00
willcast 6c884b58c9 - Linking global categories from within courses now works. 2004-02-21 02:48:53 +00:00
stronk7 ceafd825e2 Take out all he notices in this form, it had a lot !! 2004-02-21 01:53:12 +00:00
stronk7 cd44fdcb82 Some important changes:
- Now course events are supported in backup & restore.
        - in manual backups
        - in scheduled backups
    - Fixed important bug when restoring groups.
    - Added support to the "user change password" action
      (with some changes done in login/change_password.php)

Please, test it !!!!
2004-02-21 01:30:22 +00:00
stronk7 526234384c Modified the log of the "change password" action to encode the userid in the
info field, instead of the courseid. To be consistent with another user
actions (view...). I suppose that this is the propper way.
2004-02-21 01:24:07 +00:00
willcast 27f2c52057 - Linking global categories from within courses now works. 2004-02-21 01:16:03 +00:00
fiedorow f20e195fa4 Better way to eliminate superfluous parentheses in fractions 2004-02-21 01:11:00 +00:00
selliott ba90d6d0d4 Added strings for course/recent.php and course/lib.php 2004-02-20 22:25:00 +00:00
selliott 9743bb84b9 Added some strings for course/recent.php and course/lib.php 2004-02-20 22:19:59 +00:00
selliott f5ffb87d24 Cleaned up some string literals 2004-02-20 22:16:28 +00:00
selliott ffeca1205c Added logic in function assignment_get_recent_mod_activity for groups 2004-02-20 22:03:57 +00:00
selliott 90708fc1f3 Added logic in function forum_get_recent_mod_activity for groups 2004-02-20 21:52:56 +00:00
selliott 6a0c9cf8a3 Added logic in function quiz_get_recent_mod_activity for groups 2004-02-20 21:47:55 +00:00
selliott 587510bec5 changes to function print_recent_selector_form for normal/advanced filters in course/recent.php 2004-02-20 21:38:42 +00:00
selliott 08e2111bf8 Added logic for a normal view and advanced view for the filter 2004-02-20 21:34:21 +00:00
stronk7 5d31e5af40 Updated a bit. 2004-02-20 20:10:14 +00:00
stronk7 77885194e3 Bump to 1.2 alpha (to be synchronized) :-) 2004-02-20 20:08:14 +00:00
fiedorow e86a754bab Yip's additions for Greek letters and bug fixes 2004-02-20 19:24:36 +00:00
fiedorow 6361d22faf Statically linked mimetex.linux; bug fix for texdebug.php 2004-02-20 19:20:01 +00:00
moodler 97375ca98e Bumping it up a notch 2004-02-20 16:10:54 +00:00
moodler a9ccbf60bf Groups support on Surveys. Phew. 2004-02-20 16:03:05 +00:00
villate 74c82136ba Some of the new variables translated. 2004-02-20 15:39:53 +00:00
moodler 5875b7d611 Undoing recent changes ... should be in a separate file 2004-02-20 14:16:07 +00:00
moodler 1e03c552e3 Reverting a bad bug recently introduced by Petri which meant
Moodle couldn't create any new directories ...   :-(
2004-02-20 14:12:49 +00:00
moodler f96f80db5c Include "Courses" in heading as generic title 2004-02-20 12:59:12 +00:00
moodler c0b85daf7b Clean up of terminology course categories and courses 2004-02-20 12:56:17 +00:00
moodler 352d94cf37 Change course sideblock title depending on contents 2004-02-20 12:43:20 +00:00
moodler 4101e996e1 Make Quicktime movies loop by default 2004-02-20 11:58:44 +00:00
moodler 111980c772 Email enable/disable strings 2004-02-20 11:47:08 +00:00
moodler cadb96f29e GUI to allow disabling of user email addresses (from user profile) 2004-02-20 10:27:24 +00:00
bobopinna 2073bdf9ba *** empty log message *** 2004-02-20 09:56:03 +00:00
moodler 8199e3f09a New user field called "emailstop" ... to stop emails.
I had to do it ... this is driving me nuts with some people
on moodle.org
2004-02-20 09:02:27 +00:00
moodler 017b4cab3e Making the link title look a bit nicer for long strings with spaces etc 2004-02-20 04:14:24 +00:00
moodler 6b0a2ff4a5 Add some feedback and instructions for other platforms 2004-02-20 03:31:02 +00:00
moodler 13112aaa35 Added default platform 2004-02-20 03:12:01 +00:00
moodler 6e1ee58e3f Added the default platform back again. :-) 2004-02-20 03:00:44 +00:00
moodler 59c7115177 FIxed bug with forced languages by moving string definitions 2004-02-20 02:29:30 +00:00
moodler d879ed9100 Latest updates for Chinese Simplified! 2004-02-20 02:20:17 +00:00
fiedorow 1ed0ba1d77 Improved debugging of mimetex 2004-02-20 01:44:31 +00:00
koenr 03cd979250 missing strings 2004-02-19 21:39:12 +00:00
fiedorow 65a275f404 Now strips outermost parentheses in denominators 2004-02-19 21:27:16 +00:00
paca70 d956341c66 Fixed INT4 SERIAL 2004-02-19 19:07:04 +00:00
moodler e8da8d7004 Format answers in multiple choice questions 2004-02-19 18:14:19 +00:00
fiedorow 9cc1730595 Added debugger for TeX filter 2004-02-19 18:05:01 +00:00
fiedorow 9b361d24b3 Added debugger for algebra filter 2004-02-19 18:03:41 +00:00
moodler 2ab76925a2 Cleaned up group menus 2004-02-19 17:57:22 +00:00
moodler eb6147a8bb For the group functions, a group 0 means everyone 2004-02-19 17:56:52 +00:00
moodler 1d9fc41755 Groups menu now includes "All groups"
Titles have tags stripped
2004-02-19 17:56:05 +00:00
moodler 8e4c9ef7b1 Don't bug out when sort not specified 2004-02-19 17:54:32 +00:00
moodler b14875e4a4 New error message 2004-02-19 17:52:31 +00:00
giro123 5eac36be7d Benito Arias 2004-02-19 17:45:00 +00:00
moodler a63d7730d0 Add string for "All groups" 2004-02-19 17:09:43 +00:00
mits 9f182b1046 translated few. 2004-02-19 15:42:04 +00:00
moodler 004f8037f4 Fixed missing log_displays - thanks Eloy! 2004-02-19 13:28:31 +00:00
moodler 899e041895 Fixed missing Label logs - thanks Eloy! 2004-02-19 13:25:25 +00:00
paca70 94b9a1ca02 First changes for creating help-translation system.
http://site/files/index.php?fi=lang
shows now selected language "lang" files.
2004-02-19 10:13:07 +00:00
paca70 7279163ff2 Removed signed/unsigned definations (Thanks to Ulrik Petersen to pointing this out) 2004-02-19 09:54:33 +00:00
paca70 b92d1a68a5 First versions for postgres7. 2004-02-19 09:03:34 +00:00
moodler a740ff66d9 Don't show editing icons when questions can't be edited! 2004-02-19 07:53:09 +00:00
moodler f668898c3f Add logging for password changes 2004-02-19 02:09:37 +00:00
stronk7 c9ec4c5557 Bump. More modules support logs-restore. 2004-02-19 00:06:19 +00:00
giro123 4b9633290d *** empty log message *** 2004-02-18 22:53:38 +00:00
stronk7 7399316518 Now journal logs are restored too :-) 2004-02-18 22:30:35 +00:00
stronk7 93766dbd6a Now glossary logs are restored too !! :-) 2004-02-18 22:29:50 +00:00
giro123 dc06435513 Facundo Ortiz 2004-02-18 22:25:37 +00:00
stronk7 d3acd64d59 Little bug storing wrong comment->id in the info field
when performing the "delete comment" action. Now it works fine. :-)
2004-02-18 21:50:33 +00:00
giro123 2816154cd6 *** empty log message *** 2004-02-18 21:38:10 +00:00
giro123 89b264c794 Facundo Ortiz 2004-02-18 21:25:17 +00:00
stronk7 fabf55e684 Added the cmid field to some add_to_log() calls. To use it when
restoring logs. Now I think that everything is ready !! :-)
2004-02-18 20:52:44 +00:00
stronk7 f43c695e1e Added cmid to some add_to_log() function calls.
Needed to be able to restore logs properly. :-)
2004-02-18 20:02:33 +00:00
ralf-bonn 5bb661c215 Einige aktuelle Verbesserungen 2004-02-18 16:50:14 +00:00
mits 4a4d7c5ff4 step by step 2004-02-18 16:17:38 +00:00
moodler 448acc2a51 Default to just using "mimetex" binary. This makes it easier
to drop in unusual binaries and have them work
2004-02-18 16:02:09 +00:00
moodler c6e86280f2 Latest translation ... submitted here: http://moodle.org/mod/forum/discuss.php?d=5414 2004-02-18 13:14:33 +00:00
moodler ac1c2b0719 Removing old English stuff 2004-02-18 13:08:42 +00:00
rkingdon c7901feb99 Fixed restart bug - continue now handle through POST not GET. 2004-02-18 12:12:12 +00:00
moodler dbb4919258 Better error checking when trying to show an incomplete attempt 2004-02-18 08:40:58 +00:00
moodler d6021c77f6 FIxed a silly typo! 2004-02-18 05:48:31 +00:00
moodler 7758d00f97 New "secret" variable 2004-02-18 03:31:45 +00:00
moodler b8be40ce52 Variable $CFG->admineditalways will enable admin editing all the time 2004-02-18 03:30:05 +00:00
moodler a0beda7a7a Format quiz feedback 2004-02-18 03:07:50 +00:00
moodler a99008f6e1 Restore logs consistently 2004-02-18 02:28:47 +00:00
moodler 71ca2a2a05 Changed log URLs for attempts ... the old one worked too but this is
better for consistency.

Not much gets past Eloy "Eagle Eyes" Lafuente!
2004-02-18 02:24:29 +00:00
fiedorow 5794f89813 Support for absolute value added 2004-02-17 19:06:22 +00:00
fiedorow 0c7aca91e9 mimetex.darwin updated; tex previewer added 2004-02-17 19:03:30 +00:00
stronk7 10672458f9 Now "attempt", "submit" and "review" actions
use the q=xxx&attempt=yyyy syntax instead of
        id=xxxx&attempt=yyyy (not working old one)
It's necessary to change the "review" add_to_log() call
to use this sintax. It uses the old (nor working) one.
I wait to Martin to do this, because I've sent one email about this.
For info, the line to correct is number 57 in review.php from:
add_to_log($course->id, "quiz", "review", "review.php?id=$cm->id&attempt=$attempt->id", "$quiz->id", "$cm->id");
to:
add_to_log($course->id, "quiz", "review", "review.php?q=$quiz->id&attempt=$attempt->id", "$quiz->id", "$cm->id");
Ciao :-)
2004-02-17 17:27:27 +00:00
giro123 4c918350d6 *** empty log message *** 2004-02-17 16:34:12 +00:00
stronk7 40c287b095 Added support for "choose" and "choose again" action logs. :-) 2004-02-17 16:19:58 +00:00
moodler abcc3a17b9 Fixed up some logging 2004-02-17 14:39:15 +00:00
moodler 249bdbe3cf Don't allow signup page to work unless necessary 2004-02-17 14:11:19 +00:00
mits c15ed23f52 translated few strings. 2004-02-17 12:27:54 +00:00
moodler 4899c66789 FIxed up logging when viewing submissions (database truncation in logs)
Thanks Eloy!
2004-02-17 12:25:01 +00:00
moodler f8f63ecdd5 On second thoughts, Eloy was right - showall is useless. :-) 2004-02-17 12:18:02 +00:00
moodler 987ecd9806 showall is an optional variable that will showall the people in one list 2004-02-17 12:16:14 +00:00
moodler fc4a5a2f63 FIxed the logging of attempts so that clicking on the link in the log
actually shows you that attempt, rather than opening a new one!
2004-02-17 12:14:02 +00:00
rkingdon c65e968162 A couple more strings for the sanity check. 2004-02-17 11:22:25 +00:00
rkingdon 9aba486423 Added sanity check before calculating grade. 2004-02-17 11:11:00 +00:00
moodler 7a38bf2836 A tiny MP# player. :-) 2004-02-17 09:43:36 +00:00
moodler 609a2b13b7 SOme info about $CFG->filterall 2004-02-17 06:33:04 +00:00
moodler 9e353ce7e2 Upgrade filter references 2004-02-17 05:28:52 +00:00
moodler 4da85078e9 Changed the name of all filters to be consistent.
Removed texh filter
2004-02-17 05:22:26 +00:00
moodler 830e238d58 Removed tex binaries and renamed main filter file 2004-02-17 05:12:33 +00:00
moodler f4da2ed4d7 Don't specify id on upgrades! Thanks, Eloy! 2004-02-17 03:58:06 +00:00
moodler ae2aa3c82c More fixes 2004-02-17 03:43:33 +00:00
fiedorow e8e6a5602e Improved mimeTeX binaries & more uniform cross-platform code in filter 2004-02-17 03:41:10 +00:00
fiedorow 1a1de46ae2 Working version of algebra filter for Unix and Windows 2004-02-17 03:38:48 +00:00
moodler 3ce906d64d Some fixes for multiple links 2004-02-17 03:15:55 +00:00
moodler 652d573b5e JUst removing capitals .. :-) 2004-02-17 02:38:59 +00:00
moodler 6de17fde07 Cool thing for the morning - a new filter that will turn any link to
an MP3 into an embedded plugin.  It would be easy to add movies
and things later.
2004-02-17 02:37:51 +00:00
rkingdon aaac8ae3fa Additional string. 2004-02-17 00:55:06 +00:00
rkingdon 667c5e9199 Only teacher's with edit privileges see the edit links; Navigation now
uses POSTS rather than GETS.
2004-02-17 00:54:10 +00:00
stronk7 4130af7552 Now label, quiz, resource and survey logs
are restored properly (I think) :-)
2004-02-16 20:42:16 +00:00
stronk7 eaefa1c0e8 Added missing cmid parameter when calling add_to_log() function
for report and review actions :-)
2004-02-16 20:22:32 +00:00
stronk7 8f583218df Added missing cmid parameter when calling add_to_log() function. 2004-02-16 19:31:26 +00:00
moodler 0e27a3ae71 Allow longer answers to support text fields better 2004-02-16 17:58:06 +00:00
moodler 62a575d157 Chat room text is now filtered 2004-02-16 17:39:05 +00:00
moodler 302130de75 Global not defined 2004-02-16 17:32:10 +00:00
moodler 1d8063adbc Some spacing 2004-02-16 17:15:59 +00:00
moodler f14a311ec3 Minor tify up 2004-02-16 17:14:07 +00:00
moodler 077641504f Cornflower, by Tom Murdock.
A blue theme with some nice things about it.
2004-02-16 16:52:39 +00:00
giro123 5b767cb1ea *** empty log message *** 2004-02-16 16:51:28 +00:00
rkingdon 9cf1f5a6ab Add missing string. 2004-02-16 16:28:47 +00:00
moodler c9b1af4d42 Make sure the update happens (some of this new code is actually really
old and sort of got bypassed)
2004-02-16 16:15:21 +00:00
moodler 7c8c335fa3 Complete clean-up of the survey reports.
Frames are GONE.  :-)

Also, a new survey: CIQ = Critical Incident Questionnaire
2004-02-16 16:13:31 +00:00
rkingdon 9be2bd0c39 Moveit action: Removed debug messages; added redirect. 2004-02-16 16:08:40 +00:00
selliott 4897d92364 Fixed icon display for submissions when shown in course/recent.php 2004-02-16 14:17:33 +00:00
bobopinna d1156ef7ec Updated by Roberto Pinna 2004-02-16 13:24:35 +00:00
moodler 9232405d8a SOme improvements to logging 2004-02-16 12:20:40 +00:00
moodler e2e039f18b Fixed header on table 2004-02-16 12:02:08 +00:00
moodler cda397e7f3 Didn't look so good as the "L" 2004-02-16 11:59:57 +00:00
moodler bd9f4bd634 Slightly different icon ... now it looks like an "L" :-) 2004-02-16 11:56:20 +00:00
moodler 096b5432a7 Fixed some old pix paths 2004-02-16 09:24:14 +00:00
moodler c10a04e82d Log display 2004-02-16 08:45:58 +00:00
moodler c872bfb7b9 Fixed logs 2004-02-16 08:43:33 +00:00
moodler 60efe6cbb3 Apparently WIN32 gets returned sometimes too 2004-02-16 06:44:50 +00:00
moodler 23323b37b6 Accept Windows as well as WINNT 2004-02-16 06:42:10 +00:00
moodler 24d18e2f8e First cut at a new icon 2004-02-16 06:13:52 +00:00
moodler 97e4129b73 Removed the debugging statement 2004-02-16 06:06:26 +00:00
moodler 7b608def7e Add some formatting to the answers 2004-02-16 05:59:20 +00:00
moodler bbcbc0fecc Adding the Lesson module to the main CVS. Nice job Ray!
Still needs PostgreSQL support and wider testing
2004-02-16 05:41:13 +00:00
moodler fd9521f6d4 Better smiley fix 2004-02-16 03:45:53 +00:00
moodler 36a043db25 Fixed image links 2004-02-16 03:42:19 +00:00
moodler 49349c4916 Source of dodgy image 2004-02-16 03:37:08 +00:00
moodler c5fff8a5d2 FIxed a dodgy image 2004-02-16 03:36:12 +00:00
fiedorow d29d3218a2 Updates for Windows and MacOS X 2004-02-16 02:05:24 +00:00
stronk7 4866a36714 Initilize selectmod in navmenu() function to avoid some warnings
when showing the menu and no cm has been selected. No risk with this
change, I suppose. :-)
2004-02-16 00:41:52 +00:00
stronk7 0f318c26b4 Now logs from:
- Assignments
- Choices
- Workshops
are restored too.
2004-02-15 21:18:52 +00:00
stronk7 530931dd21 Modified calls to add_to_log() function to include cmid at the end. It was missing
in "resubmit" logs.
2004-02-15 20:07:21 +00:00
stronk7 7c11319ad7 Modified calls to add_to_log() function to include cmid at the end. It was missing
in "over allocatio" and "grade" logs.
2004-02-15 20:03:28 +00:00
stronk7 d09ce61d1a Modified calls to add_to_log() function to include cmid at the end. It was missing
in "league_table", "submit" and "assess" logs.
2004-02-15 19:37:26 +00:00
moodler 128452bbd8 Fixed bug selecting students in group 2004-02-15 14:54:04 +00:00
moodler 2969a73c00 Fixed bug getting group users 2004-02-15 14:51:24 +00:00
moodler ac8abb5f6a DOn't set CFG->courelang unless it means something 2004-02-15 14:34:13 +00:00
moodler e5415d580a Bug fix for languages in emails and possibly elsewhere that could
happen with blank variables.
2004-02-15 14:33:13 +00:00
moodler e1fb2e6e09 Don't create empty $CFG->courselang to be sure 2004-02-15 14:32:18 +00:00
moodler ad0abe9d77 Added new style headingblockcontent 2004-02-15 13:58:22 +00:00
moodler a711021a75 Added a missing style for the internal table of the headingblock,
since inheritance doesn't seem to work

   headingblockcontent
2004-02-15 13:54:47 +00:00
koenr 60abb6a3a8 missing strings 2004-02-15 12:55:49 +00:00
moodler 436a7cae88 Filter subject lines in discussion listings too. 2004-02-15 10:23:35 +00:00
moodler 83ec909837 Allow <lang> tags in forum subjects.
And filter them is $CFG->filterall is on
2004-02-15 10:16:12 +00:00
moodler 3c89f9a837 If $CFG->filterall is defined true, then activity names are filtered.
Useful in particular for multilang filter

More to come.
2004-02-15 10:08:05 +00:00
moodler c245b6a339 Quick GUI to turn off/on hiding of group pictures 2004-02-15 09:59:16 +00:00
moodler 3afe1085e2 Format group description 2004-02-15 09:29:55 +00:00
moodler 2ad0d1da3c Format the group description 2004-02-15 09:29:20 +00:00
moodler b6ee2d82ea Groups support for choice module 2004-02-15 08:17:45 +00:00
moodler 52f1b49620 When searching for resources, use button instead of link. 2004-02-15 08:04:33 +00:00
moodler 97ea483380 Editing teachers always can see group picture.
Plus some fixes in print_group_picture()
2004-02-15 07:37:48 +00:00
moodler 3c0561cfe7 New field in the groups table to "hidepicture" from being displayed
in locations like forums etc.

Backups done too, Eloy.  :-)
2004-02-15 07:29:55 +00:00
moodler ac0024f9f4 Center the groups menu for now 2004-02-15 07:18:28 +00:00
moodler 424aef6aef Use the new short way of setting up groups 2004-02-15 07:18:07 +00:00
moodler c3cbfe7fdf New function setup_and_print_groups() makes it much easier to set
up groups everywhere else.
2004-02-15 07:13:08 +00:00
selliott 05263aefe1 Removed extra <hr> tag 2004-02-15 06:40:25 +00:00
selliott f466c9edb6 Deleted assignment_print_recent_instance_activity and assignment_get_recent_assignments (used only in course/recent.php)
Added   assignment_get_recent_mod_activity and assignment_print_recent_mod_activity (used for course/recent.php)
2004-02-15 06:32:54 +00:00
selliott 740f94d8e7 Deleted quiz_print_recent_instance_activity and quiz_get_recent_quizzes (only used in course/recent.php)
Added quiz_print_recent_mod_activity and quiz_get_recent_mod_activity (for course/recent.php)
2004-02-15 06:26:55 +00:00
selliott a57a7794ea deleted forum_print_recent_instance_activity and forum_get_recent_posts (only used in course/recent.php)
added  forum_get_recent_mod_activity and forum_print_recent_mod_activity for course/recent.php
2004-02-15 06:19:08 +00:00
selliott 4581271ad1 Changed selector form in course/lib.php for course/recent.php
Rewrote course/recent.php to allow sorting of data before it is output
2004-02-15 06:11:15 +00:00
moodler 082e3ebc4f WHen emptying a course, delete groups and events 2004-02-15 05:08:00 +00:00
moodler 32d03b7b85 Better logic for showing group mode buttons
Teacher can now see forced mode more clearly
2004-02-15 04:13:25 +00:00
moodler 110a32e2ca Bug fix - if groupmode is forced then group icons are not even displayed 2004-02-15 03:20:51 +00:00
moodler 41b94a4044 New activities now default to course groupmode 2004-02-15 03:19:52 +00:00
stronk7 ea3591e41a Now chat logs are included in restore. I've decided to start with this
simple module to be ready for the difficults... :-)
2004-02-15 00:54:56 +00:00
moodler 31d757129f A few quick updates 2004-02-14 17:52:31 +00:00
moodler 088cbaab7b Fixed a typo 2004-02-14 17:33:24 +00:00
moodler 539a2da1f3 Happy Valentine's day everyone! I had a good one, hope you did too. 2004-02-14 17:29:48 +00:00
moodler 1d06dd30bb Tiny formatting fix 2004-02-14 17:01:14 +00:00
moodler 831b236f2c Group support for Quiz reports. :-)
... except detailed stats.
2004-02-14 16:52:55 +00:00
moodler a46b14ef76 I changed the form names, so change references to them 2004-02-14 16:22:37 +00:00
moodler 241f6f306b MOved the file icons into the proper place (at last) 2004-02-14 16:19:48 +00:00
moodler daf06e2c33 Some tidying up of the HTML on the login page to make it a little
more respectable (and fix some display bugs)
2004-02-14 14:09:25 +00:00
martignoni ad50bdddee Help file for label module translated 2004-02-14 11:04:18 +00:00
moodler 9867144441 Group suport for Journals.
This module also has a crappy interface and must be fixed.  But not today.
2004-02-14 08:52:28 +00:00
moodler e1aaf05de9 Working around that PHP bug - thanks for the confirmation Henrik! 2004-02-14 08:17:01 +00:00
moodler b7e16e6acb A few more improvements with sorting 2004-02-14 08:11:02 +00:00
moodler 486f78b51f Group support for assignment submissions, and some cleanups.
I really hate this interface - it's not scalable - but this will have
to wait for another day.
2004-02-14 07:57:48 +00:00
moodler aaad489149 Using PHP_OS to detect OS (thanks, Greg Barnett!)
Included three binaries for mimetex ... Linux is tested but I haven't
tested the others yet
2004-02-14 03:00:56 +00:00
moodler 0f6f62cbdb Removing the is_windows function ... instead, use the global define PHP_OS 2004-02-14 02:49:56 +00:00
moodler c469a7efb6 Use $modname if it's defined 2004-02-14 02:44:35 +00:00
stronk7 d2c3605c83 Changed to calls to print_log_selector_form() with modname not set
to avoid two notices with debug on. I suppose that there isn't problems
with this because modname var doesn't exist in all the file, but...
2004-02-13 23:53:36 +00:00
stronk7 07bbc2d1c7 Now the questiontextformat is supported in backup/restore too. 2004-02-13 23:47:08 +00:00
adamtpaw f91a7bf618 Translation of ver 1.2 2004-02-13 23:43:46 +00:00
stronk7 2ecad74265 First version of restore logs !!
It restores:
    course logs
    user logs
Todo:
    module logs

Coming soon :-)
2004-02-13 23:28:45 +00:00
adamtpaw 8d75b3b6dd Translation 2004-02-13 23:18:14 +00:00
adamtpaw 0b6693ec7e Translation of Moodle 1.2 2004-02-13 22:58:17 +00:00
moodler 4f91b2965e Updated get_records_select() to help Eloy out. :-) 2004-02-13 16:32:02 +00:00
moodler f064a3dfb9 WHAT!??
Why doesn't this work?

   if (!empty(trim($forum->intro))) {
   }

It gave blank screens on moodle.org!   Wierd.
2004-02-13 15:20:06 +00:00
moodler 5cdb8a856a Quiz questions now have proper formatting controls.
Any format can be used.  This fixes a number of problems at once,
but the latest one is Bug #1047
2004-02-13 14:01:27 +00:00
moodler 016bfc83bc A new is_windows function 2004-02-13 08:34:39 +00:00
moodler 54caa35e20 DOn't print blank summaries 2004-02-13 03:42:51 +00:00
moodler fe412041b5 Don't print blank journal intros 2004-02-13 03:40:57 +00:00
moodler 51a55508e6 Use format_text on forum intros 2004-02-13 03:39:58 +00:00
moodler 11157acdf0 To help with our GPL obligations 2004-02-13 01:42:46 +00:00
moodler a83d775a24 A general cleanup. Added mimetex 2004-02-13 01:39:45 +00:00
willcast e18abcc4de Adding missing columns... and tables for PosgresSQL squema 2004-02-12 22:42:04 +00:00
koenr 385272bd0f missing string 2004-02-12 22:31:35 +00:00
adamtpaw 45c93e2669 Translation of Moodle 1.2dev . 2004-02-12 22:17:44 +00:00
martignoni 58fcf99fa7 Some more tweeking 2004-02-12 18:55:31 +00:00
bobopinna 0621ba74a9 Updated by Francesco Bavastro 2004-02-12 12:55:29 +00:00
moodler 554143f22c Removed CloseOnEsc completely because it has issues on IE6
and wasn't that useful anyway

http://moodle.org/mod/forum/discuss.php?d=5253#24136
2004-02-12 12:17:02 +00:00
martignoni bdb03cafa8 All help files for Glossary module translated 2004-02-12 10:31:26 +00:00
moodler ddbc548d9f Add new headers to language stuff 2004-02-12 09:40:21 +00:00
martignoni c7c18a64b0 More help files translated 2004-02-12 09:05:09 +00:00
moodler 9d49b43016 OK, well this is working for me now! 2004-02-12 08:39:48 +00:00
moodler f1d604cbda Added new table cache_filters for all filters to use if they need to 2004-02-12 07:06:07 +00:00
moodler 65624a2821 Removing the newmodule template from this directory and putting it
in /contrib

This should prevent some user confusion.

It was getting out of date too.
2004-02-12 06:41:17 +00:00
moodler 2c42415b8c Clarification about what "Server time" means. 2004-02-12 06:13:52 +00:00
moodler d6582c7cac A new configuration setting so that the admin can define the site's default
timezone.
2004-02-12 06:08:06 +00:00
moodler 90207a06e3 Use a site-defined timezone if one is defined 2004-02-12 05:55:04 +00:00
moodler 00d727e387 FIxed (old?) bug that sometimes prevented new categories 2004-02-12 03:48:13 +00:00
moodler 0c29498ede Use format_text on question texts so we get caching, filters etc 2004-02-12 03:41:16 +00:00
martignoni 692a13b499 New help files translated 2004-02-11 21:55:12 +00:00
martignoni 8b9e007056 New help files translated 2004-02-11 19:47:32 +00:00
moodler 1cdd857ce6 SOme tweaks 2004-02-11 14:25:42 +00:00
koenr bcead64f30 missing strings 2004-02-11 12:45:31 +00:00
moodler 4901562dd7 FIxed a bug in the definition of fullnamedisplay 2004-02-11 02:35:33 +00:00
moodler 0d851f90a8 Cache format_text calls in make_mail_post for even more speed
during a forum_cron
2004-02-11 02:26:25 +00:00
martignoni 01e04d5470 ?dit? le -> Modifi? le 2004-02-10 19:41:30 +00:00
martignoni 288ffddc1e Some minor changes 2004-02-10 19:32:05 +00:00
martignoni e8fc9f954d Some tweeking done 2004-02-10 19:25:04 +00:00
martignoni 80384eee21 Translation complete 2004-02-10 19:02:16 +00:00
martignoni ac65acc89d First part translated 2004-02-10 16:56:42 +00:00
fiedorow c49dede89d Test version of TeX filter designed for moodle.org 2004-02-10 16:46:30 +00:00
moodler 78b85ede6a Fixed link to show group members 2004-02-10 14:41:45 +00:00
moodler 546b301b44 Don't print group pictures if none is defined 2004-02-10 14:36:12 +00:00
moodler 9c84314ed7 Fix for recent courselang stuff 2004-02-10 14:28:32 +00:00
moodler 30c9a78063 Interface for editing groups 2004-02-10 14:25:20 +00:00
moodler 7721c69499 save_user_image ---> save_profile_image so it works for groups too 2004-02-10 14:24:36 +00:00
moodler 35067c438f print_group_picture is more simple again, uses JPEGs
Put the fancy PNG code in a new function for later print_png()
2004-02-10 14:22:20 +00:00
moodler 0e2585ac0f Reject Opera when it is pretending to be IE 2004-02-10 14:20:44 +00:00
moodler eea2335afe Multi-lang filter can flag a text as not being cacheable 2004-02-10 10:01:42 +00:00
moodler 8eaa4c61d5 The text caching is now sensitive on the temporary variable
$CFG->currenttextiscacheable

Any filter can set this to FALSE and the current text will not be cached
2004-02-10 09:59:46 +00:00
bobopinna a953edbd35 Updated by Roberto Pinna 2004-02-10 09:49:58 +00:00
bobopinna 6af8359fc4 Updated by Roberto Pinna 2004-02-10 09:39:15 +00:00
bobopinna c696c41b5b Translated by Francesco Bavastro 2004-02-10 09:12:35 +00:00
bobopinna c57550050f Traslated by Francesco Bavastro 2004-02-10 09:03:58 +00:00
moodler ca31091b12 Uploading in course restricted by site setting ... 2004-02-10 09:00:24 +00:00
moodler e11dc9b682 Another little hack to complete the course-level forcelanguage 2004-02-10 08:10:04 +00:00
moodler 875cb9fa18 Use Unicode for the name of the language. Makes the menu look better. 2004-02-10 07:38:49 +00:00
moodler c2061f1608 New strings for forcing languages 2004-02-10 07:17:42 +00:00
moodler 2639d3d310 Allow the teacher to force a language if they want to 2004-02-10 07:17:09 +00:00
moodler a75082c017 A simple README to start off 2004-02-10 06:47:05 +00:00
moodler a3dec13dab First very rough version of Korean.
Some of it is euc-kr ... some of it is Unicode ...
2004-02-10 06:38:11 +00:00
moodler 2c7091551f Removed some test code 2004-02-10 05:10:30 +00:00
moodler 9284861420 Updated config-dist.php since options have moved out of it 2004-02-10 05:06:12 +00:00
moodler d523d2ead1 Some configuration options now added to the Configuration page.
opentogoogle

  textfilters

  cachetext

They should upgrade cleanly from anything you may have in config.php
2004-02-10 05:05:28 +00:00
giro123 0cbc7de6b6 *** empty log message *** 2004-02-10 00:43:22 +00:00
stronk7 3a4b33c3b9 Now course->lang is in backup & restore. 2004-02-09 22:24:34 +00:00
moodler 178c952a52 Latest translations from Paula Magri 2004-02-09 18:46:41 +00:00
mits 58f2393ebf translated & polished some. 2004-02-09 18:11:40 +00:00
mits 5b16d81510 translated few. 2004-02-09 17:23:34 +00:00
moodler 246dedcf47 Give new windows different names so they can be compared more easily 2004-02-09 14:37:45 +00:00
moodler e3812d2a7c Fixed table name 2004-02-09 13:12:46 +00:00
moodler 45121ffbf3 text_cache --> cache_text much better 2004-02-09 13:10:19 +00:00
moodler f0aa2fed24 Removed a small bit of debugging code 2004-02-09 12:33:44 +00:00
moodler cb3a448415 Delete old cached texts on a cleanup 2004-02-09 12:33:02 +00:00
moodler d363047eb0 TEXT CACHING
------------

I have a site which really needs this, so I went ahead with it already.

This add-on will cache formatted texts in the database and use them
for a specified timeperiod.

By default it is disabled.   Enable it with:

  $CFG->cachetext = 600;   // in seconds
2004-02-09 12:27:34 +00:00
carlesbellver 6579224b6a *** empty log message *** 2004-02-09 11:40:24 +00:00
carlesbellver c18a62ddbd *** empty log message *** 2004-02-09 11:02:41 +00:00
martignoni 822e9771f2 More files added 2004-02-09 10:19:13 +00:00
martignoni 5a1e63d532 Small corrections 2004-02-09 09:52:06 +00:00
martignoni b273933f1c New translated file 2004-02-09 09:45:58 +00:00
martignoni 095d970dba Update to last changes of french translation 2004-02-09 09:19:09 +00:00
moodler 0cc6fa6a1f Emails can take on course language as well 2004-02-09 08:49:54 +00:00
moodler b3153e4b7d Small hack to force a particular language within a course.
No interface on course/edit.php ... I want to try this on
moodle.org for a while to try and stop the encoding problems
2004-02-09 07:31:04 +00:00
martignoni e138523ff3 Adding more files 2004-02-08 22:50:24 +00:00
martignoni 4a63f1dc6c Typo corrected 2004-02-08 22:36:24 +00:00
martignoni c812e7b78a Quiz help files updated 2004-02-08 22:32:26 +00:00
stronk7 2b375658ae user_preferences fully supported
discussion->usermodified fully supported
log->cmid supported in backup
Bump previous to implement:
   - events
   - restore logs
2004-02-08 19:40:31 +00:00
stronk7 9055368540 Ooops !! Copy/paste typo. :-) 2004-02-08 19:37:43 +00:00
stronk7 63349eb15c log->cmid is included in backup (not processed in restore yet!!) 2004-02-08 19:36:42 +00:00
stronk7 e222ce0944 discussion->usermodified is in backup & restore now. 2004-02-08 19:34:22 +00:00
stronk7 41fd7fe497 Now user_preferences are fully supported in backup & restore. 2004-02-08 19:27:23 +00:00
moodler 21d1d0773b Added some documentation about a few preferences that are only in config.php
right now.
2004-02-08 14:27:54 +00:00
moodler bc5bb6f8f5 Don't show scheduled backups menu if they are disabled 2004-02-08 14:24:44 +00:00
moodler 12fb46824f Changed the name of $CFG->preventscheduledbackups to disablescheduledbackups 2004-02-08 14:21:23 +00:00
moodler 76a5ce96fe Fixed the year 2004-02-08 14:05:12 +00:00
moodler d6f2c959c7 OK, this time I've fixed that URL! 2004-02-08 13:59:50 +00:00
moodler b468a22a45 FIxed the link to old release notes 2004-02-08 13:55:04 +00:00
moodler 8b7fb26f2c Latest release notes for 1.2. Phew, this took me most of the day! 2004-02-08 13:52:47 +00:00
moodler 09119f3b8b Old release info 2004-02-08 13:51:30 +00:00
moodler 7eac5f93cd Removed some rubbish 2004-02-08 12:51:27 +00:00
moodler 952b9c07b6 Quicktime plugin 2004-02-08 12:48:43 +00:00
martignoni 96e8998e94 More files translated 2004-02-08 12:32:43 +00:00
moodler 0708881565 Use mediaplayer for ALL uploaded mediaplayer files 2004-02-08 12:21:36 +00:00
moodler 393137e290 Add a mimetype for .asf files 2004-02-08 12:21:06 +00:00
moodler 6b1ce6b2e0 Some wording changes. 2004-02-08 09:52:24 +00:00
moodler 0437ab95c6 Use format_text to print text so that filters work 2004-02-08 09:48:48 +00:00
moodler 80e376a20d Use format_text instead of text_to_html (so filtering works) 2004-02-08 09:47:29 +00:00
martignoni b53bff0767 Some small corrections 2004-02-08 08:59:02 +00:00
anvergara 2cdbaeba53 Updated 2004-02-08 00:41:39 +00:00
martignoni dcf59b72f9 More help files translated 2004-02-07 22:37:34 +00:00
ralf-bonn b6bf48acb7 Einige kleinere ?nderungen 2004-02-07 19:08:27 +00:00
martignoni 3b05a7f04c More typos corrected 2004-02-07 18:07:29 +00:00
martignoni 7df4d70ac0 Small corrections to backup strings 2004-02-07 18:01:43 +00:00
martignoni 27c7e17f44 Typo corrected 2004-02-07 17:44:54 +00:00
moodler 42e49dad0e By no means finished but at least no loose ends with groups editing 2004-02-07 17:44:10 +00:00
martignoni 6a66656eb7 Plural forms 2004-02-07 13:19:56 +00:00
martignoni 418729eb3a Plural forms 2004-02-07 13:18:23 +00:00
martignoni f2d021b0a5 More typos corrected 2004-02-07 13:16:16 +00:00
moodler b9dd2ed696 News strings for groups stuff 2004-02-07 13:06:04 +00:00
martignoni a36058af51 Typos corrected 2004-02-07 12:52:22 +00:00
moodler a6c7a9fbf8 Some more work on the groups pages (not finished yet) 2004-02-07 12:51:22 +00:00
moodler 1eddd0d8f5 Added timezone display to reduce confusion 2004-02-07 12:27:23 +00:00
ralf-bonn 8394e63f23 Einige kleinere ?nderungen 2004-02-07 12:26:21 +00:00
moodler 74736e4922 A setting $CFG->preventscheduledbackups will prevent scheduled backups
completely.
2004-02-07 05:41:58 +00:00
moodler 5e1aaecb20 Don't lowercase the module name 2004-02-07 02:10:54 +00:00
koenr e1fa1667b3 translated by Koen Roggemans 2004-02-06 23:39:23 +00:00
koenr 282ddcc924 filling in missing strings 2004-02-06 23:38:39 +00:00
koenr fddab4db5a corrected a typo 2004-02-06 23:37:57 +00:00
martignoni c422f82344 More help files translated 2004-02-06 21:51:02 +00:00
koenr 50357f373a corrected a typo 2004-02-06 19:30:11 +00:00
martignoni 755d600fbc More help files translated 2004-02-06 18:55:03 +00:00
moodler 7efa3c6bed Slight improvement to groups listing. I'm not happy with it though. 2004-02-06 17:04:09 +00:00
martignoni 08fc9b7530 More help files added 2004-02-06 16:59:21 +00:00
martignoni 2b3cfed53b Change 'Forcer' to better 'Imposer ' 2004-02-06 15:11:15 +00:00
martignoni 29fee097ad Group mode translation 2004-02-06 15:08:38 +00:00
martignoni b722a1edb9 Typos corrected 2004-02-06 14:48:14 +00:00
moodler 016cd6af4f Discussions now store the last user to change them, as well as the
last time they were modified.   This isn't actually used yet but it
will be.
2004-02-06 13:15:15 +00:00
moodler 0ad4eb5f63 Add institution to the data returned about course students 2004-02-06 12:03:30 +00:00
selliott 26b90e709e Added functions get_recent_assignments and print_recent_instance_activity (for course/recent.php) 2004-02-06 05:25:34 +00:00
selliott bbbcfe3b53 Added string for choosereportfilter (for course/recent.php) 2004-02-05 20:57:29 +00:00
selliott d92d9a22f9 Change string reference for choosereportfilter 2004-02-05 20:54:15 +00:00
selliott aae8c680c9 Used existing string showrecent for button text in print_recent_activity_selector. 2004-02-05 20:48:06 +00:00
selliott 0eb7764d4d Added user parameter to print_recent_instance_activity and get_recent_quizzes (for course/recent.php) 2004-02-05 20:40:59 +00:00
selliott c892ab3672 Added user parameter to print_recent_instance_activity and get_recent_posts (all for course/recent.php) 2004-02-05 20:38:14 +00:00
selliott e7d9c96676 Added selector form at the top of the page .
Added logic to not display hidden activities.
2004-02-05 20:34:49 +00:00
selliott cb83c3cb4d added function print_recent_selector_form for course/recent.php 2004-02-05 20:30:26 +00:00
moodler 898ffaf9d4 Tweaks 2004-02-05 09:57:18 +00:00
moodler 4da1a0a1db Improvements to the way the log upgrading works.
Centralised with an interface now.
2004-02-05 09:55:50 +00:00
moodler 14076f3ad7 More new strings 2004-02-05 09:54:57 +00:00
moodler 13bc710ffa New file for admin-only strings. 2004-02-05 09:10:23 +00:00
moodler 34050fd84a Removing old log upgrades (too slow) 2004-02-05 08:36:48 +00:00
moodler 9d162c650f Removing log upgrades from here (too slow) 2004-02-05 08:32:49 +00:00
moodler 54e5e3f387 Removing the log upgrades from here (too slow) 2004-02-05 08:24:04 +00:00
martignoni cbb60bca21 Suppression of duplicate entries 2004-02-05 08:18:18 +00:00
martignoni 67fa277dd9 Typos corrected 2004-02-05 08:16:16 +00:00
moodler 8a55b99805 UPgrade logs to new format 2004-02-05 05:16:29 +00:00
moodler 484f723352 Upgrade logs for assignments 2004-02-05 05:10:39 +00:00
moodler af7d68413f Update old quiz logs 2004-02-05 05:00:52 +00:00
moodler b44b3a9f29 Add coursemodule info to logs for attempts and submits 2004-02-05 02:54:16 +00:00
martignoni 53c02cbe53 Update to last strings 2004-02-04 21:59:08 +00:00
martignoni 4a1ac5c34e Better strings for better explanation of zip function 2004-02-04 20:48:06 +00:00
martignoni 2dd985804f Change 'backup' to 'sauvegarde' 2004-02-04 20:43:35 +00:00
martignoni 2e33a17229 Update to new strings 2004-02-04 20:38:57 +00:00
koenr 865074ce71 filling in missing strings 2004-02-04 15:30:00 +00:00
selliott fdba9bb4d9 Added functions quiz_get_recent_quizzes and quiz_print_recent_instance_activity for course/recent.php (a recent activities page). 2004-02-04 15:12:06 +00:00
selliott 2bda8358da In function forum_get_recent_posts, removed u.id from select because of conflict with p.id field (p.userid is available) also changed sort from discussion id to modified. 2004-02-04 15:07:08 +00:00
moodler dc6799ff22 Added more information to grades downloads 2004-02-04 14:56:41 +00:00
moodler 9ae8a7a94b Admins can edit the instituion and department fields now.
Long-standing oversight!
2004-02-04 14:24:29 +00:00
moodler 48adbab6bf New string "institution" ... and some minor HTML cleanups 2004-02-04 14:23:55 +00:00
moodler bd115b3f82 Caters for the case when nothing was selected 2004-02-04 13:40:20 +00:00
moodler 9b591be622 Better error messages for restricted users 2004-02-04 12:59:05 +00:00
moodler f3436de6a7 Restricted users can't enrol in other courses 2004-02-04 12:52:31 +00:00
moodler 3ed0a1c316 Restricted users can't update course formats 2004-02-04 12:45:35 +00:00
moodler b7318874b9 Don't allow restricted users to do restores 2004-02-04 12:44:06 +00:00
moodler 9069e60346 Restricted users can't do backups 2004-02-04 12:43:05 +00:00
koenr 941391a4c1 translating at Moodle speed :-) 2004-02-04 09:35:43 +00:00
moodler fed7c5ba94 Fixed a hardcoded string (thanks, koen) bug #1022 2004-02-04 09:29:01 +00:00
moodler 5c9cbb399e Remove time restriction. :-) 2004-02-04 09:13:26 +00:00
paca70 fb25ce9457 updates 2004-02-04 06:55:36 +00:00
moodler b5abf3e824 Fixed a Typo - thanks Bruno Vernier 2004-02-04 06:16:59 +00:00
moodler 31b1967fe1 Bump 2004-02-03 15:56:27 +00:00
andre_bln 4cf89ce3d2 new version german translation 2004-02-01 2004-02-03 15:23:19 +00:00
moodler d4469f2a84 Clean up of insert_record with some better error-checking 2004-02-03 15:18:41 +00:00
moodler 791b42ee1d Add framename target for logs links 2004-02-03 10:21:20 +00:00
moodler 06d6f733b7 Latest fixed from Dr Ali 2004-02-03 09:12:31 +00:00
moodler 95d4575736 If there aren't many logs to process, then do it now during the main
upgrade, but otherwise, tell the upgrader to run the separate script
at admin/upgrade_logs.php later on.
2004-02-03 04:56:22 +00:00
moodler 6ba0da0289 Quick version of script to upgrade the old logs to the new format 2004-02-03 03:46:29 +00:00
moodler 35faf19e80 SOme extra information when upgrading old logs 2004-02-03 02:27:33 +00:00
martignoni 77f4ad40d9 Update for GIFT and Aitken formats 2004-02-02 14:30:56 +00:00
martignoni 63031d4ae6 Added links to the other help files 2004-02-02 13:56:12 +00:00
martignoni fe7424eebb Update because of slippage 2004-02-02 13:51:29 +00:00
moodler e046dcd419 Made using new admin/lang.php 2004-02-02 12:13:50 +00:00
moodler 55b5b387ba Copied from en 2004-02-02 12:13:32 +00:00
moodler a2b0158423 Adding back the missing logs ... they are needed by recent activity - doh! 2004-02-02 09:44:06 +00:00
moodler 2a5885c432 Reformatted using new admin/lang.php to remove all linefeeds 2004-02-02 04:20:37 +00:00
moodler da9e21a407 Strip linefeed characters \r from multi-line strings 2004-02-02 04:19:56 +00:00
moodler 6fa45f168b Updated old language files to the new 'format' 2004-02-02 03:54:52 +00:00
andre_bln 358906742c new version german translation 2004-02-01 2004-02-01 20:36:32 +00:00
stronk7 0180f73f48 Now, this function can be called twice from the same page.
In participants list, when showing teaches, the country of
the students was not showed.
Please, check. I haven't found problems with this, but...
2004-02-01 12:07:36 +00:00
moodler 612250d025 Important fixes from Dr. Ali .... a$ --> $a :-D 2004-02-01 08:49:41 +00:00
moodler 114c82afe5 On second thoughts, no need to double up these logs 2004-02-01 07:27:40 +00:00
moodler 573eae5aa7 Save coursemodule in logs for generic updates/adds 2004-02-01 07:25:10 +00:00
moodler ed68c6db3d Fixed calculation of max upload size 2004-02-01 05:51:20 +00:00
moodler 82f5ee2678 Author details 2004-02-01 04:47:53 +00:00
moodler a7f4452d11 Updating version numbers of all Modules to make things a bit clearer 2004-02-01 04:42:39 +00:00
moodler e78d197dca Latest version of Arabic from Dr Ali 2004-02-01 04:22:21 +00:00
fiedorow 36268d0271 Added all the presentation and content tags from the MathML 1.01 specification 2004-01-31 22:02:01 +00:00
mits 8ba911fc29 New file translated. 2004-01-31 17:40:29 +00:00
mits 20144a68f0 New some translation added. 2004-01-31 17:39:36 +00:00
moodler 077b1acf0d New Lithuanian translation from
Aidas Smaizys
Klaipeda university
Lithuania
2004-01-31 16:19:40 +00:00
moodler b56fad0b50 Upgrade process can be long, so flush regularly 2004-01-31 15:33:12 +00:00
moodler 9423833cd9 All modules now require the very latest because of the changes to add_to_log 2004-01-31 15:25:00 +00:00
moodler 037f99aa2d Upgraded add_to_log to send cm->id 2004-01-31 15:22:04 +00:00
moodler 69d79bc31f OK, some big improvements to the logs.
Logs now include a field called modid which contains the coursemodule id.

This makes it now possible to

   - see complete logs per-activity

   - do backup/restore of logs

The upgrade process will currently try to scan all the old logs and
rebuild this field based on available data (especially forums).

STILL TO DO:  alter all the non-forum modules to send the coursemodule id
2004-01-31 14:47:57 +00:00
moodler bb0d4590bd Fixes to log URLs for these new ones 2004-01-31 12:01:25 +00:00
moodler 16e962a71c Use a looser search when showing an activity module's logs, to get more 2004-01-31 11:55:05 +00:00
moodler 4afe0109d1 A new log_display entry for when resources are updated 2004-01-31 11:54:26 +00:00
moodler 86c90e4541 Add a log entry under the module name whenever the module is updated 2004-01-31 11:53:49 +00:00
moodler b7510ce4ee Going through it now to make the release page 2004-01-31 09:12:25 +00:00
moodler 04b113f6e1 Updated because of slippage 2004-01-31 09:00:19 +00:00
koenr dad2efab6b translating on moodle-speed ;-) 2004-01-31 08:49:57 +00:00
moodler bd5d44fa22 Bump 2004-01-31 08:43:30 +00:00
moodler ac679ffd80 New string 'clicktochange' 2004-01-31 08:42:45 +00:00
moodler 3d575e6f08 Improvements to groups.
- you can now actually turn group modes on and off for each activity. :-)
    "Turn Editing On" to see the new icons.

  - Link to Groups page is now smarter about when it does and doesn't appear
2004-01-31 08:40:38 +00:00
koenr 30654f8c11 missing strings 2004-01-31 08:39:34 +00:00
koenr 4de2f1d6ff missing strings 2004-01-31 08:37:04 +00:00
moodler de411a0595 Slightly improved icon 2004-01-31 08:36:30 +00:00
moodler 6dfa062f89 New draft icons for defining groups per activity 2004-01-31 07:44:19 +00:00
moodler a80a772821 Fixed some hard-coded strings http://moodle.org/bugs/bug.php?op=show&bugid=1011 2004-01-31 05:55:11 +00:00
moodler 006af32664 Missing string 2004-01-31 04:27:08 +00:00
moodler 2cb2ce61ad When separate groups are being used, only show teachers and students who have
access to that group
2004-01-31 04:08:10 +00:00
moodler 3d35e6b732 Putting in a placeholder when counting or gettig users in group 0
(return nothing for now)
2004-01-31 04:03:46 +00:00
moodler 0720313b30 get_course_students can now look for groups as well (doesn't handle
group 0 yet)

get_course_users is more robust (fixes the journal report problem etc)
2004-01-31 03:30:31 +00:00
koenr 27a350e676 missing strings 2004-01-30 23:50:00 +00:00
stronk7 3caa089f49 Some strange line feeds in the latest version. Solved. 2004-01-30 23:15:11 +00:00
gustav_delius 800578b7fe increase mailed to number(2) 2004-01-30 21:44:44 +00:00
gustav_delius c7cdd6ec82 moved the database update code to where it belongs 2004-01-30 21:40:31 +00:00
stronk7 2b80c9d76a Added str. creatinggroups 2004-01-30 21:16:52 +00:00
stronk7 29856bcba0 Now everything seems to work fine with the new insert_record() function.
Please, test :-)
2004-01-30 19:04:07 +00:00
gustav_delius 3d94772d47 better logging of forum mail errors, see http://moodle.org/mod/forum/discuss.php?d=4865. Required the addition of an extra optional argument $user="" to add_to_log() 2004-01-30 18:21:56 +00:00
moodler 8ff79e8c5b Fixed the counting of submissions for a new function assignment_count_real_submissions() 2004-01-30 16:53:01 +00:00
moodler d98579dbc9 OK, much better. What was I thinking. :-) 2004-01-30 15:22:43 +00:00
moodler 819110a116 On second thoughts, added hours 2004-01-30 15:16:54 +00:00
moodler d3128ddf0e Fixed date format 2004-01-30 15:16:04 +00:00
gustav_delius 6077020a60 got rid of bad line endings 2004-01-30 14:50:03 +00:00
moodler 5ea64f4b2f Error message for restricted users 2004-01-30 09:55:57 +00:00
moodler fcf9c45033 New paratmeter to insert_record called primarykey (defaults to "id")
and removed insert_record_old
2004-01-30 09:04:31 +00:00
moodler e248a905b4 Whoops ... forgot to check this in 2004-01-30 08:50:53 +00:00
moodler 5476a93df2 Fix the mode handling for "single" forums 2004-01-30 08:45:11 +00:00
moodler e83c419d06 Check for restricted users and also removed some tabs 2004-01-30 08:31:50 +00:00
moodler ab39445640 Restrict certain users from changing profile 2004-01-30 08:29:35 +00:00
moodler cb98d3120c New function to restrict defined users 2004-01-30 08:25:49 +00:00
paca70 77e84a85f2 My php 4.3.4/postgres7.4 combination was thinking
that returned id-column was string and some modules were thingking that theres
insert error if return value is string.
Right now all id-colums is always integer so
this should be ok.
2004-01-30 07:45:36 +00:00
bobopinna b4e1d00641 Updated by Roberto -Bobo- Pinna 2004-01-30 07:43:54 +00:00
bobopinna 2d263cd84b Updated by Roberto -Bobo- Pinna 2004-01-30 07:36:08 +00:00
moodler 916ac02608 No functional change, just me moodling 2004-01-30 07:29:08 +00:00
moodler 1eff7fef0c Use natural sorting on lists 2004-01-30 07:26:52 +00:00
moodler 9fa6280580 When unenrolling students, remove them from groups too 2004-01-30 06:44:02 +00:00
moodler bb8c36313c When adding a teacher, remove them as a student. 2004-01-30 05:59:33 +00:00
moodler a698fc0e92 Simplified logic a bit 2004-01-30 04:02:17 +00:00
moodler 7008b03ca3 Fixed typo bug when getting users 2004-01-30 04:01:19 +00:00
moodler 25be6cfff3 Upgrading ADOdb to 4.11 ... there were lots of little bug fixes 2004-01-30 03:11:47 +00:00
moodler 89f1cea654 Fixed problem with magic quotes 2004-01-30 02:25:02 +00:00
moodler 5c09be163c Don't always use arraymerge in journal_get_users_done() - was causing
bad data sometimes ...
2004-01-30 01:57:00 +00:00
moodler 0892f7bd01 IMPORTANT! CRUCIAL CHANGE TO MAJOR FUNCTION!
Petri Asikainen rewrote insert_record to use ADOdb functions.  It might
be very slightly slower but it gets rid of all the horrible not-quite-working
PostgreSQL workarounds the old one contained.

It worked for him on PostgreSQL 7.4 and for me on MySQL 3.23 and 4.0.15,
so I'm checking it in.

Please test it thoroughly on your test systems.

Since it writes data it has the potential to stuff things up, so be
careful on production systems for a few days.
2004-01-29 15:27:21 +00:00
bobopinna 66e7920caf Updated by Roberto -Bobo- Pinna 2004-01-29 15:13:09 +00:00
bobopinna 99d7c97106 New version from Giorgio Borelli 2004-01-29 14:27:32 +00:00
moodler 1390f203a7 Dont print learning forums table if there aren't any 2004-01-29 05:59:26 +00:00
moodler 36c23cd6a9 Reduce intro text for general forums 2004-01-29 04:58:56 +00:00
moodler ba39fa10cc Change type of config->value to text (to allow longer info) 2004-01-29 04:13:55 +00:00
stronk7 916bb3daec - some debug info turned off.
- scheduled backups now supports groups info (need to centralize the code!!)
- solved an important issue when restoring users introduced in lib.php v1.44

Bump
2004-01-29 00:14:02 +00:00
stronk7 6be18d4f75 Solved one important issue when restoring users due to a bug in
revision 1.44, when solving bug 946. Tons of thanks to Jacob Romeyn
detecting it.
2004-01-29 00:12:17 +00:00
stronk7 50dbc51fc9 Turn off some debug info. 2004-01-29 00:08:25 +00:00
stronk7 e9163ad481 Now groups are included in scheduled backups.
I think that we should use the same exact code in backup_execute.php
and backup_scheduled.php to avoid duplicating it in two files !!
2004-01-29 00:07:25 +00:00
moodler 643cd42872 Latest tags 2004-01-28 16:46:42 +00:00
moodler e06a8263a1 Removed function, and updated versions 2004-01-28 14:49:56 +00:00
moodler 279826e26f Yes, finally forum display preferences are preserved. :-) 2004-01-28 14:48:49 +00:00
moodler 066af654c2 Bugfixes to set_user_preference 2004-01-28 14:47:39 +00:00
moodler 70812e39a0 Added new table called "user preferences" which can be used for
storing arbitrary preferences for each user.

Thanks to Jon Papaioannou for the first draft of this code
which I modified.
2004-01-28 14:14:19 +00:00
moodler ad7101a17b FIxed counting of submissions 2004-01-28 11:03:44 +00:00
koenr 73e7875705 missing strings 2004-01-28 07:41:48 +00:00
koenr df7177161a found some typo's 2004-01-28 07:41:10 +00:00
moodler 1d1a623391 Added msup 2004-01-28 04:42:30 +00:00
moodler 83f007bf39 Define minimum required versions of Moodle 2004-01-28 04:27:57 +00:00
moodler 6deb891b4c Allow modules to define the version of Moodle they require, and
abort their installation if this requirement isn't met.
2004-01-28 04:26:58 +00:00
stronk7 b50b027b2b Small typo preventing Excel Sheets to be named correctly. 2004-01-27 23:48:23 +00:00
moodler 66ee479190 Fixed tiny bug for courses without groups 2004-01-27 11:57:10 +00:00
moodler 9a7f910cf8 Bumpy bump - time moving too fast 2004-01-27 03:43:56 +00:00
moodler 899da17470 Allowing <algebra> tag 2004-01-27 03:30:57 +00:00
stronk7 eb74cfd05e Now the destination directory in scheduled bakups have some checks:
- Trailing slashes.
   - Trailing backslashes.
   - Exists.
2004-01-26 23:24:12 +00:00
moodler 4fb93b2ed2 Check $themename to prevent warnings at high levels of debugging ... 2004-01-26 18:22:02 +00:00
moodler ece42d55fc FIxed tiniest bug when trying to backup groups in courses that have none 2004-01-26 17:46:19 +00:00
moodler fd6c9e1d3a Setting moodle.php back to default format (as created by admin/lang.php) 2004-01-26 17:32:07 +00:00
moodler 9785185db2 Adding string for groups backup 2004-01-26 17:26:52 +00:00
moodler e6ce0cb9f3 Undoing some wacko formatting ... What were you trying to do, Gustav? 2004-01-26 16:55:37 +00:00
bobopinna b18077d5e3 Updated by Roberto -Bobo- Pinna 2004-01-26 13:56:46 +00:00
moodler 8eb675a555 Added dividers 2004-01-26 12:29:02 +00:00
moodler 9328530195 Added dividers and improved display of section 2004-01-26 12:27:11 +00:00
moodler de7d2d5531 New dividers 2004-01-26 12:21:44 +00:00
moodler 858c8a05e8 Better dividers in the table 2004-01-26 12:07:34 +00:00
moodler a1a6750357 Use dividers on the resource page 2004-01-26 11:51:41 +00:00
moodler 6a903e0e83 Better for CSS 2004-01-26 11:47:20 +00:00
bobopinna 391aab5ea0 Updated by Roberto -Bobo- Pinna 2004-01-26 11:26:29 +00:00
moodler 5604f7798f New style for tabledivider, and some fixups 2004-01-26 10:14:22 +00:00
moodler 9586c1dd6b Er, much better wayto do dividiers 2004-01-26 09:54:40 +00:00
moodler ef6a649b72 MOds to use dividers between sections 2004-01-26 09:48:20 +00:00
moodler e21e20cfd7 Mod to print_table to allow dividers between rows (used on forum listing) 2004-01-26 09:48:00 +00:00
moodler 6a751fca5a Adding more tags for matsh 2004-01-26 09:15:12 +00:00
moodler 404afe6b86 Get groupmode when returning a list of instances 2004-01-26 09:13:47 +00:00
moodler 8a2c90768f Clarification to some group logic 2004-01-26 09:12:52 +00:00
moodler c585ba8b14 Remove the forum links as well (for group forums when user not in group) 2004-01-26 08:57:01 +00:00
moodler a0b9571f7c Subscribe links accurately reflect what is possible according
to the user's group status.

Section numbers now printed once per section
2004-01-26 08:05:44 +00:00
moodler 0affff5ecd Put $themename back again 2004-01-26 04:34:44 +00:00
stronk7 61f95aada5 Now userid and groupid fields are recoded correctly
in the restore process. This should make the backup utility
group-compliant !! (when talking about forums, of course) :-)
2004-01-25 21:00:06 +00:00
stronk7 dfa14bc98f Now groups and members are restored and recoded when restoring courses.
Existing courses are searched by name+description to add members to
existing groups (when restoring over another course).
2004-01-25 20:57:58 +00:00
gustav_delius d7143408df replaced incorrectly closed html tags, see bug 365 2004-01-25 20:34:54 +00:00
gustav_delius 2e39d2f810 minor fixes, including bugs 997, 998 2004-01-25 19:37:04 +00:00
stronk7 a4de843e15 Groups are now included in backup too. I start working in restore now. 2004-01-25 19:26:24 +00:00
gustav_delius 09b78a6b3d removed empty lines, which for example messed up the display of the license terms 2004-01-25 19:05:09 +00:00
gustav_delius 8c0ef41d6a reset timelimit so that script does not get timed out when posting to many users 2004-01-25 17:04:54 +00:00
gustav_delius 33dd9a0bcf added missing </center> 2004-01-25 17:02:22 +00:00
gustav_delius 9928b09e6e added alt text to some icons 2004-01-25 17:00:12 +00:00
gustav_delius 0d0e550f88 apply filter_text to course summary 2004-01-25 16:50:49 +00:00
moodler afabdb1491 Run cron.php as admin user so timezones etc work 2004-01-25 14:51:04 +00:00
moodler fbe0e97ceb Shorter string to help editor display
http://moodle.org/mod/forum/discuss.php?d=4791
2004-01-25 13:50:09 +00:00
moodler 18845ac357 If $CFG->opentogoogle is defined then
- google can get in as guest

   - visitiors referred from google get in as guest
2004-01-25 09:37:28 +00:00
moodler 0609562b64 New function guest_user to create a guest user record and return it 2004-01-25 09:35:45 +00:00
willcast 33cc423e38 - Solving bug 995:
Blank aliases caused the autolinking feature to mess the whole thing...
2004-01-25 04:05:58 +00:00
rkingdon 2e855d5f05 Fixes to Backup and upload (now allows teachers multiple uploads in a
short period)
2004-01-23 17:02:47 +00:00
moodler c0ae5fc15b New strings 2004-01-23 13:23:54 +00:00
moodler 5316939bcf Prevent people from subscribing to group forums is they aren't in a group 2004-01-23 13:21:25 +00:00
moodler a7f5bf8575 Always show correct current group in popup menu 2004-01-23 13:01:05 +00:00
moodler 2f9c977e6b Fixes for recent_activity and cron to use the new groupid stuff 2004-01-23 12:48:37 +00:00
moodler f356144c52 Zipping now works in the filemanager popup from resources. 2004-01-23 12:34:29 +00:00
moodler 02509fe667 Improvements to forum groups.
New forum_discussions->groupid now stores the group ID for the
discussion.
2004-01-23 12:09:25 +00:00
moodler d26924c4ec Load overlib.js as an external Javascript file, on all pages 2004-01-23 08:51:17 +00:00
moodler 210d0f3388 MD5 library for home-made security 2004-01-23 08:40:29 +00:00
moodler 80bc80e121 Overlib function for slick popups 2004-01-23 08:35:45 +00:00
moodler 43e93a0756 FIxes to cope with this case:
- student authenticates
  - teacher enrols the student manually
  - student tries to enter course

http://moodle.org/mod/forum/discuss.php?d=4529#20493
2004-01-23 08:30:15 +00:00
stronk7 e695cd3f36 Now groupmode in course_modules is supported too. 2004-01-22 20:27:17 +00:00
moodler 18352a55f5 For now just avoid public categories.
It would be nice if instead a check was made to make sure that the
category wasn't being used by other courses, then even public
categories could be deleted.
2004-01-21 17:13:55 +00:00
moodler b2d594c8de New function quiz_delete_course() which deletes all the leftover stuff
while a course is being deleted
2004-01-21 16:44:22 +00:00
moodler ca952b033d In remove_course_contents() look for a module function called
module_delete_course and run it as well.  This is mainly for
quizzes at the moment but basically it runs cleanup stuff
whenever a course is being emptied
2004-01-21 16:15:03 +00:00
moodler facbf40f92 Only list categories that belong to real courses 2004-01-21 16:04:55 +00:00
moodler 38be5e773e Fixed buggy date string 2004-01-21 12:09:23 +00:00
andre_bln 798af5b7e7 new german version richtext.html 2004-01-21 05:02:06 +00:00
moodler 22592150f9 Slight fix for null case (Add Choose item on popup menus) 2004-01-21 03:22:16 +00:00
rkingdon 9748030a8f Fix bug in Analysis of Assessments 2004-01-20 17:25:45 +00:00
moodler 298698ae60 Removing defunct language 2004-01-20 13:58:03 +00:00
moodler 5e04a34404 Flush it 2004-01-20 13:54:32 +00:00
moodler c6d691dc28 - Prevent users from replying in groups other then own.
- groups menu at discussion level
2004-01-20 13:51:27 +00:00
moodler 28b6f2b404 Some fixes 2004-01-20 13:50:02 +00:00
moodler 1ad1390857 Fixed locale 2004-01-20 13:49:05 +00:00
moodler e08061157c Added lang and mathml tags to allowed tags 2004-01-20 13:27:37 +00:00
moodler c322ecb76a Corrected a string 2004-01-20 11:27:29 +00:00
moodler 98a45cd7e7 Support for auto embedding of WMV files 2004-01-20 11:22:09 +00:00
moodler 52c6d39e93 New Farsi translation by Adel Ghazikhani <a_g1981@yahoo.com> 2004-01-20 11:19:56 +00:00
moodler c9b7e81ac0 Make sure XML is enabled 2004-01-20 10:03:34 +00:00
moodler e318d18df2 Working code by Ga?tan Frenoy to allow texts to contain multiple languages!
See:  http://moodle.org/mod/forum/discuss.php?d=2760
2004-01-20 08:56:38 +00:00
moodler ce57cc79eb Added stripos function and allow filters to work even when courseid
isn't set.
2004-01-20 08:51:43 +00:00
moodler 46d621261b Use format_text on the site-info 2004-01-20 08:50:00 +00:00
moodler ef6b0c645e Ignore errors on chown 2004-01-20 08:46:23 +00:00
koenr 8d2acc5cee trying to improve the translation by using the module 2004-01-18 21:34:23 +00:00
trobb 7b656c9707 Further problems with the percentage displays fixed 2004-01-18 09:52:52 +00:00
trobb f287b42cee Error in percentage calculations for T/F items fixed (screen display only) 2004-01-18 08:55:18 +00:00
moodler b0be6c79bf Some fixes for displaying empty grades in quizzes
suggested by Marilyn Fleming http://moodle.org/mod/forum/discuss.php?d=4636
2004-01-18 06:17:02 +00:00
koenr 60904615c5 missing strings 2004-01-18 02:05:19 +00:00
les_kopari 1aaef0d086 Translated from MySQL. 2004-01-17 15:41:38 +00:00
les_kopari 79741ebe7e Added one column and modified test cases. 2004-01-17 14:18:55 +00:00
les_kopari 33235e53b0 Renamed. 2004-01-17 13:02:24 +00:00
les_kopari ea31ae41c7 Another test run. 2004-01-17 12:59:28 +00:00
les_kopari cab9d39e60 Renamed to schemaGroups_members.xml 2004-01-17 12:57:24 +00:00
les_kopari 49df1a42b5 Renamed to schemaGroups.xml 2004-01-17 12:56:13 +00:00
les_kopari 945e013c67 Renamed table. 2004-01-17 12:52:42 +00:00
les_kopari 6b95445ac8 Test run with new columns and tables. 2004-01-17 12:49:49 +00:00
les_kopari 339ac7daa5 New columns. 2004-01-17 12:44:50 +00:00
les_kopari 68cd6454aa New columns and tables. 2004-01-17 12:41:54 +00:00
trobb 88ba0fed41 Report lines after a matching question in screen display and Excel fixed. 2004-01-17 10:27:01 +00:00
moodler 77362fa9ce A very quick and dirty try .... Williams? What do you think? 2004-01-17 10:18:12 +00:00
moodler 5fba04fba0 EARLY SUPPORT FOR CALENDARS AND EVENTS
--------------------------------------

New functions and tables, based on work from Gustav Delius
(see http://moodle.org/mod/forum/discuss.php?d=4466)

This forms the core of a new system to store, track and utilise
event information in all modules, as well as allowing external
calendars to be synchronised with new information.
2004-01-17 09:47:45 +00:00
les_kopari e34aab0dd0 New field. 2004-01-17 09:16:20 +00:00
les_kopari 5f1317f88e Correct defaults. 2004-01-17 09:06:21 +00:00
les_kopari d8f6ab1b8a Added groupmode, groupmodeforce. 2004-01-17 08:55:22 +00:00
moodler 4fc2eb7a5e Use is_internal_email function (see bug 978) 2004-01-17 07:08:47 +00:00
moodler a33ba1367e Editing teachers can always get into forums 2004-01-17 06:49:18 +00:00
moodler eef16119b9 Only editing teachers can see files 2004-01-17 05:39:29 +00:00
koenr ca3dc4c7c0 Hans insisted 2004-01-16 21:36:04 +00:00
koenr 268e90211a mising strings 2004-01-16 21:34:15 +00:00
giro123 75b2ba754f *** empty log message *** 2004-01-16 18:32:12 +00:00
moodler 27ac57c086 Chat sessions can now be deleted 2004-01-16 13:14:42 +00:00
moodler 94d712f197 Links color = black 2004-01-16 12:16:05 +00:00
moodler 0f32a7f3f9 Require user to login to see glossary entries (if a course is specified) 2004-01-16 11:39:40 +00:00
moodler 218b443372 Add some styles in the posts so the autolinks look OK. 2004-01-16 11:32:14 +00:00
moodler bb95c08bc4 Small improvement to log-gathering for activities - works better with
glossary logs
2004-01-16 11:23:40 +00:00
moodler 71767204c9 Pass courseid to format_text explicitly 2004-01-16 10:51:24 +00:00
moodler c4ae4fa1a8 Fixes so that $courseid can be passes to format_text (and this filter_text) 2004-01-16 10:49:07 +00:00
moodler a8502a18fb Output the time in the cron output 2004-01-16 10:23:11 +00:00
moodler f95ad4b43a UNTESTED changes to allow multiple hosts to be used for POP3/IMAP/NNTP authentication
Please test them.
2004-01-16 09:17:20 +00:00
moodler b78eabdcdd When using the HTML editor, don't provide format options 2004-01-16 06:42:46 +00:00
paca70 359c9742df Updates 2004-01-15 19:02:39 +00:00
paca70 16e45ab4c9 Initial version 2004-01-15 19:01:22 +00:00
giro123 14cafbd4eb *** empty log message *** 2004-01-15 18:52:27 +00:00
paca70 757720d532 Initial translation 2004-01-15 18:39:05 +00:00
villate 80a51ae512 New files from version 1.2 2004-01-15 17:56:55 +00:00
paca70 edd962ab73 Updates 2004-01-15 17:43:46 +00:00
villate eda0719d95 Updated to the 1.2 version 2004-01-15 17:08:22 +00:00
moodler 2d1c22bb66 Menus on quiz editing no longer need the submit buttons 2004-01-15 15:26:34 +00:00
moodler 1e80bd71a4 FIxed a small typo preventing group display 2004-01-15 10:22:15 +00:00
moodler c5a05b9598 Don't show old chat users in recent activity 2004-01-15 08:44:08 +00:00
moodler 9f39874ec5 Double-check bad input data 2004-01-15 07:52:21 +00:00
moodler e2c4f8e4dc Save forum log url in a more standard way 2004-01-15 07:26:52 +00:00
moodler c57e40225f Added "All activities" 2004-01-15 07:21:32 +00:00
moodler 3da4752434 Added log links for teachers from each activity page 2004-01-15 07:17:47 +00:00
moodler f24cffb995 Logs can now be divided up by activity! 2004-01-15 07:17:12 +00:00
paca70 6f01df4957 Added missing "(" 2004-01-14 18:25:25 +00:00
paca70 f63823b3cc FIXED:
script was calling fix_course_sortorder() before courseorder have been renamed to coursecount.
2004-01-14 18:13:26 +00:00
moodler d7df380b78 Extra parameter for robustness 2004-01-14 17:53:51 +00:00
moodler bd9dd91015 Latest files from Denis 2004-01-14 16:56:39 +00:00
stigbjarne fabeeb627c New file. For now, mostly headers and infotext translated. Answers: Still in english. 2004-01-14 13:47:16 +00:00
moodler a2c3b87eda Clean output for old entries 2004-01-14 13:33:00 +00:00
moodler 999beee0b6 Clean all data in user profile 2004-01-14 13:31:28 +00:00
moodler aeb23d0a02 User descriptions weren't being filtered! They are now. :-) 2004-01-14 13:07:29 +00:00
moodler c3fcf3f3c5 Fixed two typos - seems to be working properly now 2004-01-14 13:01:54 +00:00
stigbjarne f52a0eb948 New file 2004-01-14 13:01:01 +00:00
moodler d05956ac9f Some improvements in efficiency of Recent Activity.
There is now a new field in forum_discussions which has the userid
of the author in it.  This saves a lookup every time to forum_posts.

There is also some caching and rearrangement of the logic.

It seems to work OK, I'm about to do some speed tests on moodle.org
2004-01-14 11:50:29 +00:00
moodler da8079852c Even in visible-groups mode, only show recent activity of one's own group
Not sure if this is right though
2004-01-14 09:12:53 +00:00
moodler 29aab4acda Obey "forcelogin" 2004-01-14 08:27:40 +00:00
moodler 0a45ffe301 A new configuration setting - "forcelogin".
Default is false, everything is as it is now.

If turned on, then users are forced to log in before
being able to see the front page or the course listings.
2004-01-14 08:27:18 +00:00
koenr f309f624ea added link to index of helpfiles 2004-01-14 08:22:48 +00:00
moodler c7609872ca May avoid a cookie issue 2004-01-14 03:47:40 +00:00
moodler 7d18a73462 Make it easier to click on attempts 2004-01-14 03:25:46 +00:00
moodler 413766e856 Added links to the other help files 2004-01-14 03:10:35 +00:00
moodler 34a2293e08 Journal questions can now use HTML editor, plus new field 'introformat' 2004-01-14 02:24:42 +00:00
koenr ecd7e49e87 keeping track of the changes 2004-01-13 21:19:17 +00:00
thetrinity a9981ba619 Implemented Matching Questions. 2004-01-13 14:32:18 +00:00
willcast 94b27136b2 - Solving bug 971:
Some default settings override db fields when editing an entry.
2004-01-13 13:48:40 +00:00
stigbjarne 4aac7b8ab6 New file 2004-01-13 10:16:53 +00:00
moodler 62f5a86963 Strip tags from new user's names and email. Thanks to Paul Shew. 2004-01-13 07:54:22 +00:00
moodler 127962ca2a Fixes for buggy stuff 2004-01-13 02:32:33 +00:00
koenr d57e12eb51 updated 2004-01-12 19:27:21 +00:00
koenr cc8a82dcbe updated and put in (Dutch) alphabetical order. All indexfiles should be alphabeticaly ordered now. 2004-01-12 17:35:04 +00:00
koenr a871ec51d0 changed title to fit logicaly in indexfile 2004-01-12 17:30:12 +00:00
moodler f4212b4f12 Don't print description box if there is no description. 2004-01-12 17:20:41 +00:00
moodler b91d6dcd57 This is a ridiculously complicated solution to showing only
those posts in recent activity that one should see.

It's temporary.

I have a more efficient solution in mind but it will take
at least one new database field - I'll tackle it later.
2004-01-12 17:20:10 +00:00
moodler 3fc6ae75e4 Some fixes to clarify handling of the number of attempts 2004-01-12 16:30:51 +00:00
bobopinna a6c3d65039 Updated by Bobo 2004-01-12 16:09:19 +00:00
moodler ec15d3e9f1 And make sure the group is from this course! 2004-01-12 14:51:29 +00:00
moodler e9089eb471 Secure group viewing when in separate mode 2004-01-12 14:48:33 +00:00
moodler d04d87e3bd Replaced missing string 2004-01-12 13:11:40 +00:00
moodler 91504deaee A number of fixes (fixed by simply saving with admin/lang.php) 2004-01-12 13:06:38 +00:00
andre_bln 2aa4f4d1f4 german language files version 20.11.2003 2004-01-12 10:24:08 +00:00
mits 2c33370ac5 some new translation added. 2004-01-12 08:24:56 +00:00
thetrinity f14d97d06e Fixed typo and minor polishing for GIFT filter docs. 2004-01-12 03:58:31 +00:00
thetrinity f70567fee5 Fixed typo and minor polishing. 2004-01-12 03:54:24 +00:00
moodler 19090101a9 Bug #966 - journal_grades should return NULL if no grade 2004-01-12 02:36:45 +00:00
koenr cf37cc5502 filling in missing strings 2004-01-11 22:19:04 +00:00
koenr 81cc156467 translated by koen Roggemans 2004-01-11 22:18:36 +00:00
koenr 1e32384cc0 corrected some typo's and ugly tranlations 2004-01-11 18:44:13 +00:00
moodler 7df59158b8 Bug 965 2004-01-11 18:37:00 +00:00
moodler e21f6c81b5 No need to require this file 2004-01-11 18:09:09 +00:00
moodler 1b69867429 Use is_internal_auth function instead 2004-01-11 18:08:10 +00:00
moodler 9197e1472f First version of support in groups in the forums.
Still needs plenty of testing.   There is no GUI yet for turning on
the groupmode just for the forum (this will be on the course page)
but you can put a 1 (visible) or 2 (separate) in the course_modules table.
2004-01-11 17:46:57 +00:00
moodler 0d67c51458 Work done on group functions 2004-01-11 17:44:46 +00:00
moodler ddc7afad9a Added groupmode setting to course_modules 2004-01-11 17:44:09 +00:00
moodler e9f289635d Added strings for WebCT Import format 2004-01-11 02:50:41 +00:00
moodler 998ebd420a WebCT Import format!! (untested)
Contribution from Denis Rebaud!
2004-01-11 02:43:16 +00:00
moodler 34c46c1724 Grammar fixes for "updating" and "editing" 2004-01-11 01:57:43 +00:00
moodler 37d67d011a Some grammar fixes (for modules named starting with vowels) 2004-01-11 01:56:52 +00:00
moodler 2c4263c433 Sort group members by last access by default 2004-01-10 16:52:33 +00:00
moodler 548ef30e8b Use the new print_user function for the group 2004-01-10 16:49:17 +00:00
moodler 499795e84d Links in print_user are absolute 2004-01-10 16:47:14 +00:00
moodler 951b22a829 Completely got rid of user/lib.php
- print_user() went to weblib.php and got tidied up

  - The graphics functions went to lib/gdlib.php

See Bug 922
2004-01-10 16:41:29 +00:00
moodler 158d5a4f32 New library for collecting routines related to GD 2004-01-10 16:38:18 +00:00
moodler 6e51e14435 When logging in as a user, take on their "current group" setting too,
then afterwards return teacher to their old setting
2004-01-10 14:25:18 +00:00
thetrinity 7692b869ef Converted to UNIX file type. 2004-01-10 09:50:14 +00:00
thetrinity 9249e3ab4e Fixed typo 2004-01-10 09:39:28 +00:00
thetrinity f301de5e9e Updated docs to latest revisions of GIFT import filter 2004-01-10 09:24:37 +00:00
moodler 29fb5974e7 Increased QUIZ_MAX_NUMBER_ANSWERS to 10, and actually made it apply to everythin 2004-01-10 07:39:19 +00:00
thetrinity 87e6dacbdf examples.txt added 2004-01-10 03:39:14 +00:00
thetrinity 4300aa4c58 Integrated Multiple Answers and inline comments options. Made examples.txt. Documentation now moved. 2004-01-10 03:35:11 +00:00
gniske 14b54f0166 Adding missing strings
Made som few corrections in existing translation
2004-01-09 22:04:54 +00:00
moodler 17c4a01172 Don't move courses from delete categories to the "zero" category
(Make sure the grandparents are home before sending the kids there!)
2004-01-09 16:54:10 +00:00
martignoni f0c60a8fba One sentence corrected 2004-01-09 16:49:13 +00:00
martignoni c8e87ef291 Changed to single quoted strings 2004-01-09 16:15:24 +00:00
martignoni 104789e9d6 Changed to single quoted strings 2004-01-09 14:31:17 +00:00
moodler 12c20fffc6 Fixed a small bug introduced yesterday 2004-01-09 12:57:33 +00:00
moodler 8d3f818bdd Updated with the new location of the Flash script 2004-01-09 08:47:37 +00:00
moodler f75b1ea426 Including the MP3 player source along with it. 2004-01-09 08:46:44 +00:00
moodler 0643b1db7a Old settings weren't being remembered - fixed now. 2004-01-09 07:16:07 +00:00
moodler 1b4ccb8a92 More tweaks when displaying embedded resources 2004-01-09 06:52:54 +00:00
moodler 797e9e30ce Some tidying up of the recent layout 2004-01-09 06:36:43 +00:00
moodler a98d00e2b0 Some cleaning up and native support for streaming MP3! (using Flash) 2004-01-09 03:31:28 +00:00
moodler ca34d03f32 A general-purpose MP3 player in Flash 2004-01-09 03:30:44 +00:00
martignoni 60e1ce7574 Converted to single quote strings 2004-01-08 19:02:40 +00:00
martignoni cd71d7dcb1 Converted to single quoted strings 2004-01-08 15:05:53 +00:00
moodler d1d124cbfb Add fixes from Zig 2004-01-08 13:19:05 +00:00
moodler 82fead1aa7 Bumping the version 2004-01-08 12:37:37 +00:00
moodler ffaaf096a5 Fixed long-standing problem with popup windows.
Now when you go to the using the navbar, they popup and leave
some navigation behind.

Also fixed a recent bug with embedded images
2004-01-08 12:20:11 +00:00
fiedorow c779f92903 Apply addslashes to adminuser data 2004-01-08 11:00:40 +00:00
moodler 14f3260978 Fix for case calling get_courses("all") when there is no user 2004-01-08 04:50:43 +00:00
fiedorow 5c27e7612c Apply addslashes to data 2004-01-08 03:51:08 +00:00
moodler 9aefce20af Add info about addslashes() 2004-01-08 03:10:27 +00:00
moodler 1cfed10bb9 Improved documentation for Quiz filters 2004-01-07 13:41:55 +00:00
stigbjarne e77c81e132 New file 2004-01-07 13:23:01 +00:00
moodler 544fe071bd Fixed header 2004-01-07 13:16:21 +00:00
moodler 93394a9018 Some cleaning up of the edit screen (especially in non-quiz mode) 2004-01-07 13:10:13 +00:00
moodler 20267252a2 Massive fix-up job on Norwegian ... I'm not sure what Stig was thinking
checking in those older files ...
2004-01-07 12:37:05 +00:00
martignoni 80a78b58ba More strings translated 2004-01-07 12:27:08 +00:00
stigbjarne b6da50fd63 New file 2004-01-07 12:18:42 +00:00
andre_bln a63e9ffee4 german language files 05012004 2004-01-07 08:15:56 +00:00
koenr aab97b351c followed change in Englisch version 2004-01-07 08:14:51 +00:00
moodler ca23a9c9dc SOme fixes to use the notify function all the way through 2004-01-07 06:55:35 +00:00
moodler 3e562b88f9 New strings and fixed strings, rewritten by lang.php 2004-01-07 06:54:43 +00:00
moodler 4a4b204a6a Info about commas added 2004-01-07 03:13:16 +00:00
fiedorow 748fd535fe Fixed bug in setting optionalDefaults outside the main loop 2004-01-06 20:25:12 +00:00
koenr e38015fe92 translated by Koen Roggemans 2004-01-06 19:42:43 +00:00
koenr 2abea577b6 filling in missing strings 2004-01-06 19:41:15 +00:00
fiedorow 5059262770 optionalDefaults are now set using settings from Admin account 2004-01-06 19:24:44 +00:00
koenr bf7ccea05d Changing little errors and ugly translations 2004-01-06 18:55:39 +00:00
fiedorow 8714c2cfb5 Restored feedback messages, added multilingual support, added decoding of encoded commas in the data 2004-01-06 17:33:36 +00:00
martignoni fe20dc9679 Some typos corrected 2004-01-06 16:37:53 +00:00
moodler 13f5b23d28 Fixed a bug - thanks Zig! 2004-01-06 14:00:06 +00:00
martignoni 6edf4682e6 'fullnamedisplay' had missing escape chars ('\') before the '$' char (thanks Eloy !) 2004-01-06 10:35:43 +00:00
stigbjarne 481893d070 New file 2004-01-06 10:29:19 +00:00
moodler 860a0cd028 Added a field that was missing 2004-01-06 06:15:56 +00:00
moodler 2e04935a60 Add new help file to index 2004-01-06 03:32:27 +00:00
moodler ca9c070589 Added a course to the example 2004-01-06 03:30:41 +00:00
moodler b06c3ba8cf Help file for user uploads 2004-01-06 03:29:14 +00:00
moodler 0a6150ca2e Some formatting tweaks 2004-01-06 02:48:12 +00:00
moodler f99035c299 Add a link to the upload user script in the admin menus 2004-01-06 02:35:27 +00:00
moodler 84994c886e Some new strings related to user importing 2004-01-06 02:33:28 +00:00
moodler 5de0722025 Cleaned up the script to fit coding guidelines better.
I haven't tested this yet, or touched the main parsing routine
2004-01-06 02:32:43 +00:00
thetrinity 24c70149ad Changed to UNIX file type and removed tabs for documentation. o U 2004-01-06 02:19:11 +00:00
thetrinity d0f86d1654 Brings documentation up to date with rev.1.2 of gift/format.php 2004-01-06 01:49:32 +00:00
stronk7 282ecaf828 Added support to teacherloading, assessmentstodrop and donotuse
fields in workshop module.
2004-01-05 18:21:42 +00:00
andre_bln 7748ddaa14 german language files 29.12.2003 2004-01-05 07:50:15 +00:00
stronk7 568d750b41 Now groupmode and groupmodeforce (course table) are in backup and restore too. 2004-01-05 00:57:23 +00:00
stronk7 148b8edfca Now, when the status is RUNNING, the function checks how much
old is that status in backup_logs table. If there is no activity
in that period, then the script status is unlocked automatically.
This prevents to become RUNNING for ever !!!
2004-01-05 00:27:22 +00:00
stronk7 79619daf93 Added addslashes() to check for existing users, because some characters
can break the query (old users containing ', for example).
2004-01-04 22:58:28 +00:00
stronk7 d8e24b78ea Changed code to use the insert_record() function in
the backup/restore backup_putid() function. To solve
bug 946 (http://moodle.org/bugs/bug.php?op=show&bugid=946).
2004-01-04 12:48:33 +00:00
stronk7 1a0c9eff8e Removed duplicate showreports field in course table!!
That (yy)yanked and (pp)pasted lines!! :-)
Thanks to Juan Pablo, from Bolivia.
2004-01-04 11:51:47 +00:00
moodler 4f3d1a638f Fix appearance of Guest User's name. 2004-01-04 05:04:10 +00:00
moodler f464c2757a New version of the uploaduser script from Zbigniew Fiedorowicz and Steve Zeidner
http://moodle.org/mod/forum/discuss.php?d=2367#19283
2004-01-04 02:07:59 +00:00
koenr f15d37e068 updated some ugly translations 2004-01-03 22:24:10 +00:00
stronk7 e9f3e715dd Add one more eregi_replace, because the 'alnum' allows the
comma char and it can cause some problems in filenames.

Off-topic: This is my 1st commit with my new eMac !! My old iMac screen
died two days ago... :-( but I've recovered everything :-)
2004-01-03 20:53:25 +00:00
moodler deae201fc6 Fixed missing bracket 2004-01-03 15:41:15 +00:00
moodler dfa1fbac6d Better fix 2004-01-03 06:31:23 +00:00
moodler 1cb5bf828b Don't carry description around in USER session variable ... can be big 2004-01-03 06:20:25 +00:00
les_kopari 0253cd4edc Adding remaining schema.xml files, one per table...still more to come.
See execution listing for test results thus far.
2004-01-02 18:12:45 +00:00
les_kopari 5a2f8b8dcd Initial. 2004-01-02 18:08:06 +00:00
les_kopari 7a55fe065d Initial add. 2004-01-02 17:55:09 +00:00
moodler ea229804e1 Added an error message to catch some cases of sessions not working 2004-01-02 14:11:21 +00:00
villate c133989f09 It now uses "backup" for the name of the backup files. 2004-01-02 10:25:16 +00:00
les_kopari 920d44320d Initial add...separate .xml file for each table. 2004-01-01 19:41:48 +00:00
les_kopari 18eaa5d2ca Initial add...just the first two tables, config and course. 2004-01-01 19:38:51 +00:00
koenr 431744ad94 translated by Koen Roggemans 2004-01-01 18:45:40 +00:00
koenr 7808ee76d5 filling in missing strings 2004-01-01 18:44:04 +00:00
kaipe e72a2e6d63 As this page uses the multianswer import format, the require_once statements have been updated to fit the new plug-in paths for the import formats. 2004-01-01 15:12:16 +00:00
kaipe 5276dc4887 Short-answer fixes:
As the wild card feature makes it possible for a response to match more than one answer alternative, I made sure that the alternative with the
highest grade would count.
I also fixed bug #945 for the short answer case.
2004-01-01 15:01:29 +00:00
kaipe 0226a97d31 Fixed bug that could cause duplication of attempt numbers.
This bug came to the surface when the possibility to delete attempts was introduced in report/overview/report.php
2004-01-01 12:47:50 +00:00
moodler 02759cb587 On group images use description in the title ... 2004-01-01 08:36:53 +00:00
moodler 2b9641da2f Strings for new setting 2004-01-01 06:35:42 +00:00
moodler 263a473593 New setting makes it optional to show column of people who didn't answer 2004-01-01 06:35:22 +00:00
moodler 761205376c New strings for forum settings (allow students to view ratings of others) 2004-01-01 04:52:57 +00:00
moodler 3bd98ad4bc New option to allow students to see aggregate ratings on other posts (anonymous) 2004-01-01 04:48:55 +00:00
kaipe e097165541 Fixed a single/double quote issue (again) 2003-12-31 19:22:38 +00:00
moodler 2b4287d5bc Shapes not shape 2003-12-31 15:22:05 +00:00
moodler 75194fffbf Temporary sorting order on group members 2003-12-31 14:16:55 +00:00
moodler 507407a795 Display group icon in forum is a group is defined 2003-12-31 13:40:33 +00:00
moodler a08b9fe9d4 Changes to improve group images 2003-12-31 13:39:59 +00:00
moodler f2c80965f5 Some improvements when displaying PNGs 2003-12-31 13:39:08 +00:00
martignoni 3afbefcc09 Tweeking again (still needs work!) 2003-12-31 09:29:49 +00:00
moodler 07be0ed2b9 Small fixes 2003-12-31 08:07:03 +00:00
moodler 24c32bd668 Some re-wording of English backup strings 2003-12-31 08:05:01 +00:00
moodler 6031fe85d5 Don't try to display forums if there aren't any 2003-12-31 06:44:39 +00:00
martignoni 8fcd25b850 More translation 2003-12-30 21:32:31 +00:00
moodler 3facf28fe1 Fix when storing group memberships in USER session 2003-12-30 19:06:53 +00:00
martignoni 38a8fdd790 Small modifications 2003-12-30 18:57:21 +00:00
moodler 15e06a2444 Fix up group icon display in certain situations 2003-12-30 18:42:58 +00:00
moodler 713740a044 Improvements to timekeeping etc 2003-12-30 18:39:24 +00:00
moodler 27d1407c28 Fixed up references to old tables names 2003-12-30 18:24:17 +00:00
moodler 2d439c9d59 Slight fix for MySQL 4 2003-12-30 18:19:15 +00:00
moodler f74959fbb6 Fix reference to new table name 2003-12-30 18:09:46 +00:00
moodler 0da33e07b9 Need to change table name! It was tougher than I thought to work around
the reserved word "group"
2003-12-30 18:07:09 +00:00
moodler f86eb3ce12 New strings for groups 2003-12-30 17:36:47 +00:00
moodler 3ac035a0db Some help files 2003-12-30 17:35:21 +00:00
moodler f374fb1006 This is the first check-in of support for groups.
It's very early (it doesn't actually do anything yet!) but you can
define groups and get an idea of how the interface is shaping up.
I also wanted to show that I have actually done something on this! :-)

From here my plan is to add group support to the modules, one by one
(forums first), then go back and clean up some of the central interfaces,
graphics etc.

Finally, test, test, test and get 1.2 out well before the end of February.
2003-12-30 17:18:06 +00:00
martignoni ee39bbe0ee Some tweeks again 2003-12-30 16:17:56 +00:00
moodler 89b8d337da Fixed some single/double quote issues 2003-12-30 07:28:43 +00:00
moodler d751243549 Bodgy HTML converted to nice clean XHTML fragments.
Thanks to Jonathan Moore and all his work!
2003-12-30 07:04:04 +00:00
moodler 0d71d164b8 Improved navigation info in header 2003-12-30 06:54:19 +00:00
moodler 82ca81cf69 Big cleanup for logic in handling uploaded files, now shorter and clearer 2003-12-30 06:53:53 +00:00
moodler 4cd327fb26 Change default value for backup_sche_keep to be one day.
(As the path of least impact on server resources)
2003-12-30 03:56:32 +00:00
stronk7 b06021549a A new parameter (backup_sche_keep) is included. Oldest backup files
will be deleted automatically. Try it !!
2003-12-29 20:24:45 +00:00
stronk7 1b7d0ba271 Included some strings about the "Keep Backup Files" option. 2003-12-29 20:22:41 +00:00
stronk7 4f7a557d6d Little change in the form that duplicated course shortnames are handled. This should
help when detecting copies of backup files.
2003-12-29 20:20:03 +00:00
stronk7 1ae0dbd1a7 Changed to use clean_filename() function when calculating
backup file name. Thanks Martin !! :-)
2003-12-29 20:15:56 +00:00
martignoni d99315f8db More translations 2003-12-29 18:28:35 +00:00
gniske 1e669a01ea Adding missing strings
Made som few corrections in existing translation
2003-12-29 16:37:53 +00:00
martignoni 0f776ec0e2 Some more tweeks 2003-12-29 16:28:46 +00:00
martignoni da0cd0fc56 Some tweaks and typos corrected 2003-12-29 11:17:33 +00:00
martignoni 29bf1ebf4d Update to last version, with some modifications 2003-12-29 09:41:13 +00:00
moodler 0ce4aa1a8a Some preliminary code to allow wildcards in short answers.
Based on code sent by Thomas Robb
2003-12-29 09:40:23 +00:00
moodler 3fcc331fee Better info about quizzes 2003-12-29 09:28:14 +00:00
moodler 3334a25495 Edit button on quiz reports 2003-12-29 09:24:16 +00:00
stronk7 b35a612212 Solve more bugs in set_field("backup_courses"... calls. 2003-12-28 11:15:19 +00:00
moodler e1518b0c1c Added two new styles for smallinfo displays on the side 2003-12-28 05:56:34 +00:00
moodler 0036338998 Added new styles for latest news listings smallinfo and smallinfohead 2003-12-28 05:49:16 +00:00
martignoni be8148eabb Translation complete 2003-12-27 22:57:52 +00:00
martignoni 86f4d9359b A little bit more translated 2003-12-27 16:36:46 +00:00
koenr 6087fc2062 filling in missing strings 2003-12-27 13:05:46 +00:00
koenr bdc4deaec1 Adapting translation to users fro Holland 2003-12-27 10:42:29 +00:00
moodler 51b468cdf0 New group icon 2003-12-27 08:33:19 +00:00
moodler e82b841361 Add the site's shortname to the email subject 2003-12-27 04:08:04 +00:00
moodler 8c39e2740f FIxed a small bug when updating the next time 2003-12-27 03:14:32 +00:00
moodler d642f548d2 Added a missing string 2003-12-27 03:13:41 +00:00
martignoni bf9f73f4cb Beginning of translation of folder Workshop 2003-12-26 23:11:59 +00:00
martignoni 36040ae11c Typos corrected 2003-12-26 20:59:26 +00:00
martignoni 381e9bfaef Survey folder translation complete 2003-12-26 20:52:20 +00:00
trobb 2003e4464c Null data caused errors so placed an IF statement around SWITCH
at line 920
2003-12-26 03:50:27 +00:00
les_kopari 08481e544c Inserts for MySQL and PostGRES. 2003-12-24 17:33:05 +00:00
les_kopari 218cb966c5 Initial add. 2003-12-24 17:29:30 +00:00
rkingdon d5ec0e19e6 Fixes to restore. 2003-12-24 14:49:33 +00:00
rkingdon 98591c89d5 Modified help files for late submissions and reduction of the number of
phases.
2003-12-24 14:47:15 +00:00
rkingdon 77c8896b6b New strings for the handling of late submissions. 2003-12-24 14:45:22 +00:00
rkingdon f43c849f7e A new version (2003121000). Fixes to backup/restore. Addition of "late"
work and the reduction of the number of phases to 3 (from 4).
2003-12-24 14:43:24 +00:00
rkingdon 7667ed702c One string for open dialogue list. 2003-12-24 14:38:54 +00:00
rkingdon ae1d214cd5 Bugs fixed in backup and restore. Dialogue now notifies if there are any
open dialogues.
2003-12-24 14:36:18 +00:00
stronk7 b1b589b5cc Now admin/configuration/backup strings are included.
Happy Christmas :-)
2003-12-24 12:11:35 +00:00
stronk7 d13a5d7f0c Now admin/configuration/backup strings are included.
Happy Christmas :-)
2003-12-24 12:03:49 +00:00
martignoni dab3fc5be3 Update to new roadmap 2003-12-24 09:06:34 +00:00
moodler 04304c10bc Updated 2003-12-24 05:52:29 +00:00
martignoni 11126b9cf4 Typo corrected 2003-12-23 22:21:43 +00:00
martignoni cae5f003b7 Typos corrected 2003-12-23 22:19:27 +00:00
martignoni 08ff2b3027 Help folder translation complete 2003-12-23 22:12:52 +00:00
koenr b5ef9489bf modifications by evelien roos 2003-12-23 20:21:29 +00:00
trobb 9fb9dac127 Possible division by 0 fixed with if branch line 132 2003-12-23 13:41:27 +00:00
moodler 24157e96c0 Ask for email address again to help avoid typos 2003-12-23 11:58:41 +00:00
koenr fbf60b0194 necessary for styles 2003-12-23 09:08:18 +00:00
koenr a056982dc6 updated css-file location 2003-12-23 09:07:17 +00:00
koenr 5b597be648 translated by Koen Roggemans 2003-12-23 09:05:45 +00:00
andersbe 453f8ff2a1 All the strings in the php-files and all the help-files are translated as of 2003-12-22
All standard and all development modules are included.
Some php-files required for Moodle 1.2 are also included.

Alla str?ngar i php-filerna och alla hj?lpfiler ?r ?versatta t o m 2003-12-22
Det g?ller alla standard- och utvecklingsmoduler. N?gra programfiler f?r Moodle 1.2 finns ocks? med.
2003-12-22 20:52:40 +00:00
koenr 5bacdab796 translated by Koen Roggemans 2003-12-22 20:11:34 +00:00
koenr 0829018167 initial translation 2003-12-22 19:22:56 +00:00
koenr b3ded3a32a minor changes in translation 2003-12-22 19:16:48 +00:00
koenr 24228ffc24 minor changes in translation 2003-12-22 19:15:07 +00:00
koenr b92e1c36cb translated by Koen Roggemans 2003-12-22 19:03:56 +00:00
koenr 92d7061e22 translated by Koen Roggemans 2003-12-22 15:55:58 +00:00
moodler 0787779dad Latest version from Paul Shew 2003-12-22 15:09:25 +00:00
moodler e3b343e0e3 Some improvements to style_sheet_setup based on this from John Dell
http://moodle.org/mod/forum/discuss.php?d=4171
2003-12-22 02:43:51 +00:00
moodler b4c480c34a SOme formatting fixes using new language editor 2003-12-22 02:11:19 +00:00
andre_bln cb5870c56f German language files 21.12.03 2003-12-21 21:27:22 +00:00
martignoni e1bdace263 Some more files of help folder integrated 2003-12-21 18:03:08 +00:00
martignoni c5899c7b23 Modification: "mise en correspondance" -> "appariement" 2003-12-21 14:23:51 +00:00
martignoni 3f052470ec Some typos corrected 2003-12-21 14:14:00 +00:00
trobb 83d8e36f15 Bug in percentage calculation for on-screen display fixed 2003-12-21 13:56:24 +00:00
moodler 54e7130ed2 When deleting a category, send children courses to live with grandma 2003-12-21 05:10:13 +00:00
moodler 6049fb78f2 Modification of the course format plugin structures so that it
fits in with other plugin formats in Moodle.
2003-12-21 04:52:25 +00:00
moodler 4020587b9a Shorter search box to help smaller screens 2003-12-20 02:47:14 +00:00
martignoni 64569cbb5b Some more help files translated 2003-12-19 15:12:00 +00:00
moodler 945b2b4a6e Remove pgassignment 2003-12-19 07:37:16 +00:00
koenr 46bbd4b651 translated by Koen Roggemans 2003-12-19 07:22:33 +00:00
koenr aff2c394cf typo 2003-12-19 07:21:03 +00:00
koenr 4350adc1fb filling in missing strings 2003-12-18 23:36:16 +00:00
koenr d53c70d47c Translated by Koen Roggemans 2003-12-18 22:52:36 +00:00
martignoni 94c2c3924b Some typos corrected 2003-12-18 22:49:08 +00:00
martignoni 06ab455142 File translation complete 2003-12-18 22:34:38 +00:00
martignoni 873efec0b7 Journal help folder translated 2003-12-18 19:14:37 +00:00
martignoni f1b8867491 Some terms added 2003-12-18 19:03:12 +00:00
martignoni 94791ada75 Small corrections 2003-12-18 17:59:27 +00:00
martignoni a6f989fc61 Some typos corrected 2003-12-18 16:58:16 +00:00
moodler 34edc3ad1b Clean sessioncookie variable 2003-12-18 16:46:34 +00:00
martignoni bd741d50f8 Translation of "connected" and "separate" (thanks to JF Nadeau) 2003-12-18 16:23:36 +00:00
martignoni badec294d3 Choice folder translation complete 2003-12-18 16:07:20 +00:00
martignoni cbf93aff2b Modification of "Fichier" 2003-12-18 15:40:46 +00:00
martignoni e6910f0a75 Small typo corrected 2003-12-18 15:38:47 +00:00
martignoni 86d1f427e5 Re-order alphabetically the different items 2003-12-18 15:35:54 +00:00
martignoni 120bfe673e Typo corrected 2003-12-18 15:32:41 +00:00
martignoni 391fa1bb50 Change name of resources "Page Web" and "Lien vers une page Web" to resp. "Page web (interne)" and "Page web (externe)" 2003-12-18 15:30:01 +00:00
koenr aaa8642d41 Translated by Koen Roggemans 2003-12-17 22:37:05 +00:00
martignoni 48a5356040 Small correction: fils de discussion -> discussion 2003-12-17 22:02:24 +00:00
martignoni 7a2c7ce2eb Chat directory completely translated 2003-12-17 21:58:54 +00:00
martignoni 31f5d4d1fc Folder ressource translation complete 2003-12-17 20:33:54 +00:00
martignoni e0ad04798d Forum folder translation complete 2003-12-17 20:26:11 +00:00
martignoni c610c20d16 Assignment translation complete 2003-12-17 20:21:19 +00:00
martignoni eb4ad7479f More updates of help folder 2003-12-17 20:07:34 +00:00
martignoni b7e82b4904 Update of help files (help directory) 2003-12-17 19:53:59 +00:00
moodler 1a5a3ccf24 Removed old versions of quiz format plugins 2003-12-17 15:32:45 +00:00
moodler 2860b7a5f2 More accurate info on link to reports 2003-12-17 13:49:51 +00:00
moodler 3fb839a1e4 A small fix for showing pictures in randomly-selected questions 2003-12-17 13:35:49 +00:00
moodler a6478fdc0d Improved overview, now allows deleting and shows more info.
Thanks very much for Thomas Robb for submitting the original
modification with the new functionality ... I ended up doing a
lot of cleaning up and reworking of it but it wouldn't have been
done without Thom's work.
2003-12-17 13:04:47 +00:00
trobb 99cb3dc887 Percentages displayed as numbers rather than strings in Excel 2003-12-17 13:02:49 +00:00
moodler 19a95eb03a Some new strings (related to quiz reports) 2003-12-17 12:53:25 +00:00
koenr f68846e3ec misspell corrected 2003-12-17 12:08:34 +00:00
koenr 2a4253ba76 translated by Koen Roggemans 2003-12-17 12:03:58 +00:00
trobb c95d3c0fad *** empty log message *** 2003-12-17 08:57:36 +00:00
moodler adcedde7d9 Strip tags from activity name when moving 2003-12-17 03:36:19 +00:00
moodler f36b1996a2 Strip tags from activity names when moving 2003-12-17 03:32:30 +00:00
moodler c97500720d Emergency fix for this file ... it had lots of bad strings in it 2003-12-17 03:22:59 +00:00
stigbjarne 6a366909c9 New file 2003-12-16 13:53:41 +00:00
stigbjarne cb2a3ab4b7 Improved and extended 2003-12-16 13:52:51 +00:00
paca70 4252895a6b More updates by Joni Rosenberg 2003-12-16 12:01:33 +00:00
bobopinna 49dea6bce9 A revision by Bobo. 2003-12-16 08:54:08 +00:00
moodler 003296c476 Fixed a typo (not using $CFG->admin) 2003-12-16 05:31:52 +00:00
martignoni 098c476559 Updated to last changes (docs folder translation completed) 2003-12-15 12:13:26 +00:00
moodler b1e53f2c2d Bump. It's unbelievable how fast time is going. The last update from
a week ago literally seems like yesterday.
2003-12-15 03:58:39 +00:00
stronk7 9bc586e097 max_execution_time and memory_limit to allow backup of large installations.
(I've executed it with 50 courses)
2003-12-15 00:56:12 +00:00
stronk7 d997d2d44e Now an email is sent to the admin when some course backup is excecuted.
TODO:
   - View logs
   - Language strings
2003-12-15 00:54:16 +00:00
martignoni f273fa076f Translation completed 2003-12-14 19:27:09 +00:00
martignoni ed99b35e06 Translation completed 2003-12-14 16:59:37 +00:00
moodler 60b9a5658f FIxed some faulty form 'target's that weren't using $CFG->framename 2003-12-14 15:03:23 +00:00
martignoni fcdb4a3b15 Translation completed 2003-12-14 15:01:07 +00:00
julmis 4351130450 added wordClean function and new table operations
- column sizes are calculated automatically from
  table width
2003-12-14 14:57:33 +00:00
martignoni eb87881479 First bit of translation 2003-12-14 13:26:45 +00:00
moodler f5aa1c37c9 No functional change, just me being a fussy Moodler 2003-12-14 03:27:49 +00:00
moodler 8c8c9bafa5 Align rows to top 2003-12-14 02:54:10 +00:00
stronk7 7f46857afe Now scheduled backups seem to be fully functional. Please, test it !!
TODO:
   - Insert info about process in backup_log
   - Be able to see that info from admin/backup.php
   - Email to the admin with the execution progress
   - Create all languaje strings
Bye :-)
2003-12-14 00:00:28 +00:00
stronk7 e6d273ebe7 Little change to inform in standard output. 2003-12-13 23:57:16 +00:00
martignoni 943eb7e150 Translation completed 2003-12-13 23:02:34 +00:00
martignoni d47614fad2 First part of translation 2003-12-13 21:40:04 +00:00
martignoni 32ba0b9b79 Translation complete 2003-12-13 20:00:12 +00:00
martignoni 3851ea3fe7 Translation complete 2003-12-13 18:51:47 +00:00
martignoni 5307a1a2bc Translation terminated 2003-12-13 18:10:18 +00:00
moodler 69d51d3a81 Prevent funny-looking text when trying to highlight a null string 2003-12-13 06:27:25 +00:00
moodler 6675f0141d Improved description of interim final grade 2003-12-13 02:30:20 +00:00
moodler 835389b818 Name of final grade column makes more sense now 2003-12-13 02:09:00 +00:00
martignoni 91c66d3af8 Initial bit of translation 2003-12-12 21:52:56 +00:00
martignoni da2ae41d3f Small correction (entities not correctly coded) 2003-12-12 20:29:16 +00:00
martignoni 54901b1c82 Finally terminated! 2003-12-12 20:19:35 +00:00
stronk7 c4b39dd214 Included backup's cron function (not implemented) 2003-12-12 19:36:52 +00:00
stronk7 d3159192e9 Included call to backup's cron function (not implemented). 2003-12-12 19:35:50 +00:00
moodler 11a13a66bc Fixed a buglet when changing pages via menu inside a frameset 2003-12-12 14:54:23 +00:00
martignoni 388a73c52a A bit more again! 2003-12-12 11:41:57 +00:00
moodler f8029045de Don't show replies when re-editing a post. 2003-12-12 08:46:24 +00:00
martignoni 07bc723585 A bit more translation 2003-12-12 08:21:16 +00:00
moodler 2e82fd38c1 This has been annoying me for ages, and the fix is so simple.
When replying to a post that already has replies - the replies
are listed in threaded form.
2003-12-12 08:20:45 +00:00
moodler d39e56ede3 Put docs here temporarily until the format settles down 2003-12-12 07:50:11 +00:00
moodler 43bf9fc2d7 Reworking of the plug-in format for import/export files.
Each format is now in it's own subdirectory, which allows the
format to have as many files as it likes.  The formats are now
detected automatically (no need to edit lib.php anymore) and
the parent class is now in mod/quiz/format.php

Lastly, I added Paul Shew's new GIFT format.
2003-12-12 07:35:55 +00:00
moodler c3b736a119 Name some of the newer formats 2003-12-12 07:22:14 +00:00
paca70 bdc8431a46 Translation from Janne Mikkonen 2003-12-12 05:26:08 +00:00
paca70 402377c375 initial translation and helpfiles for dialogue module.
Thanks to Janne Mikkonen.
2003-12-12 05:24:32 +00:00
trobb 544c4b9aa3 *** empty log message *** 2003-12-11 23:53:46 +00:00
moodler f1de6e874f Added a little option to disable user image upload 2003-12-11 12:59:54 +00:00
moodler 404cfbb836 Cleaned up this form a little to make it more consistent 2003-12-11 07:22:13 +00:00
martignoni e7443ea3ff Update to last mods of 'en' language 2003-12-10 22:03:39 +00:00
martignoni f6fb1034ce Update to the last mods of 'en' language 2003-12-10 21:25:56 +00:00
martignoni b85bf04ba0 Update to the last changes of 'en' language 2003-12-10 21:12:04 +00:00
kaipe 1e085edc43 The Quizzes page is given an "Edit questions" button that links to a possibility to edit questions without opening a quiz. 2003-12-10 20:03:59 +00:00
stronk7 08c80128a9 Start the cron integration task for scheduled backups... 2003-12-10 16:47:02 +00:00
moodler 55030f9a41 A little spacing on the display 2003-12-10 16:36:38 +00:00
moodler a61cf7e35e Hope you don't mind, Will, but I had to do some cleaning up of the comments pages
- comments look more like forums
   - glossary entry is displayed consistently
   - workflow makes more sense to me at least (more like forums)
   - code is shorter   :-)
2003-12-10 16:29:56 +00:00
moodler 79be5e9a41 Simplification of the comments page and more forum-like comments 2003-12-10 16:06:06 +00:00
stigbjarne 22311d81d4 New file 2003-12-10 11:26:11 +00:00
stigbjarne 60c9f51a41 New file 2003-12-10 09:43:30 +00:00
stigbjarne 27a2c7692f Minor changes 2003-12-10 09:37:59 +00:00
moodler e0920b2189 FIxed size of comment icon 2003-12-10 08:47:08 +00:00
moodler df0628e289 Whoops left a typo 2003-12-10 08:44:03 +00:00
moodler 4da57a09bd Changed some font size 2003-12-10 08:43:02 +00:00
moodler 977862af80 FIxed up quotes (double -> single) and some ommissions 2003-12-10 07:49:09 +00:00
moodler 87cfde86ba Fixed some enrol -> enroll 2003-12-10 07:38:57 +00:00
moodler f0abc763a3 Some English fixes 2003-12-10 07:30:27 +00:00
moodler 3d9f49f026 Some cleanups in the English 2003-12-10 07:29:34 +00:00
martignoni ba54365c18 Fixing missing quotes 2003-12-10 07:21:21 +00:00
moodler b1e820edc4 Clean up 2003-12-10 07:17:15 +00:00
martignoni ac80c7a338 Added feminine form e.g. for "Modifier un(e)" 2003-12-10 07:15:11 +00:00
moodler 05c6e5b96b Some cleanup of English version 2003-12-10 07:15:02 +00:00
martignoni d8b7e41c87 Added feminine form for e.g. "ajout? un(e)" 2003-12-10 07:03:12 +00:00
martignoni f0d23c6f33 Change "texte pur" to better "texte" everywhere 2003-12-10 06:58:03 +00:00
giro123 7451d96fc1 *** empty log message *** 2003-12-09 22:56:05 +00:00
stronk7 b95a986819 Included (TODO) a new feature to select manually the desired activities
to backup (an Przemyslaw Stencel idea).
See http://moodle.org/mod/forum/discuss.php?d=3964
2003-12-09 16:16:04 +00:00
andre_bln 3007ff3e80 new version german translation 2003-12-09 16:14:21 +00:00
stigbjarne 3f4b8e4214 New file 2003-12-09 09:07:46 +00:00
moodler c0f2bc8462 Fixed bug 812 about editing text files with backslashes in them. 2003-12-09 08:15:34 +00:00
moodler 0c3ffa2f7a Fixed up some ommissions about database structure 2003-12-09 06:07:12 +00:00
moodler 83891eda00 New defaults for popup window settings, which is window off, but all
sub-settings on.

These default defaults can be defined on the page

  Admin -> Config -> Modules -> Resource -> Settings
2003-12-09 04:00:33 +00:00
moodler 007df43c33 New strings for resource setting screen 2003-12-09 03:55:11 +00:00
moodler 2657d7cb46 Fix to allow quiz import to deal with Macintosh OS files (from Paul Shew) 2003-12-09 02:00:48 +00:00
stronk7 be3737bfc0 Creation of needed DB structures (prefix_backup_courses and
prefix_backup_log) to store info about scheduled backups.

NOTE: PostreSQL and Oracle not tested !!
2003-12-08 22:50:56 +00:00
stronk7 c728ec734e Included the 'firstdayofweek' entry to show week days ordered. 2003-12-08 17:42:45 +00:00
moodler 6942583e02 Larger steps on minutes when printing times - see bug 912 2003-12-08 17:20:31 +00:00
stigbjarne 04fb8cf51b Minor changes 2003-12-08 15:10:59 +00:00
stigbjarne 9ce91ed13e New file 2003-12-08 15:01:52 +00:00
stigbjarne eb375f626f Improved and extended 2003-12-08 14:49:23 +00:00
moodler d4b1ce148f Use filemtime instead of filectime 2003-12-08 13:32:32 +00:00
moodler 4511145165 Use filemtime not filectime 2003-12-08 13:31:14 +00:00
moodler bc56d5415b Bumping it 2003-12-08 13:15:44 +00:00
stigbjarne e6618986ca New file 2003-12-08 13:05:22 +00:00
moodler 26d2f5fb4a Fixing a typo I spotted in the CVS diffs. :-) 2003-12-08 13:03:41 +00:00
stigbjarne 883360834f New file 2003-12-08 11:49:27 +00:00
stigbjarne fe428e6037 New file 2003-12-08 10:41:57 +00:00
rkingdon 5a6d1a79ce Fixed bug #863. 2003-12-08 09:22:03 +00:00
stigbjarne 2931ade5d7 New file 2003-12-08 08:31:27 +00:00
moodler d6c3bebead Converted to new format using 'single quotes' 2003-12-08 06:58:12 +00:00
moodler 74b1ef5af6 Turn off time limits on all upgrades 2003-12-08 06:11:56 +00:00
koenr 4a7fc30090 translated by Koen Roggemans 2003-12-07 22:24:35 +00:00
koenr 08d2504bb3 translated by Koen Roggemans 2003-12-07 17:27:13 +00:00
moodler 2646460c6e Fixed up some examples 2003-12-07 13:49:51 +00:00
koenr 0705343e58 translated by Koen Roggemans 2003-12-07 12:52:55 +00:00
koenr a5abee5817 filling in missing string 2003-12-07 11:55:35 +00:00
koenr 2a19447428 translated by Koen Roggemans 2003-12-07 10:00:45 +00:00
koenr 0c488bf830 filling in missing links 2003-12-07 09:59:49 +00:00
moodler c30c36a352 New, smaller comment icon 2003-12-07 05:57:57 +00:00
koenr dc97859c78 missing closing tag </blockquote> 2003-12-06 13:15:51 +00:00
moodler ee273b61a4 Fix for image display - see Bug 695 Thanks, Gustav 2003-12-06 07:34:55 +00:00
moodler e7b51a9bf0 Add a check for GD library 2003-12-06 06:47:32 +00:00
moodler 6f0c8b88b4 A little script to quickly check compatibility on servers. 2003-12-06 06:43:21 +00:00
rkingdon bfd68abc58 Added the setting of League Table options to the Administration page. 2003-12-05 17:55:54 +00:00
rkingdon 2e54fffcaa Minor change to League table options. 2003-12-05 17:53:23 +00:00
stigbjarne ecdeec8e7b Minor changes 2003-12-05 13:34:24 +00:00
stigbjarne 4d98562c00 Fixed error 2003-12-05 13:33:01 +00:00
stigbjarne 7429c4afc4 New file 2003-12-05 13:17:23 +00:00
moodler 07eb7fa7b8 Fixes for POP3 and TLS (new option) 2003-12-05 03:22:34 +00:00
moodler cf3eb7c310 Slight change to make packaging easier on Debian. :-) 2003-12-05 03:10:45 +00:00
rkingdon 945bb28be7 Minor change to student listing in index.php. 2003-12-04 18:47:48 +00:00
rkingdon dc610c361a Correction to Final Grades. 2003-12-04 18:45:55 +00:00
giro123 66a7ecbe73 *** empty log message *** 2003-12-04 17:12:15 +00:00
stigbjarne 8eb50d764d New file 2003-12-04 09:24:21 +00:00
koenr de7629503a corrected little html-error 2003-12-03 23:54:12 +00:00
koenr 67c8d5cadf translated by koen roggemans 2003-12-03 23:51:41 +00:00
koenr cb6424d6e8 filling in missing links 2003-12-03 23:50:19 +00:00
koenr 7541ceed5e filling in missing strings 2003-12-03 22:56:49 +00:00
willcast c80828fe8f - First step towards Tom Murdock's suggestions on a global search feature (if it is ever implented)...
Added a new funtion: module_search( $course, $searchterms, $extended, $glossary = NULL)

It returns all entries that matches the specified criteria in any glossaries within a given $course. It performs an $extended search if necessary.

It restrict the search to only one $glossary if specified (currently used by the internal search function of the module).
2003-12-03 18:33:16 +00:00
rkingdon d33986dbe6 Tidy up return of grades in exercise_grades routine. 2003-12-03 17:38:49 +00:00
julmis d1e5e6359e Improvement to table editing. If table border is set to zero
you'll still see the dotted border.
2003-12-03 17:34:41 +00:00
moodler 4b45f30023 Latest version from Jean-Fran?ois Nadeau 2003-12-03 15:33:28 +00:00
koenr ba7c34fb18 updating links 2003-12-03 14:22:38 +00:00
koenr 0ad9666ffd translated by Koen Roggemans 2003-12-03 14:19:04 +00:00
koenr cdb4ca838d filling in missing strings 2003-12-03 13:51:40 +00:00
moodler 5a80fd86be FIxed names for names 2003-12-03 07:29:15 +00:00
moodler 74b9476a3a Fixed up names for names 2003-12-03 07:28:46 +00:00
willcast 11797fd804 - Bringing order to chaos (thanks Martin) 2003-12-02 18:53:43 +00:00
paca70 1e57486f11 Initial version for postgresql. 2003-12-02 17:00:39 +00:00
moodler 3f1d9b22ba Undoing that last checkin while I examine the consequences for other
database types
2003-12-02 16:21:28 +00:00
paca70 ce24824eba To fix postgresql 7.4 default values.
Starting with v. 7.4 postgres is returning default-values with datatype in form:
'default value'::data type
This cannot be inserted back to database so DEFAULT keyword must be used.
2003-12-02 15:42:33 +00:00
moodler 9723c2d606 Add credits for Snoopy 2003-12-02 15:24:15 +00:00
willcast 5b4388f305 - Missing a $firstname $lastname... :( Changed to fullname 2003-12-02 14:43:36 +00:00
willcast 072f753331 - Some fixes when deleting entries and glossaries.
- Changing the way the comments are shown
- Saving a couple of lines in the Add Entry screen.
2003-12-02 14:35:39 +00:00
moodler 316ebf78a3 Take post_max_size into account when calculating maximum sizes. 2003-12-02 14:34:24 +00:00
moodler 811a6f64c5 FIxed missing quotes 2003-12-02 03:53:21 +00:00
koenr a0e66115cd filling in missing strings
changed item to invoer
2003-12-01 23:24:38 +00:00
paca70 45a3ca96ae Now backuptables gets created. (Still untested) 2003-12-01 22:58:49 +00:00
koenr 06879cb492 initial translation 2003-12-01 22:57:48 +00:00
paca70 a051e31700 To fix postgres column renaming. 2003-12-01 22:28:36 +00:00
stronk7 1b225eaf65 Wow !!
Now backup of one course is ENTIRELY encapsulated inside backup_scheduled.php.
And a backup of EVERY course can be executed invoking try.php.
Backing up to a custom directory is working too !!
They are preliminary versions, of course, but seem to work fine :-)
Now I'm going to make all the necessay structures to support the cron system
and to be able to inform the admin about every scheduled backup process.
Ciao :-)
2003-12-01 22:00:00 +00:00
stronk7 78d4084cf1 Take out another notice in backup. 2003-12-01 21:39:11 +00:00
stronk7 97a49e63ed Take out one notice... 2003-12-01 20:38:09 +00:00
stronk7 37afa39a5e Added support in copy_zip_to_course_dir() to save course
backup file in a custom directory (via $preferences->backup_destination).
Needed in scheduled backups.
2003-12-01 20:25:50 +00:00
jungwirr 81434da2b3 added missing strings dynsectionshort autoattendshort gradeshort 2003-12-01 20:24:18 +00:00
rkingdon 6a6f95c3cb Fix minor bug in Administration page. 2003-12-01 17:18:08 +00:00
rkingdon f01e4314ed Extra strings for analysis of assessments. 2003-12-01 13:50:53 +00:00
moodler 79edc7f972 Allow A. B. C. in addition to A) B) C) 2003-12-01 12:21:49 +00:00
rkingdon 285b8f7fef New version (2003113000), Analysis of Assessments added. 2003-12-01 12:19:48 +00:00
rkingdon c2d27ab6a6 New Workshop help file for the analysis of assessments. 2003-12-01 12:16:24 +00:00
andre_bln c140dc684f new version german translation *.html-files 2003-12-01 08:15:19 +00:00
moodler 750eeaebd5 If a file called cronextra.php exists in the dataroot then cron will
run that too.  This allows sites to have "special" maintenance.
2003-12-01 08:01:41 +00:00
moodler eb12fd50d2 Fixed missing string adminhelpbackup 2003-12-01 06:47:23 +00:00
moodler 0315927955 New format called "Aiken format" by Thomas Robb (and Art Lader)
to allow import of questions like this:

Every seriously injured person is likely to go into
A) shock.
B) infection.
C) hemorrhage.
D) respiratory pain.
ANSWER: A
2003-12-01 06:37:14 +00:00
mits a8f9baaf4e new translation and polished few. 2003-12-01 02:12:15 +00:00
stronk7 90471d6b0b Going to "Create the script". Bump. 2003-11-30 21:57:43 +00:00
stronk7 2ee3c92e4a Destination folder is included too. 2003-11-30 21:56:21 +00:00
stronk7 129cee29fc Now weekdays, active and execution time are included, too. 2003-11-30 21:37:46 +00:00
stronk7 69c7eba733 Scheduled weekdays are now stored in DB 2003-11-30 18:58:37 +00:00
moodler 87755b16cd Switch firstname with lastname 2003-11-30 14:57:46 +00:00
moodler 43875a1069 Plural "Given name(s)" looks silly in English and isn't needed. Might be
for Spanish or Arabic though.
2003-11-30 14:44:17 +00:00
moodler 6560de825e Display FAMILY names first 2003-11-30 14:40:00 +00:00
moodler 76e70b8732 Display family names FIRST 2003-11-30 14:38:11 +00:00
moodler 50d929736e Reverse the names ... 2003-11-30 14:15:39 +00:00
moodler 4e0eb3d298 Bump 2003-11-30 14:02:14 +00:00
moodler b5cbb64dc5 Final pieces to allow site-wide configuration of name display.
Site variable can override order of "firstname lastname" or it
can leave it up to the language packs.
2003-11-30 14:02:01 +00:00
moodler d344988f0b Tweaks 2003-11-30 08:41:48 +00:00
moodler 270f6cf52c Style fixes 2003-11-30 08:40:03 +00:00
moodler e935da6f31 Added information about databases 2003-11-30 08:31:08 +00:00
giro123 f058099d78 *** empty log message *** 2003-11-30 03:43:08 +00:00
moodler 086f592ebc Bugfix - don't use control keys if alt key is also down (to fix Polish) 2003-11-30 00:35:32 +00:00
moodler b405515797 Fixed typo from last night 2003-11-29 14:26:59 +00:00
moodler db0d033776 Fix navigation buttons for hidden buttons 2003-11-29 02:27:04 +00:00
moodler 74a4505b6e Fixed notefile string 2003-11-29 02:19:34 +00:00
moodler eca1c454d7 Use fullname display for actual name in list 2003-11-28 16:16:59 +00:00
moodler ff0b0de96d Use fullname function for names 2003-11-28 15:47:11 +00:00
moodler 9450cb6561 Use fullname function for displaying names 2003-11-28 15:45:46 +00:00
moodler 6dde8c3d39 Use fullname for displaying names 2003-11-28 15:42:32 +00:00
moodler b3679ca436 Display names using fullname function 2003-11-28 15:41:18 +00:00
moodler 7cc9a05edf Make sure teacher override is there 2003-11-28 15:37:27 +00:00
moodler 8f6ca087e9 DIsplay names using the fullname function 2003-11-28 15:35:41 +00:00
stigbjarne 25d95b9763 New file 2003-11-28 14:01:56 +00:00
stigbjarne c9652d7dbd Minor changes 2003-11-28 13:40:23 +00:00
stigbjarne a39b0a606c Minor changes 2003-11-28 12:56:26 +00:00
stigbjarne 2c3de0f12e Minor changes 2003-11-28 12:49:32 +00:00
stigbjarne 2d7607dc9d Minor changes 2003-11-28 12:48:54 +00:00
moodler 6f2e07e8b9 Use fullname function 2003-11-28 11:06:53 +00:00
moodler 44e5f877b2 Use fullname function for names 2003-11-28 11:02:43 +00:00
moodler 2d71e8ee23 Use fullname function for name in login string 2003-11-28 11:00:46 +00:00
moodler 627407365c Tiny hack for Qmail - I've come across one system which REQUIRED the IsQmail
method of phpmailer to be used.

This is now possible just by specifying "qmail" in the smtphosts field.
2003-11-28 10:57:58 +00:00
moodler 0b4c582298 Some changes to use fullname function for names 2003-11-28 10:53:07 +00:00
moodler 40387b0fc7 Use fullname() function for name 2003-11-28 10:47:39 +00:00
moodler d7e1bae056 Use fullname function to display names 2003-11-28 10:41:06 +00:00
moodler 533b7ea6d9 Use fullname function. Sorting is still wrong though and the selection
mechanism sucks.
2003-11-28 10:40:04 +00:00
moodler 7ec60e4e7e Use fullname() function for names 2003-11-28 10:33:54 +00:00
moodler f5104a2b97 Use fullname for Guest name 2003-11-28 10:32:32 +00:00
moodler 2f15e48cf6 Implemented more fullname() calls 2003-11-28 10:31:06 +00:00
stigbjarne 939f26a96c New file 2003-11-28 10:09:05 +00:00
stigbjarne 8b6b50b008 New file 2003-11-28 09:08:54 +00:00
stigbjarne 4a6b6649b8 Improved and extended 2003-11-28 08:58:21 +00:00
stigbjarne 88cdb566b3 Minor changes 2003-11-28 08:45:03 +00:00
moodler 9aebbc40e3 Fixing a broken line 2003-11-28 04:02:53 +00:00
moodler 264a173f69 Editing as necessary :) Can't have all that HTML formatting in the strings ... 2003-11-28 04:01:02 +00:00
willcast bf46cd2267 - Adding error trapping to the fetching function and giving error messages accordandly.
- Adding Moodle as the web agent!!! :)

PLEASE, edit the new language strings if necessary.
2003-11-28 03:27:24 +00:00
moodler b2b8471e63 Removed some tabs 2003-11-28 02:19:20 +00:00
willcast 0c4a0e80b7 - Fixing bug that was preveting uploaded files to be shown...
Uploaded files parsing is not ready so it's desabled by code...
2003-11-28 02:18:47 +00:00
moodler 3bfe3922c2 A few rearrangments in the new code for filtered external pages 2003-11-28 02:11:02 +00:00
stronk7 d31a78675b Small change to save scheduled days always in
0=Sunday....6=Saturday format, independent from the
visual display of the week. :-)
It uses the "firstdayofweek" string in every languaje pack
(defaults to 0-Sunday)
2003-11-27 23:50:46 +00:00
stronk7 34b1d1a41d Comment some debug. I forgot it, sorry. :-( 2003-11-27 23:42:25 +00:00
stronk7 2a0acc00df Changed empty->isset !! Arghh 2003-11-27 23:38:27 +00:00
stronk7 49b95c3068 Return backup_config records as an object instead of an array. 2003-11-27 23:33:20 +00:00
stronk7 de4746a8a2 Initial release of the configure backup.
It now uses backup_config instead of config.
Not finished !!
2003-11-27 23:28:29 +00:00
stronk7 3968be8fce Solved one small typo with prefix.. :-) 2003-11-27 22:57:18 +00:00
stronk7 fe27d33f4f Included support for new backup_config table.
(postgresql and oracle versions not tested !!)
2003-11-27 22:53:30 +00:00
paca70 8ea237e932 More Finnish translation from Teemu Sumi. 2003-11-27 19:19:11 +00:00
willcast 8367faba8b - External webpage resources now are parsed and automatic links are added to the glossary terms... Only if $CFG->filterexternalpages is enabled. 2003-11-27 19:09:47 +00:00
paca70 b20ad90a53 One small correction. 2003-11-27 19:08:20 +00:00
willcast af65e103df - External webpage resources now are parsed and automatic links are added to the glossary terms... Only if $CFG->filterexternalpages is enabled. 2003-11-27 19:04:36 +00:00
willcast ef5b38b267 - Adding a new class to fetch remote files through PHP. 2003-11-27 19:02:31 +00:00
paca70 276a8df94c Finnish teachers manual. Thanks to Lasse Utti. 2003-11-27 19:01:17 +00:00
moodler ceed288505 Eloy's "war name" :-) 2003-11-27 17:52:57 +00:00
moodler ae67d9cd40 Decode pathinfo in case it has encoded spaces etc in it 2003-11-27 17:23:36 +00:00
moodler e6073312c2 Different format on headers for text downloads to improve performance on
more browsers
2003-11-27 14:52:22 +00:00
willcast 0f23e14e27 - Deleting inconsistent records on glossary_alias due to the last fixed bug. 2003-11-27 13:32:02 +00:00
andre_bln 3823500342 new version completed php-files
CVS ----------------------------------------------------------------------
2003-11-27 08:26:01 +00:00
moodler 1bdcef1051 Worksheet name can't be longer than 31 characters 2003-11-27 07:10:27 +00:00
willcast 5d422d4284 - Fixing bug regarding the aliases (pointed out by Sho Fukamachi also) 2003-11-27 05:25:26 +00:00
trobb e8a5be2853 *** empty log message *** 2003-11-26 22:21:17 +00:00
moodler eb5baa8a7e Peter Taylor got upgraded :-) 2003-11-26 16:07:44 +00:00
willcast c8473c36a4 - Fixing typo (pointed out by Sho Fukamachi) 2003-11-26 14:42:47 +00:00
willcast 65a6c7bb3f - Removing tags from glossary name when exporting the entries. 2003-11-26 14:38:34 +00:00
paca70 3bc5359621 Converting back to iso-8859-1. Sorry for this mess... 2003-11-26 13:10:54 +00:00
moodler 5e91dd3f36 Another setting to allow a default URL in webpage and weblink 2003-11-26 11:47:51 +00:00
stronk7 6e980cfa80 Updated to include scheduled backup status. 2003-11-26 10:54:06 +00:00
andre_bln c4a2d886e0 add new german translation html-files 2003-11-26 09:42:00 +00:00
andre_bln facea1b341 add new german translation html-file 2003-11-26 09:39:51 +00:00
moodler 5b645d97c4 Grade is in the main file already 2003-11-26 01:37:56 +00:00
moodler 706cf31ee1 Use "grade" string from the main language pack 2003-11-26 01:37:20 +00:00
trobb bbc8a2ade5 *** empty log message *** 2003-11-25 23:41:08 +00:00
andre_bln a5d200d862 german translation new html-files 2003-11-25 22:53:42 +00:00
willcast b620a99505 - Fixed two bugs: Teacher's modified or added entries were being set as not approved if the default approval status is off.
- Fixed bug when trying to display entries with ? in the definitions or aliases.
2003-11-25 17:44:51 +00:00
willcast d6bbfb22fa - Student can't edit their own entries solved. 2003-11-25 16:37:59 +00:00
andre_bln 5322277aa6 new version german php-files ( jetzt vollst?ndig ?? 2003-11-25 14:08:59 +00:00
moodler 98516bb40a A little tidy 2003-11-25 13:31:11 +00:00
moodler 50368eea89 New file from Tom Robb 2003-11-25 13:30:13 +00:00
trobb 036162ea9a *** empty log message *** 2003-11-25 12:35:43 +00:00
moodler 32da9038c5 Removed some bogus Control-M's 2003-11-25 12:15:10 +00:00
moodler 66c2503062 Added a new setting called "resource_websearch" ... it is simply a
URL that is offered to users as a place to to find URLs.  By default
it's google.com, but could easily be a local repository of files.
2003-11-25 08:01:52 +00:00
moodler c428e8c4cb Added a new help string 2003-11-25 08:00:33 +00:00
moodler f2d91421fd Added new navmenu function that now prints next/previous buttons - it's
based on code from Gustav Delius.  Thanks, Gustav!
2003-11-25 04:19:58 +00:00
trobb a222541e98 *** empty log message *** 2003-11-25 00:07:38 +00:00
andre_bln 8d5ad76244 add german translation help-files 2003-11-24 15:16:30 +00:00
andre_bln 63128953bd new version german translation 2003-11-24 07:51:59 +00:00
andre_bln 75547242c9 new version german translation *.html-files 2003-11-24 07:46:04 +00:00
andre_bln 38f1133371 new german translation php-files 2003-11-24 07:09:50 +00:00
moodler 0c0128531c No need for HTML editor stuff 2003-11-24 01:48:02 +00:00
moodler 0b5d3ddfb9 Some logic for focussing cursor 2003-11-24 01:23:29 +00:00
moodler 02fa231515 Use the new method for calling html editor 2003-11-24 01:16:25 +00:00
andre_bln 4fcc1c214a add german translation exercise help-files 2003-11-23 22:28:51 +00:00
andre_bln 76d91f8a41 add glossary help-files 2003-11-23 22:27:05 +00:00
andre_bln d60e82a4c3 new version german translation *.html-files 2003-11-23 22:21:22 +00:00
koenr 3ba496f1ff filling in missing strings 2003-11-23 21:40:42 +00:00
andre_bln a0a23e48fe new version german translation *.html- Files 2003-11-23 18:41:18 +00:00
stronk7 5574388a9c Search for any 'view%' string in the module log, instead
of exact matching.
2003-11-23 11:15:37 +00:00
willcast e29ad7ebbe - Properly deleting attached files when a glossary is deleted. 2003-11-23 02:46:29 +00:00
willcast 37d543b545 - Minor fix (locating the send ratings button correctely when the mode is entry.) 2003-11-23 01:01:29 +00:00
willcast a6d0cd987a - Minor change (aliases by Keywords, more intuitive, I think) 2003-11-23 00:31:13 +00:00
giro123 01abc5e6bf Trad. Sergio Alfaro 2003-11-22 22:01:54 +00:00
stronk7 15d6420f3d Bump !!
Some important changes incoming next days !!
2003-11-22 20:21:19 +00:00
stronk7 5e4f44b6ad Now glossary_ratings are in backup/restore too. !!
Solved one errors with glossary_alias.
Updated "graphical structure" of the module.
2003-11-22 20:02:34 +00:00
moodler 4708a37266 Quick script to slam timezones 2003-11-22 09:00:15 +00:00
moodler 7e0830caea Fixed bug 902 when displaying scale grades for offline assignments 2003-11-22 03:14:59 +00:00
moodler 71be7f90ac Converted back to single quotes, and removed "grade", "grades" strings 2003-11-22 02:45:07 +00:00
moodler 06e9893001 Use main translation for grade 2003-11-22 02:43:48 +00:00
moodler c0542d081d Use main translation for "grades" 2003-11-22 02:42:38 +00:00
trobb a234654021 *** empty log message *** 2003-11-21 23:56:34 +00:00
trobb 6f2b3bcdd2 *** empty log message *** 2003-11-21 23:53:24 +00:00
stronk7 a741f7eea8 Some needed scales recoding previous to ratings... :-) 2003-11-21 22:51:56 +00:00
andre_bln c1acb61934 new version help-files in german 2003-11-21 22:24:15 +00:00
trobb 6b36aa9396 *** empty log message *** 2003-11-21 22:22:50 +00:00
trobb c4cfddf4d1 *** empty log message *** 2003-11-21 21:35:45 +00:00
willcast 375c162355 - Minor fix (removing a notice) 2003-11-21 19:04:21 +00:00
willcast 1c1f86b7b1 - Compatibility issue. (Eloy, try this one). 2003-11-21 19:00:09 +00:00
willcast 63dd5fb281 - Grading enabled.... finally. 2003-11-21 18:42:38 +00:00
trobb 21e98e21c9 *** empty log message *** 2003-11-21 14:08:28 +00:00
moodler 2185622e76 Removed unnecessary functions 2003-11-21 14:03:06 +00:00
moodler 33c1770940 Whoops forgot a debugging statement 2003-11-21 12:54:53 +00:00
moodler 0fd7da8138 For recent activity, only parse modules that are enabled 2003-11-21 12:54:09 +00:00
moodler 7bc81aac9b New translation - Galego (Sonia ?lvarez L?pez - sonial@uvigo.es) 2003-11-21 12:30:52 +00:00
moodler b2eda6e0a5 Wrong case for rtl 2003-11-21 09:40:39 +00:00
moodler 440dfec649 Added direction again 2003-11-21 09:39:03 +00:00
moodler 2573aaa996 Latest translation from Dr Ali 2003-11-21 09:37:20 +00:00
moodler 46fd234634 Show current user image on editing page ...
Bit of a hack ... not sure about the location .
2003-11-21 07:06:17 +00:00
moodler cc41c129c8 Remove evil styles ;-) 2003-11-21 05:24:01 +00:00
moodler 08ff4ca6fb Added some missing strings 2003-11-21 05:18:10 +00:00
willcast 505eec9cad - Removing my nice black lines around the tabs.. sniff... sniff
8D
2003-11-21 04:55:32 +00:00
willcast ae07873330 - Removing some Notices.. Thanks to Eloy for leting me know! 2003-11-21 03:33:21 +00:00
willcast 840d3ba8e3 - Found the bug with the Edit Categories button. Fixed. 2003-11-21 03:00:42 +00:00
willcast db87439af3 - Fixing minor bugs... Nothing related with the problems the glossary is presenting right now in moodle.org... :( 2003-11-21 02:50:08 +00:00
willcast 229ed3b57c - Adding slashes to [,] and other characters to allow autolinking. 2003-11-20 23:37:33 +00:00
kaipe 7c9c2a8da6 Made it possble to give negative grades for single multichoice answers in a question with embedded answers, as suggested by Koen Roggemans. The total score of the whole question must still be greater than or equeal to zero. 2003-11-20 19:39:08 +00:00
stronk7 cc652b4d76 This report shows the total number of views for each activity in a course.
It is based in the "Outline User Activity Report". I commit it here, but
you (Martin, of course) decide if you want to link to it from the "logs" page.
2003-11-20 18:45:52 +00:00
kaipe b63519ebda Added simplified aliases for answer types, as proposed by Thomas Robb. It is now possible to use these aliases:
SHORTANSWER = SA = MW ;
NUMERICAL = NM ;
MULTICHOICE = MC
2003-11-20 18:39:25 +00:00
moodler 565e970ee2 New report from Thomas Robb - provides detailed statistics. Needs some work. 2003-11-20 16:02:13 +00:00
moodler 0a8d8da96a Show standard reports first 2003-11-20 16:01:21 +00:00
moodler f6b9326173 Added "Detailed statistics" 2003-11-20 15:51:12 +00:00
moodler 5ee2080112 Escape double quotes too 2003-11-20 11:47:14 +00:00
moodler 513c636d94 Fixed authentication a little 2003-11-20 11:23:45 +00:00
willcast 38f7f44e73 - fixed little bug on url called by the alphabet tab. 2003-11-20 02:26:35 +00:00
rkingdon f52cdc8c43 Bug fixed in assesssubmission code. 2003-11-19 17:54:54 +00:00
willcast b6862360af - Case sensitive search when click on a letter, fixed.
- Adding a display format manager. It controls the behavior of the display format when the user enter the glossary and when an auto-link is shown.
- Adding support to the new fullname function.
2003-11-19 17:47:40 +00:00
willcast 0dafa92b4d - Case sensitive search when click on a letter, fixed.
- Adding a display format manager. It controls the behavior of the display format when the user enter the glossary and when an auto-link is shown.
- Adding support to the new fullname function.
2003-11-19 17:36:00 +00:00
moodler 1b26d5e74e Changes to use the new fullname function 2003-11-19 16:45:20 +00:00
moodler 2ac64806ff Names now use the new fullname function 2003-11-19 16:30:09 +00:00
moodler 5fde0ca615 Use the new fullname function 2003-11-19 16:15:56 +00:00
moodler e2cd50652b This function is just a stub to stand in for a while until I have more
time ... Following this I'll be converting all the other files around
the place to use this function.
2003-11-19 15:59:45 +00:00
moodler a4c3ccc36a Script to look at database performanceusing ADOdb tools 2003-11-19 08:15:23 +00:00
moodler 9c72928dc3 Show enrolled courses on user page to teachers
See http://moodle.org/mod/forum/discuss.php?d=3562
2003-11-19 07:55:00 +00:00
moodler fb88144ba4 Latest tags 2003-11-19 07:34:45 +00:00
moodler 18eebff22d Mention new style 2003-11-19 02:55:37 +00:00
moodler a0456978ef Changed a style -> categoryname --> categorynumber 2003-11-19 02:52:26 +00:00
willcast f287e69c33 - Messing of A and IMG tags because of auto-linking fixed 2003-11-18 14:29:31 +00:00
willcast 4f3e59c3a2 - Improved printer-friendly version
- Cosmetic change in the main view of a glossary.
2003-11-18 13:49:31 +00:00
julmis b694b2bd1f Increase size to popups for translations. So buttons or text
would fit into popups.
2003-11-18 08:01:35 +00:00
moodler 025583cd23 Add a little language-changing menu here to make it easier 2003-11-18 07:41:35 +00:00
moodler 892a80dc63 New, speedier English translation. All files and every line has changed.
This is working OK in my testing, but please contact me immediately
if you find any errors.
2003-11-18 07:28:46 +00:00
moodler 452c1cb363 Language editor now saves strings with 'single quotes' which should
- simplify the files a bit
     - speed up processing at run time
2003-11-18 07:26:40 +00:00
willcast 66d7ae88a1 - Adding View comments link to the new display format 2003-11-18 03:41:09 +00:00
willcast a0d1e2bba7 - Adding View comments link to the new display format 2003-11-18 03:25:28 +00:00
willcast 584dcac979 - Using user-defined functions to display comments properly.
- Adding a default view to auto-linked entries when the new display format is used (temporarly until the display format manager is done)
2003-11-18 02:28:18 +00:00
willcast 9d12152641 - Nice default view to the new format display. 2003-11-18 01:07:21 +00:00
willcast 1f8ab70281 - New display format: Entry list (please, fix the translation if it is wrong). 2003-11-18 00:46:02 +00:00
willcast b191803470 - Now you can override the display format of a glossary (useful to certain display format -asked by Tom Murdock-, automatic linking, etc) 2003-11-18 00:41:35 +00:00
rkingdon f47f90af64 Removal of diagnostic messages in Administration page; correction to
db/mysql.php
2003-11-17 18:51:01 +00:00
giro123 b7926afa48 *** empty log message *** 2003-11-17 18:29:01 +00:00
mits a56d226564 New help files. 2003-11-17 17:05:47 +00:00
mits 04a3c84ac7 translated some. 2003-11-17 16:46:00 +00:00
mits 8861507850 New help files added. 2003-11-17 16:45:17 +00:00
willcast 0756aaecac - Fixed bug regarding default setting' variable names 2003-11-17 12:40:25 +00:00
willcast 5e3d1f59de - Backup/restore of the new field entbypage 2003-11-17 03:08:35 +00:00
willcast dcae5a5804 - Added string used in the browse by author page (forgot to inlude it in the previous checkout) 2003-11-17 02:56:56 +00:00
moodler 0108633793 Updating en_us to match the latest English (should help with speed
and memory usage on US installations)
2003-11-17 02:40:09 +00:00
moodler f8dbffb1c0 Check for string before sorting it 2003-11-17 02:19:13 +00:00
moodler bae53097c9 Removed some old editor stuff causing problems in IE 2003-11-17 01:56:43 +00:00
stronk7 73daab351c When restoring "teacher" forums, if it exists in destinatio course, discussions
are merged mantaining a unique forum (previously, a second "teacher" forum
was created). See bug 880 (http://moodle.org/bugs/bug.php?op=show&bugid=880).
2003-11-16 22:49:11 +00:00
koenr 08ded30845 filling in missing strings... 2003-11-16 20:11:14 +00:00
willcast c4a354196b - Improved browse by author.
- view.php?id=cm&show=[concept | alias ] done.
2003-11-16 17:13:19 +00:00
willcast 2f23555ddd - Todo list. 2003-11-16 02:58:18 +00:00
willcast 5020a17a85 - Fixing a bug: Group breaks even when the only thing that change between an entry and the previous is its case. 2003-11-16 02:53:13 +00:00
giro123 7601c1f082 *** empty log message *** 2003-11-16 01:12:30 +00:00
willcast 1ac87c7397 - Rewrite of the internal API in order to, hopefully, create an easy way to handle the flow of data internally and externally.
- Adding a new frame: Browse by Author
- A new, friendly way to show entries (asked by Martin): view?id=cm&mode=term&hook=[concept | alias ]
- Handling user activies, outline and complete.
- Properly showing new entries in recent activity box.
- Adding a flag to categories to specify if a category should or should not be automatically linked.
- Adding some missing strings and files as well.
- Adding a field to each glossary that specify how many entries by pages it should show.
2003-11-15 15:55:47 +00:00
moodler 45376a51a9 Don't have the Javascript dialog on submitting an attempt if the quiz
doesn't have a grade.
2003-11-15 03:31:37 +00:00
selliott 02f007f45d modified print_recent_instance_activity to fix missing course value
modified get_recent_posts to select course id from forum_discussions table
2003-11-14 19:28:43 +00:00
selliott 6f526f7451 Added some words for course/recent.php 2003-11-14 19:16:23 +00:00
selliott 37e00f7039 Created links for how many days to go back in report. 2003-11-14 19:06:02 +00:00
moodler f7c225fbd4 Check for existence of grades 2003-11-14 18:34:17 +00:00
moodler c0fa5540c3 No need to strip slashes in a filter ... 2003-11-14 17:18:15 +00:00
rkingdon e539802dc5 Indexes added to submissions, assessments and grades tables.
Administration page cleaned up slightly.
2003-11-14 15:38:50 +00:00
moodler ab809cc2c0 To cover the recent security fix. 2003-11-14 15:06:14 +00:00
moodler 6a7585f259 SECURITY FIX: This patch prevents teachers from logging in as admins or
course creators!  I'll make an announcement to registered
               administrators.
2003-11-14 12:48:26 +00:00
martignoni 8fdd4fa419 Just a bit more translated 2003-11-13 20:05:29 +00:00
giro123 b6ebdaffb3 *** empty log message *** 2003-11-13 18:39:33 +00:00
rkingdon 178761415f Change to the handling of Error Banded asessments; Removed percentages
from grades.
2003-11-13 16:25:33 +00:00
rkingdon a50f447b04 Some minor improvements, see Workshop Forum. 2003-11-13 16:22:27 +00:00
rkingdon 8d8deea21a A few more strings. 2003-11-13 16:19:38 +00:00
rkingdon b15aadd7b5 Change to new-style tabs. 2003-11-13 11:57:34 +00:00
rkingdon 939a906ec8 New style Tabs in Management page. 2003-11-13 11:39:09 +00:00
martignoni c311f59944 A little bit more translated 2003-11-12 12:44:15 +00:00
moodler 959e11bf24 Fixed paging bar at the bottom of the page 2003-11-12 07:40:09 +00:00
moodler 1040ea8501 A workaround for a PHP bug with Turkish, and some fixed strings changed from "" to '' 2003-11-12 07:39:10 +00:00
moodler 6ee9d39b49 urlencode the dynalinks so they don't give errors if they have quotes
in them etc
2003-11-12 06:21:15 +00:00
moodler 6abd1eedbf Added label icon to cordoroyblue example 2003-11-12 02:42:26 +00:00
julmis a3ee23b115 Fixing charset setting. 2003-11-11 23:19:39 +00:00
moodler 4340a83ae8 Added some bug-fixing code from Eloy Lafuente that fixes a quiz problem.
What happens is that adding random questions used to set the timestamps
of these questions to the same value.  This is fine in normal operation,
but it stuffs up the backup of that course, overwriting the question.
When the course is restored, the missing questions cause quizzes to
have lots of red notices like "Question not found".

Anyhow, this patch should safely fix older installations that may have
these duplicate questions lying around.

THANKS ELOY!
2003-11-11 16:13:57 +00:00
martignoni ec93fb5015 Corrected version 2003-11-11 12:26:32 +00:00
martignoni 9d4ec48859 Removing bad developer.html 2003-11-11 12:24:55 +00:00
martignoni f6d57b0e6a Initial bit of translation 2003-11-11 12:15:32 +00:00
moodler bb8acf8844 More new files 2003-11-11 09:11:38 +00:00
moodler fdeba4eda2 Latest version of Greek, from geof@01infonet.gr 2003-11-11 09:08:43 +00:00
moodler 003891b463 Undoing my changes to the editing functions, because it removed backward
compatibility with 1.1.1 ... this way it works on both.
2003-11-11 06:27:49 +00:00
mits cc79c31911 translated some. 2003-11-11 02:49:00 +00:00
mits 46fa359f8c New langfile added. 2003-11-11 01:22:47 +00:00
koenr 894d86760b closing tags 2003-11-10 22:39:10 +00:00
julmis 3b26f9fb20 Link correction to smileys 2003-11-10 21:04:12 +00:00
martignoni 794122a7b0 Typos corrected 2003-11-10 20:49:51 +00:00
martignoni c1b2d9f922 Translation terminated! 2003-11-10 20:44:18 +00:00
martignoni e66c8a57f0 A little bit more (again)! 2003-11-10 12:25:46 +00:00
martignoni c56db831c3 Translation almost finished 2003-11-10 07:59:30 +00:00
moodler 26e40578f8 Removed text focus to avoid errors in IE 2003-11-10 01:49:00 +00:00
koenr 1d7abb687c translated by koen roggemans 2003-11-10 00:01:21 +00:00
koenr 11beba1dcb filling in missing strings 2003-11-10 00:00:00 +00:00
koenr 7890cbe40c translated by Koen Roggemans 2003-11-09 22:04:32 +00:00
koenr 91a1cb371b updating... 2003-11-09 22:01:47 +00:00
koenr 06d0d0eb6f filling in missing strings 2003-11-09 22:01:07 +00:00
willcast 1d8cfdce7c - BUg when importing aliases 2003-11-09 12:35:12 +00:00
julmis 835cc2f85e Charset update 2003-11-09 11:30:52 +00:00
moodler f6d5ac7efc Removed focus from header 2003-11-09 03:54:26 +00:00
moodler 34fb06515c if the glossary is at site-level then don't require a login 2003-11-09 03:35:36 +00:00
willcast 4403d2b89c - Setting as optional the course id so, by default, it look for entries in global glossaries (unless a glossary is specify that will search in both). 2003-11-09 03:29:25 +00:00
moodler f26d986a17 Minimal formatting changes to center things 2003-11-09 03:26:33 +00:00
moodler 1c338cdbc8 Some cosmetic changes to the code to use the new html editor functions.
No change in functionality at all.

I was in the area trying to fix a bug on this page that only
shows up in Internet Explorer (something to do with editor)
2003-11-09 03:16:28 +00:00
julmis 3c62da905c Change insertSmile function to use insertHTML or pasteHTML method
since insertimage method is not working so good in gecko based browsers
2003-11-08 14:41:30 +00:00
julmis 8dcd870756 Changes to charset and window return value is now "string". 2003-11-08 14:39:52 +00:00
julmis 88f614bf1c Change charset to dynamic "print_string("thischarset")" 2003-11-08 14:38:39 +00:00
martignoni 19f6a59e86 Just a bit more translated 2003-11-08 11:48:33 +00:00
gniske d272a7ffd3 Adding missing strings
Made som few corrections in existing translation
2003-11-08 11:06:51 +00:00
martignoni 79705cb7e4 Some strings corrected 2003-11-07 21:50:35 +00:00
martignoni 5b1db5f305 Just a bit more translated 2003-11-07 21:48:08 +00:00
martignoni 4a6817fd4a File partially translated 2003-11-07 20:34:29 +00:00
willcast 0075885151 - Missed that one. 2003-11-07 16:04:31 +00:00
willcast 7965be79e3 - Backup/restore and Import/export aliases. 2003-11-07 15:58:29 +00:00
moodler 82196932b0 Forgot to check this in ... has a new function 2003-11-07 15:11:34 +00:00
moodler fbfc267591 New language file called pix.php for defining alt-text of pix files.
Smileys code is changed over to use this, both in replace_smileys
and in editor/popups/dlg_ins_smile.php

Needs testing please!
2003-11-07 14:55:44 +00:00
moodler 6476f5fca6 Modifications from Mark (main author) to be more robust with
certain types of bad HTML code
2003-11-07 11:01:16 +00:00
moodler 4bd91f99b8 Fixes to include ALT tags in smilies - by Janne Mikkonen 2003-11-07 07:59:23 +00:00
moodler 4110d37f45 Added style as a valid tag 2003-11-07 04:53:54 +00:00
jungwirr 129b43ee0e fixed foreach problem on line 125 per request from forums 2003-11-07 04:29:13 +00:00
moodler 428aaa2911 Accidentally deleted a $CFG line 2003-11-07 04:14:38 +00:00
moodler c6927f670c Added html2text function to credits 2003-11-07 03:28:43 +00:00
moodler 6ff45b597e Use the new html2text function for converting html to text.
This function is still being tested - it seems fast enough so far
but I'm checking it in to do some further testing on moodle.org
for a while.
2003-11-07 03:27:21 +00:00
moodler b6c120104f A new function for converting HTML into text form 2003-11-07 03:25:09 +00:00
rkingdon c21c48cbe6 Cosmetic change to Admin page. 2003-11-06 17:47:11 +00:00
rkingdon 955f94887e Minor change to one string. 2003-11-06 17:44:35 +00:00
rkingdon 81d581d04b Extra strings for setting League Table parameters. 2003-11-06 17:41:18 +00:00
giro123 bd17f26b48 *** empty log message *** 2003-11-06 17:25:47 +00:00
willcast 046a797c1a - Allowing to selectively export categories or entries based on current frame and view. 2003-11-06 15:07:34 +00:00
martignoni ab28847cc8 Some corrections for consistency 2003-11-06 13:47:28 +00:00
martignoni 38ef098d11 Replace every occurence of "e-mail" with the better french term "courriel" 2003-11-06 13:25:10 +00:00
willcast 38e7bbab8d - Adding missing files to index.html 2003-11-06 13:12:14 +00:00
martignoni c0495ed519 Coded accented characters with HTML entities codes 2003-11-06 13:12:10 +00:00
martignoni 7c78bf998f Typo corrected for "bar?me" 2003-11-06 13:08:29 +00:00
martignoni 1531ab7421 Incorporation of french-canadian terms 2003-11-06 13:02:44 +00:00
julmis ff7f7b1028 Print character set based on user settings
- print_string("thischarset")
2003-11-06 12:25:32 +00:00
moodler 7fc0f9e5e4 Add fancy help cursors on help icons 2003-11-06 11:47:23 +00:00
moodler 8b68eb7ebc I didn't like it as much as I thought. :-) 2003-11-06 09:11:35 +00:00
moodler 43acb21fff Putting link to course listing on the course front page.
If anyone doesn't like this please say so!!
2003-11-06 09:10:01 +00:00
moodler b5333476db Search link should go to listing (it has a search box anyway) 2003-11-06 09:05:41 +00:00
moodler 98ba1e32cf Latest updates from Dr Ali Abureesh. 2003-11-06 09:00:53 +00:00
martignoni 0e9d1cdb1d Integrating files translated by Jean-Francois Nadeau, with slight adaptations 2003-11-06 06:44:01 +00:00
mits da440af88f Polished some and New translation added. 2003-11-05 18:38:19 +00:00
rkingdon 6e1cedb5e4 Fixed a bug, referenced a non existent help file. 2003-11-05 18:31:11 +00:00
rkingdon df5405996c Fixed a bug with re-submissions. Added options for the League table of submissions (show in phase 4). 2003-11-05 18:02:06 +00:00
martignoni c2229403ae Changed special characters of all HTML files to entity codes 2003-11-05 17:51:33 +00:00
willcast 53bc5a9433 - Removing tinyints from Postgresql's db squema. 2003-11-05 16:41:56 +00:00
martignoni 87ee1f918b Added some strings 2003-11-05 15:37:39 +00:00
willcast c4c2f1886d - Fixed bug (printing-friendly version of an empty glossary) 2003-11-05 15:27:37 +00:00
moodler 2abc70b558 Whoops typo 2003-11-05 13:48:25 +00:00
moodler c7563a9c70 Improved fix to $search variable 2003-11-05 13:47:19 +00:00
moodler cd6f0c1e28 Fixing up some handling when searching for strings with quotes in them 2003-11-05 13:43:31 +00:00
willcast 81bdc9e928 - Aliases are now shown when displaying entries 2003-11-05 12:46:51 +00:00
moodler 2df00c5bad New translation for Swedish by Anders Berggren - complete! 2003-11-05 10:21:34 +00:00
willcast 3c1b31d913 - New icon... :) 2003-11-05 03:30:38 +00:00
willcast 1ba2befbf1 - Adding aliases 2003-11-05 00:06:31 +00:00
willcast de1fe38401 - Adding paging when the number of entries shown is greater than $CFG->glossary_entbypage
- Adding $CFG->glossary_entbypage to config.html
2003-11-04 18:38:22 +00:00
aszora 17200e8f4d Some upgrade to version 1.1, not fully completed yet 2003.11.04. 2003-11-04 17:31:46 +00:00
rkingdon 563f606731 Minor mods to phase 3 display for students.. 2003-11-04 17:19:07 +00:00
rkingdon d69e279438 An extra string for view.php. 2003-11-04 17:14:54 +00:00
moodler de119da9e4 Fixed attachments ...
typo:   type -> enctype   !!
2003-11-04 15:59:42 +00:00
willcast 40b6b8d8b5 Typo 2003-11-04 15:08:00 +00:00
willcast fd9f0ec83a - Solving problems when trying to autolink entries with apostrophes on it
- Idem, when importing entries.
2003-11-04 15:04:35 +00:00
moodler 3bbde52099 Don't focus on the post message (upsets html editor) 2003-11-04 12:42:42 +00:00
moodler c427414996 Glossary now gets the alphabet string from moodle.php instead of glossary.php 2003-11-04 12:36:55 +00:00
moodler ba33f1dd2f Moved string 'alphabet' from glossary.php to moodle.php for various languages
Also changed the separator from | to ,
2003-11-04 12:35:17 +00:00
moodler a328425d17 New feature based on code from Gustav Delius
-> A-Z subsets on the participant list.

http://moodle.org/mod/forum/discuss.php?d=3162

I also made a new datalib function called count_course_students()
2003-11-04 12:09:52 +00:00
moodler 5c2766327f Bump it up 2003-11-04 06:21:36 +00:00
willcast 748b1932aa - Basic export/import functionality.. Does not export nor import the attached files. 2003-11-04 03:54:01 +00:00
moodler 2b23eea312 Removed header redirect for cases where output already occurred
(thougn it shouldn't happen)
2003-11-04 03:35:05 +00:00
gniske 1dc78ff52a Adding missing strings
Made som few corrections in existing translation
2003-11-03 23:59:59 +00:00
julmis 61d5f1854d Hide cut, copy and paste buttons from gecko browsers 2003-11-03 23:53:49 +00:00
julmis 9466f50707 Style improvements to popups 2003-11-03 23:01:13 +00:00
julmis 99a5970cb1 style improvments to popups 2003-11-03 22:59:06 +00:00
koenr fbaf0edb03 translated by koen roggemans 2003-11-03 21:51:13 +00:00
koenr 8c527924a0 filling in missing strings 2003-11-03 21:50:14 +00:00
rkingdon 3d24fbafb5 Minor fix in assessments.php. Revisions to backup and restore to always include teacher's submissions. 2003-11-03 18:45:05 +00:00
bobopinna c66dcab21f Minor Fixing in password change 2003-11-03 17:18:04 +00:00
moodler 40bed9e13d Use new editor stuff 2003-11-03 16:58:45 +00:00
moodler 4b00b4b34a Update to use new editor stuff 2003-11-03 16:49:37 +00:00
moodler 126f0da58d Just moodling ... tidied up the horrible interface a little 2003-11-03 16:27:46 +00:00
moodler 1e8ac0541b No need for useneweditor anymore 2003-11-03 16:13:59 +00:00
moodler 6a1e688f83 Some fixes for using the new editor 2003-11-03 16:12:59 +00:00
moodler 06a179a75c Removing reference 2003-11-03 16:06:13 +00:00
moodler 983962a590 Stopgap measure 2003-11-03 15:21:25 +00:00
moodler 47037513fe Goodbye Richtext editor!
This does not affect any of the existing modules - I've kept some
stub functions to retain backward compatibility.
2003-11-03 15:17:21 +00:00
moodler 8c8e74ae10 SERIAL8 -> SERIAL 2003-11-03 13:21:00 +00:00
moodler 315915628d Keep guests out of chat 2003-11-03 10:22:24 +00:00
moodler 14b6fcdb5f The font style menu is now translatable (Heading, etc) 2003-11-03 05:30:32 +00:00
moodler 1e16942739 Show version number to aid in debugging 2003-11-03 03:22:52 +00:00
moodler 8a55c98423 More redirect tweaks 2003-11-03 03:13:14 +00:00
moodler 091333e091 Removed a blank line 2003-11-03 03:00:45 +00:00
moodler fb7a194e6b Removed blank lines at the end (!) 2003-11-03 02:59:09 +00:00
willcast ea14e78373 - Cosmetic changes... Changing the Add Entry button for a new tab
- Creating two new tabs for the future export/import features.
- Improving a little the Printer-Friendly version (now it shows what you were watching in the previous frame)
2003-11-03 02:26:44 +00:00
kaipe fe98ea90f9 The new quizfile.php makes it possible to view associated file material on quizes, such as images, even for questions belonging to a category on a different course. lib.php is updated accordingly... 2003-11-02 21:36:25 +00:00
aszora ecb1b5ec7c *** empty log message *** 2003-11-02 20:42:17 +00:00
aszora 7523f8a84f *** empty log message *** 2003-11-02 19:27:18 +00:00
aszora 26f80c924e *** empty log message *** 2003-11-02 17:55:04 +00:00
moodler c4df6e1799 Don't even show submitted dates on offline assignments 2003-11-02 15:11:53 +00:00
martignoni 6aa0291420 Update to current work 2003-11-02 12:40:32 +00:00
moodler d0e15bf61f Some cleanups 2003-11-02 07:19:07 +00:00
moodler d8e6933f72 Explicitly setting mimetype and other things to
- hopefully fix Norton problems
  - hopefully improve caching
2003-11-02 07:01:48 +00:00
moodler 6226d47d4e Removed a blank line 2003-11-02 03:13:12 +00:00
willcast ab653b5517 - Typo 2003-11-02 02:40:00 +00:00
willcast f6149b0910 - Applying proper coding conventions to the default settings' variables 2003-11-02 02:37:44 +00:00
willcast cb2f5705ec - The admin can define default values for glossary and entries' settings via the admin modules interface. 2003-11-02 01:48:44 +00:00
willcast 4f4ca7b5e1 - Printer-friendly version of the glossary
- First step in the export/import feature (export is done)
- Minor changes here and there
2003-11-01 20:27:21 +00:00
martignoni ec48239def Typos corrected 2003-11-01 19:38:14 +00:00
martignoni 4c0fd2d731 New translated file 2003-11-01 19:34:16 +00:00
rkingdon c50365cd38 Fix to the Complete isting. Upload now checks the submission for spurious re-submission caused by using the Back button. User and Teacher deletions of submissions are now logged. Redirect delay when marking submissions shortened to one second. 2003-11-01 17:25:13 +00:00
rkingdon 56dc5ba143 Extra string for Complete listing. 2003-11-01 17:19:00 +00:00
willcast 996f4afc1f - Missing help files. 2003-11-01 15:55:49 +00:00
martignoni 34f875d829 New translated file 2003-11-01 15:35:14 +00:00
martignoni a0c66c2450 Changed everywhere "en chapitres" to "th?matique" for the topics format. 2003-11-01 12:11:42 +00:00
martignoni ecb865400f File translation completed 2003-11-01 11:56:51 +00:00
martignoni 60896c7667 Added to french docs folder 2003-11-01 09:36:49 +00:00
moodler ff01945522 Fixed Mozilla redirection-after-htmlediting bug using Javascript! 2003-11-01 06:59:31 +00:00
julmis 55d035b098 Minor change for iframe width 2003-10-31 21:58:24 +00:00
kaipe 004c02e05c An improvement asked for by koen roggemans:
Especially for multianswer questions it is often desirable to have the grade of the question in a quiz larger than the earlier maximum of 10 points.
The new function quiz_gradesmenu_options($defaultgrade) makes quiz question list grade selector drop-down have the maximum grade option set to the highest value between 10 and the defaultgrade of the question.
2003-10-31 21:27:43 +00:00
willcast 49210b9085 - Important update: I did not delete categories nor comments once a glossary has been deleted. Fixed now. 2003-10-31 15:26:28 +00:00
stronk7 40c9e047e0 Another small typo, == instead of =. :-D 2003-10-31 14:24:44 +00:00
stronk7 8c844d2d40 Small typo preventing users to be sorted. :-) 2003-10-31 14:22:37 +00:00
willcast 5eaa2d3468 Bug fixed:
- Updating a Default Approval Status from NO to YES in a glossary, now approve automatically all entries waiting for approval.
2003-10-31 13:40:34 +00:00
martignoni f303b365be Updates for EasyPHP 1.7 2003-10-31 12:29:29 +00:00
martignoni 17ffa1ed24 new string for choosing a file 2003-10-31 12:18:36 +00:00
martignoni 925711c0b3 New strings added 2003-10-31 12:13:42 +00:00
martignoni 4e0f8146ba No due date string 2003-10-31 12:05:26 +00:00
martignoni a3480d4377 Change Richtext editor to HTML editor 2003-10-31 11:51:45 +00:00
moodler 0604ce1a32 Added missing link 2003-10-31 09:52:44 +00:00
koenr e49106faac filling in missing strings 2003-10-31 09:50:52 +00:00
koenr 9bbbc6700e filling in missing entry 2003-10-31 09:47:55 +00:00
koenr 7a896ffbc6 Translated by Koen Roggemans 2003-10-31 09:47:22 +00:00
koenr ac234da04d filling in missing strings... 2003-10-31 09:18:03 +00:00
stronk7 961d2828e8 globalglossary is included now in backup/restore. :-) 2003-10-31 08:47:03 +00:00
moodler e764aa71ef Add navmenu to header of forum search pages 2003-10-31 08:31:39 +00:00
moodler 5d6c043a39 Using Location header is not subject to the meta-refresh bug in Mozilla 2003-10-31 08:13:44 +00:00
moodler 497588fe37 No longer need parent link in the footer 2003-10-31 06:57:25 +00:00
moodler 8f85017285 Show activity button for students on their profile page 2003-10-31 06:50:19 +00:00
moodler 85a6e76c51 Tidy up 2003-10-31 06:45:38 +00:00
moodler 01f7344a40 Some updates to the text 2003-10-31 06:06:30 +00:00
moodler 3f125001bc New feature: Allow students to see their own activity reports.
This is a course setting.  By default it is off.  When on, there
is a new link in the course admin menu for students, and they can
browse the same report that teachers see.

The report icon is temporary.
2003-10-31 05:57:30 +00:00
moodler d94ee341e5 Undoing Greg's UNION hack ... it was causing problems on Mysql 3 2003-10-31 03:25:37 +00:00
martignoni dffc499b47 Systematic HTML encoding of entities in all files 2003-10-30 22:04:50 +00:00
rkingdon 8090ace7a2 Teacher assessment table string added. 2003-10-30 17:47:26 +00:00
rkingdon 0d1bd24dad Index.php now ignores grading grades; Teacher Assessment Table added to Administration. 2003-10-30 17:45:47 +00:00
moodler 73d0da8084 New database GIF by Eloy! 2003-10-30 14:25:23 +00:00
moodler 65f19876d8 Removed the offensive "and" 2003-10-30 03:44:49 +00:00
willcast 0de786f7da - Global glossaries now available. All current rules apply to its entries. 2003-10-29 23:33:54 +00:00
koenr 68e16a6f47 translated by Koen Roggemans 2003-10-29 19:45:31 +00:00
moodler b3f247e4d1 Rearranged toolbar a bit - put insert stuff together and toggles at end 2003-10-29 16:42:10 +00:00
moodler bfdc52bd32 Missing a semicolon! LOL 2003-10-29 16:28:41 +00:00
moodler 0a8ba9dd7d Sorted the strings, minor fixes 2003-10-29 12:48:17 +00:00
koenr e97a364475 transforming to HTML editor 2003-10-29 12:29:14 +00:00
koenr 7ee3031e69 filling in missing string 2003-10-29 12:28:41 +00:00
moodler 7f0c3a44e4 Oops, typo 2003-10-29 09:16:12 +00:00
moodler 7e224207d0 Fixed bug when moving discussions with attachments 2003-10-29 09:12:23 +00:00
carlesbellver 4ea47efb05 *** empty log message *** 2003-10-29 09:07:49 +00:00
moodler 088e092db8 More language fixes, mostly using print_string instead of get_string 2003-10-29 08:21:52 +00:00
moodler d4a6788523 More editor translations I forgot to alter 2003-10-29 08:13:03 +00:00
moodler 4c46c425db Changes to integrate the new HTML editor into Moodle in an optional way
until it's stable enough to replace Richtext

To enable the new editor, add this line into config.php:

  $CFG->useneweditor = true;
2003-10-29 08:06:11 +00:00
moodler a800c94891 HTMLArea 3.0, slightly edited by Janne Mikkonen. Alpha version. 2003-10-29 07:51:46 +00:00
moodler ba1ce4c0eb new style forumheaderlist (instead of re-using forumpost as before) 2003-10-29 06:24:49 +00:00
martignoni fc881d4afc Initial bit of translation 2003-10-28 21:55:25 +00:00
stronk7 edfc003cd0 Small typo !! :-) 2003-10-28 18:27:22 +00:00
willcast 1d9ddaaf2e - New encapsulated functions in order to make easier to create new display formats
- Fixed problem when showing 'ALL' in alphabet frame
- Disabled unnecessary fields when selecting DO NOT AUTOMATICALY LINK THIS ENTRY in the adde entry screen
2003-10-28 16:10:36 +00:00
martignoni a49f407cc6 File translation terminated 2003-10-28 15:52:48 +00:00
moodler 9788367bb9 Sometimes you really want to know if they are a teacher 2003-10-28 14:44:39 +00:00
moodler 57ef348040 If debugging is on, then make SMTP print debugging info 2003-10-28 14:35:00 +00:00
moodler c260b07707 Make sure resources are put through format_text so that they can be
processed properly (eg autolinking)
2003-10-28 14:01:15 +00:00
moodler cb4f77069d Use unique stamps when creating multiple questions ... 2003-10-28 09:50:23 +00:00
moodler 97ac9019a9 Print "never" on profile page if the user has never logged in 2003-10-28 04:09:03 +00:00
stronk7 8094a84cad Take out some debug info. Forgot it in previous commit. 2003-10-27 17:31:57 +00:00
stronk7 91c59b920c Bump. timeaccess (students and teachers) working. 2003-10-27 17:26:08 +00:00
stronk7 dabf73b44a timeaccess (students and teachers) included in backup/restore. :-) 2003-10-27 17:23:43 +00:00
moodler 0f4ae874d9 A little typo hiding the continuous format 2003-10-27 14:25:08 +00:00
moodler f1603208db The last access date is now that of the course. 2003-10-27 14:15:05 +00:00
moodler 937ae59c8e Get longtimenosee students according to their course access (not site access) 2003-10-27 14:01:29 +00:00
moodler 29b25b0498 Much better updating of access times to make the accurate straight away 2003-10-27 13:38:08 +00:00
koenr d88d693a57 Minor changes 2003-10-27 13:22:10 +00:00
moodler 4d744a220a Added a new column to user_students and user_teachers called "timeaccess"
for recording the last access to the COURSE.

This is updated at the same time as add_to_log and is now used instead
of user->lastaccess when course user listings are required.

This means course listings now show what you expect and open up the way
for a "current users" listing and instant messaging etc ...
2003-10-27 12:38:00 +00:00
koenr ecd25101f5 Translated by Koen Roggemans 2003-10-27 09:41:31 +00:00
moodler 6951a89497 Thomas Robb suggested a movehere image instead of the string. I made an image
and I agree it looks/works a lot better.
2003-10-27 08:31:28 +00:00
mits 2f4424c352 Translated few. 2003-10-27 08:23:09 +00:00
moodler 1c49bffc3c Slight alteration to search option, since not all glossary types
are "definitions" ... using "full text" is more generic
2003-10-27 06:25:56 +00:00
koenr 44d7cbb3b3 filling in missing strings 2003-10-26 23:43:26 +00:00
koenr 6415638ded translated by Koen Roggemans 2003-10-26 23:21:37 +00:00
moodler a52ec9020a Trivial changes that were hanging around 2003-10-26 16:12:03 +00:00
moodler d2e3fa130b No due date string 2003-10-26 16:10:27 +00:00
moodler 953c64fe93 Trying to avoid database clashes 2003-10-26 16:08:31 +00:00
moodler cf2db3ab76 Fixed colours again 2003-10-26 16:07:02 +00:00
moodler 94e935e7d1 In the index, show how many entries there are in each glossary 2003-10-26 08:14:54 +00:00
moodler 00af6d7e91 Use format_text for consistency 2003-10-26 08:06:16 +00:00
moodler 93de2fbcb6 Updates to ADOdb 4.0.1 - some bug fixes 2003-10-25 05:59:58 +00:00
moodler 9652408974 Now uses choose_from_menu() for the format display, and the items
are now sorted.

The other items could be easily done with choose_from_menu() too  ;-)
2003-10-25 02:53:02 +00:00
moodler 7829b7d98b Fixed background colours in quix editing page body-> cellcontent2 2003-10-25 02:38:47 +00:00
giro123 8cae411fa1 *** empty log message *** 2003-10-25 01:38:59 +00:00
moodler 2eea2ccedc Remove quotes from title - these can cause the stylesheet to not load
properly on Internet Explorer.
2003-10-24 06:27:15 +00:00
moodler 55dd77620e Updates from Kristian Nielsen 2003-10-24 03:12:02 +00:00
koenr a92e598d2f adding link 2003-10-23 21:49:00 +00:00
koenr 60150ae1be translated by Koen Roggemans 2003-10-23 21:37:41 +00:00
koenr ffac5de76e translated by Koen Roggemans 2003-10-23 20:20:57 +00:00
rkingdon ce7c86e689 New icon from Eloy Lafuente. 2003-10-23 17:39:49 +00:00
rkingdon 523f5da5ed Extra sting for Administration page. 2003-10-23 17:31:39 +00:00
moodler 16a1917250 Fix bug in NUMERICAL questions where feedback was only shown if the
question was correct
2003-10-23 15:40:17 +00:00
martignoni a3498659ed Translation is now half-way! 2003-10-23 14:54:46 +00:00
moodler a8edccefc9 Updates for EasyPHP 1.7 2003-10-23 03:49:11 +00:00
gregb_cc dcfa857df2 This is a massive speed increase in journal_get_users_done.
The fix requires UNION support in the database.  I've added a simple little
test to see if UNION queries work.

This change very much needs to be tested out by someone using MySQL 3.  If
it tests out there successfully, the supports_union code should be moved out
of this file and into datalib.  Ideally, someone will extend that test and
creatle get_records_union_sql, a function that would split up UNION queries
for databases that don't support them and do an array_merge (and proper
sorting, which is missing from my fix) on the result sets.
2003-10-22 20:06:44 +00:00
stronk7 665ec9436d Added glossary icon to cordoroyblue theme 2003-10-22 16:27:12 +00:00
stronk7 8a59942e4c Take out one notice when the only activity was
create a module and delete it. Strange but possible. :-)
2003-10-22 16:19:21 +00:00
moodler d89a514226 Bump 2003-10-22 14:26:24 +00:00
moodler e2d94a5f26 I revised some of the Glossary texts in English. 2003-10-22 13:59:46 +00:00
moodler 8dddba42ce Modularised some of the processing for "extra" information such as
information for popup windows on resources and labels
2003-10-22 13:14:56 +00:00
martignoni 62e0fb7989 Initial bit of translation 2003-10-22 11:37:22 +00:00
moodler 06e3c5c030 Upgraded to AdoDB 4.00 ... starting to think seriously about the
data dictionary conversion ...
2003-10-22 08:52:42 +00:00
moodler 1789e61668 Fixed some missing styles 2003-10-22 07:54:37 +00:00
moodler 978165545e Some missing styles 2003-10-22 07:51:40 +00:00
moodler 9d212d8602 FIxed some missing styles and colours 2003-10-22 07:48:23 +00:00
moodler b67117d848 Some missing colours 2003-10-22 07:47:18 +00:00
moodler f91847d0c3 New styles 2003-10-22 07:45:47 +00:00
willcast c197e6070b - Added a new frame: Browse by date.
- Removing unnecesary double quotes (not all of them yet)
2003-10-22 04:15:08 +00:00
willcast 841d317f4a - Sorting entries by the length of the concept so large concepts could be linked first if they exist in the text to parse (avoiding that smaller concepts "gain control" over the larges one).
- Setting hard=coded default settings to glossary (will be replaced soon by global default settings)
2003-10-21 20:45:53 +00:00
willcast 290891415d - Preventing guest for posting comments on entries 2003-10-21 18:32:36 +00:00
willcast 20853eabc7 - Fixed bug the dealing with concepts that contains slashes 2003-10-21 16:30:12 +00:00
willcast 4d4c38f3fe - Fixed some bugs detected with Jeff's glossary (mostly with dynalink link feature) 2003-10-21 13:27:48 +00:00
stronk7 e0234384f4 Small typo :-) 2003-10-21 09:49:55 +00:00
moodler 5bc6e68fbe Put rounded corners on category box too 2003-10-21 06:55:02 +00:00
moodler 5f546a46f0 Slightly nicer code when redirecting 2003-10-21 06:42:10 +00:00
moodler 1b6a4b1db2 Some cleanups for some of the HTML, including addition of new styles 2003-10-21 06:40:39 +00:00
moodler dfe052fcfd Some additions to standard styles 2003-10-21 06:39:05 +00:00
willcast 7b892c8787 - Backup/Restore of the new field 2003-10-21 05:19:43 +00:00
willcast 8f7bd776a9 - New entries for the new feature 2003-10-21 04:56:05 +00:00
willcast c76e673ab5 - Cleaning a lot of code in edit.php and view.php
- Removing more notices when debug is ON
- Added a new feature: Now the entries have a default approval status... Not approved entries are shown on a teachers-only frame from which they can be approved or not prior to be visible by everyone.
2003-10-21 04:55:22 +00:00
moodler 016f1bebbf Removed unnecessary code (maxlogs) 2003-10-21 03:58:08 +00:00
moodler d6f73f538f Put the help inside a box, in case the background is dark 2003-10-21 02:30:42 +00:00
moodler 7f98994816 Don't display search buttons if all the courses are being displayed anyway 2003-10-21 02:25:22 +00:00
rkingdon af58d5f7b5 New function dialogue_count_all_needing_replies_self($user) added to lib.php. 2003-10-20 19:09:31 +00:00
willcast 677038ee7d - Removing notices when debug is on
- Deleting entries with attachments now delete the attachments properly
2003-10-20 16:42:49 +00:00
stronk7 54849831c2 Bump :-) 2003-10-19 23:04:19 +00:00
stronk7 d1014ff79f Now, glossary_comments are in restore too !! :-) 2003-10-19 22:24:25 +00:00
stronk7 e425fb1621 Splited one function into two :-) 2003-10-19 22:00:41 +00:00
stronk7 710c3be112 Now glossary_comments are in backup.
Solved one issue when exporting categories.
2003-10-19 21:38:47 +00:00
willcast 48972ecf12 - Backing up new fields...
- No restoring yet... :(
2003-10-19 18:04:34 +00:00
rkingdon f257277e11 Fixed bug in exercise_grades function. Fixed bug in viewing of students assessments by teachers. 2003-10-19 16:40:07 +00:00
willcast ba38613904 - Adding webquest.php to the lang directory.. It's annoying that the system can't find the file and mess all the screen when editing is on.
Just have the name of the module anyway.
2003-10-19 16:03:24 +00:00
willcast 2a0a6f17fb - Fixed bug related to comments when doing a backup... 2003-10-19 15:49:48 +00:00
moodler 8321a04ed9 new string for choosing a file 2003-10-19 15:18:19 +00:00
moodler 199d242993 I finally added a proper course files browser to replace the menu. 2003-10-19 15:02:41 +00:00
moodler 0abc815473 Allow uploaded files to be declared in popup windows too. 2003-10-19 14:21:54 +00:00
koenr 7480ff5f28 filling in missing strings... 2003-10-19 09:17:47 +00:00
koenr c35d77229d translated by Koen Roggemans 2003-10-19 09:17:02 +00:00
moodler ab16b4ffd5 Some small style changes for tabs 2003-10-19 05:24:33 +00:00
moodler 5e70f06961 Removed one hard-coded "admin" 2003-10-19 05:19:14 +00:00
moodler e8ff59d6cb More styles -- missed the target last time! 2003-10-19 05:07:29 +00:00
moodler e94c179a04 Added styles to tabs 2003-10-19 05:02:45 +00:00
willcast 4257e7f69e - A couple of icons that I forgot to include 2003-10-19 03:48:21 +00:00
giro123 7df67a0dbe *** empty log message *** 2003-10-19 03:41:26 +00:00
willcast 767a31c3bc - Adding two more display formats: Continuous and FAQ
- Fixed bug 818: Adding a new view: Sorted (by creation date or by last modified.
2003-10-19 03:40:36 +00:00
moodler 7069af60aa FIxed styles 2003-10-19 03:28:53 +00:00
moodler f33db1ce37 Use CFG->admin 2003-10-19 02:40:03 +00:00
willcast 3dfa6ce23a - Fixed another bug when showing "dynaentries" (it does not take in count the case sensitive setting) 2003-10-18 20:37:40 +00:00
willcast cca6f7f1bb - Fixed bug when showing "dynaentries" (it showed all concepts no matter the course nor its dynasetting) 2003-10-18 20:23:29 +00:00
willcast 2ee6608ae4 - Fixed bug when showing "dynaentries" (it showed all concepts no matter the course nor its dynasetting) 2003-10-18 20:21:04 +00:00
martignoni a4c1b131c4 New translated file 2003-10-18 19:22:49 +00:00
martignoni 61706b0caf Translation terminated! 2003-10-18 18:14:55 +00:00
willcast d88824c4be - Housekeeping... :( 2003-10-18 13:48:24 +00:00
willcast ad2c7282e9 - Housekeeping... :) 2003-10-18 13:43:36 +00:00
willcast 891ae55ee4 - Fixed a problem when showing the icons in entries with inline images.
- Fixed a bug when deleting entries without attachments.
2003-10-18 13:33:46 +00:00
mits 9c379682aa New help translation. 2003-10-18 12:17:55 +00:00
willcast c7b811b14c - "striping_tags" inthe title 2003-10-18 12:14:46 +00:00
moodler 2d7efab286 Nicer styles in Mozilla 2003-10-18 11:44:52 +00:00
moodler fa3d376d5f Nicer styles on Mozilla 2003-10-18 11:44:22 +00:00
mits 86b68a821c New help translation. 2003-10-18 10:22:13 +00:00
martignoni 938c2c35b2 More translation (almost finished) 2003-10-18 10:20:57 +00:00
mits 5b61f5c8a0 New translation and polish some. 2003-10-18 09:52:25 +00:00
mits 9f4f8828b1 New help translation 2003-10-18 08:48:53 +00:00
willcast f4a809db92 - Two little mods in the category linking issue:
The concepts could be in more than one glossary so...
    I put it inside the "if concept is category" conditional... I little more efficient.
2003-10-17 15:35:18 +00:00
moodler dc04ce9547 Fixed category linking. :-) 2003-10-17 15:30:18 +00:00
martignoni 855eef5d27 Initial bit of translation 2003-10-17 15:08:31 +00:00
martignoni b5aabd4f5f Initial bit of translation 2003-10-17 15:06:23 +00:00
martignoni 65ecd1c557 Just a little bit more translated 2003-10-17 14:04:47 +00:00
moodler e845dee27d Icons for activities should use $CFG->modpixpath so custom icons work 2003-10-17 12:46:33 +00:00
moodler 482b6e6e38 Same as Eloy's fix, just a few less lines of code. ;-) 2003-10-17 12:30:17 +00:00
moodler 24b8e78e2a Bump 2003-10-17 11:49:30 +00:00
stronk7 23f6216b92 Do some isset() checkings with $CFG->sessioncookie.
Previously when debug turned on, login was impossible
due to some notices sent before writing http headers.
2003-10-17 09:54:41 +00:00
moodler c1e97fe591 Made comments link smaller, and also prints "1 comment" and "2 comments" 2003-10-17 08:55:16 +00:00
moodler 13152b970b Some tidying up of the code to display the comment editing page 2003-10-17 08:49:00 +00:00
moodler 477e78b6fd Some small changes ... made the heading a real heading and removed
includes from the template
2003-10-17 08:42:12 +00:00
moodler 101f330fdb Some more cleaning up of the HTML and code formatting ... 2003-10-17 08:38:16 +00:00
moodler 21863a3bb4 Some modification so that the encyclopedia format looks
more like forum posts (in fact it uses the same styles)
2003-10-17 08:19:56 +00:00
giro123 7568aa033a *** empty log message *** 2003-10-17 01:21:08 +00:00
willcast dc36351d8b Case sensitive match
Whole words match
No match at all (a bit rude (you have to get down to the HTML code), no GUI so far either)
Categories are now linked too (I forced to be a case sensitive match)
You can automatically link one or several glossaries at once no matter if it is a main one or not.
2003-10-16 22:05:00 +00:00
mits 09c3588446 New translation and plished some. 2003-10-16 20:07:40 +00:00
mits d8deb5db94 New help translation 2003-10-16 19:46:32 +00:00
mits 4075975c4b Sorry for slow translation. 2003-10-16 18:05:45 +00:00
giro123 fb63db2c36 *** empty log message *** 2003-10-16 18:02:19 +00:00
rkingdon 98933e78b4 A couple of extra messages for teachers about resubmissions. 2003-10-16 17:47:25 +00:00
giro123 4442ed1169 *** empty log message *** 2003-10-16 17:36:49 +00:00
martignoni e08a9cd97e First bit of translation 2003-10-16 17:36:08 +00:00
rkingdon 32a2b23f43 More information to teachers on resubmissions. Add submission entry to log only if upload is successful. 2003-10-16 17:35:01 +00:00
rkingdon 7c54bd509a Fixed bug stopping the calculation of final grades. 2003-10-16 17:17:19 +00:00
martignoni 30396b3e65 Changed to proper encoding 2003-10-16 16:00:07 +00:00
martignoni e4c54c3d58 Translation finished 2003-10-16 15:51:26 +00:00
moodler 39dda0fc4f Added nolink tag 2003-10-16 14:25:36 +00:00
moodler 6de85459d2 Use $CFG->sessioncookie on MOODLEID cookie as well 2003-10-16 13:23:53 +00:00
moodler c1f5319532 A new Moodle variable called sessioncookie is now added to the session
cookie name.  This provides a means for multiple Moodles within the
same website to keep separate sessions and not get confused.
2003-10-16 13:19:10 +00:00
moodler 3528bae253 Fixed comments on str_ireplace 2003-10-16 10:20:35 +00:00
moodler b81789c55b Add a simple README 2003-10-16 09:39:18 +00:00
moodler 3e6525ba88 A very simple filter to censor "bad" words.
Also provides an example of how to write filters.
2003-10-16 09:33:27 +00:00
moodler 7ec2fc00a0 Improved version of str_ireplace() for older versions of PHP (now handles arrays) 2003-10-16 09:28:27 +00:00
willcast ff6c782016 - Testing... If you can read this.. I solved the problem (thanks to Martin)! :) 2003-10-16 06:37:43 +00:00
moodler 46fc277d38 Added version number to source 2003-10-16 06:00:47 +00:00
moodler b93cee20be Slight change to glossary_print_entry_icons so that
"comments" link isn't printed if comments are disabled
2003-10-16 05:41:35 +00:00
willcast ed0201dd7f - Now entries could be commented by other users.
- KNOWN BUG: It does not restore the comments even when userinfo is set... Eloy! I need your help! :)
2003-10-16 05:15:59 +00:00
moodler b16f0342a3 Add a check in case no attendances are defined 2003-10-16 04:17:53 +00:00
moodler 6f27717759 Autolinks added 2003-10-16 03:38:26 +00:00
moodler 23d7c2c5a8 Added autolink style 2003-10-16 03:23:29 +00:00
moodler 8a0e509384 Info for upgraders 2003-10-16 03:23:08 +00:00
moodler d8ff63f276 Added styles and colour for autolink'ed text 2003-10-16 03:21:09 +00:00
willcast 1a1370bb0d - Link within link issue: Solved. 2003-10-15 22:01:12 +00:00
koenr 841da5f0d5 translated by Koen Roggemans 2003-10-15 21:53:38 +00:00
koenr 40c1b0f8d8 filling the gaps 2003-10-15 20:31:23 +00:00
koenr ad70034400 Translated by Koen Roggemans 2003-10-15 20:20:46 +00:00
willcast a9c4a830f7 - Link within link issue: Solved. 2003-10-15 17:27:51 +00:00
jungwirr ce594a239c fixed import of shortanswer questions to get rid of blank answers 2003-10-15 16:38:46 +00:00
willcast 7dd8844764 - Solving bug 817 (adding a glossary overview)
- Minor changes adopting moodle's naming and coding conventions (perhaps not fully adopted yet)
- Solving bug that traspose All Categories with Not Categorised view.
2003-10-15 16:12:38 +00:00
jungwirr 108ef20260 took out some debugging messages. 2003-10-15 15:49:01 +00:00
jungwirr 7386d3d886 fixed some foreach problems with if tests 2003-10-15 14:34:50 +00:00
moodler 857e0dfdd5 Added new import format - Course Test Manager - from Russell Jungwirth.
All I've done is clean up the source code - I've not tested it at all.
2003-10-15 08:53:51 +00:00
moodler 72c751da80 New class for handling ODBC socket server 2003-10-15 08:49:12 +00:00
moodler 06bf9b71e5 New help for Course Test Manager import 2003-10-15 08:48:06 +00:00
moodler c53be4c013 Some cleaning up ... shouldn't make much difference 2003-10-15 02:48:40 +00:00
stronk7 68b32c8cf4 Small typo :-) 2003-10-14 17:33:44 +00:00
stronk7 42960e439a Function exercise_get_participants() included and working. :-) 2003-10-14 17:31:54 +00:00
stronk7 142a6a46ca Take out more notices in restore process. Undefined variables, mainly. 2003-10-14 17:26:37 +00:00
rkingdon 428ab4b9bf Minor re-ordering - Asssessments for teachers now ordered oldest first, youngest last (previously they were ordered by title). 2003-10-14 17:13:10 +00:00
stronk7 e3713e1a31 Take out more notices in restore process. Undefined variables, mainly. 2003-10-14 17:06:58 +00:00
stronk7 0e232d1841 Take out some notices !! :-) 2003-10-13 22:45:36 +00:00
stronk7 f654deea11 Now, when copying files/folders, CFG->directorypermissions is forced
(previously permissions were copied from original)
2003-10-13 22:44:41 +00:00
koenr abf1c6d842 typo 2003-10-13 20:40:15 +00:00
giro123 f36034bcaf *** empty log message *** 2003-10-13 17:21:59 +00:00
rkingdon bd6ba5263c Changes to help file, describes the new phase. 2003-10-13 17:16:15 +00:00
rkingdon 8231fef937 Minor change to phase names. 2003-10-13 16:16:36 +00:00
rkingdon 8dfe0fa64f Change to workshop_grades - only return grades when in the final phase (phase 6). 2003-10-13 15:23:56 +00:00
rkingdon 0d4d32d183 Workshop now has 6 phases. The phase is show on the Workshops page (index.php).
Administration page now excludes "hot" assessments (peer assessments which have been allocated but not yet made).
2003-10-13 14:56:25 +00:00
rkingdon 63d43fa1b9 Additional strings for 6 phases and showing the phase on the index page. 2003-10-13 14:52:24 +00:00
moodler 75f7bfe6a5 Minor formatting change ... links were obtrusive in forums etc ...
Will, what do you think?
2003-10-13 14:44:23 +00:00
moodler e67b9e31e5 NEW EXPERIMENTAL FEATURE: text filters.
This new feature allows arbitrary text filters to be added to
any HTML that is printed (forum posts, resources etc) ... anything
that uses the standard format_text function.

The first one properly supported is the glossary dynamic linking
feature.
2003-10-13 14:11:17 +00:00
moodler 445b23013e use format_text, not text_to_html 2003-10-13 14:03:48 +00:00
rkingdon 27ca988aa7 Additonal help file - addsubject. 2003-10-13 12:44:39 +00:00
rkingdon 5ff082b127 Removing unused files. 2003-10-13 12:42:58 +00:00
rkingdon 9b1a0374e0 Dialogue version 2003101300. 2003-10-13 12:41:36 +00:00
rkingdon 1e18f1923c Some additional strings for version 2003101300. 2003-10-13 12:39:45 +00:00
rkingdon 39b7e05e81 Addition help file - sendmail 2003-10-13 12:31:43 +00:00
martignoni ff2d03f994 A little more translation, almost finished ! 2003-10-13 10:47:22 +00:00
moodler 266a416e16 get_real_size can now pick up 900k 2003-10-13 03:16:25 +00:00
martignoni b55ff547c3 More translation. Not yet finished. 2003-10-12 20:57:43 +00:00
martignoni 5ebcf7b2cb Title translation was omitted 2003-10-12 20:56:05 +00:00
martignoni 1ee767efc1 Encoding corrected 2003-10-12 20:55:11 +00:00
rkingdon efef04ff4b Removed trailing blank line. 2003-10-12 18:09:13 +00:00
moodler 5204d8316a A new configuration parameter 'allowunenroll' will enable/disable the
"unenrol me" buttons on user pages and course pages.
2003-10-12 18:03:50 +00:00
moodler 726705327f Bump to cover Richtext picture insertion 2003-10-12 17:32:39 +00:00
moodler 089ce20f37 Stop inadvertant browsing 2003-10-12 17:27:31 +00:00
moodler 408e62f865 FIxed bug when no courseid 2003-10-12 17:24:46 +00:00
moodler 6d04a477a2 Fix richtext editing and inserting images 2003-10-12 17:21:36 +00:00
rkingdon 1b4a87a780 Removing old todo.txt file. 2003-10-12 17:21:01 +00:00
rkingdon b896875293 Additional information exercises page (index.php). 2003-10-12 17:19:19 +00:00
rkingdon 3ca5e8bee8 Extra strings for index.php page. 2003-10-12 17:17:01 +00:00
moodler 50bdc74de2 A new feature to allow teachers to browse course files to
find images to insert into Richtext editor windows.

This hack was started by Janne Mikkonen, and I further refined it
to fit better into Moodle.

See:  http://moodle.org/mod/forum/discuss.php?d=2126
2003-10-12 17:12:02 +00:00
giro123 35cd5f90ee *** empty log message *** 2003-10-12 13:38:53 +00:00
koenr 010af7e878 filling in the missing strings ... 2003-10-10 23:04:36 +00:00
koenr bf226d8d16 translated till 8 2003-10-10 22:54:29 +00:00
koenr 9630774343 deleted broken link 2003-10-10 21:26:06 +00:00
stronk7 aefbd27636 Added the dialogue_get_participants() function
to use it in backup/restore.
2003-10-10 18:57:38 +00:00
moodler 4bb17e4bab Latest updates for Moodle 1.1 by Riaan de Villiers 2003-10-10 07:49:52 +00:00
moodler 8f6495804d Smaller borders on frames 2003-10-10 06:02:43 +00:00
moodler 6efec14518 Added information about Norton fireewalls 2003-10-10 03:15:48 +00:00
mits 701bf0bb30 Polished. 2003-10-10 01:54:52 +00:00
moodler f06d1c6c66 Bump de bump 2003-10-09 16:50:14 +00:00
moodler 8664309614 Add an "unenrol" link for students on the course page 2003-10-09 16:47:57 +00:00
moodler 74f5d1e381 Only print the ratings button if there are ratings to be made. 2003-10-09 16:36:09 +00:00
mits be7a0ebb09 Polished. 2003-10-09 14:44:37 +00:00
moodler 6bf0078f07 Removed focus from course page - see Bug 825 2003-10-09 12:42:47 +00:00
moodler c0cf7543b6 No need for focus 2003-10-09 08:45:10 +00:00
moodler ec2137ba49 Some changes so that forum_cron is not fooled in case there is already
a real $USER variable present (eg if cron.php was run manually) and
so the timezones are not calculated incorrectly.
2003-10-09 04:58:09 +00:00
koenr 95a1b0cc4e Section 1-5 translated by Koen Roggemans 2003-10-08 21:36:39 +00:00
koenr 76e0168130 translated by Koen Roggemans 2003-10-08 21:18:10 +00:00
martignoni 7e8d372a4e Partial translation 2003-10-08 21:14:41 +00:00
martignoni 748c9b23e0 Partial translation 2003-10-08 21:14:15 +00:00
koenr 342b80c1bb translated by Koen Roggemans 2003-10-08 20:05:18 +00:00
koenr 942d746a1e filling in missing links... 2003-10-08 20:03:55 +00:00
koenr 9a0480fc6e translated by koen roggemans 2003-10-08 20:01:44 +00:00
jungwirr da5d1efec9 fix attempt for auto-attendance logging. Set to use gmdate and gmmktime
functions.
2003-10-08 19:09:39 +00:00
koenr a8d28cb932 translated by koen roggemans 2003-10-08 18:50:08 +00:00
rkingdon 1d23070249 Cosmetic change to index.php list; Logging of phase changes in a workshop; tidy up of log_display entries - thus the new version; 2003-10-08 18:15:22 +00:00
jungwirr aa47f2710d added official support for postgres7 2003-10-08 18:02:10 +00:00
koenr a52fe881d0 filling in missing strings 2003-10-08 18:01:02 +00:00
stronk7 c163e202c2 This image was missing in this theme and '?' images were showded.
See http://moodle.org/mod/forum/discuss.php?d=2882
2003-10-08 17:51:17 +00:00
martignoni 3c99a66aa9 New translated files 2003-10-08 16:48:00 +00:00
rkingdon 08811301b8 Fix in Cron routine to delete closed dialogues; Remove No entries on
the Closed Dialogues pane to make it consistent with the other panes.
2003-10-08 16:15:59 +00:00
koenr 6dfa542d1d translated by Koen Roggemans 2003-10-08 15:57:23 +00:00
koenr 6c18fe9715 translated for version 1.1 2003-10-08 15:56:31 +00:00
koenr 852d8858c1 corrected typo 2003-10-08 15:55:46 +00:00
koenr 97321042a2 showing double help-files: fixed 2003-10-08 15:54:54 +00:00
koenr 161574c331 Fillling missing strings ... 2003-10-08 15:53:55 +00:00
martignoni cd15e0cb15 Changed to proper encoding 2003-10-08 10:56:07 +00:00
martignoni 52d409f93b New translated file 2003-10-08 10:45:06 +00:00
stronk7 4119844902 Now scales users are in backup too. See bug 824.
Closing it in some hours.
2003-10-08 07:35:53 +00:00
moodler af4efb1484 Improved the heading a little 2003-10-08 05:53:55 +00:00
moodler 094640f170 Split up the looooooooooooooong page into separate files, to make editing
a little easier!
2003-10-08 05:44:56 +00:00
moodler 8aed17838e Tweak to add entry button 2003-10-08 03:49:43 +00:00
moodler af4ea1a280 iTweak to english 2003-10-08 03:43:52 +00:00
moodler 86183b0716 Started out reformatting the code a little and ended up simplifying
the interface a bit ... hope you like it, Will!
2003-10-08 03:13:12 +00:00
moodler 1e6e23fe93 Only show visible modules in help 2003-10-08 01:24:49 +00:00
moodler 69901d1994 First main-tree version of the Exercise module (formerly in contrib)
by Ray Kingdon.

Works quite well, but it's not clear yet if this will be part of
major releases (due to the overlap with assignments and workshops
and the confusion this may cause).
2003-10-07 14:54:21 +00:00
martignoni d8f27b7b60 Cleanup of file "moodle.php" 2003-10-07 14:26:58 +00:00
moodler d497a2a2fb Don't throw an error if users aren't found - just print a notice. 2003-10-07 14:02:32 +00:00
moodler e23defdb12 Not having any users in a backup is not necessarily an error. 2003-10-07 14:01:23 +00:00
moodler 8c02baf617 If there aren't any users, don't do anything. 2003-10-07 14:00:09 +00:00
moodler 9501b8f5ad Added notifications right through the backup when errors occur. 2003-10-07 13:59:15 +00:00
stronk7 9bc0466171 Now assessment->resubmission is in backup/restore too. 2003-10-07 12:14:16 +00:00
stronk7 4a4f96bd79 Now forum->maxbytes is supported in backup/restore. 2003-10-07 12:02:19 +00:00
stronk7 6ecc3ea8d3 Now course->maxbytes is supported in backup/restore. 2003-10-07 11:58:56 +00:00
moodler c3235459d0 Only print expanded course listing on the first page (ie short category) 2003-10-07 03:29:44 +00:00
rkingdon 8e7f0d621c Fixed links in email messages. 2003-10-06 19:30:27 +00:00
moodler 950cf40381 <acronym> is an allowed tag 2003-10-06 18:09:27 +00:00
moodler 4909e17632 These changes implement some better controls for controlling uploads.
1) There is a new site-wide configuration variable called maxbytes,
   which provides an upper filesize limit for all (student) uploads.

2) There is a new course-level variable called maxbytes, which further
   limits uploads within a course.

3) There is a new maxbytes field for forums, which further restricts
   the size allowed in a particular forum.  There is also a new config
   variable in the module configuration to specify a default size
   to use when defining a new forum.

4) Assignments already had a limit, but this is now aware of the other
   limits, and like forums there is now a settable default value.

5) Finally, the sizes of files (Gb, Mb, Kb, bytes) is now translatable
   in the language packs.
2003-10-06 18:02:35 +00:00
moodler e72727728c New strings and help pages for file upload restrictions 2003-10-06 17:44:42 +00:00
martignoni f26f1e9491 New tranlated files added to repository 2003-10-06 14:46:39 +00:00
carlesbellver 2e94893668 *** empty log message *** 2003-10-06 13:04:37 +00:00
carlesbellver ebcfcf57a6 *** empty log message *** 2003-10-06 12:31:08 +00:00
martignoni 7f9b5bb7f6 Changed README to proper encoding 2003-10-06 12:06:43 +00:00
moodler e0a0a1146b Moving Dialogue into the main tree for convenience. 2003-10-06 12:00:28 +00:00
carlesbellver 709a2e61bb *** empty log message *** 2003-10-06 07:36:56 +00:00
koenr e73c9b2739 Deleted blank lines 2003-10-06 06:48:54 +00:00
koenr 7b69801533 link to index of helpfiles added 2003-10-05 21:16:41 +00:00
koenr 74ad68736c example for aon added 2003-10-05 21:16:04 +00:00
koenr 53a07d2a7d corrected some errors 2003-10-05 21:15:30 +00:00
koenr 6f752861d8 translated by Koen Roggemans 2003-10-05 21:13:45 +00:00
koenr ef7d006950 some helpfiles translated 2003-10-05 21:12:23 +00:00
rkingdon 2e217fcfc1 New strings for improved resubmission handling. 2003-10-05 19:02:16 +00:00
rkingdon 12fbf6995e Version 2003100200: improved handling of resubmissions (new field added to workshop_assessments) 2003-10-05 19:00:43 +00:00
moodler d8152d04c0 Language direction is now set in the language file, rather than
as a site-level setting.  This currently only affects Arabic but
will affect Hebrew later and maybe others.
2003-10-05 14:05:57 +00:00
moodler eed655faf2 Add default text direction for English (and most other languages) 2003-10-05 13:44:07 +00:00
moodler 2b128e1979 Add direction for Arabic 2003-10-05 13:43:05 +00:00
giro123 c1d075a0ba *** empty log message *** 2003-10-03 19:03:35 +00:00
giro123 26550bcf4a No traslated yet 2003-10-02 16:52:24 +00:00
giro123 cdaaf794b1 No traslated yet 2003-10-02 16:28:47 +00:00
carlesbellver f6a4021073 *** empty log message *** 2003-10-02 08:15:00 +00:00
carlesbellver dcac5b4fbb *** empty log message *** 2003-10-02 06:45:27 +00:00
moodler 399018a07e Minor fix 2003-10-01 19:03:04 +00:00
moodler ed3979a3dc Style sheet (main one is in /doc ... other one is just useful for editing) 2003-10-01 18:01:34 +00:00
moodler ee8b1abe65 First round clean up of the docs
- new Coding Guidelines
  - new Philosophy page
  - new dedicated styles sheet for all pages
  - better table of contents in left frame
  - source fixups all over

The styles are very boring - I'll work on that next time!
Also, we'll get David's optimisation page and a student manual in there.
2003-10-01 18:00:41 +00:00
rkingdon ec47220e87 Adding "weight", fixed bug #799 2003-10-01 16:54:22 +00:00
rkingdon e7a4d829a8 Replace Literal string "Weight": fixes bug #799 2003-10-01 16:50:42 +00:00
carlesbellver bd20496911 *** empty log message *** 2003-10-01 16:11:37 +00:00
willcast b764feaa29 - Exported entries with attachments are now properly shown everywhere. 2003-10-01 01:35:45 +00:00
giro123 9c131dd61f No traslated yet 2003-09-30 22:18:14 +00:00
giro123 26859ced08 No traslated yet 2003-09-30 15:52:42 +00:00
mits 7c897e49b6 New translation. 2003-09-30 14:08:18 +00:00
moodler 927910f190 Changed Excel library and a few names. 2003-09-30 13:36:25 +00:00
moodler 7631d9c355 Goodbye old library! Replaced by moodle/lib/excel 2003-09-30 13:24:23 +00:00
moodler 329cbe682b Excel report now uses the new library. Conversion by Russell Jungwirth - thanks! 2003-09-30 13:23:05 +00:00
moodler 768f85c43d Excel reports now use the new libraray ... code by Russell Jungwirth - thanks! 2003-09-30 13:18:09 +00:00
stronk7 5e0f9e613a Bug 801 reopened. Problem occur when adding a new activity to a hidden
section, it's visibility defaults to 1.
Now, default visibility is "inherited" from the section visibility.
2003-09-30 12:28:22 +00:00
stronk7 866d33df9b Added to avoid one notice when no news exist !! 2003-09-30 12:25:11 +00:00
bobopinna d9170c87c1 New from Moodle1.2develop 2003-09-30 09:01:10 +00:00
bobopinna cc25b5ef9f Second step of general revision 2003-09-30 08:57:32 +00:00
willcast 703f296be2 - Multiwords concepts are now shown as a single link when they are dinymically linked.
KNOWN BUG: When a concept is contained inside another concept (i.e. HOUSE and DOLL HOUSE) only the smaller concept is shown. Any help would be appreciated.
2003-09-30 04:13:33 +00:00
willcast 4f5c5e11a5 - Multiwords concepts are now shown as a single link when they are dinymically linked.
KNOWN BUG: When a concept is contained inside another concept (i.e. HOUSE and DOLL HOUSE) only the smaller concept is shown. Any help would be appreciated.
2003-09-30 04:01:34 +00:00
les_kopari 99d83573a1 Test inserts updated for new column. 2003-09-30 04:00:18 +00:00
les_kopari eca7d6df6e Truncated names to < 30 chars for table, sequence and trigger. 2003-09-30 03:55:40 +00:00
willcast de53b9ac25 - Duplicated entries are now shown together when a dynamic link is clicked on. 2003-09-30 02:17:09 +00:00
stronk7 d8cb66a846 Included new format for glossary display "Encyclopedia" 2003-09-29 21:37:54 +00:00
stronk7 f4e08011ad Included new format for glossary display "Enciclopedia" 2003-09-29 21:25:59 +00:00
adamtpaw 988e91df6b Time format changed to 24 hour. 2003-09-29 20:51:43 +00:00
willcast 66aff5e665 *** empty log message *** 2003-09-29 19:14:14 +00:00
stronk7 1f32209ef1 Now the module template includes the XXXX_get_participants()
function too (in standard area). See bug 807 and 721.
2003-09-29 18:14:23 +00:00
willcast 466ea2349a - Implementing output text filters for glossary entries
dynalink.php::glossary_dynamic_link($courseid, $text, $glossaryid = NULL)
2003-09-29 17:45:42 +00:00
stronk7 0585509135 Simply, move the XXXX_get_participants() function from
bottom to the common function area.
See bug 807
2003-09-29 15:27:30 +00:00
willcast 3122e8f391 - Not Categorized is now the default view for category tab. 2003-09-29 13:44:07 +00:00
moodler 60c3f4ed84 Updates to French from nicolas@martignoni.net 2003-09-29 10:23:16 +00:00
moodler 9313053d8c Fixed typo on sourceglossaryid line 2003-09-29 10:06:03 +00:00
willcast ad58adac10 - Exported entries are now linked instead of copied to the main glossary.
- Short tags are gone.
- Little changes in ES language.
2003-09-29 03:06:30 +00:00
koenr e75547eb14 adjusted title to index.htm 2003-09-28 22:40:06 +00:00
koenr 655841d3a1 updated 2003-09-28 22:38:49 +00:00
koenr 08bfb7fe27 Corrected minor errors 2003-09-28 22:35:33 +00:00
koenr 0d1a280055 Translated by Koen Roggemans 2003-09-28 22:34:46 +00:00
stronk7 ddd0f4ef09 Now the JumpMenu is showed when listing activities of this module.
See Bug 803
2003-09-28 16:53:17 +00:00
stronk7 383b5c993c Take out CR+LF is some files.
Now, when listing activities, entries are dimmed if they are hidden
(teacher view). See bug 802.
2003-09-28 16:29:32 +00:00
moodler d85ce97e99 Getting there ... still working on it. 2003-09-28 15:56:58 +00:00
moodler d061d88381 MOved quiz_get_participants from the bottom to the standard functions area 2003-09-28 14:57:16 +00:00
stronk7 9ab344eebc Now, when listing activities, entries are dimmed if they are hidden
(teacher view). See bug 802.
2003-09-28 10:57:22 +00:00
jungwirr ea5ae1a70f changed icon per martin's suggestion 2003-09-27 20:40:41 +00:00
giro123 1a2a727fd6 *** empty log message *** 2003-09-27 16:56:29 +00:00
moodler 71c960d5ac Don't print city/country if there aren't any 2003-09-27 14:50:45 +00:00
moodler e02eea80e9 Changes from Mad Alex to allow better error reporting when
adding or updating modules.

See: http://moodle.org/mod/forum/discuss.php?d=2738

If a moderr.html file exists in the module, it is shown.

If a string is returned, it's shown.

Otherwise it works as before.
2003-09-27 14:06:09 +00:00
moodler 65a3ef30c9 Add slahses to raw strings before insertion into database 2003-09-27 13:56:55 +00:00
moodler 834f1c7f6f More tiny modifications to forum post headers (they now can wrap) 2003-09-27 06:25:13 +00:00
moodler 6f4bfe956d Slightly smaller font on by line for forum posts 2003-09-27 06:18:00 +00:00
rkingdon 93dcde0e53 Recent Activity fixed; Student names removed from emails. 2003-09-27 00:10:38 +00:00
rkingdon dfed3275e4 Added strings for Recent Activity 2003-09-27 00:07:04 +00:00
giro123 9759cb2cfb *** empty log message *** 2003-09-26 18:24:29 +00:00
bobopinna 55522afd04 Filled new fields 2003-09-26 13:17:59 +00:00
bobopinna e83068c4eb First step of general revision 2003-09-26 12:12:55 +00:00
moodler aa3eb05096 When getting a list of countries, check the parent language if necessary. 2003-09-26 08:21:11 +00:00
moodler 5833a6c8eb The list of countries has finally been moved into the language packs
so it can be translated.

There is now a new function get_list_of_countries() which will return a
sorted array of countries in the best current language.

get_string("AU", "countries")   will also work if needed
2003-09-26 08:04:48 +00:00
moodler ffe242df4d Attendance now uses the main Moodle version of the Excel library 2003-09-26 04:27:53 +00:00
moodler fdf4b0c1bb Upgraded gradebook to use the new Excel library.
Most of these changes are from Russell Jungwirth - thanks!

I also moved the download buttons to the top - better for BIG classes.
2003-09-26 04:19:21 +00:00
moodler 8b1fb0c66a Adding a new system for producing Excel documents that are a little
more compatible with non-Excel spreadsheets.  It also has more features
than the old system that we might take advantage of later.
2003-09-26 04:18:02 +00:00
jungwirr ec0ce75f90 updated view to show extra information re: grading, dynamic section,
automation based on logs.
2003-09-25 23:09:28 +00:00
jungwirr 29bd1e46c5 Added grading support for attendance - including settings and database
fields.

Cleaned up some function names in lib to proper naming conventions.
2003-09-25 22:47:11 +00:00
stronk7 7b6d108076 Fixed small error in overallocation field !! :-) 2003-09-25 19:40:25 +00:00
stronk7 58fb571d4d Now autoattend field is supported in backup/restore.
Ciao.
2003-09-25 19:38:28 +00:00
rkingdon 5c32d7258d Addition of the overallocation field to the workshop table. 2003-09-25 19:14:14 +00:00
jungwirr eab709a095 Added automatic attendance logging based on date and any activity by
student on that day.  NOTE - cron must be running for this to work
properly

Modified multi-page views to use arrows instead of words, added a first
page and last page link as well.  Cleaned up that nav menu a bit as well.
2003-09-25 18:54:18 +00:00
rkingdon 5edceb5b79 Changes to handling of peer assessments allocation; over allocation
option added; new assessment phase added; options added to control the
length of the league table and the display of name in the league table.
2003-09-25 17:32:58 +00:00
rkingdon 076a08c58d One missing help file added; two new help files added 2003-09-25 17:28:55 +00:00
rkingdon 87d37868d1 New Assessment Phase added. 2003-09-25 17:27:02 +00:00
rkingdon e3153bb9bf Some new strings for over allocation; the new phase, hiding names and
the league table.
2003-09-25 17:25:47 +00:00
adamtpaw 24d80a24d1 Fixed problems slash before vars 2003-09-25 10:03:51 +00:00
les_kopari ff74d85283 Initial add for Oracle. 2003-09-25 02:11:31 +00:00
les_kopari 39cb14779b Initial add for Oracle. 2003-09-25 01:11:22 +00:00
les_kopari 17ae02e5d6 Initial add for Oracle...does nothing. 2003-09-24 23:20:58 +00:00
les_kopari c5c71888bc Sorry...brainphart...corrected glossary to journal. 2003-09-24 23:15:41 +00:00
les_kopari 861a1b96bc Initial add for Oracle...does nothing. 2003-09-24 23:09:49 +00:00
les_kopari 941d835248 Added new columns and tables, but need resolution on table names > 30 in length, including mdl_glossary_entries_categories. 2003-09-24 22:46:27 +00:00
giro123 eb57630381 *** empty log message *** 2003-09-24 21:28:29 +00:00
jungwirr bff1d71664 removed demo file from library 2003-09-24 19:11:14 +00:00
jungwirr 275b48ac2b changed the excel writing library to a more fully-featured, less buggy
one.
2003-09-24 19:10:14 +00:00
jungwirr caf4bef130 added export to excel and text feature for reports. Still a bug with
export full report to excel in viewweek.php
2003-09-24 17:35:09 +00:00
jungwirr 96f63ba5cb added strings for export to excel 2003-09-24 17:32:24 +00:00
giro123 3ba9cd9c16 *** empty log message *** 2003-09-24 16:51:27 +00:00
paca70 7d53de2687 Converted files from iso-8859-1 to UTF-8 2003-09-24 16:49:10 +00:00
mits e2d5302736 New translation added. 2003-09-24 14:39:20 +00:00
les_kopari 401a81dddf Added columns indent, visible to create, inserts. 2003-09-24 02:06:34 +00:00
les_kopari 24604ce7fe Initial version for Oracle: does nothing. 2003-09-24 01:30:43 +00:00
stronk7 519ed08a44 Up abit to solve one category issue. 2003-09-23 16:51:57 +00:00
stronk7 46f1f7822d Now, to restore course category do this:
- Check if (category_id, category_name) exists.
- Check if (category_name) exists.
- Check if category_id = 1 exists.
- Create a new, initially invisible category withe the info in backup-file.

This solves a issue when restoring to a new course and category_id 1
had been removed !!
2003-09-23 16:40:44 +00:00
willcast 89d7efdb13 *** empty log message *** 2003-09-23 12:42:29 +00:00
willcast 914cb260dc - Corrections in EN language. Thanks to Przemek!
- Added a "All categories" link to the category drop-down box in Category view.
- Better display of categorized entries (more organized).
- SelectLetter, Special and All captions are now properly showed when some of the their flags are not set.
- Properly use of course module visibility (in case someone directly access the URL)
2003-09-23 12:34:47 +00:00
moodler a1f8ff87c7 Small fix to avoid warnings on empty tables 2003-09-23 12:18:27 +00:00
moodler e2b7251de9 Whoops, silly typo 2003-09-23 03:13:31 +00:00
moodler e1d1049893 Trivial change to users listing to compress display a bit 2003-09-23 03:11:36 +00:00
stronk7 57129544d1 Updated a bit (only date) 2003-09-23 00:00:00 +00:00
adamtpaw 7db8791cb5 New file 2003-09-22 21:46:17 +00:00
villate 2b696934bc Included a few missing variables. 2003-09-22 18:02:04 +00:00
villate dcfb88a70a Replace "Mova" by "Mude" 2003-09-22 17:18:26 +00:00
mits 5afc5272f5 Some new translations added. 2003-09-22 16:12:55 +00:00
moodler 0a660b03e0 Fixed a NASTY little bug that sometimes occurred when
re-grading quizzes with random questions in them.

(everyone got set to zero)
2003-09-22 16:03:30 +00:00
stronk7 543e1c58b5 Take off one notice when there is no news in a course... 2003-09-22 14:58:46 +00:00
moodler ecac660cd6 Use the new is_internal_auth function 2003-09-22 14:01:45 +00:00
moodler ba7166c377 Added is_internal_auth() function to quickly identify internal authentication 2003-09-22 13:58:20 +00:00
moodler 9f798bff9f Fixed bug when main admin was editing externally-defined accounts
(the username/password was editable)
2003-09-22 13:25:27 +00:00
willcast 2e26533562 *** empty log message *** 2003-09-22 12:35:13 +00:00
bobopinna b138512178 Updated Moodle 1.2develop 2003-09-22 10:06:43 +00:00
stronk7 bd96236e86 Solved two possibe bugs:
- Restoring to courses without section 0 (manually deleted).
    - Restoring to sections without mods and null values in its sequence field.
Thanks to Janne Mikkonen...
2003-09-22 08:30:22 +00:00
giro123 25b19994cc *** empty log message *** 2003-09-22 06:27:10 +00:00
stronk7 86db7a137d Now glossary categories are inbackup/restore too !!
Not tested !!
2003-09-22 00:06:51 +00:00
stronk7 0eb61c5e87 Some cosmetical updates plus one error selecting glossary_categories_entries
solved. No backup is working ok... I think.
2003-09-21 23:40:42 +00:00
willcast 615453c9c5 *** empty log message *** 2003-09-21 23:40:00 +00:00
willcast 71009e400d *** empty log message *** 2003-09-21 23:34:21 +00:00
stronk7 50164ebaf9 Fixed small error 2003-09-21 23:07:18 +00:00
stronk7 3f46ed14b5 No restoring categories, but working again. 2003-09-21 22:43:07 +00:00
stronk7 626aab5d67 Now, the "edited" field is included in backup/restore too. 2003-09-21 20:45:46 +00:00
adamtpaw 540fa20b31 Info about maintener and contributors 2003-09-21 19:55:07 +00:00
willcast aa1ce48512 - Backup of categories and its entries
- Working on the restore process... Eloy will gives me a hand this (hopefully!)
2003-09-21 18:09:54 +00:00
jungwirr 5b42a6a893 added field I fergot about when creating the update code. duhrrr. 2003-09-21 17:40:12 +00:00
willcast fb443f1acf - Now the entries could be categorized.
- Any entry could belongs to many categories
- Improved main page and add entry look.
- Added PostgreSQL7 squema (Thanks Janne Mikkonen!)
- Deleting entries also delete its attachments if any.
2003-09-21 17:08:41 +00:00
moodler e4576482d5 Robustness on an optional variable 2003-09-21 16:35:49 +00:00
moodler 66a51452d9 Changes from Mad Alex and Gustav Delius:
- make more of the HTML into XHTML
  - add a $usexml parameter to print_header that sets up the page as XML
    (in the first case, for MathML)
2003-09-21 15:45:24 +00:00
moodler 8bb0899949 Some improved XHTML 2003-09-21 15:32:25 +00:00
adamtpaw c18aebd06d Translation of Survey module 2003-09-21 10:58:23 +00:00
adamtpaw dde9e6ab4c Translation of Journal 2003-09-20 20:02:20 +00:00
adamtpaw 9c2d9968d7 Traltaion of resource module 2003-09-20 19:58:29 +00:00
stronk7 3bd4de22f5 Changed !empty to isset to avoid warnings. 2003-09-20 17:33:55 +00:00
stronk7 2832badf38 Added one check to avoid some notices in make_categories_list().
Commented in Moodle's forum: http://moodle.org/mod/forum/discuss.php?d=2627
2003-09-20 17:08:45 +00:00
moodler a9a070e0fd Make the "guest allowed" icon separate from the user icon. 2003-09-20 06:11:39 +00:00
moodler 30bacddc59 Fixed user display with less than 20 students 2003-09-20 05:19:02 +00:00
moodler 0d5c3f158d Fixed up Adam's tags again 2003-09-20 03:27:33 +00:00
jungwirr 254989f151 fixed a default for the 'presentshort' string 2003-09-19 23:29:14 +00:00
adamtpaw ceb8ca87af some new filesCVS: ---------------------------------------------------------------------- 2003-09-19 19:27:03 +00:00
adamtpaw 95371d813b Few new files 2003-09-19 19:23:14 +00:00
adamtpaw adafc950c1 "<? " => "<php? 2003-09-19 19:12:05 +00:00
jungwirr 028776ce07 added config.html 2003-09-19 15:43:21 +00:00
moodler 35b8e7c28d Database needs prefix 2003-09-19 11:58:24 +00:00
moodler 489b291962 When searching users don't use "LIKE" for all databases. 2003-09-19 08:33:27 +00:00
jungwirr cddc26f6fb Added preference to allow for default attendance status for unedited
rolls.  (it used to be just 'present' now it can be any of the three.
2003-09-19 04:24:28 +00:00
jungwirr 233c877c05 added new strings for attendance status preference 2003-09-19 04:22:11 +00:00
willcast 06d94a5228 - Initial changes to categorize the entries..
- A new function in lib that perhaps could be used in other modules:
   print_tabbed_table_start and print_tabbed_table_end
2003-09-18 23:53:05 +00:00
willcast 0a855df8f0 - Initial changes to categorize the entries..
- A new function in lib that perhaps could be used in other modules:
   print_tabbed_table_start and print_tabbed_table_end
2003-09-18 23:36:06 +00:00
stronk7 0249828cf9 Now restore button is always showed here too !!
Same behaviour than the restore link in main page.
(automatically creates backupdata dir)
Closed bug #741
2003-09-18 21:58:04 +00:00
jungwirr 8be3ac4473 updated to reflect changes in the module 2003-09-18 21:25:21 +00:00
jungwirr 5dc088851c viewweek.php:
Added a report to view attendance rolls by week instead of all or one -

Updated view.php and viewall.php to reflect these options as well.
2003-09-18 21:23:41 +00:00
stronk7 1becf68da2 Small typo :-) 2003-09-18 19:28:05 +00:00
stronk7 bb5eb662d0 Labels, attendances and glosaries finished.
Updated a bit info in STATUS.txt
2003-09-18 18:52:40 +00:00
stronk7 d1a551a11a Now attendance module is in backup/restore too !!
Please test.
2003-09-18 18:41:15 +00:00
stronk7 5735794924 Added attendace_get_participants(). Needed to implement
backup & restore.
2003-09-18 18:08:49 +00:00
willcast 2cc4c0b4bf - When guest or students search entries, now they are correctly displayed. 2003-09-18 17:57:31 +00:00
stronk7 3f6cc68f6a Now glossaries are included too.
And backup filename is editable.
2003-09-18 17:48:24 +00:00
stronk7 11db6f92a2 Now more characters are replaced in the backup filename.
And it's editable in the backup proccess, too.
Bug #763 closed.
2003-09-18 17:43:52 +00:00
moodler 45d525422e Somehow the version went down ... bumping it up again! 2003-09-18 17:03:40 +00:00
moodler dd301fb595 Bump 2003-09-18 17:01:27 +00:00
willcast 868cb96a47 - When guest or students search entries, now they are correctly displayed. 2003-09-18 15:54:02 +00:00
willcast 1edaf3f6f5 - When guest or students search entries, now they are correctly displayed. 2003-09-18 15:49:52 +00:00
moodler df19d0d912 Updates to dates 2003-09-18 14:41:45 +00:00
willcast 6a22879b41 - When guest or students search entries, now they are correctly displayed. 2003-09-18 14:18:04 +00:00
giro123 8202a36a21 *** empty log message *** 2003-09-18 13:59:20 +00:00
thepurpleblob 3b51e7816f Updated to reflect change in quote handling, and to document inline
file linking (which was in code but not in help)
2003-09-18 12:57:49 +00:00
thepurpleblob 299665b644 Changed replacement logic for quotes (") as some versions of Micro$oft's
(so called) browser are buggy and sometimes ignore <p> tags.
2003-09-18 12:52:14 +00:00
moodler 160e811553 Don't grab unconfirmed users in user listing 2003-09-18 11:51:05 +00:00
moodler 7a1ade1b78 Make get_course_students backward compatible 2003-09-18 04:50:22 +00:00
moodler 4969ad7400 First attempt at proper paging for the user page.
Still needs some work ...
2003-09-18 04:46:34 +00:00
moodler 7c930c46b0 Updates from Paula 2003-09-18 03:35:51 +00:00
jungwirr 4f96d7f45e Finished first version of add.php - to add multiple attendance instances
at the same time.
2003-09-17 23:46:53 +00:00
stronk7 2fbd1b81d8 Now restoring glossaries is included too !!
Please, test it !!
2003-09-17 21:27:13 +00:00
stronk7 7c0a8a1ab6 Some fields missing in backup. Fixed. 2003-09-17 21:07:20 +00:00
giro123 3af1df1670 *** empty log message *** 2003-09-17 17:04:58 +00:00
giro123 eb53588cdb *** empty log message *** 2003-09-17 16:50:28 +00:00
jungwirr 8bc37becbc just some more strings for new functionality. 2003-09-17 14:40:38 +00:00
jungwirr 7cab0ba37c fixed bugs in view.php, mod.html, viewall.php
added add.php for adding mutiple instances at once - not nearly done yet!
2003-09-17 14:37:42 +00:00
moodler fa5a5b5295 Forums in section 0 (top section) now get combined in the
"General Forums" listing on the Forums list
2003-09-17 06:20:25 +00:00
willcast cd564e5dfc - Testing new permissions... 2003-09-17 01:56:56 +00:00
moodler 6ecf2e4c87 Remove $PHP_SELF 2003-09-17 01:33:12 +00:00
willcast c3e01ed20a *** empty log message *** 2003-09-17 00:21:00 +00:00
stronk7 46ea6d74da Now entries attachments are in backup too. This module is slighty
different because when "no user info" is selected, teacher entries are
exported so, instead of copying all the moddata/glossary dir (as other
modules), files are copied selectively !!
2003-09-16 21:45:50 +00:00
stronk7 b79e51b46c Will is having problems, so I upload this... 2003-09-16 20:24:02 +00:00
willcast e179048ec1 - Display format of entries is now modular.
- Entries can have an optional file
- English help files.
- Now the alphabet is a language string so it is now usable in other languages.

KNOWN BUGS:
- It does not backup nor restore the attached files of the entries.
2003-09-16 18:51:40 +00:00
mits 83985ddaa6 New translation added. 2003-09-16 18:24:56 +00:00
les_kopari 61323671b7 Oracle version 2003-09-16 17:23:27 +00:00
villate 4e0e093696 Some language improvements 2003-09-16 14:07:14 +00:00
moodler dc158ece12 Bump! 2003-09-16 07:24:14 +00:00
moodler ce45515e7d Err ... whose idea was it to cache the strings in forum_make_mail_post? :-) 2003-09-16 06:35:37 +00:00
moodler fdfc6269ef Backupdata is now always created if it is needed.
Navigation is a little neater (no longer puts a link on the current folder)
2003-09-16 06:15:01 +00:00
moodler ffc69cd31d Move all the activity editing buttons back on the end of the activity name 2003-09-16 05:48:09 +00:00
moodler 872d7f598c New module Attendance, by Russell Jungwirth. 2003-09-16 05:33:54 +00:00
moodler 48769c6e2d Language file for new Attendance module, by Russell Jungwirth 2003-09-16 05:32:16 +00:00
moodler 0784202319 New Glossary module, version 0.1 - by Williams Castillo! 2003-09-16 03:07:21 +00:00
moodler 20e62af383 Spanish language files for new Glossary module 2003-09-16 03:06:10 +00:00
moodler 8820896338 Language files for Glossary module - help files in Spanish still! 2003-09-16 03:04:32 +00:00
moodler 2e2e71a8da New feature: "Show Parent" on all posts will take you to to the parent
of any given post.  Detects threaded mode and behaves a bit differently
though intuitively.
2003-09-16 02:42:22 +00:00
moodler ab2df10cc8 Hide labels from nav menu 2003-09-15 11:59:15 +00:00
moodler da23d41a1f FIxed some PHP tags and empty strings 2003-09-15 02:29:20 +00:00
les_kopari b36e7694a8 Oracle translation of mySQL module for label. 2003-09-14 23:41:22 +00:00
stronk7 0611af101d Now, "needed" users are included in backup/restore when
"course users" are selected.  This uses the xxxx_get_participants()
function in every module.
This solves an issue about info in modules belonging to
unenrolled users (Bug #692 closed).
Mantain compatibility with old backups (1.1 and 1.1.1).
Updated version to "1.2 development".
Included support to "label" module (by Martin)
2003-09-14 21:43:34 +00:00
koenr 623d403c66 Some Englisch text was stil in it 2003-09-14 21:27:42 +00:00
koenr 31f5cb39d2 leraars replaced with leraren 2003-09-14 21:16:56 +00:00
adamtpaw 0cdc9c53ea First translation of Workshop module 2003-09-14 21:14:02 +00:00
moodler 875ea7db1b Removed typo .php 2003-09-14 18:56:45 +00:00
moodler 809e6508db Hide labels on topic pages 2003-09-14 18:51:52 +00:00
moodler 5704a98da7 Some docs for PostgreSQL sockets users (see bug #749) 2003-09-14 17:50:07 +00:00
moodler 30222590f7 When adding a new column, set all the default values manually 2003-09-14 17:39:18 +00:00
moodler 567df7420a Reduced size of table cells ... might need to work on editing buttons 2003-09-14 17:20:40 +00:00
moodler bf1241ad96 Some tidying up of the editing icons 2003-09-14 16:43:10 +00:00
moodler 892da6a051 Strings to move activities left and right 2003-09-14 16:34:36 +00:00
moodler aac94fd0cc New field on course_modules called "indent" ... this is an integer
that tells us how far to indent the activity when it is displayed.

This gives us some more flexibility on the course outline to
arrange things as we might like them, into subtopics etc

Backup/restore is updated as well.

There is also a bit more robustness in course/mod.php
2003-09-14 16:31:33 +00:00
stronk7 2b9f062552 Added "graphical structure".
Added label_get_participants() function.
2003-09-14 15:47:36 +00:00
moodler 27a026c7e8 Backupo / Restore for labels (untested as yet) 2003-09-14 15:20:43 +00:00
moodler a90fb36bd2 Added a course field (whoops!) and edited backuplib.php and restorelib.php 2003-09-14 15:20:09 +00:00
moodler 2c5c3e62a7 New module: Label.
This is a sort of "dummy" activity that allows HTML to be placed
anywhere in the course sections ...
2003-09-14 12:30:09 +00:00
moodler c9f6251ea8 Two things are in this checkin:
1) Support for the new "label" module has been added.  It's unfortunate
   about having to make these exceptions but this was the overall cleanest
   way I could think of.

2) All local calculation of pixpath and modpixpath has been removed and
   replaced with a single calculation which is done in setup.php and
   stored in $CFG->pixpath and #CFG->modpixpath.  All graphics should
   use these variables so that themes can easily override them.
2003-09-14 12:25:16 +00:00
moodler c7ce6d80a3 Used the wrong function to display the message (Notify, not Notice) 2003-09-14 12:22:13 +00:00
moodler ad410dd19b New help files for label module 2003-09-14 12:20:32 +00:00
moodler f9efae0e40 Put rating setup last because it's optional 2003-09-14 09:36:28 +00:00
moodler 18a97fd84d Some early phpdoc-style documentation (thanks to Russell Jungwirth!)
Fixes for use of MySQL-only CONCAT function on other databases
2003-09-14 04:04:15 +00:00
adamtpaw 4382b8f2e3 update for Moodle 1.1 2003-09-14 00:25:59 +00:00
moodler 07bc24351d Show restore icon all the time, even if there are no backups. 2003-09-13 12:59:39 +00:00
moodler cabcedda58 Time to move on! 2003-09-13 11:59:41 +00:00
moodler bb9cf93d21 Frontpage directories to ignore are called _vti_cnf .. not vti_cnf 2003-09-13 08:19:42 +00:00
les_kopari 96c1e116e6 Oracle tables, etc converted from mysql, plus test transactions. 2003-09-13 08:05:21 +00:00
les_kopari 1930ab3694 Oracle tables, etc converted from mysql. 2003-09-13 07:43:55 +00:00
moodler 9ac796a68f PLace included metadata lines above the <title> 2003-09-13 07:34:20 +00:00
mits 2237c10c84 New translation added, and polished some. 2003-09-12 10:33:58 +00:00
koenr 914b06de0a Translated by Koen Roggemans 2003-09-12 05:31:47 +00:00
koenr d81a77dddf Translated files in index; alphabetical order 2003-09-12 05:30:51 +00:00
3529 changed files with 253013 additions and 72480 deletions
+11363 -6753
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -97,7 +97,7 @@
foreach ($admins as $admin) {
$adminarray[] = $admin->id;
echo "<p align=right>$admin->firstname $admin->lastname,
echo "<p align=right>".fullname($admin, true).",
$admin->email &nbsp;&nbsp; ";
if ($primaryadmin->id == $admin->id){
print_spacer(10, 9, false);
@@ -138,7 +138,7 @@
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";
"border=0></a>&nbsp;&nbsp;".fullname($user).", $user->email";
}
}
+1 -1
View File
@@ -95,7 +95,7 @@
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", "");
choose_from_menu ($options, "auth", $auth, "","document.location='auth.php?auth='+document.authmenu.auth.options[document.authmenu.auth.selectedIndex].value", "");
echo "</B></P></CENTER>";
+90
View File
@@ -0,0 +1,90 @@
<?PHP // $Id$
// backup.php - allows admin to edit all configuration variables for scheduled backups
require_once("../config.php");
require_once("../backup/lib.php");
require_login();
if (!isadmin()) {
error("Only an admin can use this page");
}
if (!$site = get_site()) {
error("Site isn't defined!");
}
//Initialise error variables
$error = false;
$sche_destination_error = "";
/// If data submitted, then process and store.
if ($config = data_submitted()) {
//First of all we check that everything is correct
//Check for trailing slash and backslash in backup_sche_destination
if (!empty($backup_sche_destination) and
(substr($backup_sche_destination,-1) == "/" or substr($backup_sche_destination,-1) == "\\")) {
$error = true;
$sche_destination_error = get_string("pathslasherror");
//Now check that backup_sche_destination dir exists
} else if (!empty($backup_sche_destination) and
!is_dir($backup_sche_destination)) {
$error = true;
$sche_destination_error = get_string("pathnotexists");
}
//We need to do some weekdays conversions prior to continue
$i = 0;
$temp = "";
$a_config = (array)$config;
while ($i<7) {
$tocheck = "dayofweek_".$i;
if (isset($a_config[$tocheck])) {
$temp .= "1";
} else {
$temp .= "0";
}
unset($a_config[$tocheck]);
$i++;
}
$a_config['backup_sche_weekdays'] = $temp;
$config = (object)$a_config;
//weekdays conversions done. Continue
print_header();
foreach ($config as $name => $value) {
backup_set_config($name, $value);
}
if (!$error) {
redirect("$CFG->wwwroot/$CFG->admin/index.php", get_string("changessaved"), 1);
exit;
}
}
/// Otherwise print the form.
$stradmin = get_string("administration");
$strconfiguration = get_string("configuration");
$strbackup = get_string("backup");
print_header("$site->shortname: $strconfiguration: $strbackup", $site->fullname,
"<a href=\"index.php\">$stradmin</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> -> ".
$strbackup);
echo "<p align=right><a href=\"../backup/log.php\">".get_string("logs")."</a></p>";
print_heading($strbackup);
print_simple_box("<center>".get_string("adminhelpbackup")."</center>", "center", "50%");
echo "<br />";
print_simple_box_start("center", "", "$THEME->cellheading");
include("$CFG->dirroot/backup/config.html");
print_simple_box_end();
print_footer();
?>
+135 -16
View File
@@ -10,21 +10,6 @@
<?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>
<?php print_string("configlangdir") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>langmenu:</td>
<td>
@@ -58,9 +43,36 @@
<?php print_string("configlocale") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>timezone:</td>
<td><?php
if (abs($config->timezone) > 13) {
$config->timezone = 99;
}
$timenow = time();
for ($tz = -26; $tz <= 26; $tz++) {
$zone = (float)$tz/2.0;
$usertime = $timenow + ($tz * 1800);
if ($tz == 0) {
$timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT)";
} else if ($tz < 0) {
$timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT$zone)";
} else {
$timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT+$zone)";
}
}
choose_from_menu ($timezones, "timezone", $config->timezone, get_string("serverlocaltime"), "", "99");
?>
</td>
<td>
<?php print_string("configtimezone") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>country:</td>
<td><?php choose_from_menu ($COUNTRIES, "country", $config->country, get_string("selectacountry"), "") ?>
<td><?php choose_from_menu (get_list_of_countries(), "country", $config->country, get_string("selectacountry"), "") ?>
</td>
<td>
<?php print_string("configcountry") ?>
@@ -165,6 +177,30 @@
<?php print_string("configlongtimenosee") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>deleteunconfirmed:</td>
<td>
<?php
unset($options);
$options[0] = get_string("never");
$options[168] = get_string("numdays", "", 7);
$options[144] = get_string("numdays", "", 6);
$options[120] = get_string("numdays", "", 5);
$options[96] = get_string("numdays", "", 4);
$options[72] = get_string("numdays", "", 3);
$options[48] = get_string("numdays", "", 2);
$options[24] = get_string("numdays", "", 1);
$options[12] = get_string("numhours", "", 12);
$options[6] = get_string("numhours", "", 6);
$options[1] = get_string("numhours", "", 1);
choose_from_menu ($options, "deleteunconfirmed", $config->deleteunconfirmed, "", "", "");
?>
</td>
<td>
<?php print_string("configdeleteunconfirmed") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>loglifetime:</td>
<td>
@@ -209,6 +245,15 @@
<?php print_string("configsessiontimeout") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>sessioncookie:</td>
<td>
<input name=sessioncookie type=text size=10 value="<?php p($config->sessioncookie)?>">
</td>
<td>
<?php print_string("configsessioncookie") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>zip:</td>
<td>
@@ -315,6 +360,80 @@
<?php print_string("configteacherassignteachers") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>allowunenroll:</td>
<td>
<?php
unset($options);
$options[0] = get_string("no");
$options[1] = get_string("yes");
choose_from_menu ($options, "allowunenroll", $config->allowunenroll, "", "", "");
?>
</td>
<td>
<?php print_string("configallowunenroll") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>maxbytes:</td>
<td>
<?php
$options = get_max_upload_sizes();
choose_from_menu ($options, "maxbytes", $config->maxbytes, "");
?>
</td>
<td>
<?php print_string("configmaxbytes") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>fullnamedisplay:</td>
<td>
<?php
unset($options);
$options['language'] = get_string('language');
$options['firstname lastname'] = get_string('firstname') . ' + ' . get_string('lastname');
$options['lastname firstname'] = get_string('lastname') . ' + ' . get_string('firstname');
$options['firstname'] = get_string('firstname');
choose_from_menu ($options, "fullnamedisplay", $config->fullnamedisplay, "", "", "");
?>
</td>
<td>
<?php print_string("configfullnamedisplay") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>forcelogin:</td>
<td>
<?php
unset($options);
$options[0] = get_string('no');
$options[1] = get_string('yes');
choose_from_menu ($options, "forcelogin", $config->forcelogin, "", "", "");
?>
</td>
<td>
<?php print_string("configforcelogin") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>opentogoogle:</td>
<td>
<?php
unset($options);
$options[0] = get_string("no");
$options[1] = get_string("yes");
choose_from_menu ($options, "opentogoogle", $config->opentogoogle, "", "", "");
?>
</td>
<td>
<?php print_string("configopentogoogle") ?>
</td>
</tr>
<tr>
<td colspan=3 align=center>
+3 -1
View File
@@ -2,7 +2,6 @@
// config.php - allows admin to edit all configuration variables
require_once("../config.php");
require_once("../lib/countries.php");
if ($site = get_site()) { // If false then this is a new installation
@@ -28,6 +27,9 @@
if (count($err) == 0) {
print_header();
foreach ($config as $name => $value) {
if ($name == "sessioncookie") {
$value = clean_filename($value);
}
unset($conf);
$conf->name = $name;
$conf->value = $value;
+6
View File
@@ -32,6 +32,12 @@
get_string("adminhelplanguage"));
$table->data[] = array("<b><a href=\"modules.php\">".get_string("managemodules")."</a></b>",
get_string("adminhelpmanagemodules"));
$table->data[] = array("<b><a href=\"filters.php\">".get_string("managefilters")."</a></b>",
get_string("adminhelpmanagefilters"));
if (!isset($CFG->disablescheduledbackups)) {
$table->data[] = array("<b><a href=\"backup.php\">".get_string("backup")."</a></b>",
get_string("adminhelpbackup"));
}
print_table($table);
+3 -3
View File
@@ -94,8 +94,7 @@
$creatorarray = array();
foreach ($creators as $creator) {
$creatorarray[] = $creator->id;
echo "<p align=right>$creator->firstname $creator->lastname,
$creator->email &nbsp;&nbsp; ";
echo "<p align=right>".fullname($creator, true).", $creator->email &nbsp;&nbsp; ";
echo "<a href=\"{$_SERVER['PHP_SELF']}?remove=$creator->id\"
title=\"$strremovecreator\"><img src=\"../pix/t/right.gif\"
border=0></a>";
@@ -128,9 +127,10 @@
}
foreach ($users as $user) {
$fullname = fullname($user, TRUE);
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";
"border=0></a>&nbsp;&nbsp;$fullname, $user->email";
}
}
+50 -8
View File
@@ -17,9 +17,18 @@
require_once("../config.php");
if (!$alreadyadmin = isadmin()) {
unset($_SESSION['USER']);
unset($USER);
unset($_SESSION['SESSION']);
unset($SESSION);
$USER = get_admin(); /// Temporarily, to provide environment for this script
}
echo "<pre>\n";
$timenow = time();
echo "Server Time: ".date('r',$timenow)."\n\n";
/// Run all cron jobs for each module
@@ -54,23 +63,23 @@
if ($CFG->longtimenosee) { // value in days
$longtime = $timenow - ($CFG->longtimenosee * 3600 * 24);
if ($users = get_users_longtimenosee($longtime)) {
foreach ($users as $user) {
if (unenrol_student($user->id)) {
echo "Deleted student enrolment for $user->firstname $user->lastname ($user->id)\n";
if ($students = get_users_longtimenosee($longtime)) {
foreach ($students as $student) {
if (unenrol_student($student->userid, $student->course)) {
echo "Deleted student enrolment for user $student->userid from course $student->course\n";
}
}
}
}
/// Delete users who haven't confirmed within seven days
$oneweek = $timenow - (7 * 24 * 3600);
/// Delete users who haven't confirmed within required period
$oneweek = $timenow - ($CFG->deleteunconfirmed * 3600);
if ($users = get_users_unconfirmed($oneweek)) {
foreach ($users as $user) {
if (delete_records("user", "id", $user->id)) {
echo "Deleted unconfirmed user for $user->firstname $user->lastname ($user->id)\n";
echo "Deleted unconfirmed user for ".fullname($user, true)." ($user->id)\n";
}
}
}
@@ -93,6 +102,39 @@
$loglifetime = $timenow - ($CFG->loglifetime * 3600 * 24);
delete_records_select("log", "time < '$loglifetime'");
}
/// Delete old cached texts
if (!empty($CFG->cachetext)) { // Defined in config.php
$cachelifetime = time() - $CFG->cachetext;
delete_records_select("cache_text", "timemodified < '$cachelifetime'");
}
}
if (file_exists("$CFG->dataroot/cronextra.php")) {
include("$CFG->dataroot/cronextra.php");
}
if (!isset($CFG->disablescheduledbackups)) { // Defined in config.php
//Execute backup's cron
//Perhaps a long time and memory could help in large sites
set_time_limit(0);
ini_set("memory_limit","56M");
if (file_exists("$CFG->dirroot/backup/backup_scheduled.php") and
file_exists("$CFG->dirroot/backup/backuplib.php") and
file_exists("$CFG->dirroot/backup/lib.php")) {
include_once("$CFG->dirroot/backup/backup_scheduled.php");
include_once("$CFG->dirroot/backup/backuplib.php");
include_once("$CFG->dirroot/backup/lib.php");
echo "Running backups if required...\n";
flush();
if (! schedule_backup_cron()) {
echo "Something went wrong while performing backup tasks!!!\n";
} else {
echo "Backup tasks finished\n";
}
}
}
echo "Cron script completed correctly\n";
+36
View File
@@ -0,0 +1,36 @@
<?PHP // $Id$
// dbperformance.php - shows latest ADOdb stats for the current server
require_once("../config.php");
require_login();
if (!isadmin()) {
error("Only the admin can use this page");
}
$strdatabaseperformance = get_string("databaseperformance");
$stradministration = get_string("administration");
$site = get_site();
if (isset($topframe)) {
print_header("$site->shortname: $strdatabaseperformance", "$site->fullname",
"<a target=\"$CFG->framename\" href=\"index.php\">$stradministration</a> -> Database performance");
exit;
}
if (isset($bottomframe) or isset($_GET['do'])) {
$perf =&NewPerfMonitor($db);
$perf->UI($pollsecs=5);
exit;
}
?>
<head>
<title><?php echo "$site->shortname: $strdatabaseperformance" ?></title>
</head>
<frameset rows="80,*">
<frame src="dbperformance.php?topframe=true">
<frame src="dbperformance.php?bottomframe=true">
</frameset>
+139
View File
@@ -0,0 +1,139 @@
<?php print_simple_box_start("center", "", "$THEME->cellheading"); ?>
<form name="filters" id="filters" method="post" action="filters.php">
<table align="center" border="0" cellpadding="5" cellspacing="0">
<tr>
<td valign="top"><div align="right">
<br />
<input name="up" type="submit" id="up" value="&uarr;" />
<br />
<input name="down" type="submit" id="down" value="&darr;" />
<br />
</div></td>
<td valign="top">
<?php p($stractive) ?>
<br />
<select name="iselect" size="20" id="iselect"
onclick="document.filters.add.disabled=true;
document.filters.remove.disabled=false;
document.filters.uselect.selectedIndex=-1;">
<?php
$runscript = "";
foreach ($installedfilters as $filter) {
if ($selectedfilter == $filter) {
$selected = " selected ";
$runscript = "eval(\"document.filters.add.disabled=true\");
eval(\"document.filters.remove.disabled=false\");
eval(\"document.filters.uselect.selectedIndex=-1\");";
} else {
$selected = "";
}
echo "<option value=\"$filter\" $selected>".$allfilters[$filter]."</option>";
}
?>
</select></td>
<td valign="top">
<br />
<input name="add" type="submit" id="add" value="&larr;" />
<br />
<input name="remove" type="submit" id="remove" value="&rarr;" />
<br />
</td>
<td valign="top">
<?php p($strinactive) ?>
<br />
<select name="uselect" size="20" id="select"
onclick="document.filters.add.disabled=false;
document.filters.remove.disabled=true;
document.filters.iselect.selectedIndex=-1;">
<?php
foreach ($uninstalledfilters as $filter) {
if ($selectedfilter == $filter) {
$selected = " selected ";
$runscript = "eval(\"document.filters.add.disabled=false\");
eval(\"document.filters.remove.disabled=true\");
eval(\"document.filters.iselect.selectedIndex=-1\");";
} else {
$selected = "";
}
echo "<option value=\"$filter\" $selected>".$allfilters[$filter]."</option>";
}
?>
</select></td>
</tr>
</table>
</form>
<script language="Javascript">
<!--
<?php echo $runscript ?>
-->
</script>
<?php print_simple_box_end(); ?>
<br />
<br />
<?php print_simple_box_start("center", "", "$THEME->cellheading"); ?>
<form name="options" id="options" method="post" action="filters.php">
<input type="hidden" name="options" value="1">
<table cellpadding="20">
<tr valign=top>
<td nowrap="nowrap" align="right"><?php p($strcachetext) ?>:</td>
<td>
<?php
unset($options);
$options[10800] = get_string('numhours', '', 3);
$options[7200] = get_string('numhours', '', 2);
$options[3600] = get_string('numhours', '', 1);
$options[2700] = get_string('numminutes', '', 45);
$options[1800] = get_string('numminutes', '', 30);
$options[900] = get_string('numminutes', '', 15);
$options[600] = get_string('numminutes', '', 10);
$options[540] = get_string('numminutes', '', 9);
$options[480] = get_string('numminutes', '', 8);
$options[420] = get_string('numminutes', '', 7);
$options[360] = get_string('numminutes', '', 6);
$options[300] = get_string('numminutes', '', 5);
$options[240] = get_string('numminutes', '', 4);
$options[180] = get_string('numminutes', '', 3);
$options[120] = get_string('numminutes', '', 2);
$options[60] = get_string('numminutes', '', 1);
$options[30] = get_string('numseconds', '', 30);
$options[0] = get_string('no');
choose_from_menu ($options, "cachetext", $CFG->cachetext, "", "", "");
?>
</td>
<td>
<?php p($strconfigcachetext) ?>
</td>
</tr>
<tr valign=top>
<td nowrap="nowrap" align="right"><?php p($strfilteruploadedfiles) ?>:</td>
<td>
<?php
unset($options);
$options[0] = get_string('no');
$options[1] = get_string('yes');
choose_from_menu ($options, "filteruploadedfiles", $CFG->filteruploadedfiles, "", "", "");
?>
</td>
<td>
<?php p($strconfigfilteruploadedfiles) ?>
</td>
</tr>
<tr valign=top>
<td>&nbsp;</td>
<td><input type="submit" value="<?php print_string("savechanges") ?>"></td>
<td>&nbsp;</td>
</tr>
</table>
</form>
<?php print_simple_box_end(); ?>
+169
View File
@@ -0,0 +1,169 @@
<?PHP // $Id$
// Allows the admin to create, delete and rename course categories
require_once("../config.php");
optional_variable($iselect);
optional_variable($uselect);
optional_variable($add);
optional_variable($remove);
optional_variable($up);
optional_variable($down);
if (!isadmin()) {
error("Only administrators can use this page!");
}
if (!$site = get_site()) {
error("Site isn't defined!");
}
/// Print headings
$stradministration = get_string("administration");
$strconfiguration = get_string("configuration");
$strmanagefilters = get_string("managefilters");
$strversion = get_string("version");
$strsettings = get_string("settings");
$strup = get_string("up");
$strdown = get_string("down");
$stractive = get_string("active");
$strinactive = get_string("inactive");
$strcachetext = get_string("cachetext", "admin");
$strconfigcachetext = get_string("configcachetext");
$strfilteruploadedfiles = get_string("filteruploadedfiles", "admin");
$strconfigfilteruploadedfiles = get_string("configfilteruploadedfiles");
print_header("$site->shortname: $strmanagefilters", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> -> $strmanagefilters");
print_heading($strmanagefilters);
/// Make a list of all available filters and the best names for them we can find
$allfilters = array();
$filterlocations = array("mod", "filter");
foreach ($filterlocations as $filterlocation) {
$plugins = get_list_of_plugins($filterlocation);
foreach ($plugins as $key => $plugin) {
if (is_readable("$CFG->dirroot/$filterlocation/$plugin/filter.php")) {
$name = get_string("filtername", $plugin);
if ($name == "[[filtername]]") {
$name = $plugin;
}
$allfilters["$filterlocation/$plugin"] = $name;
}
}
}
/// Make an array of all the currently installed filters
$installedfilters = array();
if (!empty($CFG->textfilters)) {
$installedfilters = explode(',',$CFG->textfilters);
// Do a little cleanup for robustness
foreach ($installedfilters as $key => $installedfilter) {
if (empty($installedfilter)) {
unset($installedfilters[$key]);
set_config("textfilters", implode(',', $installedfilters));
}
}
}
$selectedfilter = "none";
/// If data submitted, then process and store.
if (!empty($options)) {
if ($config = data_submitted()) {
unset($config->options);
foreach ($config as $name => $value) {
set_config($name, $value);
}
}
}
if (!empty($add) and !empty($uselect)) {
$selectedfilter = $uselect;
if (!in_array($selectedfilter, $installedfilters)) {
$installedfilters[] = $selectedfilter;
set_config("textfilters", implode(',', $installedfilters));
}
} else if (!empty($remove) and !empty($iselect)) {
$selectedfilter = $iselect;
foreach ($installedfilters as $key => $installedfilter) {
if ($installedfilter == $selectedfilter) {
unset($installedfilters[$key]);
}
}
set_config("textfilters", implode(',', $installedfilters));
} else if ((!empty($up) or !empty($down)) and !empty($iselect)) {
if (!empty($up)) {
if ($allfilters[$iselect]) {
foreach ($installedfilters as $key => $installedfilter) {
if ($installedfilter == $iselect) {
$movefilter = $key;
break;
}
$swapfilter = $key;
}
}
}
if (!empty($down)) {
if ($allfilters[$iselect]) {
$choosenext = false;
foreach ($installedfilters as $key => $installedfilter) {
if ($choosenext) {
$swapfilter = $key;
break;
}
if ($installedfilter == $iselect) {
$movefilter = $key;
$choosenext = true;
}
}
}
}
if (isset($swapfilter) and isset($movefilter)) {
$tempfilter = $installedfilters[$swapfilter];
$installedfilters[$swapfilter] = $installedfilters[$movefilter];
$installedfilters[$movefilter] = $tempfilter;
set_config("textfilters", implode(',', $installedfilters));
}
$selectedfilter = $iselect;
}
/// Make an array of all the currently uninstalled filters
$uninstalledfilters = array();
foreach ($allfilters as $filter => $name) {
$installed = false;
foreach ($installedfilters as $installedfilter) {
if ($installedfilter == $filter) {
$installed = true;
}
}
if (!$installed) {
$uninstalledfilters[] = $filter;
}
}
/// Print the current form
include("filters.html");
print_footer();
?>
+40 -7
View File
@@ -54,7 +54,7 @@
/// Check settings in config.php
$dirroot = dirname(realpath("../config.php"));
$dirroot = dirname(realpath("../index.php"));
if (!empty($dirroot) and $dirroot != $CFG->dirroot) {
error("Please fix your settings in config.php:
<P>You have:
@@ -75,7 +75,9 @@
$CFG->version = "";
}
/// Turn off time limits, sometimes upgrades can be slow.
set_time_limit(0);
/// Check if the main tables have been installed yet or not.
@@ -115,7 +117,6 @@
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
if (modify_database("$CFG->libdir/db/$CFG->dbtype.sql")) {
$db->debug = false;
notify($strdatabasesuccess, "green");
@@ -237,17 +238,32 @@
continue;
}
if (!isset($module)) {
continue;
}
if (!empty($module->requires)) {
if ($module->requires > $CFG->version) {
$info->modulename = $mod;
$info->moduleversion = $module->version;
$info->currentmoodle = $CFG->version;
$info->requiremoodle = $module->requires;
notify(get_string('modulerequirementsnotmet', 'error', $info));
unset($info);
continue;
}
}
$module->name = $mod; // The name MUST match the directory
if ($currmodule = get_record("modules", "name", $module->name)) {
if ($currmodule->version == $module->version) {
// do nothing
} else if ($currmodule->version < $module->version) {
if (empty($updated_modules)) {
$strmodulesetup = get_string("modulesetup");
print_header($strmodulesetup, $strmodulesetup, $strmodulesetup, "", "", false, "&nbsp;", "&nbsp;");
}
print_heading("$module->name module needs upgrading");
$upgrade_function = $module->name."_upgrade";
if (function_exists($upgrade_function)) {
@@ -330,6 +346,8 @@
}
/// Check for valid admin user
require_login();
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
@@ -342,6 +360,12 @@
print_simple_box_start("center", "100%", "$THEME->cellcontent2", 20);
print_heading($stradministration);
if (!empty($CFG->upgrade)) { // Print notice about extra upgrading that needs to be done
print_simple_box(get_string("upgrade$CFG->upgrade", "admin",
"$CFG->wwwroot/$CFG->admin/upgrade$CFG->upgrade.php"), "center");
print_spacer(10,10);
}
$table->tablealign = "right";
$table->align = array ("right", "left");
$table->wrap = array ("nowrap", "nowrap");
@@ -359,6 +383,12 @@
get_string("adminhelplanguage")."</font><br />";
$configdata .= "<font size=+1>&nbsp;</font><a href=\"modules.php\">".get_string("managemodules")."</a> - <font size=1>".
get_string("adminhelpmanagemodules")."</font><br />";
$configdata .= "<font size=+1>&nbsp;</font><a href=\"filters.php\">".get_string("managefilters")."</a> - <font size=1>".
get_string("adminhelpmanagefilters")."</font><br />";
if (!isset($CFG->disablescheduledbackups)) {
$configdata .= "<font size=+1>&nbsp;</font><a href=\"backup.php\">".get_string("backup")."</a> - <font size=1>".
get_string("adminhelpbackup")."</font><br />";
}
$table->data[] = array("<font size=+1><b><a href=\"configure.php\">".get_string("configuration")."</a></b>",
$configdata);
@@ -367,10 +397,13 @@
$userdata = "<font size=+1>&nbsp;</font><a href=\"auth.php\">".get_string("authentication")."</a> - <font size=1>".
get_string("adminhelpauthentication")."</font><br />";
if ($CFG->auth == "email" || $CFG->auth == "none" || $CFG->auth == "manual") {
if (is_internal_auth()) {
$userdata .= "<font size=+1>&nbsp;</font><a href=\"$CFG->wwwroot/$CFG->admin/user.php?newuser=true\">".
get_string("addnewuser")."</a> - <font size=1>".
get_string("adminhelpaddnewuser")."</font><br />";
$userdata .= "<font size=+1>&nbsp;</font><a href=\"$CFG->wwwroot/$CFG->admin/uploaduser.php\">".
get_string("uploadusers")."</a> - <font size=1>".
get_string("adminhelpuploadusers")."</font><br />";
}
$userdata .= "<font size=+1>&nbsp;</font><a href=\"user.php\">".get_string("edituser")."</a> - <font size=1>".
get_string("adminhelpedituser")."</font><br />";
@@ -388,11 +421,11 @@
$table->data[] = array("<font size=+1><b><a href=\"../course/index.php?edit=on\">".get_string("courses")."</a></b>",
"<font size=+1>&nbsp;</font>".get_string("adminhelpcourses"));
$table->data[] = array("<font size=+1><b><a href=\"../course/log.php?id=$site->id.php\">".get_string("logs")."</a></b>",
$table->data[] = array("<font size=+1><b><a href=\"../course/log.php?id=$site->id\">".get_string("logs")."</a></b>",
"<font size=+1>&nbsp;</font>".get_string("adminhelplogs"));
$table->data[] = array("<font size=+1><b><a href=\"../files/index.php?id=$site->id\">".get_string("sitefiles")."</a></b>",
"<font size=+1>&nbsp;</font>".get_string("adminhelpsitefiles"));
if (file_exists("$CFG->dirroot/admin/$CFG->dbtype")) {
if (file_exists("$CFG->dirroot/$CFG->admin/$CFG->dbtype")) {
$table->data[] = array("<font size=+1><b><a href=\"$CFG->dbtype/frame.php\">".get_string("managedatabase")."</a></b>",
"<font size=+1>&nbsp;</font>".get_string("adminhelpmanagedatabase"));
}
@@ -403,7 +436,7 @@
//// IT IS ILLEGAL AND A VIOLATION OF THE GPL TO REMOVE OR MODIFY THE COPYRIGHT NOTICE BELOW ////
$copyrighttext = "<a href=\"http://moodle.org/\">Moodle</a> ".
"<a href=\"../doc/?frame=release.html\">$CFG->release</a> ($CFG->version)<br />".
"Copyright &copy; 2000-2003 Martin Dougiamas<br />".
"Copyright &copy; 1999-2004 Martin Dougiamas<br />".
"<a href=\"../doc/?frame=licence.html\">GNU Public License</a>";
echo "<center><p><font size=1>$copyrighttext</font></p></center>";
//////////////////////////////////////////////////////////////////////////////////////////////////
+113 -100
View File
@@ -3,6 +3,7 @@
require_once("../config.php");
optional_variable($mode, "");
optional_variable($currentfile, "moodle.php");
require_login();
@@ -44,7 +45,13 @@
"<a href=\"configure.php\">$strconfiguration</a> -> $navigation");
if (!$mode) {
print_heading("$strcurrentlanguage: $currentlang - ".get_string("thislanguage"));
$currlang = current_language();
$langs = get_list_of_languages();
echo "<table align=center><tr><td align=\"right\">";
echo "<b>$strcurrentlanguage:</b>";
echo "</td><td>";
echo popup_form ("$CFG->wwwroot/admin/lang.php?lang=", $langs, "chooselang", $currlang, "", "", "", true);
echo "</td></tr></table>";
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>";
@@ -65,7 +72,7 @@
}
foreach ($stringfiles as $key => $file) {
if ($file == "README" or $file == "help" or $file == "docs" or $file == "fonts") {
if (substr($file, -4) != ".php") {
unset($stringfiles[$key]);
}
}
@@ -135,114 +142,119 @@
} else if ($mode == "compare") {
if (isset($_POST['file'])){ // Save a file
if (isset($_POST['currentfile'])){ // Save a file
$newstrings = $_POST;
$file = $newstrings['file'];
unset($newstrings['file']);
if (lang_save_file($langdir, $file, $newstrings)) {
notify(get_string("changessaved")." ($langdir/$file)");
unset($newstrings['currentfile']);
if (lang_save_file($langdir, $currentfile, $newstrings)) {
notify(get_string("changessaved")." ($langdir/$currentfile)", "green");
} else {
error("Could not save the file '$file'!", "lang.php?mode=compare");
error("Could not save the file '$currentfile'!", "lang.php?mode=compare&currentfile=$currentfile");
}
}
print_heading($strcomparelanguage);
echo "<center>";
helpbutton("langedit",$strcomparelanguage);
echo "</center>";
print_heading_with_help($strcomparelanguage, "langedit");
print_simple_box_start("center", "80%");
echo '<center><font size="2">';
foreach ($stringfiles as $file) {
print_heading("$file", "LEFT", 4);
if (!file_exists("$langdir/$file")) {
if (!touch("$langdir/$file")) {
echo "<p><font color=red>".get_string("filemissing", "", "$langdir/$file")."</font></p>";
continue;
}
}
error_reporting(0);
if ($f = fopen("$langdir/$file","r+")) {
$editable = true;
fclose($f);
if ($file == $currentfile) {
echo "<b>$file</b> &nbsp; ";
} else {
$editable = false;
echo "<p><font size=1>".get_string("makeeditable", "", "$langdir/$file")."</font></p>";
echo "<a href=\"lang.php?mode=compare&currentfile=$file\">$file</a> &nbsp; ";
}
error_reporting(7);
}
echo '</font></center>';
print_simple_box_end();
print_heading("$currentfile", "center", 4);
unset($string);
include("$enlangdir/$file");
$enstring = $string;
ksort($enstring);
unset($string);
include("$langdir/$file");
if ($editable) {
echo "<form name=\"$file\" action=\"lang.php\" method=\"post\">";
if (!file_exists("$langdir/$currentfile")) {
if (!touch("$langdir/$currentfile")) {
echo "<p><font color=red>".get_string("filemissing", "", "$langdir/$currentfile")."</font></p>";
continue;
}
echo "<table width=\"100%\" cellpadding=2 cellspacing=3 border=0>";
foreach ($enstring as $key => $envalue) {
$envalue = nl2br(htmlspecialchars($envalue));
$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 = $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;
if ($editable) {
echo "<td width=40% bgcolor=\"$cellcolour\" valign=top>";
if (isset($string[$key])) {
$valuelen = strlen($value);
} else {
$valuelen = strlen($envalue);
}
$cols=50;
if (strstr($value, "\r") or strstr($value, "\n") or $valuelen > $cols) {
$rows = ceil($valuelen / $cols);
echo "<textarea name=\"string-$key\" cols=\"$cols\" rows=\"$rows\">$value</textarea>";
} else {
if ($valuelen) {
$cols = $valuelen + 2;
}
echo "<input type=\"text\" name=\"string-$key\" value=\"$value\" size=\"$cols\"></td>";
}
echo "</TD>";
} else {
echo "<td width=40% bgcolor=\"$cellcolour\" valign=top>$value</td>";
}
}
if ($editable) {
echo "<tr><td colspan=2>&nbsp;<td>";
echo " <input type=\"hidden\" name=\"file\" value=\"$file\">";
echo " <input type=\"hidden\" name=\"mode\" value=\"compare\">";
echo " <input type=\"submit\" name=\"update\" value=\"".get_string("savechanges").": $file\">";
echo "</td></tr>";
}
echo "</table>";
echo "</form>";
}
print_continue("lang.php");
error_reporting(0);
if ($f = fopen("$langdir/$currentfile","r+")) {
$editable = true;
fclose($f);
} else {
$editable = false;
echo "<p><font size=1>".get_string("makeeditable", "", "$langdir/$currentfile")."</font></p>";
}
error_reporting(7);
unset($string);
include("$enlangdir/$currentfile");
$enstring = $string;
ksort($enstring);
unset($string);
include("$langdir/$currentfile");
if ($editable) {
echo "<form name=\"$currentfile\" action=\"lang.php\" method=\"post\">";
}
echo "<table width=\"100%\" cellpadding=2 cellspacing=3 border=0>";
foreach ($enstring as $key => $envalue) {
$envalue = nl2br(htmlspecialchars($envalue));
$envalue = preg_replace('/(\$a\-\&gt;[a-zA-Z0-9]*|\$a)/', '<b>$0</b>', $envalue); // Make variables bold.
$envalue = str_replace("%%","%",$envalue);
$envalue = str_replace("\\","",$envalue); // Delete all slashes
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 = $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;
if ($editable) {
echo "<td width=40% bgcolor=\"$cellcolour\" valign=top>";
if (isset($string[$key])) {
$valuelen = strlen($value);
} else {
$valuelen = strlen($envalue);
}
$cols=50;
if (strstr($value, "\r") or strstr($value, "\n") or $valuelen > $cols) {
$rows = ceil($valuelen / $cols);
echo "<textarea name=\"string-$key\" cols=\"$cols\" rows=\"$rows\">$value</textarea>";
} else {
if ($valuelen) {
$cols = $valuelen + 2;
}
echo "<input type=\"text\" name=\"string-$key\" value=\"$value\" size=\"$cols\"></td>";
}
echo "</TD>";
} else {
echo "<td width=40% bgcolor=\"$cellcolour\" valign=top>$value</td>";
}
}
if ($editable) {
echo "<tr><td colspan=2>&nbsp;<td><br />";
echo " <input type=\"hidden\" name=\"currentfile\" value=\"$currentfile\">";
echo " <input type=\"hidden\" name=\"mode\" value=\"compare\">";
echo " <input type=\"submit\" name=\"update\" value=\"".get_string("savechanges").": $currentfile\">";
echo "</td></tr>";
}
echo "</table>";
echo "</form>";
}
print_footer();
@@ -257,7 +269,7 @@ function lang_save_file($path, $file, $strings) {
// $file is the file to overwrite.
// $strings is an array of strings to write
global $CFG;
global $CFG, $USER;
error_reporting(0);
if (!$f = fopen("$path/$file","w")) {
@@ -276,11 +288,12 @@ function lang_save_file($path, $file, $strings) {
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); // Add slashes for "
$value = str_replace("%","%%",$value); // Escape % characters
$value = str_replace("\r", "",$value); // Remove linefeed characters
if ($id == "string" and $value != ""){
fwrite($f,"\$string['$stringname'] = \"$value\";\n");
fwrite($f,"\$string['$stringname'] = '$value';\n");
}
}
fwrite($f,"\n?>\n");
+2 -2
View File
@@ -37,10 +37,10 @@
$strmanagemodules = get_string("managemodules");
$strmodulename = get_string("modulename", $module);
print_header("$site->shortname: $strconfigvariables", $site->fullname,
print_header("$site->shortname: $strmodulename: $strconfiguration", $site->fullname,
"<a href=\"index.php\">$stradmin</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> -> ".
"<a href=\"modules.php\">$strmanagemodules</a> -> $strmodulename", $focus);
"<a href=\"modules.php\">$strmanagemodules</a> -> $strmodulename");
print_heading($strmodulename);
+9 -5
View File
@@ -24,9 +24,11 @@
$strconfiguration = get_string("configuration");
$strmanagemodules = get_string("managemodules");
$strdelete = get_string("delete");
$strversion = get_string("version");
$strhide = get_string("hide");
$strshow = get_string("show");
$strsettings = get_string("settings");
$stractivities = get_string("activities");
$stractivitymodule = get_string("activitymodule");
print_header("$site->shortname: $strmanagemodules", "$site->fullname",
@@ -148,10 +150,10 @@
$modpixpath = "../theme/$CFG->theme/pix/mod";
}
$table->head = array ($stractivitymodule, "$strhide/$strshow", $strdelete, $strsettings);
$table->align = array ("LEFT", "CENTER", "CENTER", "CENTER");
$table->wrap = array ("NOWRAP", "", "","");
$table->size = array ("100%", "10", "10","12");
$table->head = array ($stractivitymodule, $stractivities, $strversion, "$strhide/$strshow", $strdelete, $strsettings);
$table->align = array ("LEFT", "RIGHT", "LEFT", "CENTER", "CENTER", "CENTER");
$table->wrap = array ("NOWRAP", "", "", "", "","");
$table->size = array ("100%", "10", "10", "10", "10","12");
$table->width = "100";
foreach ($modulebyname as $modulename => $module) {
@@ -166,6 +168,8 @@
$settings = "";
}
$count = count_records("$module->name");
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>";
@@ -180,7 +184,7 @@
$visible = "";
$class = "";
}
$table->data[] = array ("<p $class>$icon $modulename</p>", $visible, $delete, $settings);
$table->data[] = array ("<p $class>$icon $modulename</p>", $count, $module->version, $visible, $delete, $settings);
}
print_table($table);
+2 -3
View File
@@ -2,7 +2,6 @@
// register.php - allows admin to register their site on moodle.org
include("../config.php");
require_once("../lib/countries.php");
require_login();
@@ -81,7 +80,7 @@
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")."...", "", "");
choose_from_menu (get_list_of_countries(), "country", $admin->country, get_string("selectacountry")."...", "", "");
echo "</td>\n";
echo "</tr>\n";
@@ -102,7 +101,7 @@
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 "<td><p><input size=50 type=\"text\" name=\"adminname\" value=\"".fullname($admin, true)."\"></td>\n";
echo "</tr>\n";
echo "<tr valign=top>\n";
+1
View File
@@ -52,6 +52,7 @@
if ($site and empty($form)) {
$form = $site;
$course = $site;
$firsttime = false;
} else {
$form->fullname = "";
+57
View File
@@ -0,0 +1,57 @@
<?php // $Id$
include("../config.php");
require_login();
if (!isadmin()) {
error("You must be an admin");
}
$strtimezone = get_string("timezone");
$strsavechanges = get_string("savechanges");
$strusers = get_string("users");
$strall = get_string("all");
print_header($strtimezone, $strtimezone, $strtimezone);
print_heading("");
if (isset($zone)) {
$db->debug = true;
echo "<center>";
execute_sql("UPDATE {$CFG->prefix}user SET timezone = '$zone'");
$db->debug = false;
echo "</center>";
$USER->timezone = $zone;
}
$user = $USER;
if (abs($user->timezone) > 13) {
$user->timezone = 99;
}
$timenow = time();
for ($tz = -26; $tz <= 26; $tz++) {
$zone = (float)$tz/2.0;
$usertime = $timenow + ($tz * 1800);
if ($tz == 0) {
$timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT)";
} else if ($tz < 0) {
$timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT$zone)";
} else {
$timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT+$zone)";
}
}
echo "<center><form action=timezone.php method=get>";
echo "$strusers ($strall): ";
choose_from_menu ($timezones, "zone", $user->timezone, get_string("serverlocaltime"), "", "99");
echo "<input type=submit value=\"$strsavechanges\">";
echo "</form>";
print_footer();
?>
+131
View File
@@ -0,0 +1,131 @@
<?PHP //$Id$
require("../config.php");
optional_variable($confirm);
require_login();
if (!isadmin()) {
error("You must be an admin to use this script");
}
if ($CFG->version < 2004013101) {
error("This script does not work with this old version of Moodle");
}
if (!$site = get_site()) {
redirect("index.php");
}
/// Turn off time limits, sometimes upgrades can be slow.
set_time_limit(0);
/// Print header
$stradministration = get_string("administration");
$strupgradinglogs = get_string("upgradinglogs", "admin");
print_header("$site->shortname: $stradministration: $strupgradinglogs", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> $strupgradinglogs");
if (empty($_GET['confirm'])) {
notice_yesno(get_string("upgradelogsinfo", "admin"),
"upgradelogs.php?confirm=true",
"index.php");
print_footer();
exit;
}
/// Try and extract as many cmids as possible from the existing logs
if ($coursemodules = get_records_sql("SELECT cm.*, m.name
FROM {$CFG->prefix}course_modules cm,
{$CFG->prefix}modules m
WHERE cm.module = m.id")) {
$cmcount = count($coursemodules);
$count = 0;
$starttime = time();
$sleeptime = 0;
if ($CFG->dbtype == "mysql") {
$LIKE = "LIKE";
} else {
$LIKE = "ILIKE";
}
if ($cmcount > 10) {
print_simple_box('This process may take a very long time ... please be patient and let it finish.',
'center', '', '#ffcccc');
$sleeptime = 1;
}
foreach ($coursemodules as $cm) {
switch ($cm->name) {
case "forum":
execute_sql("UPDATE {$CFG->prefix}log SET cmid = '$cm->id'
WHERE module = '$cm->name' AND url = 'view.php?id=$cm->id'", false);
execute_sql("UPDATE {$CFG->prefix}log SET cmid = '$cm->id'
WHERE module = '$cm->name' AND url = 'view.php?f=$cm->instance'", false);
if ($discussions = get_records("forum_discussions", "forum", $cm->instance)) {
foreach ($discussions as $discussion) {
execute_sql("UPDATE {$CFG->prefix}log SET cmid = '$cm->id'
WHERE module = '$cm->name' AND url $LIKE 'discuss.php?d=$discussion->id%'", false);
}
}
break;
case "glossary":
execute_sql("UPDATE {$CFG->prefix}log SET cmid = '$cm->id'
WHERE module = '$cm->name' AND url $LIKE 'view.php?id=$cm->id%'", false);
break;
case "quiz":
execute_sql("UPDATE {$CFG->prefix}log SET cmid = '$cm->id'
WHERE module = '$cm->name' AND url = 'view.php?id=$cm->id'", false);
break;
case "assignment":
execute_sql("UPDATE {$CFG->prefix}log SET cmid = '$cm->id'
WHERE module = '$cm->name' AND url = 'view.php?id=$cm->id'", false);
execute_sql("UPDATE {$CFG->prefix}log SET cmid = '$cm->id'
WHERE module = '$cm->name' AND url = 'view.php?a=$cm->instance'", false);
execute_sql("UPDATE {$CFG->prefix}log SET cmid = '$cm->id'
WHERE module = '$cm->name' AND url = 'submissions.php?id=$cm->instance'", false);
break;
case "journal":
execute_sql("UPDATE {$CFG->prefix}log SET cmid = '$cm->id'
WHERE module = '$cm->name' AND url = 'report.php?id=$cm->id'", false);
execute_sql("UPDATE {$CFG->prefix}log SET cmid = '$cm->id'
WHERE module = '$cm->name' AND url = 'view.php?id=$cm->id'", false);
break;
}
$count++;
$elapsedtime = time() - $starttime;
$projectedtime = (int)(((float)$cmcount / (float)$count) * $elapsedtime) - $elapsedtime;
if ($cmcount > 10) {
notify("Processed $count of $cmcount coursemodules. Estimated completion: ".format_time($projectedtime));
flush();
sleep($sleeptime); // To help reduce database load
}
}
}
delete_records("config", "name", "upgrade", "value", "logs");
notify("Log upgrading was successful!");
print_footer();
?>
+271
View File
@@ -0,0 +1,271 @@
<?PHP // $Id$
/// Bulk user registration script from a comma separated file
/// Returns list of users with their user ids
require_once("../config.php");
optional_variable($numusers, 0);
require_login();
if (!isadmin()) {
error("You must be an administrator to edit users this way.");
}
if (! $site = get_site()) {
error("Could not find site-level course");
}
if (!$adminuser = get_admin()) {
error("Could not find site admin");
}
$streditmyprofile = get_string("editmyprofile");
$stradministration = get_string("administration");
$strchoose = get_string("choose");
$struser = get_string("user");
$strusers = get_string("users");
$strusersnew = get_string("usersnew");
$struploadusers = get_string("uploadusers");
$straddnewuser = get_string("importuser");
/// Print the header
print_header("$site->shortname: $struploadusers", $site->fullname,
"<a href=\"index.php\">$stradministration</a> ->
<a href=\"users.php\">$strusers</a> -> $struploadusers");
/// If a file has been uploaded, then process it
if ($filename = valid_uploaded_file($_FILES['userfile'])) {
//Fix mac/dos newlines
$text = my_file_get_contents($filename);
$text = preg_replace('!\r\n?!',"\n",$text);
$fp = fopen($filename, "w");
fwrite($fp,$text);
fclose($fp);
$fp = fopen($filename, "r");
// make arrays of valid fields for error checking
$required = array("username" => 1,
"password" => 1,
"firstname" => 1,
"lastname" => 1,
"email" => 1);
$optionalDefaults = array("institution" => 1,
"department" => 1,
"city" => 1,
"country" => 1,
"lang" => 1,
"timezone" => 1);
$optional = array("idnumber" => 1,
"icq" => 1,
"phone1" => 1,
"phone2" => 1,
"address" => 1,
"url" => 1,
"description" => 1,
"mailformat" => 1,
"maildisplay" => 1,
"htmleditor" => 1,
"autosubscribe" => 1,
"idnumber" => 1,
"icq" => 1,
"course1" => 1,
"course2" => 1,
"course3" => 1,
"course4" => 1,
"course5" => 1,
"group1" => 1,
"group2" => 1,
"group3" => 1,
"group4" => 1,
"group5" =>1);
// --- get header (field names) ---
$header = split("\,", fgets($fp,1024));
// check for valid field names
foreach ($header as $i => $h) {
$h = trim($h); $header[$i] = $h; // remove whitespace
if (!($required[$h] or $optionalDefaults[$h] or $optional[$h])) {
error(get_string('invalidfieldname', 'error', $h), 'uploaduser.php');
}
if ($required[$h]) {
$required[$h] = 2;
}
}
// check for required fields
foreach ($required as $key => $value) {
if ($value < 2) {
error(get_string('fieldrequired', 'error', $key), 'uploaduser.php');
}
}
$linenum = 2; // since header is line 1
while (!feof ($fp)) {
foreach ($optionalDefaults as $key => $value) {
$user->$key = addslashes($adminuser->$key);
}
//Note: commas within a field should be encoded as &#44
$line = split("\,", fgets($fp,1024));
foreach ($line as $key => $value) {
//decode encoded commas
$record[$header[$key]] = preg_replace('/\&\#44/',',',trim($value));
}
if ($record[$header[0]]) {
// add a new user to the database
optional_variable($newuser, "");
// add fields to object $user
foreach ($record as $name => $value) {
// check for required values
if ($required[$name] and !$value) {
error(get_string('missingfield', 'error', $name). " ".
get_string('erroronline', 'error', $linenum),
'uploaduser.php');
}
// password needs to be encrypted
else if ($name == "password") {
$user->password = md5($value);
}
// normal entry
else {
$user->{$name} = addslashes($value);
}
}
$user->confirmed = 1;
$user->timemodified = time();
$linenum++;
$username = $user->username;
$addcourse[0] = $user->course1;
$addcourse[1] = $user->course2;
$addcourse[2] = $user->course3;
$addcourse[3] = $user->course4;
$addcourse[4] = $user->course5;
$addgroup[0] = $user->group1;
$addgroup[1] = $user->group2;
$addgroup[2] = $user->group3;
$addgroup[3] = $user->group4;
$addgroup[4] = $user->group5;
$courses = get_courses("all");
for ($i=0; $i<5; $i++) {
$courseid[$i]=0;
}
foreach ($courses as $course) {
for ($i=0; $i<5; $i++) {
if ($course->shortname == $addcourse[$i]) {
$courseid[$i] = $course->id;
}
}
}
if (! $user->id = insert_record("user", $user)) {
if (!$user = get_record("user", "username", "changeme")) { // half finished user from another time
//Record not added - probably because user is already registered
//In this case, output userid from previous registration
//This can be used to obtain a list of userids for existing users
if ($user = get_record("user","username",$username)) {
notify("$user->id ".get_string('usernotaddedregistered', 'error', $username));
} else {
notify(get_string('usernotaddederror', 'error', $username));
}
}
} else if ($user->username != "changeme") {
notify("$struser: $user->id = $user->username");
$numusers++;
}
for ($i=0; $i<5; $i++) {
if ($addcourse[$i] && !$courseid[$i]) {
notify(get_string('unknowncourse', 'error', $addcourse[$i]));
}
}
for ($i=0; $i<5; $i++) {
$groupid[$i] = 0;
if ($addgroup[$i]) {
if (!$courseid[$i]) {
notify(get_string('coursegroupunknown','error',$addgroup[$i]));
} else {
if ($group = get_record("groups","courseid",$courseid[$i],"name",$addgroup[$i])) {
$groupid[$i] = $group->id;
} else {
notify(get_string('groupunknown','error',$addgroup[$i]));
}
}
}
}
for ($i=0; $i<5; $i++) {
if ($courseid[$i]) {
if (enrol_student($user->id, $courseid[$i])) {
notify('-->'. get_string('enrolledincourse', '', $addcourse[$i]));
} else {
notify('-->'.get_string('enrolledincoursenot', '', $addcourse[$i]));
}
}
}
for ($i=0; $i<5; $i++) {
if ($courseid[$i] && $groupid[$i]) {
if (record_exists("user_students","userid",$user->id,"course",$courseid[$i])) {
$usergroup = user_group($courseid[$i],$user->id);
if ($usergroup) {
notify('-->' . get_string('groupalready','error',$usergroup->name));
} else {
$group_member->groupid = $groupid[$i];
$group_member->userid = $user->id;
$group_member->timeadded = time();
if (insert_record("groups_members",$group_member)) {
notify('-->' . get_string('addedtogroup','',$addgroup[$i]));
} else {
notify('-->' . get_string('addedtogroupnot','',$addgroup[$i]));
}
}
} else {
notify('-->' . get_string('addedtogroupnotenrolled','',$addgroup[$i]));
}
}
}
unset ($user);
}
}
fclose($fp);
notify("$strusersnew: $numusers");
echo '<hr />';
}
/// Print the form
print_heading_with_help($struploadusers, 'uploadusers');
$maxuploadsize = get_max_upload_file_size();
echo '<center>';
echo '<form method="post" enctype="multipart/form-data" action="uploaduser.php">'.
$strchoose.':<input type="hidden" name="MAX_FILE_SIZE" value="'.$maxuploadsize.'">'.
'<input type="file" name="userfile" size=30>'.
'<input type="submit" value="'.$struploadusers.'">'.
'</form></br>';
echo '</center>';
print_footer($course);
function my_file_get_contents($filename, $use_include_path = 0) {
/// Returns the file as one big long string
$data = "";
$file = @fopen($filename, "rb", $use_include_path);
if ($file) {
while (!feof($file)) {
$data .= fread($file, 1024);
}
fclose($file);
}
return $data;
}
?>
+173 -108
View File
@@ -1,18 +1,18 @@
<?PHP // $Id$
require_once("../config.php");
require_once("../user/lib.php");
require_once("../lib/countries.php");
$recordsperpage = 30;
optional_variable($newuser, "");
optional_variable($delete, "");
optional_variable($confirm, "");
optional_variable($confirmuser, "");
optional_variable($sort, "name");
optional_variable($dir, "ASC");
optional_variable($page, 0);
optional_variable($search, "");
optional_variable($lastinitial, ""); // only show students with this last initial
optional_variable($firstinitial, ""); // only show students with this first initial
optional_variable($perpage, "30"); // how many per page
unset($user);
unset($admin);
@@ -106,10 +106,34 @@
$strsearch = get_string("search");
$strshowallusers = get_string("showallusers");
print_header("$site->shortname: $stredituser", $site->fullname,
"<a href=\"index.php\">$stradministration</a> -> <a href=\"users.php\">$strusers</a> -> $stredituser");
if ($firstinitial or $lastinitial or $search or $page) {
print_header("$site->shortname: $stredituser", $site->fullname,
"<a href=\"index.php\">$stradministration</a> -> ".
"<a href=\"users.php\">$strusers</a> -> ".
"<a href=\"user.php\">$stredituser</a>");
} else {
print_header("$site->shortname: $stredituser", $site->fullname,
"<a href=\"index.php\">$stradministration</a> -> ".
"<a href=\"users.php\">$strusers</a> -> $stredituser");
}
if ($delete) { // Delete a selected user, after confirmation
if ($confirmuser) {
if (!$user = get_record("user", "id", "$confirmuser")) {
error("No such user!");
}
unset($confirmeduser);
$confirmeduser->id = $confirmuser;
$confirmeduser->confirmed = 1;
$confirmeduser->timemodified = time();
if (update_record("user", $confirmeduser)) {
notify(get_string("userconfirmed", "", fullname($user, true)) );
} else {
notify(get_string("usernotconfirmed", "", fullname($user, true)));
}
} else if ($delete) { // Delete a selected user, after confirmation
if (!$user = get_record("user", "id", "$delete")) {
error("No such user!");
}
@@ -120,7 +144,8 @@
}
if ($confirm != md5($delete)) {
notice_yesno(get_string("deletecheckfull", "", "'$user->firstname $user->lastname'"),
$fullname = fullname($user, true);
notice_yesno(get_string("deletecheckfull", "", "'$fullname'"),
"user.php?delete=$delete&confirm=".md5($delete), "user.php");
exit;
@@ -135,145 +160,185 @@
unenrol_student($user->id); // From all courses
remove_teacher($user->id); // From all courses
remove_admin($user->id);
notify(get_string("deletedactivity", "", "$user->firstname $user->lastname"));
notify(get_string("deletedactivity", "", fullname($user, true)) );
} else {
notify(get_string("deletednot", "", "$user->firstname $user->lastname"));
notify(get_string("deletednot", "", fullname($user, true)));
}
}
}
// Carry on with the user listing
$columns = array("name", "email", "city", "country", "lastaccess");
$columns = array("firstname", "lastname", "email", "city", "country", "lastaccess");
foreach ($columns as $column) {
$string[$column] = get_string("$column");
$columnsort = "$column";
if ($column == "lastaccess") {
$columndir = "DESC";
if ($sort != $column) {
$columnicon = "";
if ($column == "lastaccess") {
$columndir = "DESC";
} else {
$columndir = "ASC";
}
} else {
$columndir = "ASC";
}
if ($columnsort == $sort) {
$$column = $string[$column];
} else {
$$column = "<A HREF=\"user.php?sort=$columnsort&dir=$columndir&search=$search\">".$string[$column]."</A>";
$columndir = $dir == "asc" ? "desc":"asc";
if ($column == "lastaccess") {
$columnicon = $dir == "asc" ? "up":"down";
} else {
$columnicon = $dir == "asc" ? "down":"up";
}
$columnicon = " <img src=\"$CFG->pixpath/t/$columnicon.gif\" />";
}
$$column = "<a href=\"user.php?sort=$column&dir=$columndir&search=$search&firstinitial=$firstinitial&lastinitial=$lastinitial\">".$string[$column]."</a>$columnicon";
}
if ($sort == "name") {
$sort = "firstname";
}
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 = "";
}
}
$users = get_users_listing($sort, $dir, $page*$perpage, $perpage, $search, $firstinitial, $lastinitial);
$usercount = get_users(false);
$usersearchcount = get_users(false, $search, true, "", "", $firstinitial, $lastinitial);
if ($search) {
$usersearchcount = get_users(false, $search);
if ($search or $firstinitial or $lastinitial) {
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;
$alphabet = explode(',', get_string('alphabet'));
$strall = get_string("all");
/// Bar of first initials
echo "<center><p align=\"center\">";
echo get_string("firstname")." : ";
if ($firstinitial) {
echo " <a href=\"user.php?sort=firstname&dir=ASC&".
"perpage=$perpage&lastinitial=$lastinitial\">$strall</a> ";
} else {
echo " <b>$strall</b> ";
}
echo "<TABLE align=center cellpadding=10><TR>";
echo "<TD>";
if ($page) {
$prevpage = $page - $recordsperpage;
if ($prevpage < 0) {
$prevpage = 0;
foreach ($alphabet as $letter) {
if ($letter == $firstinitial) {
echo " <b>$letter</b> ";
} else {
echo " <a href=\"user.php?sort=firstname&dir=ASC&".
"perpage=$perpage&lastinitial=$lastinitial&firstinitial=$letter\">$letter</a> ";
}
$options["dir"] = $dir;
$options["page"] = 0;
$options["sort"] = $sort;
$options["search"] = $search;
print_single_button("user.php", $options, " << ");
echo "</TD><TD>";
$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>";
$options["page"] = $usercount-$recordsperpage;
print_single_button("user.php", $options, " >> ");
echo "<br />";
/// Bar of last initials
echo get_string("lastname")." : ";
if ($lastinitial) {
echo " <a href=\"user.php?sort=lastname&dir=ASC&".
"perpage=$perpage&firstinitial=$firstinitial\">$strall</a> ";
} else {
echo " <b>$strall</b> ";
}
echo "</TD></TR></TABLE>";
foreach ($alphabet as $letter) {
if ($letter == $lastinitial) {
echo " <b>$letter</b> ";
} else {
echo " <a href=\"user.php?sort=lastname&dir=ASC&".
"perpage=$perpage&firstinitial=$firstinitial&lastinitial=$letter\">$letter</a> ";
}
}
echo "</p>";
echo "</center>";
print_paging_bar($usercount, $page, $perpage,
"user.php?sort=$sort&dir=$dir&perpage=$perpage&firstinitial=$firstinitial&lastinitial=$lastinitial&search=$search&");
flush();
foreach ($users as $key => $user) {
if (!empty($user->country)) {
$users[$key]->country = $COUNTRIES[$user->country];
if (!$users) {
$match = array();
if ($search) {
$match[] = $search;
}
}
if ($sort == "country") { // Need to resort by full country name, not code
if ($firstinitial) {
$match[] = get_string("firstname").": $firstinitial"."___";
}
if ($lastinitial) {
$match[] = get_string("lastname").": $lastinitial"."___";
}
$matchstring = implode(", ", $match);
print_heading(get_string("nousersmatching", "", $matchstring));
} else {
$countries = get_list_of_countries();
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 ("$firstname / $lastname", $email, $city, $country, $lastaccess, "", "", "");
$table->align = array ("left", "left", "left", "left", "left", "center", "center", "center");
$table->width = "95%";
foreach ($users as $user) {
$susers[$user->id] = $user->country;
if ($user->id == $USER->id or $user->username == "changeme") {
$deletebutton = "";
} else {
$deletebutton = "<a href=\"user.php?delete=$user->id\">$strdelete</a>";
}
if ($user->lastaccess) {
$strlastaccess = format_time(time() - $user->lastaccess);
} else {
$strlastaccess = get_string("never");
}
if ($user->confirmed == 0) {
$confirmbutton = "<a href=\"user.php?confirmuser=$user->id\">" . get_string("confirm") . "</a>";
} else {
$confirmbutton = "";
}
$fullname = fullname($user, true);
$table->data[] = array ("<a href=\"../user/view.php?id=$user->id&course=$site->id\">$fullname</a>",
"$user->email",
"$user->city",
"$user->country",
$strlastaccess,
"<a href=\"../user/edit.php?id=$user->id&course=$site->id\">$stredit</a>",
$deletebutton,
$confirmbutton);
}
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\">$strdelete</a>";
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\">";
}
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 "</form>";
echo "</td></tr></table>";
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_table($table);
print_paging_bar($usercount, $page, $perpage,
"user.php?sort=$sort&dir=$dir&perpage=$perpage".
"&firstinitial=$firstinitial&lastinitial=$lastinitial&search=$search&");
}
if ($CFG->auth == "email" || $CFG->auth == "none" || $CFG->auth == "manual"){
print_heading("<a href=\"user.php?newuser=true\">".get_string("addnewuser")."</a>");
+4 -2
View File
@@ -4,7 +4,7 @@
require_login();
if (!isadmin) {
if (!isadmin()) {
error("Only admins can access this page");
}
@@ -25,9 +25,11 @@
$table->data[] = array("<b><a href=\"auth.php\">".get_string("authentication")."</a></b>",
get_string("adminhelpauthentication"));
if ($CFG->auth == "email" || $CFG->auth == "none" || $CFG->auth == "manual"){
if (is_internal_auth()) {
$table->data[] = array("<b><a href=\"$CFG->wwwroot/$CFG->admin/user.php?newuser=true\">".get_string("addnewuser")."</a></b>",
get_string("adminhelpaddnewuser"));
$table->data[] = array("<b><a href=\"$CFG->wwwroot/$CFG->admin/uploaduser.php\">".get_string("uploadusers")."</a></b>",
get_string("adminhelpuploadusers"));
}
$table->data[] = array("<b><a href=\"user.php\">".get_string("edituser")."</a></b>",
get_string("adminhelpedituser"));
+2
View File
@@ -27,6 +27,8 @@ function auth_user_login ($username, $password) {
$rs = $authdb->Execute("SELECT * FROM $CFG->auth_dbtable
WHERE $CFG->auth_dbfielduser = '$username'
AND $CFG->auth_dbfieldpass = '$password' ");
$authdb->Close();
if (!$rs) {
notify("Could not connect to the specified authentication database...");
return false;
+2 -1
View File
@@ -16,7 +16,8 @@
<?php if (isset($err["auth_imaphost"])) formerr($err["auth_imaphost"]); ?>
</TD>
<TD>
<?php print_string("auth_imaphost","auth") ?>
<?php print_string("auth_imaphost","auth") ?>
<?php print_string("auth_multiplehosts","auth") ?>
</TD>
</TR>
+29 -23
View File
@@ -7,34 +7,40 @@ function auth_user_login ($username, $password) {
global $CFG;
switch ($CFG->auth_imaptype) {
case "imapssl":
$host = "{".$CFG->auth_imaphost.":$CFG->auth_imapport/imap/ssl}";
break;
$hosts = split(';', $CFG->auth_imaphost); // Could be multiple hosts
case "imapcert":
$host = "{".$CFG->auth_imaphost.":$CFG->auth_imapport/imap/ssl/novalidate-cert}";
break;
foreach ($hosts as $host) { // Try each host in turn
case "imaptls":
$host = "{".$CFG->auth_imaphost.":$CFG->auth_imapport/imap/notls}";
break;
$host = trim($host);
default:
$host = "{".$CFG->auth_imaphost.":$CFG->auth_imapport}";
switch ($CFG->auth_imaptype) {
case "imapssl":
$host = '{'.$host.":$CFG->auth_imapport/imap/ssl}";
break;
case "imapcert":
$host = '{'.$host.":$CFG->auth_imapport/imap/ssl/novalidate-cert}";
break;
case "imaptls":
$host = '{'.$host.":$CFG->auth_imapport/imap/notls}";
break;
default:
$host = '{'.$host.":$CFG->auth_imapport}";
}
error_reporting(0);
$connection = imap_open($host, $username, $password, OP_HALFOPEN);
error_reporting($CFG->debug);
if ($connection) {
imap_close($connection);
return true;
}
}
error_reporting(0);
$connection = imap_open($host, $username, $password, OP_HALFOPEN);
error_reporting($CFG->debug);
if ($connection) {
imap_close($connection);
return true;
} else {
return false;
}
return false; // No match
}
+1
View File
@@ -15,6 +15,7 @@
</TD>
<TD>
<?php print_string("auth_nntphost","auth") ?>
<?php print_string("auth_multiplehosts","auth") ?>
</TD>
</TR>
+12 -9
View File
@@ -8,19 +8,22 @@ function auth_user_login ($username, $password) {
global $CFG;
$host = "{".$CFG->auth_nntphost.":$CFG->auth_nntpport/nntp}";
$hosts = split(';', $CFG->auth_nntphost); // Could be multiple hosts
error_reporting(0);
$connection = imap_open($host, $username, $password, OP_HALFOPEN);
error_reporting($CFG->debug);
foreach ($hosts as $host) { // Try each host in turn
$host = '{'.trim($host).":$CFG->auth_nntpport/nntp}";
if ($connection) {
imap_close($connection);
return true;
error_reporting(0);
$connection = imap_open($host, $username, $password, OP_HALFOPEN);
error_reporting($CFG->debug);
} else {
return false;
if ($connection) {
imap_close($connection);
return true;
}
}
return false; // No match
}
+3 -2
View File
@@ -3,7 +3,7 @@
$config->auth_pop3host = "127.0.0.1";
}
if (!isset($config->auth_pop3type)) {
$config->auth_pop3type = "pop3";
$config->auth_pop3type = "pop3notls";
}
if (!isset($config->auth_pop3port)) {
$config->auth_pop3port = "110";
@@ -17,13 +17,14 @@
</TD>
<TD>
<?php print_string("auth_pop3host","auth") ?>
<?php print_string("auth_multiplehosts","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?php echo $THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_pop3type:</TD>
<TD>
<?php $pop3types = array("pop3","pop3cert");
<?php $pop3types = array("pop3","pop3cert", "pop3notls");
foreach($pop3types as $pop3type) {
$pop3options[$pop3type] = $pop3type;
}
+27 -18
View File
@@ -7,26 +7,35 @@ function auth_user_login ($username, $password) {
global $CFG;
switch ($CFG->auth_pop3type) {
case "pop3":
$host = "{".$CFG->auth_pop3host.":$CFG->auth_pop3port/pop3/notls}INBOX";
break;
case "pop3cert":
$host = "{".$CFG->auth_pop3host.":$CFG->auth_pop3port/pop3/ssl/novalidate-cert}INBOX";
break;
$hosts = split(';', $CFG->auth_pop3host); // Could be multiple hosts
foreach ($hosts as $host) { // Try each host in turn
$host = trim($host);
switch ($CFG->auth_pop3type) {
case "pop3":
$host = '{'.$host.":$CFG->auth_pop3port/pop3}INBOX";
break;
case "pop3notls":
$host = '{'.$host.":$CFG->auth_pop3port/pop3/notls}INBOX";
break;
case "pop3cert":
$host = '{'.$host.":$CFG->auth_pop3port/pop3/ssl/novalidate-cert}INBOX";
break;
}
error_reporting(0);
$connection = imap_open($host, $username, $password, OP_HALFOPEN);
error_reporting($CFG->debug);
if ($connection) {
imap_close($connection);
return true;
}
}
error_reporting(0);
$connection = imap_open($host, $username, $password, OP_HALFOPEN);
error_reporting($CFG->debug);
if ($connection) {
imap_close($connection);
return true;
} else {
return false;
}
return false; // No matches found
}
+41 -5
View File
@@ -5,8 +5,7 @@ This documment shows the current status of the backup/restore option.
Backup: WORKING. COMPLETED !!
Restore: WORKING. COMPLETED except logs.
Restore: WORKING. COMPLETED !!
========== ========== ========== ========== ========== ==========
@@ -49,6 +48,8 @@ Backup Details:
- All..........................................DONE
- Logs...............................................DONE
- Scales.............................................DONE
- Events.(course)....................................DONE
- Groups.............................................DONE
- Categories and Questions.(STEP 1)..................DONE
+ categories......................................DONE
+ questions structure.............................DONE
@@ -57,6 +58,10 @@ Backup Details:
+ course data..................................DONE
+ user data....................................DONE
+ files........................................DONE
x attendances.....................................DONE
+ course data..................................DONE
+ user data....................................DONE
+ files.....(NOT EXISTS).......................DONE
x chats...........................................DONE
+ course data..................................DONE
+ user data....................................DONE
@@ -69,10 +74,18 @@ Backup Details:
+ course data..................................DONE
+ user data....................................DONE
+ files........................................DONE
x glosaries.......................................DONE
+ course data..................................DONE
+ user data....................................DONE
+ files........................................DONE
x journals........................................DONE
+ course data..................................DONE
+ user data....................................DONE
+ files.(NOT EXISTS)...........................DONE
x labels..........................................DONE
+ course data..................................DONE
+ user data....................................DONE
+ files.(NOT EXISTS)...........................DONE
x quizzes.(STEP 2)................................DONE
+ course data..................................DONE
+ user data....................................DONE
@@ -103,7 +116,16 @@ Backup Details:
- Browse backup files........................................DONE
- Download backup files......................................DONE
- Delete backup files........................................DONE
- Program automatic backups..................................NO EXISTS
- Program scheduled backups..................................IN PROGRESS
- Build a configuration inteface..........................DONE
- Create the script.......................................DONE
- Integrate it in cron....................................DONE
- View logs...............................................IN PROGRESS
- Send email..............................................DONE
- Select manually the desired activities to backup...........NOT EXISTS
- Modify the backup frontend..............................NOT EXISTS
- Modify the backup of course_sections and course_modules.NOT EXISTS
- Modify every module backuplib to work properly..........NOT EXISTS
Restore Details:
===============
@@ -156,6 +178,8 @@ Restore Details:
+ categories......................................DONE
+ questions structure.............................DONE
- Scales.............................................DONE
- Events.(course)....................................DONE
- Groups.............................................DONE
- Mods Info Prepare..................................DONE
x read modules zone...............................DONE
x separate every mod..............................DONE
@@ -166,6 +190,10 @@ Restore Details:
+ course data..................................DONE
+ user data....................................DONE
+ files........................................DONE
x attendances.....................................DONE
+ course data..................................DONE
+ user data....................................DONE
+ files.(NOT EXISTS)...........................DONE
x chats...........................................DONE
+ course data..................................DONE
+ user data....................................DONE
@@ -178,10 +206,18 @@ Restore Details:
+ course data..................................DONE
+ user data....................................DONE
+ files........................................DONE
x glosaries.......................................DONE
+ course data..................................DONE
+ user data....................................DONE
+ files........................................DONE
x journals........................................DONE
+ course data..................................DONE
+ user data....................................DONE
+ files.(NOT EXISTS)...........................DONE
x labels..........................................DONE
+ course data..................................DONE
+ user data....................................DONE
+ files.(NOT EXISTS)...........................DONE
x quizzes.(STEP 2)................................DONE
+ course data..................................DONE
+ user data....................................DONE
@@ -200,7 +236,7 @@ Restore Details:
+ files........................................DONE
- User files from temp.......................................DONE
- Course files from temp.....................................DONE
- Log entries................................................NO EXISTS
- Log entries................................................DONE
- Readjust instance in course_modules........................DONE
- Readjust modinfo in course (serialize).....................DONE
- Delete old entries at restore end. .......................DONE
@@ -210,7 +246,7 @@ Restore Details:
========== ========== ========== =========== =========== =========== ===
This is all. It's no a little thing !!! :-)
This is all. It isn't a little thing !!! :-)
Eloy (stronk7)
29-04-2003
+2
View File
@@ -68,6 +68,8 @@
error("Course ID was incorrect (can't find it)");
}
check_for_restricted_user($USER->username, "$CFG->wwwroot/course/view.php?id=$course->id");
//Print header
if (isadmin()) {
print_header("$site->shortname: $strcoursebackup", $site->fullname,
+33 -15
View File
@@ -73,7 +73,7 @@
}
?>
<form name="form" method="post" <?php echo $onsubmit ?> action="<?php echo $ME ?>">
<form name="form" method="post" action="<?php echo $ME ?>">
<table cellpadding=5>
<?php
@@ -83,22 +83,41 @@
echo get_string("name").":";
echo "</B></td><td>";
//Calculate the backup string
//Take off spaces in the filename !!
$backup_name = str_replace(" ","_",strtolower(get_string("backupfilename")));
//Calculate the backup word
//Take off some characters in the filename !!
$takeoff = array(" ", ":", "/", "\\", "|");
$backup_word = str_replace($takeoff,"_",strtolower(get_string("backupfilename")));
//If non-translated, use "backup"
if (substr($backup_name,0,1) == "[") {
$backup_name = "backup";
if (substr($backup_word,0,1) == "[") {
$backup_word= "backup";
}
//Calculate the format string
$backup_name_format = str_replace(" ","_",get_string("backupnameformat"));
//Calculate the date format string
$backup_date_format = str_replace(" ","_",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";
if (substr($backup_date_format,0,1) == "[") {
$backup_date_format = "%%Y%%m%%d-%%H%%M";
}
$backup_name .= str_replace(" ","_","-".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."\">";
//Calculate the shortname
$backup_shortname = clean_filename($course->shortname);
if (empty($backup_shortname) or $backup_shortname == '_' ) {
$backup_shortname = $course->id;
}
//Calculate the final backup filename
//The backup word
$backup_name = $backup_word."-";
//The shortname
$backup_name .= strtolower($backup_shortname)."-";
//The date format
$backup_name .= userdate(time(),$backup_date_format,99,false);
//The extension
$backup_name .= ".zip";
//Add as text field
echo "<input type=\"text\" name=\"backup_name\" size=\"40\" value=\"".$backup_name."\">";
echo "</td></tr>";
//Calculate the backup unique code to allow simultaneus backups (to define
@@ -125,7 +144,7 @@
$modbackup = $modname."_backup_mods";
//If exists the lib & function
$var = "exists_".$modname;
if ($$var) {
if (isset($$var) && $$var) {
//Add hidden fields
$var = "backup_".$modname;
echo "<input type=\"hidden\" name=\"".$var."\" value=\"".$$var."\">";
@@ -161,7 +180,6 @@
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."\">";
+67 -18
View File
@@ -136,7 +136,7 @@
echo "<li>".get_string("deletingolddata");
$status = backup_delete_old_data();
if (!$status) {
error ("An error has ocurred");
error ("An error occurred deleting old backup data");
}
//Create the moodle.xml file
@@ -150,7 +150,9 @@
echo "<li>".get_string("writinggeneralinfo");;
//Prints general info about backup to file
if ($backup_file) {
$status = backup_general_info($backup_file,$preferences);
if (!$status = backup_general_info($backup_file,$preferences)) {
notify("An error occurred while backing up general info");
}
}
echo "<li>".get_string("writingcoursedata");
@@ -160,12 +162,16 @@
echo "<li>".get_string("courseinfo");
//Prints course start (tag and general info)
if ($status) {
$status = backup_course_start($backup_file,$preferences);
if (!$status = backup_course_start($backup_file,$preferences)) {
notify("An error occurred while backing up course start");
}
}
echo "<li>".get_string("sections");
//Section info
if ($status) {
$status = backup_course_sections($backup_file,$preferences);
if (!$status = backup_course_sections($backup_file,$preferences)) {
notify("An error occurred while backing up course sections");
}
}
//End course contents (close ul)
@@ -174,28 +180,52 @@
echo "<li>".get_string("writinguserinfo");
//User info
if ($status) {
$status = backup_user_info($backup_file,$preferences);
if (!$status = backup_user_info($backup_file,$preferences)) {
notify("An error occurred while backing up user info");
}
}
//If we have selected to backup quizzes, backup categories and
//questions structure (step 1). See notes on mod/quiz/backuplib.php
if ($status and $preferences->mods['quiz']->backup) {
echo "<li>".get_string("writingcategoriesandquestions");
$status = quiz_backup_question_categories($backup_file,$preferences);
if (!$status = quiz_backup_question_categories($backup_file,$preferences)) {
notify("An error occurred while backing up quiz categories");
}
}
//Print logs if selected
if ($status) {
if ($preferences->backup_logs) {
echo "<li>".get_string("writingloginfo");
$status = backup_log_info($backup_file,$preferences);
if (!$status = backup_log_info($backup_file,$preferences)) {
notify("An error occurred while backing up log info");
}
}
}
//Print scales info
if ($status) {
echo "<li>".get_string("writingscalesinfo");
$status = backup_scales_info($backup_file,$preferences);
if (!$status = backup_scales_info($backup_file,$preferences)) {
notify("An error occurred while backing up scales");
}
}
//Print groups info
if ($status) {
echo "<li>".get_string("writinggroupsinfo");
if (!$status = backup_groups_info($backup_file,$preferences)) {
notify("An error occurred while backing up groups");
}
}
//Print events info
if ($status) {
echo "<li>".get_string("writingeventsinfo");
if (!$status = backup_events_info($backup_file,$preferences)) {
notify("An error occurred while backing up events");
}
}
//Module info, this unique function makes all the work!!
@@ -212,26 +242,34 @@
if ($mods_to_backup) {
echo "<li>".get_string("writingmoduleinfo");
//Start modules tag
$status = backup_modules_start ($backup_file,$preferences);
if (!$status = backup_modules_start ($backup_file,$preferences)) {
notify("An error occurred while backing up module info");
}
//Open ul for module list
echo "<ul>";
//Iterate over modules and call backup
foreach ($preferences->mods as $module) {
if ($module->backup and $status) {
echo "<li>".get_string("modulenameplural",$module->name);
$status = backup_module($backup_file,$preferences,$module->name);
if (!$status = backup_module($backup_file,$preferences,$module->name)) {
notify("An error occurred while backing up '$module->name'");
}
}
}
//Close ul for module list
echo "</ul>";
//Close modules tag
$status = backup_modules_end ($backup_file,$preferences);
if (!$status = backup_modules_end ($backup_file,$preferences)) {
notify("An error occurred while finishing the module backups");
}
}
}
//Prints course end
if ($status) {
$status = backup_course_end($backup_file,$preferences);
if (!$status = backup_course_end($backup_file,$preferences)) {
notify("An error occurred while closing the course backup");
}
}
//Close the xml file and xml data
if ($backup_file) {
@@ -246,7 +284,9 @@
if ($status) {
if ($preferences->backup_user_files) {
echo "<li>".get_string("copyinguserfiles");
$status = backup_copy_user_files ($preferences);
if (!$status = backup_copy_user_files ($preferences)) {
notify("An error occurred while copying user files");
}
}
}
@@ -254,26 +294,34 @@
if ($status) {
if ($preferences->backup_course_files) {
echo "<li>".get_string("copyingcoursefiles");
$status = backup_copy_course_files ($preferences);
if (!$status = backup_copy_course_files ($preferences)) {
notify("An error occurred while copying course files");
}
}
}
//Now, zip all the backup directory contents
if ($status) {
echo "<li>".get_string("zippingbackup");
$status = backup_zip ($preferences);
if (!$status = backup_zip ($preferences)) {
notify("An error occurred while zipping the backup");
}
}
//Now, copy the zip file to course directory
if ($status) {
echo "<li>".get_string("copyingzipfile");
$status = copy_zip_to_course_dir ($preferences);
if (!$status = copy_zip_to_course_dir ($preferences)) {
notify("An error occurred while copying the zip file to the course directory");
}
}
//Now, clean temporary data (db and filesystem)
if ($status) {
echo "<li>".get_string("cleaningtempdata");
$status = clean_temp_data ($preferences);
if (!$status = clean_temp_data ($preferences)) {
notify("An error occurred while cleaning up temporary data");
}
}
//Ends th main ul
@@ -286,7 +334,8 @@
echo "</table>";
if (!$status) {
error ("An error has ocurred");
error ("The backup did not complete successfully",
"$CFG->wwwroot/course/view.php?id=$course->id");
}
//Print final message
+2 -2
View File
@@ -74,7 +74,7 @@
?>
<form name="form" method="post" <?php echo $onsubmit ?> action="<?php echo $ME ?>">
<form name="form" method="post" action="<?php echo $ME ?>">
<table cellpadding=5>
<?php
if ($allmods = get_records("modules") ) {
@@ -83,7 +83,7 @@
$modbackup = $modname."_backup_mods";
//If exists the lib & function
$var = "exists_".$modname;
if ($$var) {
if (isset($$var) && $$var) {
//Print the full tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
+674
View File
@@ -0,0 +1,674 @@
<?PHP //$Id$
//This file contains all the code needed to execute scheduled backups
//This function is executed via moodle cron
//It prepares all the info and execute backups as necessary
function schedule_backup_cron() {
global $CFG;
$status = true;
$emailpending = false;
//Get now
$now = time();
//First of all, we have to see if the scheduled is active and detect
//that there isn't another cron running
echo " Checking backup status";
$backup_config = backup_get_config();
if(!isset($backup_config->backup_sche_active) || !$backup_config->backup_sche_active) {
echo "...INACTIVE\n";
return true;
} else if (isset($backup_config->backup_sche_running) && $backup_config->backup_sche_running) {
echo "...RUNNING\n";
//Now check if it's a really running task or something very old looking
//for info in backup_logs to unlock status as necessary
$timetosee = 1800; //Half an hour looking for activity
$timeafter = time() - $timetosee;
$numofrec = count_records_select ("backup_log","time > $timeafter");
if (!$numofrec) {
$timetoseemin = $timetosee/60;
echo " No activity in last ".$timetoseemin." minutes. Unlocking status\n";
} else {
echo " Scheduled backup seems to be running. Execution delayed\n";
return true;
}
} else {
echo "...OK\n";
//Mark backup_sche_running
backup_set_config("backup_sche_running","1");
}
//Now we get the main admin user (we'll use his timezone, mail...)
echo " Getting admin info\n";
$admin = get_admin();
if (!$admin) {
$status = false;
}
//Now we get a list of courses in the server
if ($status) {
echo " Checking courses\n";
$courses = get_records("course");
//For each course, we check (insert, update) the backup_course table
//with needed data
foreach ($courses as $course) {
if ($status) {
echo " $course->fullname\n";
//We check if the course exists in backup_course
$backup_course = get_record("backup_courses","courseid",$course->id);
//If it doesn't exist, create
if (!$backup_course) {
$temp_backup_course->courseid = $course->id;
$newid = insert_record("backup_courses",$temp_backup_course);
//And get it from db
$backup_course = get_record("backup_courses","id",$newid);
}
//If it doesn't exist now, error
if (!$backup_course) {
echo " ERROR (in backup_courses detection)\n";
$status = false;
}
//Now we backup every course with nextstarttime < now
if ($backup_course->nextstarttime > 0 && $backup_course->nextstarttime < $now) {
//Set laststarttime
$starttime = time();
set_field("backup_courses","laststarttime",$starttime,"courseid",$backup_course->courseid);
//Launch backup
$course_status = schedule_backup_launch_backup($course,$starttime);
//We have to send a email because we have included at least one backup
$emailpending = true;
//Set lastendtime
set_field("backup_courses","lastendtime",time(),"courseid",$backup_course->courseid);
//Set laststatus
if ($course_status) {
set_field("backup_courses","laststatus","1","courseid",$backup_course->courseid);
} else {
set_field("backup_courses","laststatus","0","courseid",$backup_course->courseid);
}
}
//Now, calculate next execution of the course
$nextstarttime = schedule_backup_next_execution ($backup_course,$backup_config,$now,$admin->timezone);
//Save it to db
set_field("backup_courses","nextstarttime",$nextstarttime,"courseid",$backup_course->courseid);
//Print it to screen as necessary
$showtime = "undefined";
if ($nextstarttime > 0) {
$showtime = userdate($nextstarttime,"",$admin->timezone);
}
echo " Next execution: $showtime\n";
}
}
}
//Delete old logs
if (!empty($CFG->loglifetime)) {
echo " Deleting old logs\n";
$loglifetime = $now - ($CFG->loglifetime * 86400);
delete_records_select("backup_log", "laststarttime < '$loglifetime'");
}
//Send email to admin
if ($emailpending) {
echo " Sending email to admin\n";
$message = "";
//Build the message text (future versions should handle html messages too!!)
$logs = get_records_select ("backup_log","laststarttime >= '$now'","id");
if ($logs) {
$currentcourse = 1;
foreach ($logs as $log) {
if ($currentcourse != $log->courseid) {
$message .= "\n==================================================\n\n";
$currentcourse = $log->courseid;
}
$message .= userdate($log->time,"%T",$admin->timezone)." ".$log->info."\n";
}
}
//Send the message
$site = get_site();
email_to_user($admin,$admin,"$site->shortname: ".get_string("scheduledbackupstatus"),$message);
}
//Everything is finished stop backup_sche_running
backup_set_config("backup_sche_running","0");
return $status;
}
//This function executes the ENTIRE backup of a course (passed as parameter)
//using all the scheduled backup preferences
function schedule_backup_launch_backup($course,$starttime = 0) {
$preferences = false;
$status = false;
echo " Executing backup\n";
schedule_backup_log($starttime,$course->id,"Start backup course $course->fullname");
schedule_backup_log($starttime,$course->id," Phase 1: Checking and counting:");
$preferences = schedule_backup_course_configure($course,$starttime);
if ($preferences) {
schedule_backup_log($starttime,$course->id," Phase 2: Executing and copying:");
$status = schedule_backup_course_execute($preferences,$starttime);
}
if ($status && $preferences) {
//Only if the backup_sche_keep is set
if ($preferences->backup_keep) {
schedule_backup_log($starttime,$course->id," Phase 3: Deleting old backup files:");
$status = schedule_backup_course_delete_old_files($preferences,$starttime);
}
}
if ($status && $preferences) {
echo " End backup OK\n";
schedule_backup_log($starttime,$course->id,"End backup course $course->fullname - OK");
} else {
echo " End backup with ERROR\n";
schedule_backup_log($starttime,$course->id,"End backup course $course->fullname - ERROR!!");
}
return $status && $preferences;
}
//This function saves to backup_log all the needed process info
//to use it later. NOTE: If $starttime = 0 no info in saved
function schedule_backup_log($starttime,$courseid,$message) {
if ($starttime) {
$log->courseid = $courseid;
$log->time = time();
$log->laststarttime = $starttime;
$log->info = $message;
insert_record ("backup_log",$log);
}
}
//This function returns the next future GMT time to execute the course based in the
//configuration of the scheduled backups
function schedule_backup_next_execution ($backup_course,$backup_config,$now,$timezone) {
$result = -1;
//Get today's midnight GMT
$midnight = usergetmidnight($now,$timezone);
//Get today's day of week (0=Sunday...6=Saturday)
$date = usergetdate($now,$timezone);
$dayofweek = $date['wday'];
//Get number of days (from today) to execute backups
$scheduled_days = substr($backup_config->backup_sche_weekdays,$dayofweek).
$backup_config->backup_sche_weekdays;
$daysfromtoday = strpos($scheduled_days, "1");
//If some day has been found
if ($daysfromtoday !== false) {
//Calculate distance
$dist = ($daysfromtoday * 86400) + //Days distance
($backup_config->backup_sche_hour*3600) + //Hours distance
($backup_config->backup_sche_minute*60); //Minutes distance
$result = $midnight + $dist;
}
//If that time is past, call the function recursively to obtain the next valid day
if ($result > 0 && $result < time()) {
$result = schedule_backup_next_execution ($backup_course,$backup_config,$now + 86400,$timezone);
}
return $result;
}
//This function implements all the needed code to prepare a course
//to be in backup (insert temp info into backup temp tables).
function schedule_backup_course_configure($course,$starttime = 0) {
global $CFG;
$status = true;
schedule_backup_log($starttime,$course->id," checking parameters");
//Check the required variable
if (empty($course->id)) {
$status = false;
}
//Get scheduled backup preferences
$backup_config = backup_get_config();
//Checks backup_config pairs exist
if ($status) {
if (!isset($backup_config->backup_sche_modules)) {
$backup_config->backup_sche_modules = 1;
}
if (!isset($backup_config->backup_sche_withuserdata)) {
$backup_config->backup_sche_withuserdata = 1;
}
if (!isset($backup_config->backup_sche_users)) {
$backup_config->backup_sche_users = 1;
}
if (!isset($backup_config->backup_sche_logs)) {
$backup_config->backup_sche_logs = 0;
}
if (!isset($backup_config->backup_sche_userfiles)) {
$backup_config->backup_sche_userfiles = 1;
}
if (!isset($backup_config->backup_sche_coursefiles)) {
$backup_config->backup_sche_coursefiles = 1;
}
if (!isset($backup_config->backup_sche_active)) {
$backup_config->backup_sche_active = 0;
}
if (!isset($backup_config->backup_sche_weekdays)) {
$backup_config->backup_sche_weekdays = "0000000";
}
if (!isset($backup_config->backup_sche_hour)) {
$backup_config->backup_sche_hour = 00;
}
if (!isset($backup_config->backup_sche_minute)) {
$backup_config->backup_sche_minute = 00;
}
if (!isset($backup_config->backup_sche_destination)) {
$backup_config->backup_sche_destination = "";
}
if (!isset($backup_config->backup_sche_keep)) {
$backup_config->backup_sche_keep = 1;
}
}
if ($status) {
//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 = "$CFG->dirroot/mod/$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 = $backup_config->backup_sche_modules;
}
//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 = $backup_config->backup_sche_withuserdata;
}
//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;
}
}
}
//Convert other parameters
if ($status) {
$preferences->backup_users = $backup_config->backup_sche_users;
$preferences->backup_logs = $backup_config->backup_sche_logs;
$preferences->backup_user_files = $backup_config->backup_sche_userfiles;
$preferences->backup_course_files = $backup_config->backup_sche_coursefiles;
$preferences->backup_course = $course->id;
$preferences->backup_destination = $backup_config->backup_sche_destination;
$preferences->backup_keep = $backup_config->backup_sche_keep;
}
//Calculate the backup string
if ($status) {
schedule_backup_log($starttime,$course->id," calculating backup name");
//Calculate the backup word
//Take off some characters in the filename !!
$takeoff = array(" ", ":", "/", "\\", "|");
$backup_word = str_replace($takeoff,"_",strtolower(get_string("backupfilename")));
//If non-translated, use "backup"
if (substr($backup_word,0,1) == "[") {
$backup_word= "backup";
}
//Calculate the date format string
$backup_date_format = str_replace(" ","_",get_string("backupnameformat"));
//If non-translated, use "%Y%m%d-%H%M"
if (substr($backup_date_format,0,1) == "[") {
$backup_date_format = "%%Y%%m%%d-%%H%%M";
}
//Calculate the shortname
$backup_shortname = clean_filename($course->shortname);
if (empty($backup_shortname) or $backup_shortname == '_' ) {
$backup_shortname = $course->id;
}
//Calculate the final backup filename
//The backup word
$backup_name = $backup_word."-";
//The shortname
$backup_name .= strtolower($backup_shortname)."-";
//The date format
$backup_name .= userdate(time(),$backup_date_format,99,false);
//The extension
$backup_name .= ".zip";
//Calculate the string to match the keep preference
$keep_name = $backup_word."-";
//The shortname
$keep_name .= strtolower($backup_shortname)."-";
$preferences->backup_name = $backup_name;
$preferences->keep_name = $keep_name;
}
//Calculate the backup unique code to allow simultaneus backups (to define
//the temp-directory name and records in backup temp tables
if ($status) {
$backup_unique_code = time();
$preferences->backup_unique_code = $backup_unique_code;
}
//Calculate necesary info to backup modules
if ($status) {
schedule_backup_log($starttime,$course->id," calculating modules data");
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 (isset($$var) && $$var) {
//Add hidden fields
$var = "backup_".$modname;
//Only if selected
if ($$var == 1) {
$var = "backup_user_info_".$modname;
//Call the check function to show more info
$modcheckbackup = $modname."_check_backup_mods";
schedule_backup_log($starttime,$course->id," $modname");
$modcheckbackup($course->id,$$var,$backup_unique_code);
}
}
}
}
}
//Now calculate the users
if ($status) {
schedule_backup_log($starttime,$course->id," calculating users");
user_check_backup($course->id,$backup_unique_code,$preferences->backup_users);
}
//Now calculate the logs
if ($status) {
if ($preferences->backup_logs) {
schedule_backup_log($starttime,$course->id," calculating logs");
log_check_backup($course->id);
}
}
//Now calculate the userfiles
if ($status) {
if ($preferences->backup_user_files) {
schedule_backup_log($starttime,$course->id," calculating user files");
user_files_check_backup($course->id,$preferences->backup_unique_code);
}
}
//Now calculate the coursefiles
if ($status) {
if ($preferences->backup_course_files) {
schedule_backup_log($starttime,$course->id," calculating course files");
course_files_check_backup($course->id,$preferences->backup_unique_code);
}
}
//If everything is ok, return calculated preferences
if ($status) {
$status = $preferences;
}
return $status;
}
//This function implements all the needed code to backup a course
//copying it to the desired destination (default if not specified)
function schedule_backup_course_execute($preferences,$starttime = 0) {
global $CFG;
$status = true;
//Another Info to add
$preferences->moodle_version = $CFG->version;
$preferences->moodle_release = $CFG->release;
$preferences->backup_version = $CFG->backup_version;
$preferences->backup_release = $CFG->backup_release;
//Check for temp and backup and backup_unique_code directory
//Create them as needed
schedule_backup_log($starttime,$preferences->backup_course," checking temp structures");
$status = check_and_create_backup_dir($preferences->backup_unique_code);
//Empty dir
if ($status) {
schedule_backup_log($starttime,$preferences->backup_course," cleaning old data");
$status = clear_backup_dir($preferences->backup_unique_code);
}
//Delete old_entries from backup tables
if ($status) {
$status = backup_delete_old_data();
}
//Create the moodle.xml file
if ($status) {
schedule_backup_log($starttime,$preferences->backup_course," creating backup file");
//Obtain the xml file (create and open) and print prolog information
$backup_file = backup_open_xml($preferences->backup_unique_code);
//Prints general info about backup to file
if ($backup_file) {
schedule_backup_log($starttime,$preferences->backup_course," general info");
$status = backup_general_info($backup_file,$preferences);
} else {
$status = false;
}
//Prints course start (tag and general info)
if ($status) {
$status = backup_course_start($backup_file,$preferences);
}
//Section info
if ($status) {
schedule_backup_log($starttime,$preferences->backup_course," sections info");
$status = backup_course_sections($backup_file,$preferences);
}
//User info
if ($status) {
schedule_backup_log($starttime,$preferences->backup_course," user info");
$status = backup_user_info($backup_file,$preferences);
}
//If we have selected to backup quizzes, backup categories and
//questions structure (step 1). See notes on mod/quiz/backuplib.php
if ($status and $preferences->mods['quiz']->backup) {
schedule_backup_log($starttime,$preferences->backup_course," categories & questions");
$status = quiz_backup_question_categories($backup_file,$preferences);
}
//Print logs if selected
if ($status) {
if ($preferences->backup_logs) {
schedule_backup_log($starttime,$preferences->backup_course," logs");
$status = backup_log_info($backup_file,$preferences);
}
}
//Print scales info
if ($status) {
schedule_backup_log($starttime,$preferences->backup_course," scales");
$status = backup_scales_info($backup_file,$preferences);
}
//Print groups info
if ($status) {
schedule_backup_log($starttime,$preferences->backup_course," groups");
$status = backup_groups_info($backup_file,$preferences);
}
//Print events info
if ($status) {
schedule_backup_log($starttime,$preferences->backup_course," events");
$status = backup_events_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) {
schedule_backup_log($starttime,$preferences->backup_course," modules");
//Start modules tag
$status = backup_modules_start ($backup_file,$preferences);
//Iterate over modules and call backup
foreach ($preferences->mods as $module) {
if ($module->backup and $status) {
schedule_backup_log($starttime,$preferences->backup_course," $module->name");
$status = backup_module($backup_file,$preferences,$module->name);
}
}
//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);
}
}
//Now, if selected, copy user files
if ($status) {
if ($preferences->backup_user_files) {
schedule_backup_log($starttime,$preferences->backup_course," copying user files");
$status = backup_copy_user_files ($preferences);
}
}
//Now, if selected, copy course files
if ($status) {
if ($preferences->backup_course_files) {
schedule_backup_log($starttime,$preferences->backup_course," copying course files");
$status = backup_copy_course_files ($preferences);
}
}
//Now, zip all the backup directory contents
if ($status) {
schedule_backup_log($starttime,$preferences->backup_course," zipping files");
$status = backup_zip ($preferences);
}
//Now, copy the zip file to course directory
if ($status) {
schedule_backup_log($starttime,$preferences->backup_course," copying backup");
$status = copy_zip_to_course_dir ($preferences);
}
//Now, clean temporary data (db and filesystem)
if ($status) {
schedule_backup_log($starttime,$preferences->backup_course," cleaning temp data");
$status = clean_temp_data ($preferences);
}
return $status;
}
//This function deletes old backup files when the "keep" limit has been reached
//in the destination directory.
function schedule_backup_course_delete_old_files($preferences,$starttime=0) {
global $CFG;
$status = true;
//Calculate the directory to check
$dirtocheck = "";
//if $preferences->backup_destination isn't empty, then check that directory
if (!empty($preferences->backup_destination)) {
$dirtocheck = $preferences->backup_destination;
//else calculate standard backup directory location
} else {
$dirtocheck = $CFG->dataroot."/".$preferences->backup_course."/backupdata";
}
schedule_backup_log($starttime,$preferences->backup_course," checking $dirtocheck");
echo " Keeping backup files in $dirtocheck\n";
//Get all the files in $dirtocheck
$files = get_directory_list($dirtocheck,"",false);
//Get all matching files ($preferences->keep_name) from $files
$matchingfiles = array();
foreach ($files as $file) {
if (substr($file, 0, strlen($preferences->keep_name)) == $preferences->keep_name) {
$modifieddate = filemtime($dirtocheck."/".$file);
$matchingfiles[$modifieddate] = $file;
}
}
//Sort by key (modified date) to get the oldest first (instead of doing that by name
//because it could give us problems in some languages with different format names).
ksort($matchingfiles);
//Count matching files
$countmatching = count($matchingfiles);
schedule_backup_log($starttime,$preferences->backup_course," found $countmatching backup files");
echo " found $countmatching backup files\n";
if ($preferences->backup_keep < $countmatching) {
schedule_backup_log($starttime,$preferences->backup_course," keep limit ($preferences->backup_keep) reached. Deleting old files");
echo " keep limit ($preferences->backup_keep) reached. Deleting old files\n";
$filestodelete = $countmatching - $preferences->backup_keep;
$filesdeleted = 0;
foreach ($matchingfiles as $matchfile) {
if ($filesdeleted < $filestodelete) {
schedule_backup_log($starttime,$preferences->backup_course," $matchfile deleted");
echo " $matchfile deleted\n";
$filetodelete = $dirtocheck."/".$matchfile;
unlink($filetodelete);
$filesdeleted++;
}
}
}
return $status;
}
?>
+339 -56
View File
@@ -32,61 +32,75 @@
//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
// 1-->course (needed + enrolled)
global $CFG;
global $db;
$count_users = 0;
//Select all users from user (only id)
//If there are a lot of users and we retrieve all the info->memory shortage !!
$users = get_records ("user","","","","id,id");
//If we have users
if ($users) {
//Calculate needed users (calling every xxxx_get_participants function + scales users)
$needed_users = backup_get_needed_users($course);
//Calculate enrolled users (students + teachers)
$enrolled_users = backup_get_enrolled_users($course);
//Calculate all users (every record in users table)
$all_users = backup_get_all_users();
//Calculate course users (needed + enrolled)
//First, needed
$course_users = $needed_users;
//Now, enrolled
if ($enrolled_users) {
foreach ($enrolled_users as $enrolled_user) {
$course_users[$enrolled_user->id]->id = $enrolled_user->id;
}
}
//Now, depending of parameters, create $backupable_users
if ($backup_users == 0) {
$backupable_users = $all_users;
} else {
$backupable_users = $course_users;
}
//If we have backupable users
if ($backupable_users) {
//Iterate over users putting their roles
foreach ($users as $user) {
$user->info = "";
foreach ($backupable_users as $backupable_user) {
$backupable_user->info = "";
//Is Admin in tables (not is_admin()) !!
if (record_exists("user_admins","userid",$user->id)) {
$user->info .= "admin";
$user->role_admin = true;
if (record_exists("user_admins","userid",$backupable_user->id)) {
$backupable_user->info .= "admin";
}
//Is Course Creator in tables (not is_coursecreator()) !!
if (record_exists("user_coursecreators","userid",$user->id)) {
$user->info .= "coursecreator";
$user->role_coursecreator = true;
if (record_exists("user_coursecreators","userid",$backupable_user->id)) {
$backupable_user->info .= "coursecreator";
}
//Is Teacher in tables (not is_teacher()) !!
if (record_exists("user_teachers","course",$course,"userid",$user->id)) {
$user->info .= "teacher";
$user->role_teacher = true;
if (record_exists("user_teachers","course",$course,"userid",$backupable_user->id)) {
$backupable_user->info .= "teacher";
}
//Is Student in tables (not is_student()) !!
if (record_exists("user_students","course",$course,"userid",$user->id)) {
$user->info .= "student";
$user->role_student = true;
if (record_exists("user_students","course",$course,"userid",$backupable_user->id)) {
$backupable_user->info .= "student";
}
//Is needed user (exists in needed_users)
if (isset($needed_users[$backupable_user->id])) {
$backupable_user->info .= "needed";
}
//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;
$backupids_rec->old_id = $backupable_user->id;
$backupids_rec->info = $backupable_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++;
}
}
$status = insert_record("backup_ids",$backupids_rec,false,"backup_code");
$count_users++;
}
//Do some output
backup_flush(30);
@@ -100,6 +114,117 @@
return $info;
}
//Returns every needed user (participant) in a course
//It uses the xxxx_get_participants() function
//plus users needed to backup scales.
//WARNING: It returns only NEEDED users, not every
// every student and teacher in the course, so it
//must be merged with backup_get_enrrolled_users !!
function backup_get_needed_users ($courseid) {
global $CFG;
$result = false;
$course_modules = get_records_sql ("SELECT cm.id, m.name, cm.instance
FROM {$CFG->prefix}modules m,
{$CFG->prefix}course_modules cm
WHERE m.id = cm.module and
cm.course = '$courseid'");
if ($course_modules) {
//Iterate over each module
foreach ($course_modules as $course_module) {
$modlib = "$CFG->dirroot/mod/$course_module->name/lib.php";
$modgetparticipants = $course_module->name."_get_participants";
if (file_exists($modlib)) {
include_once($modlib);
if (function_exists($modgetparticipants)) {
$module_participants = $modgetparticipants($course_module->instance);
//Add them to result
if ($module_participants) {
foreach ($module_participants as $module_participant) {
$result[$module_participant->id]->id = $module_participant->id;
}
}
}
}
}
}
//Now, add scales users (from site and course scales)
//Get users
$scaleusers = get_records_sql("SELECT DISTINCT userid,userid
FROM {$CFG->prefix}scale
WHERE courseid = '0' or courseid = '$courseid'");
//Add scale users to results
if ($scaleusers) {
foreach ($scaleusers as $scaleuser) {
//If userid != 0
if ($scaleuser->userid != 0) {
$result[$scaleuser->userid]->id = $scaleuser->userid;
}
}
}
return $result;
}
//Returns every enrolled user (student and teacher) in a course
function backup_get_enrolled_users ($courseid) {
global $CFG;
$result = false;
//Get teachers
$teachers = get_records_sql("SELECT DISTINCT userid,userid
FROM {$CFG->prefix}user_teachers
WHERE course = '$courseid'");
//Get students
$students = get_records_sql("SELECT DISTINCT userid,userid
FROM {$CFG->prefix}user_students
WHERE course = '$courseid'");
//Add teachers
if ($teachers) {
foreach ($teachers as $teacher) {
$result[$teacher->userid]->id = $teacher->userid;
}
}
//Add students
if ($students) {
foreach ($students as $student) {
$result[$student->userid]->id = $student->userid;
}
}
return $result;
}
//Returns all users (every record in users table)
function backup_get_all_users() {
global $CFG;
$result = false;
//Get users
$users = get_records_sql("SELECT DISTINCT id,id
FROM {$CFG->prefix}user");
//Add users
if ($users) {
foreach ($users as $user) {
$result[$user->id]->id = $user->id;
}
}
return $result;
}
//Calculate the number of log entries to backup
//Return an array of info (name,value)
function log_check_backup($course) {
@@ -433,6 +558,11 @@
fwrite ($bf,full_tag("STARTDATE",3,false,$course->startdate));
fwrite ($bf,full_tag("NUMSECTIONS",3,false,$course->numsections));
fwrite ($bf,full_tag("SHOWRECENT",3,false,$course->showrecent));
fwrite ($bf,full_tag("MAXBYTES",3,false,$course->maxbytes));
fwrite ($bf,full_tag("SHOWREPORTS",3,false,$course->showreports));
fwrite ($bf,full_tag("GROUPMODE",3,false,$course->groupmode));
fwrite ($bf,full_tag("GROUPMODEFORCE",3,false,$course->groupmodeforce));
fwrite ($bf,full_tag("LANG",3,false,$course->lang));
fwrite ($bf,full_tag("MARKER",3,false,$course->marker));
fwrite ($bf,full_tag("VISIBLE",3,false,$course->visible));
fwrite ($bf,full_tag("TIMECREATED",3,false,$course->timecreated));
@@ -530,7 +660,9 @@
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("INDENT",6,false,$course_module[$tok]->indent));
fwrite ($bf,full_tag("VISIBLE",6,false,$course_module[$tok]->visible));
fwrite ($bf,full_tag("GROUPMODE",6,false,$course_module[$tok]->groupmode));
fwrite ($bf,end_tag("MOD",5,true));
}
//check for next
@@ -580,6 +712,7 @@
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("EMAILSTOP",4,false,$user_data->emailstop));
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));
@@ -610,10 +743,12 @@
$user->iscoursecreator = strpos($user->info,"coursecreator");
$user->isteacher = strpos($user->info,"teacher");
$user->isstudent = strpos($user->info,"student");
$user->isneeded = strpos($user->info,"needed");
if ($user->isadmin!==false or
$user->iscoursecreator!==false or
$user->isteacher!==false or
$user->isstudent!==false) {
$user->isstudent!==false or
$user->isneeded!==false) {
//Begin ROLES tag
fwrite ($bf,start_tag("ROLES",4,true));
//PRINT ROLE INFO
@@ -647,6 +782,7 @@
fwrite ($bf,full_tag("TEA_ROLE",6,false,$tea->role));
fwrite ($bf,full_tag("EDITALL",6,false,$tea->editall));
fwrite ($bf,full_tag("TIMEMODIFIED",6,false,$tea->timemodified));
fwrite ($bf,full_tag("TIMEACCESS",6,false,$tea->timeaccess));
//Print ROLE end
fwrite ($bf,end_tag("ROLE",5,true));
}
@@ -661,13 +797,38 @@
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));
fwrite ($bf,full_tag("TIMEACCESS",6,false,$stu->timeaccess));
//Print ROLE end
fwrite ($bf,end_tag("ROLE",5,true));
}
//Needed
if ($user->isneeded!==false) {
//Print ROLE start
fwrite ($bf,start_tag("ROLE",5,true));
//Print Role info
fwrite ($bf,full_tag("TYPE",6,false,"needed"));
//Print ROLE end
fwrite ($bf,end_tag("ROLE",5,true));
}
//End ROLES tag
fwrite ($bf,end_tag("ROLES",4,true));
//Check if we have user_preferences to backup
if ($preferences_data = get_records("user_preferences","userid",$user->old_id)) {
//Start USER_PREFERENCES tag
fwrite ($bf,start_tag("USER_PREFERENCES",4,true));
//Write each user_preference
foreach ($preferences_data as $user_preference) {
fwrite ($bf,start_tag("USER_PREFERENCE",5,true));
fwrite ($bf,full_tag("NAME",6,false,$user_preference->name));
fwrite ($bf,full_tag("VALUE",6,false,$user_preference->value));
fwrite ($bf,end_tag("USER_PREFERENCE",5,true));
}
//End USER_PREFERENCES tag
fwrite ($bf,end_tag("USER_PREFERENCES",4,true));
}
}
//End User tag
fwrite ($bf,end_tag("USER",3,true));
@@ -684,8 +845,8 @@
//End Users tag
fwrite ($bf,end_tag("USERS",2,true));
} else {
//There isn't users. Impossible !!
$status = false;
// There aren't any users.
$status = true;
}
return $status;
@@ -732,6 +893,7 @@
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("CMID",4,false,$log->cmid));
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));
@@ -799,6 +961,117 @@
return $status;
}
//Backup events info (course events)
function backup_events_info($bf,$preferences) {
global $CFG;
$status = true;
//Counter, points to current record
$counter = 0;
//Get events (course events)
$events = get_records_select("event","courseid='$preferences->backup_course' AND instance='0'","id");
//Pring events header
if ($events) {
//Pring events header
fwrite ($bf,start_tag("EVENTS",2,true));
//Iterate
foreach ($events as $event) {
//Begin event tag
fwrite ($bf,start_tag("EVENT",3,true));
//Output event tag
fwrite ($bf,full_tag("ID",4,false,$event->id));
fwrite ($bf,full_tag("NAME",4,false,$event->name));
fwrite ($bf,full_tag("DESCRIPTION",4,false,$event->description));
fwrite ($bf,full_tag("GROUPID",4,false,$event->groupid));
fwrite ($bf,full_tag("USERID",4,false,$event->userid));
fwrite ($bf,full_tag("EVENTTYPE",4,false,$event->eventtype));
fwrite ($bf,full_tag("TIMESTART",4,false,$event->timestart));
fwrite ($bf,full_tag("TIMEDURATION",4,false,$event->timeduration));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$event->timemodified));
//End event tag
fwrite ($bf,end_tag("EVENT",3,true));
}
//End events tag
$status = fwrite ($bf,end_tag("EVENTS",2,true));
}
return $status;
}
//Backup groups info
function backup_groups_info($bf,$preferences) {
global $CFG;
$status = true;
$status2 = true;
//Get groups
$groups = get_records("groups","courseid",$preferences->backup_course);
//Pring groups header
if ($groups) {
//Pring groups header
fwrite ($bf,start_tag("GROUPS",2,true));
//Iterate
foreach ($groups as $group) {
//Begin group tag
fwrite ($bf,start_tag("GROUP",3,true));
//Output group contents
fwrite ($bf,full_tag("ID",4,false,$group->id));
fwrite ($bf,full_tag("COURSEID",4,false,$group->courseid));
fwrite ($bf,full_tag("NAME",4,false,$group->name));
fwrite ($bf,full_tag("DESCRIPTION",4,false,$group->description));
fwrite ($bf,full_tag("LANG",4,false,$group->lang));
fwrite ($bf,full_tag("PICTURE",4,false,$group->picture));
fwrite ($bf,full_tag("HIDEPICTURE",4,false,$group->hidepicture));
fwrite ($bf,full_tag("TIMECREATED",4,false,$group->timecreated));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$group->timemodified));
//Now, backup groups_members
$status2 = backup_groups_members_info($bf,$preferences,$group->id);
//End group tag
fwrite ($bf,end_tag("GROUP",3,true));
}
//End groups tag
$status = fwrite ($bf,end_tag("GROUPS",2,true));
}
return ($status && $status2);
}
//Backup groups_members info
function backup_groups_members_info($bf,$preferences,$groupid) {
global $CFG;
$status = true;
//Get groups_members
$groups_members = get_records("groups_members","groupid",$groupid);
//Pring groups_members header
if ($groups_members) {
//Pring groups_members header
fwrite ($bf,start_tag("MEMBERS",4,true));
//Iterate
foreach ($groups_members as $group_member) {
//Begin group_member tag
fwrite ($bf,start_tag("MEMBER",5,true));
//Output group_member contents
fwrite ($bf,full_tag("USERID",6,false,$group_member->userid));
fwrite ($bf,full_tag("TIMEADDED",6,false,$group_member->timeadded));
//End group_member tag
fwrite ($bf,end_tag("MEMBER",5,true));
}
//End groups_members tag
$status = fwrite ($bf,end_tag("MEMBERS",4,true));
}
return $status;
}
//Start the modules tag
function backup_modules_start ($bf,$preferences) {
@@ -970,30 +1243,40 @@
global $CFG;
$status = true;
//Define zip location (from)
$from_zip_file = $CFG->dataroot."/temp/backup/".$preferences->backup_unique_code."/".$preferences->backup_name;
//Define zip destination (course dir)
$to_zip_file = $CFG->dataroot."/".$preferences->backup_course;
//Initialise $to_zip_file
$to_zip_file="";
//echo "<p>From: ".$from_zip_file."<br>"; //Debug
//If $preferences->backup_destination isn't empty, then copy to custom directory
if (!empty($preferences->backup_destination)) {
$to_zip_file = $preferences->backup_destination."/".$preferences->backup_name;
} else {
//Define zip destination (course dir)
$to_zip_file = $CFG->dataroot."/".$preferences->backup_course;
//echo "<p>From: ".$from_zip_file."<br>"; //Debug
//echo "<p>Checking: ".$to_zip_file."<br>"; //Debug
//Checks course dir exists
$status = check_dir_exists($to_zip_file,true);
//Define zip destination (backup dir)
$to_zip_file = $to_zip_file."/backupdata";
//echo "<p>Checking: ".$to_zip_file."<br>"; //Debug
//Checks backup dir exists
$status = check_dir_exists($to_zip_file,true);
//echo "<p>Checking: ".$to_zip_file."<br>"; //Debug
//Define zip destination (zip file)
$to_zip_file = $to_zip_file."/".$preferences->backup_name;
}
//Checks course dir exists
$status = check_dir_exists($to_zip_file,true);
//Define zip destination (backup dir)
$to_zip_file = $to_zip_file."/backupdata";
//echo "<p>Checking: ".$to_zip_file."<br>"; //Debug
//Checks backup dir exists
$status = check_dir_exists($to_zip_file,true);
//Define zip destination (zip file)
$to_zip_file = $to_zip_file."/".$preferences->backup_name;
//echo "<p>To: ".$to_zip_file."<br>"; //Debug
//Copy zip file
+208
View File
@@ -0,0 +1,208 @@
<?php
//Get some strings
$yes = get_string("yes");
$no = get_string("no");
$withuserdata = get_string("withuserdata");
$withoutuserdata = get_string("withoutuserdata");
$course = get_string("course");
$all = get_string("all");
$include = get_string("include");
$modules = get_string("modules");
//Get backup_config pairs
$backup_config = backup_get_config();
//Checks backup_config pairs exist
if (!isset($backup_config->backup_sche_modules)) {
$backup_config->backup_sche_modules = 1;
}
if (!isset($backup_config->backup_sche_withuserdata)) {
$backup_config->backup_sche_withuserdata = 1;
}
if (!isset($backup_config->backup_sche_users)) {
$backup_config->backup_sche_users = 1;
}
if (!isset($backup_config->backup_sche_logs)) {
$backup_config->backup_sche_logs = 0;
}
if (!isset($backup_config->backup_sche_userfiles)) {
$backup_config->backup_sche_userfiles = 1;
}
if (!isset($backup_config->backup_sche_coursefiles)) {
$backup_config->backup_sche_coursefiles = 1;
}
if (!isset($backup_config->backup_sche_active)) {
$backup_config->backup_sche_active = 0;
}
if (!isset($backup_config->backup_sche_weekdays)) {
$backup_config->backup_sche_weekdays = "0000000";
}
if (!isset($backup_config->backup_sche_hour)) {
$backup_config->backup_sche_hour = 00;
}
if (!isset($backup_config->backup_sche_minute)) {
$backup_config->backup_sche_minute = 00;
}
if (!isset($backup_config->backup_sche_destination)) {
$backup_config->backup_sche_destination = "";
}
if (!isset($backup_config->backup_sche_keep)) {
$backup_config->backup_sche_keep = 1;
}
//print_object($backup_config); //Debug
//Yes/no array for use in yes/no menu
$yesno_array[0] = $no;
$yesno_array[1] = $yes;
//With user data/without user data array for use in menu
$withwithout_array[0] = $withoutuserdata;
$withwithout_array[1] = $withuserdata;
//Course/alla array for use in course/all menu
$courseall_array[0] = $all;
$courseall_array[1] = $course;
//Keep array for use in keep menu
$keep_array[0] = $all;
$keep_array[1] = "1";
$keep_array[2] = "2";
$keep_array[5] = "5";
$keep_array[10] = "10";
$keep_array[20] = "20";
$keep_array[30] = "30";
$keep_array[40] = "40";
$keep_array[50] = "50";
$keep_array[100] = "100";
$keep_array[200] = "200";
$keep_array[300] = "300";
$keep_array[400] = "400";
$keep_array[500] = "500";
?>
<form method="post" action="backup.php" name="form">
<table cellpadding=9 cellspacing=0 >
<tr valign=top>
<td colspan = 3 align=center><strong><?php print_string("settings") ?></strong></td>
</tr>
<tr valign=top>
<td align=right><p><?php print_string("includemodules") ?>:</td>
<td nowrap>
<?php choose_from_menu($yesno_array, "backup_sche_modules", $backup_config->backup_sche_modules, "") ?>
<?php choose_from_menu($withwithout_array, "backup_sche_withuserdata", $backup_config->backup_sche_withuserdata, "") ?>
</td>
<td>
<?php print_string("backupincludemoduleshelp") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p><?php print_string("users") ?>:</td>
<td>
<?php choose_from_menu($courseall_array, "backup_sche_users", $backup_config->backup_sche_users, "") ?>
</td>
<td>
<?php print_string("backupusershelp") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p><?php print_string("logs") ?>:</td>
<td>
<?php choose_from_menu($yesno_array, "backup_sche_logs", $backup_config->backup_sche_logs, "") ?>
</td>
<td>
<?php print_string("backuplogshelp") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p><?php print_string("userfiles") ?>:</td>
<td>
<?php choose_from_menu($yesno_array, "backup_sche_userfiles", $backup_config->backup_sche_userfiles, "") ?>
</td>
<td>
<?php print_string("backupuserfileshelp") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p><?php print_string("coursefiles") ?>:</td>
<td>
<?php choose_from_menu($yesno_array, "backup_sche_coursefiles", $backup_config->backup_sche_coursefiles, "") ?>
</td>
<td>
<?php print_string("backupcoursefileshelp") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p><?php print_string("keep") ?>:</td>
<td>
<?php
choose_from_menu($keep_array, "backup_sche_keep", $backup_config->backup_sche_keep, "");
print_string("files");
?>
</td>
<td>
<?php print_string("backupkeephelp") ?>
</td>
</tr>
<tr valign=top>
<td colspan = 3 align=center><strong><?php print_string("schedule") ?></strong></td>
</tr>
<tr valign=top>
<td colspan = 3 align=center>
<?php print_string("active") ?>: <?php choose_from_menu($yesno_array, "backup_sche_active", $backup_config->backup_sche_active, "") ?>
</td>
</tr>
<tr>
<td colspan=3 align=center>
<?php
//Get first day of week from languaje files
//after searching the web I haven't find a sytem to retrieve it in php from locale info
$firstdayofweek = get_string("firstdayofweek");
//If it is empty ot it is different of 1, default to 0
if (!isset($firstdayofweek) || $firstdayofweek != 1) {
$firstdayofweek = 0;
}
//Now create the timestamp of a well-know sunday (02/25/2001, my 31th birthday (stronk7) !!)
$onesunday = make_timestamp(2001,2,25);
$i = 0;
$day_names = "";
$check_names = "";
while ($i<7) {
$day_names[] = strftime("%A",$onesunday + (($firstdayofweek+$i)*86400));
//Calculate standard day of week (0=Sunday......6=Saturday)
//to store info in that exact order in DB
$stddayofweek = ($i+$firstdayofweek) % 7;
//Calculate the status of the checkbox
if (substr($backup_config->backup_sche_weekdays,$stddayofweek,1) == "1") {
$strchecked = " checked";
} else {
$strchecked = "";
}
$check_names[] = "<input type=\"checkbox\" name=\"dayofweek_$stddayofweek\" value=\"1\"$strchecked>";
$i++;
}
$table->align = array("center","center","center","center","center","center","center");
$table->head = $day_names;
$table->data[] = $check_names;
print_table($table);
?>
</td>
</tr>
<tr valign=top>
<td colspan = 3 align=center>
<?php print_string("executeat") ?>: <?php print_time_selector("backup_sche_hour","backup_sche_minute",make_timestamp(2000,1,1,$backup_config->backup_sche_hour,$backup_config->backup_sche_minute)) ?>
</td>
</tr>
<tr valign=top>
<td colspan = 3 align=center>
<?php print_string("saveto") ?>: <input name="backup_sche_destination" type="text" size="40" value="<?php p($backup_config->backup_sche_destination) ?>"><br><?php if (!empty($sche_destination_error)) { formerr($sche_destination_error); echo "<br>"; } ?><?php print_string("backupsavetohelp") ?>
</td>
</tr>
<tr>
<td colspan=3 align=center>
<input type="submit" value="<?php print_string("savechanges") ?>"></td>
</tr>
</table>
</form>
+35 -1
View File
@@ -68,7 +68,41 @@ function backup_upgrade($oldversion=0) {
if ($oldversion < 2003082600 and $result) {
print_simple_box("This is the first non-alpha release of the Backup/Restore module.<p>Thanks for upgrading!","center", "50%", "$THEME->cellheading", "20", "noticebox");
}
}
if ($oldversion < 2003112700 and $result) {
$result = execute_sql("CREATE TABLE `{$CFG->prefix}backup_config` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
`value` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) TYPE=MyISAM COMMENT='To store backup configuration variables'");
}
if ($oldversion < 2003120800 and $result) {
$result = execute_sql("CREATE TABLE `{$CFG->prefix}backup_courses` (
`id` int(10) unsigned NOT NULL auto_increment,
`courseid` int(10) unsigned NOT NULL default '0',
`laststarttime` int(10) unsigned NOT NULL default '0',
`lastendtime` int(10) unsigned NOT NULL default '0',
`laststatus` varchar(1) NOT NULL default '0',
`nextstarttime` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `courseid` (`courseid`)
) TYPE=MyISAM COMMENT='To store every course backup status'");
if ($result) {
$result = execute_sql("CREATE TABLE `{$CFG->prefix}backup_log` (
`id` int(10) unsigned NOT NULL auto_increment,
`courseid` int(10) unsigned NOT NULL default '0',
`time` int(10) unsigned NOT NULL default '0',
`laststarttime` int(10) unsigned NOT NULL default '0',
`info` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='To store every course backup log info'");
}
}
//Finally, return result
return $result;
+44
View File
@@ -24,4 +24,48 @@ CREATE TABLE `prefix_backup_ids` (
`info` mediumtext,
PRIMARY KEY (`backup_code`,`table_name`,`old_id`)
) TYPE=MyISAM COMMENT='To store and convert ids in backup/restore';
# --------------------------------------------------------
#
# Table structure for table `prefix_backup_config`
#
CREATE TABLE `prefix_backup_config` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
`value` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) TYPE=MyISAM COMMENT='To store backup configuration variables';
# --------------------------------------------------------
#
# Table structure for table `prefix_backup_courses`
#
CREATE TABLE `prefix_backup_courses` (
`id` int(10) unsigned NOT NULL auto_increment,
`courseid` int(10) unsigned NOT NULL default '0',
`laststarttime` int(10) unsigned NOT NULL default '0',
`lastendtime` int(10) unsigned NOT NULL default '0',
`laststatus` varchar(1) NOT NULL default '0',
`nextstarttime` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `courseid` (`courseid`)
) TYPE=MyISAM COMMENT='To store every course backup status';
# --------------------------------------------------------
#
# Table structure for table `prefix_backup_log`
#
CREATE TABLE `prefix_backup_log` (
`id` int(10) unsigned NOT NULL auto_increment,
`courseid` int(10) unsigned NOT NULL default '0',
`time` int(10) unsigned NOT NULL default '0',
`laststarttime` int(10) unsigned NOT NULL default '0',
`info` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='To store every course backup log info';
# --------------------------------------------------------
+130
View File
@@ -0,0 +1,130 @@
rem
rem Table structure for table prefix_backup_files
rem
drop table prefix_backup_files;
CREATE TABLE prefix_backup_files (
backup_code number(10) default '0' NOT NULL,
file_type varchar2(10) default '' NOT NULL,
path varchar2(255) default '' NOT NULL,
old_id number(10) default NULL,
new_id number(10) default NULL
);
ALTER TABLE prefix_backup_files
ADD CONSTRAINT pbf_pk
PRIMARY KEY (backup_code,file_type,path);
COMMENT on table prefix_backup_files is 'To store and recode ids to user and course files.';
rem --------------------------------------------------------
rem
rem Table structure for table prefix_backup_ids
rem
drop table prefix_backup_ids;
CREATE TABLE prefix_backup_ids (
backup_code number(12) default '0' NOT NULL,
table_name varchar2(30) default '' NOT NULL,
old_id number(10) default '0' NOT NULL,
new_id number(10) default NULL,
info varchar2(20)
);
ALTER TABLE prefix_backup_ids
ADD CONSTRAINT pbi_pk
PRIMARY KEY (backup_code,table_name,old_id);
COMMENT on table prefix_backup_ids is 'To store and convert ids in backup/restore';
rem --------------------------------------------------------
rem
rem Table structure for table prefix_backup_config
rem
drop TABLE prefix_backup_config;
CREATE TABLE prefix_backup_config (
id number(10) not null,
name varchar2(255) not null,
value varchar2(255) not null,
constraint pk_baco primary key (id),
constraint uk_baco_name unique (name)
);
COMMENT on table prefix_backup_config is 'To store backup configuration variables';
drop sequence p_backup_config_seq;
create sequence p_backup_config_seq;
create or replace trigger p_backup_config_trig
before insert on prefix_backup_config
referencing new as new_row
for each row
begin
select p_backup_config_seq.nextval into :new_row.id from dual;
end;
rem --------------------------------------------------------
rem
rem Table structure for table prefix_backup_courses
rem
drop TABLE prefix_backup_courses;
CREATE TABLE prefix_backup_courses (
id number(10) default '0' NOT NULL,
courseid number(10) default '0' NOT NULL,
laststarttime number(10) default '0' NOT NULL,
lastendtime number(10) default '0' NOT NULL,
laststatus varchar2(1) default '0' NOT NULL,
nextstarttime number(10) default '0' NOT NULL,
constraint pk_bacu primary key (id),
constraint uk_bacu_courseid unique (courseid)
);
COMMENT on table prefix_backup_courses is 'To store every course backup status';
drop sequence p_backup_courses_seq;
create sequence p_backup_courses_seq;
create or replace trigger p_backup_courses_trig
before insert on prefix_backup_courses
referencing new as new_row
for each row
begin
select p_backup_courses_seq.nextval into :new_row.id from dual;
end;
rem --------------------------------------------------------
rem
rem Table structure for table prefix_backup_log
rem
drop TABLE prefix_backup_log;
CREATE TABLE prefix_backup_log (
id number(10) default '0' NOT NULL,
courseid number(10) default '0' NOT NULL,
time number(10) default '0' NOT NULL,
laststarttime number(10) default '0' NOT NULL,
info varchar2(255) default '0' NOT NULL,
constraint pk_balo primary key (id)
);
COMMENT on table prefix_backup_log is 'To store every course backup log info';
drop sequence p_backup_log_seq;
create sequence p_backup_log_seq;
create or replace trigger p_backup_log_trig
before insert on prefix_backup_log
referencing new as new_row
for each row
begin
select p_backup_log_seq.nextval into :new_row.id from dual;
end;
/
+33
View File
@@ -31,4 +31,37 @@ CREATE TABLE prefix_backup_ids (
CREATE INDEX prefix_backup_codenameid_idx ON prefix_backup_ids (backup_code,table_name,old_id);
#
# Table structure for table prefix_backup_config
#
CREATE TABLE prefix_backup_config (
id SERIAL PRIMARY KEY,
name varchar(255) UNIQUE NOT NULL default '',
value varchar(255) NOT NULL default ''
);
#
# Table structure for table prefix_backup_courses
#
CREATE TABLE prefix_backup_courses (
id SERIAL PRIMARY KEY,
courseid int8 UNIQUE NOT NULL default '0',
laststarttime int8 NOT NULL default '0',
lastendtime int8 NOT NULL default '0',
laststatus varchar(1) NOT NULL default '0',
nextstarttime int8 NOT NULL default '0'
);
#
# Table structure for table prefix_backup_log
#
CREATE TABLE prefix_backup_log (
id SERIAL PRIMARY KEY,
courseid int8 NOT NULL default '0',
time int8 NOT NULL default '0',
laststarttime int8 NOT NULL default '0',
info varchar(255) NOT NULL default ''
);
+42 -7
View File
@@ -2,6 +2,28 @@
//This file contains all the general function needed (file manipulation...)
//not directly part of the backup/restore utility
//Sets a name/value pair in backup_config table
function backup_set_config($name, $value) {
if (get_field("backup_config", "name", "name", $name)) {
return set_field("backup_config", "value", $value, "name", $name);
} else {
$config->name = $name;
$config->value = $value;
return insert_record("backup_config", $config);
}
}
//Gets all the information from backup_config table
function backup_get_config() {
$backup_config = null;
if ($configs = get_records("backup_config")) {
foreach ($configs as $config) {
$backup_config[$config->name] = $config->value;
}
}
return (object)$backup_config;
}
//Delete old data in backup tables (if exists)
//Two days seems to be apropiate
function backup_delete_old_data() {
@@ -184,6 +206,8 @@
//This function return the names of all directories under a give directory
//Not recursive
function list_directories ($rootdir) {
$results = null;
$dir = opendir($rootdir);
while ($file=readdir($dir)) {
@@ -201,6 +225,8 @@
//This function return the names of all directories and files under a give directory
//Not recursive
function list_directories_and_files ($rootdir) {
$results = "";
$dir = opendir($rootdir);
while ($file=readdir($dir)) {
@@ -252,10 +278,15 @@
//Little modifications done
function backup_copy_file ($from_file,$to_file) {
global $CFG;
if (is_file($from_file)) {
//echo "<br>Copying ".$from_file." to ".$to_file; //Debug
$perms=fileperms($from_file);
return copy($from_file,$to_file) && chmod($to_file,$perms);
//$perms=fileperms($from_file);
//return copy($from_file,$to_file) && chmod($to_file,$perms);
umask(0000);
return copy($from_file,$to_file) && chmod($to_file,$CFG->directorypermissions);
}
else if (is_dir($from_file)) {
return backup_copy_dir($from_file,$to_file);
@@ -272,6 +303,7 @@
if (!is_dir($to_file)) {
//echo "<br>Creating ".$to_file; //Debug
umask(0000);
$status = mkdir($to_file,$CFG->directorypermissions);
}
$dir = opendir($from_file);
@@ -355,7 +387,6 @@
global $CFG;
$max_db_storage = 128; //Max bytes to save to db, else save to file
//MUST BE LOWER THAN 256 (VARCHAR LIMIT)
$status = true;
@@ -382,10 +413,14 @@
//Now, insert the record
if ($status) {
$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_to_save')",false);
//Build the record
$rec->backup_code = $backup_unique_code;
$rec->table_name = $table;
$rec->old_id = $old_id;
$rec->new_id =$new_id;
$rec->info = $info_to_save;
$status = insert_record ("backup_ids", $rec, false,"backup_code");
}
return $status;
}
+138
View File
@@ -0,0 +1,138 @@
<?PHP // $Id$
// backup.php - allows admin to edit all configuration variables for scheduled backups
require_once("../config.php");
require_once("../backup/lib.php");
optional_variable($courseid);
require_login();
if (!isadmin()) {
error("Only an admin can use this page");
}
if (!$site = get_site()) {
error("Site isn't defined!");
}
//Get needed strings
$backuploglaststatus = get_string("backuploglaststatus");
$backuplogdetailed = get_string("backuplogdetailed");
$stradmin = get_string("administration");
$strconfiguration = get_string("configuration");
$strbackup = get_string("backup");
$strbackupdetails = get_string("backupdetails");
$strlogs = get_string("logs");
$strftimedatetime = get_string("strftimerecent");
$strftimetime = get_string("strftimetime").":%S";
$strerror = get_string("error");
$strok = get_string("ok");
$strcourse = get_string("course");
$strtimetaken = get_string("timetaken","quiz");
$strstatus = get_string("status");
$strnext = get_string("next");
//Decide when to show last execution logs or detailed logs
//Lastlog view
if (!$courseid) {
print_header("$site->shortname: $strconfiguration: $strbackup", $site->fullname,
"<a href=\"../admin/index.php\">$stradmin</a> -> ".
"<a href=\"../admin/configure.php\">$strconfiguration</a> -> ".
"<a href=\"../admin/backup.php\">$strbackup</a> -> ".
$strlogs);
print_heading($backuploglaststatus);
print_simple_box_start("center", "", "$THEME->cellheading");
//Now, get every record from backup_courses
$courses = get_records("backup_courses");
if (!$courses) {
notify("No logs found!");
} else {
echo "<table border=0 align=center cellpadding=3 cellspacing=3>";
//Print table header
echo "<tr nowrap>";
echo "<td nowrap align=center><font size=3>$strcourse</font></td>";
echo "<td nowrap align=center colspan=3><font size=3>$strtimetaken</font></td>";
echo "<td nowrap align=center><font size=3>$strstatus</font></td>";
echo "<td nowrap align=center><font size=3>$strnext</font></td>";
foreach ($courses as $course) {
//Get the course shortname
$coursename = get_field ("course","fullname","id",$course->courseid);
if ($coursename) {
echo "<tr nowrap>";
echo "<td nowrap><font size=2><a href=\"log.php?courseid=$course->courseid\">".$coursename."</a></td>";
echo "<td nowrap><font size=2>".userdate($course->laststarttime,$strftimedatetime)."</td>";
echo "<td nowrap><font size=2> - </td>";
echo "<td nowrap><font size=2>".userdate($course->lastendtime,$strftimedatetime)."</td>";
if (!$course->laststatus) {
echo "<td nowrap align=center><font size=2 color=red>".$strerror."</td>";
} else {
echo "<td nowrap align=center><font size=2 color=green>".$strok."</td>";
}
echo "<td nowrap><font size=2>".userdate($course->nextstarttime,$strftimedatetime)."</td>";
echo "</tr>";
}
}
echo "</table>";
}
print_simple_box_end();
//Detailed View !!
} else {
print_header("$site->shortname: $strconfiguration: $strbackup", $site->fullname,
"<a href=\"../admin/index.php\">$stradmin</a> -> ".
"<a href=\"../admin/configure.php\">$strconfiguration</a> -> ".
"<a href=\"../admin/backup.php\">$strbackup</a> -> ".
"<a href=\"log.php\">$strlogs</a> -> ".
$strbackupdetails);
print_heading($backuplogdetailed);
$coursename = get_field("course","fullname","id","$courseid");
print_heading("$strcourse: $coursename");
print_simple_box_start("center", "", "$THEME->cellheading");
//First, me get all the distinct backups for that course in backup_log
$executions = get_records_sql("SELECT DISTINCT laststarttime,laststarttime
FROM {$CFG->prefix}backup_log
WHERE courseid = '$courseid'
ORDER BY laststarttime DESC");
//Iterate over backup executions
if (!$executions) {
notify("No logs found!");
} else {
echo "<table border=0 align=center cellpadding=3 cellspacing=3>";
foreach($executions as $execution) {
echo "<tr nowrap>";
echo "<td nowrap align=center colspan=3>";
print_simple_box("<center>".userdate($execution->laststarttime)."</center>", "center");
echo "</td>";
echo "</tr>";
$logs = get_records_sql("SELECT *
FROM {$CFG->prefix}backup_log
WHERE courseid = '$courseid' AND
laststarttime = '$execution->laststarttime'
ORDER BY time");
if ($logs) {
foreach ($logs as $log) {
echo "<tr nowrap>";
echo "<td nowrap><font size=2>".userdate($log->time,$strftimetime)."</font></td>";
$log->info = str_replace("- ERROR!!","- <font color=red>ERROR!!</font>",$log->info);
$log->info = str_replace("- OK","- <font color=green>OK</font>",$log->info);
echo "<td nowrap><font size=2>".str_replace(" ","&nbsp;&nbsp;&nbsp;&nbsp;",$log->info)."</font></td>";
echo "</tr>";
}
}
}
echo "</table>";
}
print_simple_box_end();
}
print_footer();
?>
+2
View File
@@ -76,6 +76,8 @@
error("Course ID was incorrect (can't find it)");
}
check_for_restricted_user($USER->username, "$CFG->wwwroot/course/view.php?id=$course->id");
//Print header
if (isadmin()) {
print_header("$site->shortname: $strcourserestore", $site->fullname,
+6 -4
View File
@@ -9,12 +9,14 @@
if ($SESSION) {
$info = $SESSION->info;
$course_header = $SESSION->course_header;
$restore = $SESSION->restore;
if (isset($SESSION->restore)) {
$restore = $SESSION->restore;
}
}
//If restore session info exists, but we are posting parameters
//manually, this has prioriry
if ($restore and isset($restore_restoreto)) {
if (isset($restore) and isset($restore_restoreto)) {
unset($restore);
}
@@ -29,7 +31,7 @@
//If the restore object doesn't exist, we are going
//to check every variable individually and create it
if (!$restore) {
if (!isset($restore)) {
//Check that we have all we need
//backup_unique_code
require_variable($backup_unique_code);
@@ -146,7 +148,7 @@
//Now, select the course if needed
if (($restore->restoreto == 0 or $restore->restoreto == 1) and ($restore->course_id == 0) and (isadmin())) {
if ($courses = get_courses()) {
if ($courses = get_courses("all","c.fullname")) {
print_heading(get_string("choosecourse"));
print_simple_box_start("CENTER");
foreach ($courses as $course) {
+23 -17
View File
@@ -143,9 +143,6 @@
$exists_count = 0;
$student_count = 0;
$teacher_count = 0;
$coursecreator_count = 0;
$admin_count = 0;
$other_count = 0;
$counter = 0;
//Iterate, filling counters
foreach ($recs as $rec) {
@@ -157,16 +154,10 @@
if (strpos($record->info,"exists") !== false) {
$exists_count++;
}
if (strpos($record->info,"student")) {
if (strpos($record->info,"student") !== false) {
$student_count++;
} else if (strpos($record->info,"teacher")) {
} else if (strpos($record->info,"teacher") !== false) {
$teacher_count++;
} else if (strpos($record->info,"admin")) {
$admin_count++;
} else if (strpos($record->info,"coursecreator")) {
$coursecreator_count++;
} else if ($record->info == "new" or $record->info == "exists") {
$other_count++;
}
//Do some output
$counter++;
@@ -183,13 +174,9 @@
echo "<ul>";
echo "<li>".get_string("students").": ".$student_count;
echo "<li>".get_string("teachers").": ".$teacher_count;
echo "<li>".get_string("coursecreators").": ".$coursecreator_count;
echo "<li>".get_string("administrators").": ".$admin_count;
echo "<li>".get_string("other").": ".$other_count;
echo "</ul>";
} else {
notify("Something is wrong - no users were found!");
$status = false;
notify("No users were found!");
}
}
}
@@ -240,6 +227,22 @@
}
}
//Now create groups as needed
if ($status) {
echo "<li>".get_string("creatinggroups");
if (!$status = restore_create_groups($restore,$xml_file)) {
notify("Could not restore groups!");
}
}
//Now create events as needed
if ($status) {
echo "<li>".get_string("creatingevents");
if (!$status = restore_create_events($restore,$xml_file)) {
notify("Could not restore course events!");
}
}
//Now create course modules as needed
if ($status) {
echo "<li>".get_string("creatingcoursemodules");
@@ -250,7 +253,10 @@
//Now create log entries as needed
if ($status and ($restore->logs)) {
echo "<li>".get_string("creatinglogentries")."<b> (not implemented!!)</b>";
echo "<li>".get_string("creatinglogentries");
if (!$status = restore_create_logs($restore,$xml_file)) {
notify("Could not restore logs!");
}
}
//Now, if all is OK, adjust the instance field in course_modules !!
+27 -21
View File
@@ -98,7 +98,7 @@
?>
<form name="form" method="post" <?php echo $onsubmit ?> action="<?php echo $ME ?>">
<form name="form" method="post" action="<?php echo $ME ?>">
<table cellpadding=5>
<?php
@@ -130,29 +130,35 @@
$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, "");
if (isset($$exist)) {
if ($$exist) {
//Now check that we have that module info in the backup file
if (isset($info->mods[$modname]) && $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 haven't userdata
echo get_string("withoutuserdata");
//Module isn't restorable
echo "<input type=\"hidden\" name=\"$restore_var\" value=\"0\">";
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\">";
+957 -22
View File
File diff suppressed because it is too large Load Diff
+42
View File
@@ -0,0 +1,42 @@
<?php
require_once ("../config.php");
require_once ("backup_scheduled.php");
require_once ("lib.php");
require_once ("backuplib.php");
require_login();
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 necessary functions exists. Thanks to gregb@crowncollege.edu
backup_required_functions();
//Adjust some php variables to the execution of this script
ini_set("max_execution_time","3000");
ini_set("memory_limit","56M");
echo "<pre>\n";
$status = true;
$courses = get_records("course");
foreach ($courses as $course) {
echo "Start course ".$course->fullname;
$preferences = schedule_backup_course_configure($course);
if ($preferences && $status) {
$status = schedule_backup_course_execute($preferences);
}
if ($status && $preferences) {
echo "End course ".$course->fullname." OK\n\n";
} else {
echo "End course ".$course->fullname." FAIL\n\n";
}
}
?>
+2 -2
View File
@@ -5,6 +5,6 @@
// database (backup_version) to determine whether upgrades should
// be performed (see db/backup_*.php)
$backup_version = 2003082800; // The current version is a date (YYYYMMDDXX)
$backup_version = 2004032500; // The current version is a date (YYYYMMDDXX)
$backup_release = "1.1"; // User-friendly version number
$backup_release = "1.2.1"; // User-friendly version number
+172 -144
View File
@@ -1,144 +1,172 @@
<?PHP // $Id$
///////////////////////////////////////////////////////////////////////////
// //
// Moodle configuration file //
// //
// This file should be renamed "config.php" in the top-level directory //
// //
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.com //
// //
// Copyright (C) 2001-2003 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 //
// //
///////////////////////////////////////////////////////////////////////////
unset($CFG); // Ignore this line
//=========================================================================
// 1. DATABASE SETUP
//=========================================================================
// First, you need to configure the database where all Moodle data //
// will be stored. This database must already have been created //
// and a username/password created to access it. //
// //
// 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 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->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 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';
//=========================================================================
// 3. SERVER FILES LOCATION
//=========================================================================
// Next, specify the full OS directory path to this same location
// 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 = '/var/www/html/moodle';
//=========================================================================
// 4. DATA FILES LOCATION
//=========================================================================
// Now you need a place where Moodle can save uploaded files. This
// 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'
$CFG->dataroot = '/home/moodledata';
//=========================================================================
// 5. DATA FILES PERMISSIONS
//=========================================================================
// 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->directorypermissions = 0777;
//=========================================================================
// 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
//=========================================================================
if (file_exists("$CFG->dirroot/lib/setup.php")) { // Do not edit
include_once("$CFG->dirroot/lib/setup.php");
} else {
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.
?>
<?PHP // $Id$
///////////////////////////////////////////////////////////////////////////
// //
// Moodle configuration file //
// //
// This file should be renamed "config.php" in the top-level directory //
// //
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.org //
// //
// Copyright (C) 1999-2004 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 //
// //
///////////////////////////////////////////////////////////////////////////
unset($CFG); // Ignore this line
//=========================================================================
// 1. DATABASE SETUP
//=========================================================================
// First, you need to configure the database where all Moodle data //
// will be stored. This database must already have been created //
// and a username/password created to access it. //
// //
// 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 already contains tables. //
// //
// A special case exists when using PostgreSQL databases via sockets. //
// Define dbhost as follows, leaving dbname, dbuser, dbpass BLANK!: //
// $CFG->dbhost = " user='muser' password='mpass' dbname='mdata'"; //
//
$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 = false; // Should database connections be reused?
// "false" is the most stable setting
// "true" can improve performance sometimes
//=========================================================================
// 2. WEB SITE LOCATION
//=========================================================================
// Now you need to tell Moodle where it is located. Specify the full
// 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';
//=========================================================================
// 3. SERVER FILES LOCATION
//=========================================================================
// Next, specify the full OS directory path to this same location
// 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 = '/home/example/www/moodle'; // Cpanel host
$CFG->dirroot = '/home/example/www/moodle';
//=========================================================================
// 4. DATA FILES LOCATION
//=========================================================================
// Now you need a place where Moodle can save uploaded files. This
// 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'
$CFG->dataroot = '/home/example/moodledata';
//=========================================================================
// 5. DATA FILES PERMISSIONS
//=========================================================================
// 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->directorypermissions = 0777;
//=========================================================================
// 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';
//=========================================================================
// 7. OTHER MISCELLANEOUS SETTINGS (ignore these for new installations)
//=========================================================================
//
// Prevent users from updating their profile images
// $CFG->disableuserimages = true;
//
// Prevent scheduled backups from operating (and hide the GUI for them)
// Useful for webhost operators who have alternate methods of backups
// $CFG->disablescheduledbackups = true;
//
// Restrict certain usernames from doing things that may mess up a site
// This is especially useful for demonstration teacher accounts
// $CFG->restrictusers = 'teacher,fred,jim';
//
// Turning this on will make Moodle filter more than usual, including
// forum subjects, activity names and so on (in ADDITION to the normal
// texts like forum postings, journals etc). This is mostly only useful
// when using the multilang filter. This feature may not be complete.
// $CFG->filterall = true;
//
// Setting this to true will enable admins to edit any post at any time
// $CFG->admineditalways = true;
//=========================================================================
// ALL DONE! To continue installation, visit your main page with a browser
//=========================================================================
if (file_exists("$CFG->dirroot/lib/setup.php")) { // Do not edit
include_once("$CFG->dirroot/lib/setup.php");
} else {
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.
?>
+51 -42
View File
@@ -22,17 +22,20 @@
if (iscreator()) {
if (isset($_GET['edit'])) {
if ($edit == "on") {
$USER->editing = true;
$USER->categoryediting = true;
} else if ($edit == "off") {
$USER->editing = false;
$USER->categoryediting = false;
}
}
$navbaritem = update_category_button($category->id);
$creatorediting = !empty($USER->editing);
$creatorediting = !empty($USER->categoryediting);
$adminediting = (isadmin() and $creatorediting);
} else {
if (!$category->visible) {
error(get_string('notavailable', 'error'));
}
$navbaritem = print_course_search("", true, "navbar");
$adminediting = false;
$creatorediting = false;
@@ -67,17 +70,17 @@
if ($creatorediting) {
if ($adminediting) {
print_header("$site->shortname: $category->name", "$site->fullname",
print_header("$site->shortname: $category->name", "$site->fullname: $strcourses",
"<a href=\"../$CFG->admin/index.php\">$stradministration</a> -> ".
"<a href=\"index.php\">$strcategories</a> -> $category->name",
"", "", true, $navbaritem);
} else {
print_header("$site->shortname: $category->name", "$site->fullname",
"<a href=\"index.php\">$strcourses</a> -> $category->name", "", "", true, $navbaritem);
print_header("$site->shortname: $category->name", "$site->fullname: $strcourses",
"<a href=\"index.php\">$strcategories</a> -> $category->name", "", "", true, $navbaritem);
}
} else {
print_header("$site->shortname: $category->name", "$site->fullname",
"<a href=\"index.php\">$strcourses</a> -> $category->name", "", "", true, $navbaritem);
print_header("$site->shortname: $category->name", "$site->fullname: $strcourses",
"<a href=\"index.php\">$strcategories</a> -> $category->name", "", "", true, $navbaritem);
}
@@ -88,7 +91,9 @@
make_categories_list($displaylist, $parentlist, "");
echo "<table align=center><tr><td>";
echo "<table align=center><tr><td align=\"right\">";
echo "<p>$strcategories:</p>";
echo "</td><td>";
popup_form("category.php?id=", $displaylist, "switchcategory", "$category->id", "", "", "", false);
echo "</td></tr></table><br />";
@@ -201,14 +206,23 @@
/// Print out all the sub-categories
if ($subcategories = get_records("course_categories", "parent", $category->id)) {
echo "<table align=\"center\" border=0 cellspacing=2 cellpadding=4 class=\"generalbox\">";
echo "<tr><th>".get_string("subcategories")."</th></tr>";
echo "<tr><td nowrap>";
$firstentry = true;
foreach ($subcategories as $subcategory) {
echo "<a href=\"category.php?id=$subcategory->id\">$subcategory->name</a><br />";
if ($subcategory->visible or iscreator()) {
if ($firstentry) {
echo "<table align=\"center\" border=0 cellspacing=2 cellpadding=4 class=\"generalbox\">";
echo "<tr><th>".get_string("subcategories")."</th></tr>";
echo "<tr><td nowrap>";
$firstentry = false;
}
$catlinkcss = $subcategory->visible ? "" : " class=\"dimmed\" ";
echo "<a $catlinkcss href=\"category.php?id=$subcategory->id\">$subcategory->name</a><br />";
}
}
if (!$firstentry) {
echo "</td></tr></table>";
echo "<br />";
}
echo "</td></tr></table>";
echo "<br />";
}
@@ -219,7 +233,7 @@
if (!$courses) {
print_heading(get_string("nocoursesyet"));
} else if ($numcourses <= COURSE_MAX_SUMMARIES_PER_PAGE and !$creatorediting) {
} else if ($numcourses <= COURSE_MAX_SUMMARIES_PER_PAGE and !$page and !$creatorediting) {
print_courses($category, "80%");
} else {
@@ -264,49 +278,44 @@
$count = 0;
$abletomovecourses = false; // for now
foreach ($courses as $course) {
foreach ($courses as $acourse) {
$count++;
$up = ($count == 1) ? false : true;
$down = ($count == $numcourses) ? false : true;
$linkcss = $course->visible ? "" : " class=\"dimmed\" ";
$linkcss = $acourse->visible ? "" : " class=\"dimmed\" ";
echo "<tr>";
echo "<td><a $linkcss href=\"view.php?id=$course->id\">$course->fullname</a></td>";
echo "<td><a $linkcss href=\"view.php?id=$acourse->id\">$acourse->fullname</a></td>";
if ($creatorediting) {
if ($adminediting) {
echo "<td>";
echo "<a title=\"$strassignteachers\" href=\"$CFG->wwwroot/course/teacher.php?id=$course->id\"><img".
echo "<a title=\"$strassignteachers\" href=\"$CFG->wwwroot/course/teacher.php?id=$acourse->id\"><img".
" src=\"$pixpath/t/user.gif\" height=11 width=11 border=0></a> ";
echo "<a title=\"$strdelete\" href=\"delete.php?id=$course->id\"><img".
echo "<a title=\"$strdelete\" href=\"delete.php?id=$acourse->id\"><img".
" src=\"$pixpath/t/delete.gif\" height=11 width=11 border=0></a> ";
if (!empty($course->visible)) {
echo "<a title=\"$strhide\" href=\"category.php?id=$category->id&hide=$course->id\"><img".
if (!empty($acourse->visible)) {
echo "<a title=\"$strhide\" href=\"category.php?id=$category->id&hide=$acourse->id\"><img".
" src=\"$pixpath/t/hide.gif\" height=11 width=11 border=0></a> ";
} else {
echo "<a title=\"$strshow\" href=\"category.php?id=$category->id&show=$course->id\"><img".
echo "<a title=\"$strshow\" href=\"category.php?id=$category->id&show=$acourse->id\"><img".
" src=\"$pixpath/t/show.gif\" height=11 width=11 border=0></a> ";
}
echo "<a title=\"$strbackup\" href=\"../backup/backup.php?id=$course->id\"><img".
echo "<a title=\"$strbackup\" href=\"../backup/backup.php?id=$acourse->id\"><img".
" src=\"$pixpath/t/backup.gif\" height=11 width=11 border=0></a> ";
//Only showed if "backupdata" dir exists
if (is_dir("$CFG->dataroot/$course->id/backupdata")) {
echo "<a title=\"$strrestore\" href=\"../files/index.php?id=$course->id&wdir=/backupdata\"><img".
echo "<a title=\"$strrestore\" href=\"../files/index.php?id=$acourse->id&wdir=/backupdata\"><img".
" src=\"$pixpath/t/restore.gif\" height=11 width=11 border=0></a> ";
} else {
echo "<img src=\"$CFG->wwwroot/pix/spacer.gif\" height=11 width=11 border=0></a> ";
}
if ($up) {
echo "<a title=\"$strmoveup\" href=\"category.php?id=$category->id&moveup=$course->id\"><img".
echo "<a title=\"$strmoveup\" href=\"category.php?id=$category->id&moveup=$acourse->id\"><img".
" src=\"$pixpath/t/up.gif\" height=11 width=11 border=0></a> ";
} else {
echo "<img src=\"$CFG->wwwroot/pix/spacer.gif\" height=11 width=11 border=0></a> ";
}
if ($down) {
echo "<a title=\"$strmovedown\" href=\"category.php?id=$category->id&movedown=$course->id\"><img".
echo "<a title=\"$strmovedown\" href=\"category.php?id=$category->id&movedown=$acourse->id\"><img".
" src=\"$pixpath/t/down.gif\" height=11 width=11 border=0></a> ";
} else {
echo "<img src=\"$CFG->wwwroot/pix/spacer.gif\" height=11 width=11 border=0></a> ";
@@ -314,25 +323,25 @@
echo "</td>";
echo "<td align=\"center\">";
echo "<input type=\"checkbox\" name=\"c$course->id\">";
echo "<input type=\"checkbox\" name=\"c$acourse->id\">";
$abletomovecourses = true;
} else if (isteacheredit($course->id)) {
} else if (isteacheredit($acourse->id)) {
echo "<td>";
echo "<a title=\"$strassignteachers\" href=\"$CFG->wwwroot/course/teacher.php?id=$course->id\"><img".
echo "<a title=\"$strassignteachers\" href=\"$CFG->wwwroot/course/teacher.php?id=$acourse->id\"><img".
" src=\"$pixpath/t/user.gif\" height=11 width=11 border=0></a> ";
}
echo "</td>";
} else {
echo "<td align=\"right\">";
if ($course->guest ) {
echo "<a href=\"view.php?id=$course->id\"><img hspace=2 title=\"$strallowguests\" alt=\"\" height=16 width=16 border=0 src=\"$pixpath/i/user.gif\"></a>";
if ($acourse->guest ) {
echo "<a href=\"view.php?id=$acourse->id\"><img hspace=2 title=\"$strallowguests\" alt=\"\" height=16 width=16 border=0 src=\"$pixpath/i/user.gif\"></a>";
}
if ($course->password) {
echo "<a href=\"view.php?id=$course->id\"><img hspace=2 title=\"$strrequireskey\" alt=\"\" height=16 width=16 border=0 src=\"$pixpath/i/key.gif\"></a>";
if ($acourse->password) {
echo "<a href=\"view.php?id=$acourse->id\"><img hspace=2 title=\"$strrequireskey\" alt=\"\" height=16 width=16 border=0 src=\"$pixpath/i/key.gif\"></a>";
}
if ($course->summary) {
link_to_popup_window ("/course/info.php?id=$course->id", "courseinfo",
if ($acourse->summary) {
link_to_popup_window ("/course/info.php?id=$acourse->id", "courseinfo",
"<img hspace=2 alt=\"info\" height=16 width=16 border=0 src=\"$pixpath/i/info.gif\">",
400, 500, $strsummary);
}
+135 -76
View File
@@ -1,75 +1,123 @@
<?PHP
// Make sure all variables are defined
if (!isset($form->showreports)) {
$form->showreports = 0;
}
if (!isset($form->maxbytes)) {
$form->maxbytes = 0;
}
?>
<FORM METHOD="post" action="edit.php" NAME="form">
<table cellpadding=9 cellspacing=0 >
<tr valign=top>
<td><P><?php print_string("category") ?>:</td>
<td><?php
<td align="right"><P><?php print_string("category") ?>:</td>
<td><?php
$displaylist = array();
$parentlist = array();
make_categories_list($displaylist, $parentlist);
choose_from_menu($displaylist, "category", "$form->category", "");
helpbutton("coursecategory", get_string("category"));
?>
</td>
</td>
</tr>
<tr valign=top>
<td><P><?php print_string("fullname") ?>:</td>
<td><input type="text" name="fullname" maxlength="254" size=50 value="<?php p($form->fullname) ?>">
<td align="right"><P><?php print_string("fullname") ?>:</td>
<td><input type="text" name="fullname" maxlength="254" size=50 value="<?php p($form->fullname) ?>">
<?php helpbutton("coursefullname", get_string("fullname")) ?>
<?php if (isset($err["fullname"])) formerr($err["fullname"]); ?>
</td>
</td>
</tr>
<tr valign=top>
<td><P><?php print_string("shortname") ?>:</td>
<td><input type="text" name="shortname" maxlength="15" size="10" value="<?php p($form->shortname) ?>">
<td align="right"><P><?php print_string("shortname") ?>:</td>
<td><input type="text" name="shortname" maxlength="15" size="10" value="<?php p($form->shortname) ?>">
<?php helpbutton("courseshortname", get_string("shortname")) ?>
<?php if (isset($err["shortname"])) formerr($err["shortname"]); ?>
</td>
</td>
</tr>
<tr valign=top>
<td><P><?php print_string("summary") ?>:</td>
<td><TEXTAREA NAME=summary COLS=50 ROWS=10 WRAP=virtual><?php p($form->summary) ?></TEXTAREA>
<?php helpbutton("text", get_string("helptext")) ?>
<?php if (isset($err["summary"])) formerr($err["summary"]); ?>
</td>
<td align="right"><P><?php print_string("summary") ?>:</td>
<td><?php
print_textarea($usehtmleditor, 10, 50, 660, 200, "summary", $form->summary);
helpbutton("text", get_string("helptext"));
if (isset($err["summary"])) formerr($err["summary"]);
?>
</td>
</tr>
<tr valign=top>
<td><P><?php print_string("availability") ?>:</td>
<td><?php
<td align="right"><P><?php print_string("format") ?>:</td>
<td><?php
choose_from_menu ($form->courseformats, "format", "$form->format", "");
helpbutton("courseformats", get_string("courseformats"));
?>
</td>
</tr>
<tr valign=top>
<td align="right"><P><?php print_string("startdate") ?>:</td>
<td><?php
print_date_selector("startday", "startmonth", "startyear", $form->startdate);
helpbutton("coursestartdate", get_string("startdate"));
?></td>
</tr>
<tr valign=top>
<td align="right"><P><?php print_string("numberweeks") ?>:</td>
<td><?php
for ($i=1; $i<=52; $i++) {
$sectionmenu[$i] = "$i";
}
choose_from_menu ($sectionmenu, "numsections", "$form->numsections", "");
helpbutton("coursenumsections", get_string("numberweeks"));
?></td>
</tr>
<tr valign=top>
<td align="right"><P><?php print_string("groupmode") ?>:</td>
<td><?php
unset($choices);
$choices[NOGROUPS] = get_string("groupsnone");
$choices[SEPARATEGROUPS] = get_string("groupsseparate");
$choices[VISIBLEGROUPS] = get_string("groupsvisible");
choose_from_menu ($choices, "groupmode", $form->groupmode, "");
helpbutton("groupmode", get_string("groupmode"));
echo '&nbsp;&nbsp;&nbsp;&nbsp;';
print_string('force');
echo ': ';
unset($choices);
$choices["0"] = get_string("no");
$choices["1"] = get_string("yes");
choose_from_menu ($choices, "groupmodeforce", $form->groupmodeforce, "");
helpbutton("groupmodeforce", get_string("groupmodeforce")); ?>
</td>
</tr>
<tr valign=top>
<td align="right"><P><?php print_string("availability") ?>:</td>
<td><?php
unset($choices);
$choices["0"] = get_string("courseavailablenot");
$choices["1"] = get_string("courseavailable");
choose_from_menu ($choices, "visible", $form->visible, "");
helpbutton("courseavailability", get_string("availability")); ?>
</td>
</td>
</tr>
<tr valign=top>
<td><P><?php print_string("enrolmentkey") ?>:</td>
<td><input type="text" name="password" size=25 value="<?php p($form->password) ?>">
<td align="right"><P><?php print_string("enrolmentkey") ?>:</td>
<td><input type="text" name="password" size=25 value="<?php p($form->password) ?>">
<?php helpbutton("enrolmentkey", get_string("enrolmentkey")) ?>
<?php if (isset($err["password"])) formerr($err["password"]); ?>
</td>
</td>
</tr>
<tr valign=top>
<td><P><?php print_string("opentoguests") ?>:</td>
<td><?php
<td align="right"><P><?php print_string("opentoguests") ?>:</td>
<td><?php
unset($choices);
$choices["0"] = get_string("guestsno");
$choices["1"] = get_string("guestsyes");
$choices["2"] = get_string("guestskey");
choose_from_menu ($choices, "guest", $form->guest, "");
helpbutton("guestaccess", get_string("opentoguests")); ?>
</td>
</td>
</tr>
<tr valign=top>
<td><P><?php print_string("format") ?>:</td>
<td><?php
choose_from_menu ($form->courseformats, "format", "$form->format", "");
helpbutton("courseformats", get_string("courseformats"));
?>
</td>
</tr>
<tr valign=top>
<td><P><?php print_string("newsitemsnumber") ?>:</td>
<td align="right"><P><?php print_string("newsitemsnumber") ?>:</td>
<td><?php
$newsitem = get_string("newsitem");
$newsitems = get_string("newsitems");
@@ -91,73 +139,84 @@
</td>
</tr>
<tr valign=top>
<td><P><?php print_string("startdate") ?>:</td>
<td><?php
print_date_selector("startday", "startmonth", "startyear", $form->startdate);
helpbutton("coursestartdate", get_string("startdate"));
?></td>
</tr>
<tr valign=top>
<td><P><?php print_string("numberweeks") ?>:</td>
<td><?php
for ($i=1; $i<=52; $i++) {
$sectionmenu[$i] = "$i";
}
choose_from_menu ($sectionmenu, "numsections", "$form->numsections", "");
helpbutton("coursenumsections", get_string("numberweeks"));
?></td>
</tr>
<tr valign=top>
<td><P><?php print_string("showrecent") ?>:</td>
<td><?php
<td align="right"><P><?php print_string("showrecent") ?>:</td>
<td><?php
unset($choices);
$choices["0"] = get_string("no");
$choices["1"] = get_string("yes");
choose_from_menu ($choices, "showrecent", $form->showrecent, "");
helpbutton("courserecent", get_string("recentactivity")); ?>
</td>
</td>
</tr>
<tr valign=top>
<td><P><?php print_string("showgrades") ?>:</td>
<td><?php
<td align="right"><P><?php print_string("showgrades") ?>:</td>
<td><?php
unset($choices);
$choices["0"] = get_string("no");
$choices["1"] = get_string("yes");
choose_from_menu ($choices, "showgrades", $form->showgrades, "");
helpbutton("coursegrades", get_string("grades")); ?>
</td>
</td>
</tr>
<tr valign=top>
<td><P><?php print_string("wordforteacher") ?>:</td>
<td><input type="text" name="teacher" maxlength="100" size=25 value="<?php p($form->teacher) ?>">
(<?php print_string("wordforteachereg") ?>)
<td align="right"><P><?php print_string("showreports") ?>:</td>
<td><?php
unset($choices);
$choices["0"] = get_string("no");
$choices["1"] = get_string("yes");
choose_from_menu ($choices, "showreports", $form->showreports, "");
helpbutton("coursereports", get_string("activityreport")); ?>
</td>
</tr>
<tr valign=top>
<td align="right"><P><?php print_string("maximumupload") ?>:</td>
<td><?php
$choices = get_max_upload_sizes($CFG->maxbytes);
choose_from_menu ($choices, "maxbytes", $form->maxbytes, "");
helpbutton("courseuploadsize", get_string("maximumupload")); ?>
</td>
</tr>
<tr valign=top>
<td align="right"><P><?php print_string("wordforteacher") ?>:</td>
<td><input type="text" name="teacher" maxlength="100" size=25 value="<?php p($form->teacher) ?>">
(<?php print_string("wordforteachereg") ?>)
<?php if (isset($err["teacher"])) formerr($err["teacher"]); ?>
</td>
</td>
</tr>
<tr valign=top>
<td><P><?php print_string("wordforteachers") ?>:</td>
<td><input type="text" name="teachers" maxlength="100" size=25 value="<?php p($form->teachers) ?>">
(<?php print_string("wordforteacherseg") ?>)
<td align="right"><P><?php print_string("wordforteachers") ?>:</td>
<td><input type="text" name="teachers" maxlength="100" size=25 value="<?php p($form->teachers) ?>">
(<?php print_string("wordforteacherseg") ?>)
<?php if (isset($err["teachers"])) formerr($err["teachers"]); ?>
</td>
</td>
</tr>
<tr valign=top>
<td><P><?php print_string("wordforstudent") ?>:</td>
<td><input type="text" name="student" maxlength="100" size=25 value="<?php p($form->student) ?>">
(<?php print_string("wordforstudenteg") ?>)
<td align="right"><P><?php print_string("wordforstudent") ?>:</td>
<td><input type="text" name="student" maxlength="100" size=25 value="<?php p($form->student) ?>">
(<?php print_string("wordforstudenteg") ?>)
<?php if (isset($err["student"])) formerr($err["student"]); ?>
</td>
</td>
</tr>
<tr valign=top>
<td><P><?php print_string("wordforstudents") ?>:</td>
<td><input type="text" name="students" maxlength="100" size=25 value="<?php p($form->students) ?>">
(<?php print_string("wordforstudentseg") ?>)
<td align="right"><P><?php print_string("wordforstudents") ?>:</td>
<td><input type="text" name="students" maxlength="100" size=25 value="<?php p($form->students) ?>">
(<?php print_string("wordforstudentseg") ?>)
<?php if (isset($err["students"])) formerr($err["students"]); ?>
</td>
</td>
</tr>
<tr valign=top>
<td align="right"><P><?php print_string("forcelanguage") ?>:</td>
<td>
<?php
$languages[''] = get_string("forceno");
$languages += get_list_of_languages();
choose_from_menu ($languages, "lang", $form->lang, "", "", "");
?>
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="<?php print_string("savechanges") ?>"></td>
</TABLE>
<INPUT type="hidden" name="id" value="<?php echo $form->id ?>">
</FORM>
<td></td>
<td><input type="submit" value="<?php print_string("savechanges") ?>"></td>
</table>
<input type="hidden" name="id" value="<?php echo $form->id ?>">
</form>
+17 -6
View File
@@ -37,6 +37,8 @@
if ($form = data_submitted()) {
check_for_restricted_user($USER->username, "$CFG->wwwroot/course/view.php?id=$course->id");
$form->startdate = make_timestamp($form->startyear, $form->startmonth, $form->startday);
validate_form($course, $form, $err);
@@ -116,6 +118,8 @@
$form->newsitems = 5;
$form->showrecent = 1;
$form->showgrades = 1;
$form->groupmode = 0;
$form->groupmodeforce = 0;
$form->category = $category;
$form->id = "";
$form->visible = 1;
@@ -139,12 +143,15 @@
}
$form->categories = get_records_select_menu("course_categories", "", "name", "id,name");
$form->courseformats = array (
"weeks" => get_string("formatweeks"),
"social" => get_string("formatsocial"),
"topics" => get_string("formattopics")
);
$courseformats = get_list_of_plugins("course/format");
$form->courseformats = array();
foreach ($courseformats as $courseformat) {
$form->courseformats["$courseformat"] = get_string("format$courseformat");
}
$usehtmleditor = can_use_html_editor();
$streditcoursesettings = get_string("editcoursesettings");
$straddnewcourse = get_string("addnewcourse");
@@ -168,6 +175,10 @@
print_footer($course);
if ($usehtmleditor) {
use_html_editor();
}
exit;
/// Functions /////////////////////////////////////////////////////////////////
+15 -23
View File
@@ -1,35 +1,27 @@
<center>
<form name="theform" method="post" <?php echo $onsubmit ?> action="editsection.php">
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td align=top>
<p><b><?php print_string("summaryof", "", "$sectionname $form->section") ?></b></p>
</td>
<td align=top width=100>
&nbsp;
</td>
<td align=top>
<font size=-1>
<form name="theform" method="post" action="editsection.php">
<table cellpadding=5>
<tr valign=top>
<td align=right><p><b><?php print_string("summary") ?>:</b></p>
<br />
<font size="1">
<?php helpbutton("summaries", get_string("helpsummaries"), "moodle", true, true);
echo "<br />";
if ($usehtmleditor) {
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
} else {
helpbutton("text", get_string("helptext"), "moodle", true, true);
}
?>
</font>
</td>
</tr></table>
<?php print_textarea($usehtmleditor, 4, 60, 660, 200, "summary", $form->summary); ?>
<p>
<br />
</font>
</td>
<td>
<?php print_textarea($usehtmleditor, 4, 60, 660, 200, "summary", $form->summary); ?>
</td>
</tr>
</table>
<input type="hidden" name=id value="<?php echo $form->id ?>">
<input type="submit" value="<?php print_string("savechanges") ?>">
<input type="reset" value="<?php print_string("revert") ?>">
</p>
</form>
</center>
<?php
if ($usehtmleditor) {
print_richedit_javascript("theform", "summary", "yes");
}
?>
+8 -6
View File
@@ -43,21 +43,23 @@
$form = $section;
}
if ($usehtmleditor = can_use_richtext_editor()) {
$onsubmit = "onsubmit=\"copyrichtext(theform.summary);\"";
} else {
$onsubmit = "";
}
$usehtmleditor = can_use_html_editor();
$sectionname = get_string("name$course->format");
$stredit = get_string("edit", "", " $sectionname $section->section");
print_header("$course->shortname: $stredit", "$course->fullname",
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>
-> $stredit", "form.summary");
-> $stredit");
print_heading(get_string("summaryof", "", "$sectionname $form->section"));
print_simple_box_start("center", "", "$THEME->cellheading");
include("editsection.html");
print_simple_box_end();
if ($usehtmleditor) {
use_html_editor();
}
print_footer($course);
?>
+32 -8
View File
@@ -8,10 +8,21 @@
require_login();
$strloginto = get_string("loginto", "", $course->shortname);
$strcourses = get_string("courses");
if (! $course = get_record("course", "id", $id) ) {
error("That's an invalid course id");
}
if (! $site = get_site()) {
error("Could not find a site!");
}
check_for_restricted_user($USER->username);
/// Check the submitted enrollment key if there is one
if ($form = data_submitted()) {
if ($form->password == $course->password) {
@@ -39,13 +50,13 @@
add_to_log($course->id, "course", "enrol", "view.php?id=$course->id", "$USER->id");
}
$USER->student["$id"] = true;
$USER->student[$course->id] = true;
if ($SESSION->wantsurl) {
$destination = $SESSION->wantsurl;
unset($SESSION->wantsurl);
} else {
$destination = "$CFG->wwwroot/course/view.php?id=$id";
$destination = "$CFG->wwwroot/course/view.php?id=$course->id";
}
redirect($destination);
@@ -55,13 +66,26 @@
}
}
$strloginto = get_string("loginto", "", $course->shortname);
$strcourses = get_string("courses");
if (! $site = get_site()) {
error("Could not find a site!");
/// Double check just in case they are actually enrolled already
/// This might occur if they were manually enrolled during this session
if (record_exists("user_students", "userid", $USER->id, "course", $course->id)) {
$USER->student[$course->id] = true;
if ($SESSION->wantsurl) {
$destination = $SESSION->wantsurl;
unset($SESSION->wantsurl);
} else {
$destination = "$CFG->wwwroot/course/view.php?id=$course->id";
}
redirect($destination);
}
/// Automatically enrol into courses without password
if ($course->password == "") { // no password, so enrol
if (isguest()) {
@@ -82,13 +106,13 @@
}
add_to_log($course->id, "course", "enrol", "view.php?id=$course->id", "$USER->id");
$USER->student["$id"] = true;
$USER->student[$course->id] = true;
if ($SESSION->wantsurl) {
$destination = $SESSION->wantsurl;
unset($SESSION->wantsurl);
} else {
$destination = "$CFG->wwwroot/course/view.php?id=$id";
$destination = "$CFG->wwwroot/course/view.php?id=$course->id";
}
redirect($destination);
+9
View File
@@ -0,0 +1,9 @@
Course formats
--------------
To add a new course format, just duplicate one of the
existing folders in here with a new name (eg coollayout).
Then edit lang/en/moodle and add a new string like:
$string['formatcoollayout'] = 'Cool Layout';
@@ -6,6 +6,8 @@
require_once("$CFG->dirroot/mod/resource/lib.php");
$leftwidth = 210;
$strgroups = get_string("groups");
$strgroupmy = get_string("groupmy");
?>
<table width="100%" border="0" cellspacing="5" cellpadding="5">
@@ -13,15 +15,29 @@
<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\">".
$modicon[]="<img src=\"$CFG->pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
if ($course->groupmode or !$course->groupmodeforce) {
if ($course->groupmode == VISIBLEGROUPS or isteacheredit($course->id)) {
$moddata[]="<a title=\"$strgroups\" href=\"groups.php?id=$course->id\">$strgroups</a>";
$modicon[]="<img src=\"$CFG->pixpath/i/group.gif\" height=16 width=16 alt=\"\">";
} else if ($course->groupmode == SEPARATEGROUPS and $course->groupmodeforce) {
// Show nothing
} else if ($currentgroup = get_current_group($course->id)) {
$moddata[]="<a title=\"$strgroupmy\" href=\"group.php?id=$course->id\">$strgroupmy</a>";
$modicon[]="<img src=\"$CFG->pixpath/i/group.gif\" height=16 width=16 alt=\"\">";
}
}
$fullname = fullname($USER, true);
$editmyprofile = "<a title=\"$fullname\" href=\"../user/edit.php?id=$USER->id&course=$course->id\">".
get_string("editmyprofile")."</A>";
if ($USER->description) {
$moddata[]= $editmyprofile;
} else {
$moddata[]= $editmyprofile." <blink>*</blink>";
}
$modicon[]="<img src=\"$pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
$modicon[]="<img src=\"$CFG->pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
print_side_block(get_string("people"), "", $moddata, $modicon, "", $leftwidth);
@@ -60,7 +76,7 @@
} else {
$subtext = get_string("subscribe", "forum");
}
$headertext = "<table border=0 width=100% cellpadding=0 cellspacing=0><tr><td>".
$headertext = "<table border=0 width=100% cellpadding=0 cellspacing=0 class=headingblockcontent><tr><td>".
get_string("socialheadline").
"</td><td align=right><font size=1>".
"<a href=\"../mod/forum/subscribe.php?id=$social->id\">$subtext</a></td>".
@@ -34,6 +34,8 @@
$stractivities = get_string("activities");
$strshowalltopics = get_string("showalltopics");
$strtopic = get_string("topic");
$strgroups = get_string("groups");
$strgroupmy = get_string("groupmy");
if (isediting($course->id)) {
$strstudents = moodle_strtolower($course->students);
$strtopichide = get_string("topichide", "", $strstudents);
@@ -54,14 +56,28 @@
/// Links to people
$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>";
$modicon[]="<img src=\"$CFG->pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
if ($course->groupmode or !$course->groupmodeforce) {
if ($course->groupmode == VISIBLEGROUPS or isteacheredit($course->id)) {
$moddata[]="<a title=\"$strgroups\" href=\"groups.php?id=$course->id\">$strgroups</a>";
$modicon[]="<img src=\"$CFG->pixpath/i/group.gif\" height=16 width=16 alt=\"\">";
} else if ($course->groupmode == SEPARATEGROUPS and $course->groupmodeforce) {
// Show nothing
} else if ($currentgroup = get_current_group($course->id)) {
$moddata[]="<a title=\"$strgroupmy\" href=\"group.php?id=$course->id\">$strgroupmy</a>";
$modicon[]="<img src=\"$CFG->pixpath/i/group.gif\" height=16 width=16 alt=\"\">";
}
}
$fullname = fullname($USER, true);
$editmyprofile = "<a title=\"$fullname\" href=\"../user/edit.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile")."</a>";
if ($USER->description) {
$moddata[]= $editmyprofile;
} else {
$moddata[]= $editmyprofile." <blink>*</blink>";
}
$modicon[]="<img src=\"$pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
$modicon[]="<img src=\"$CFG->pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
print_side_block(get_string("people"), "", $moddata, $modicon);
@@ -70,8 +86,10 @@
$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=\"$modpixpath/$modname/icon.gif\" height=16 width=16 alt=\"\">";
if ($modname != "label") {
$moddata[] = "<a href=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</a>";
$modicon[] = "<img src=\"$CFG->modpixpath/$modname/icon.gif\" height=16 width=16 alt=\"\">";
}
}
}
print_side_block($stractivities, "", $moddata, $modicon);
@@ -97,7 +115,7 @@
/// If currently moving a file then show the current clipboard
if (ismoving($course->id)) {
$stractivityclipboard = get_string("activityclipboard", "", addslashes($USER->activitycopyname));
$stractivityclipboard = strip_tags(get_string("activityclipboard", "", addslashes($USER->activitycopyname)));
$strcancel= get_string("cancel");
echo "<tr>";
echo "<td colspan=3 valign=top bgcolor=\"$THEME->cellcontent\" class=\"topicoutlineclip\" width=\"100%\">";
@@ -120,13 +138,15 @@
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%\">";
echo format_text($thissection->summary, FORMAT_HTML);
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 alt=\"$streditsummary\"></a></p>";
echo "<a title=\"$streditsummary\" ".
" href=\"editsection.php?id=$thissection->id\"><img src=\"$CFG->pixpath/t/edit.gif\" ".
" height=11 width=11 border=0 alt=\"$streditsummary\"></a><br />";
}
echo text_to_html($thissection->summary);
echo '<br clear="all">';
print_section($course, $thissection, $mods, $modnamesused);
@@ -209,12 +229,14 @@
} else {
echo "<td valign=top $colormain width=\"100%\">";
echo format_text($thissection->summary, FORMAT_HTML);
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 " <a title=\"$streditsummary\" href=editsection.php?id=$thissection->id>".
"<img src=\"$CFG->pixpath/t/edit.gif\" border=0 height=11 width=11></a><br />";
}
echo text_to_html($thissection->summary);
echo '<br clear="all">';
print_section($course, $thissection, $mods, $modnamesused);
@@ -232,38 +254,38 @@
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 />";
"<img src=\"$CFG->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=\"$pixpath/i/one.gif\" height=16 width=16 border=0></a><br />";
"<img src=\"$CFG->pixpath/i/one.gif\" height=16 width=16 border=0></a><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 />";
"<img src=\"$CFG->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 />";
"<img src=\"$CFG->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 />";
"<img src=\"$CFG->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 />";
"<img src=\"$CFG->pixpath/i/show.gif\" vspace=3 height=16 width=16 border=0></a><br />";
}
if ($section > 1) { // Add a arrow to move section up
echo "<a href=\"view.php?id=$course->id&section=$section&move=-1\" title=\"$strmoveup\">".
"<img src=\"$pixpath/t/up.gif\" vspace=3 height=11 width=11 border=0></a><br />";
"<img src=\"$CFG->pixpath/t/up.gif\" vspace=3 height=11 width=11 border=0></a><br />";
}
if ($section < $course->numsections) { // Add a arrow to move section down
echo "<a href=\"view.php?id=$course->id&section=$section&move=1\" title=\"$strmovedown\">".
"<img src=\"$pixpath/t/down.gif\" vspace=3 height=11 width=11 border=0></a><br />";
"<img src=\"$CFG->pixpath/t/down.gif\" vspace=3 height=11 width=11 border=0></a><br />";
}
}
@@ -284,12 +306,12 @@
}
if ($news or $course->showrecent) {
if (!empty($news) or $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", "", false);
@@ -24,6 +24,8 @@
$stractivities = get_string("activities");
$strshowallweeks = get_string("showallweeks");
$strweek = get_string("week");
$strgroups = get_string("groups");
$strgroupmy = get_string("groupmy");
if (isediting($course->id)) {
$strstudents = moodle_strtolower($course->students);
$strweekhide = get_string("weekhide", "", $strstudents);
@@ -42,14 +44,28 @@
/// Links to people
$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>";
$modicon[]="<img src=\"$CFG->pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
if ($course->groupmode or !$course->groupmodeforce) {
if ($course->groupmode == VISIBLEGROUPS or isteacheredit($course->id)) {
$moddata[]="<a title=\"$strgroups\" href=\"groups.php?id=$course->id\">$strgroups</a>";
$modicon[]="<img src=\"$CFG->pixpath/i/group.gif\" height=16 width=16 alt=\"\">";
} else if ($course->groupmode == SEPARATEGROUPS and $course->groupmodeforce) {
// Show nothing
} else if ($currentgroup = get_current_group($course->id)) {
$moddata[]="<a title=\"$strgroupmy\" href=\"group.php?id=$course->id\">$strgroupmy</a>";
$modicon[]="<img src=\"$CFG->pixpath/i/group.gif\" height=16 width=16 alt=\"\">";
}
}
$fullname = fullname($USER, true);
$editmyprofile = "<a title=\"$fullname\" href=\"../user/edit.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile")."</a>";
if ($USER->description) {
$moddata[]= $editmyprofile;
} else {
$moddata[]= $editmyprofile." <blink>*</blink>";
}
$modicon[]="<img src=\"$pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
$modicon[]="<img src=\"$CFG->pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
print_side_block(get_string("people"), "", $moddata, $modicon);
@@ -58,8 +74,10 @@
$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=\"$modpixpath/$modname/icon.gif\" height=16 width=16 alt=\"\">";
if ($modname != "label") {
$moddata[] = "<a href=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</a>";
$modicon[] = "<img src=\"$CFG->modpixpath/$modname/icon.gif\" height=16 width=16 alt=\"\">";
}
}
}
print_side_block($stractivities, "", $moddata, $modicon);
@@ -85,7 +103,7 @@
/// If currently moving a file then show the current clipboard
if (ismoving($course->id)) {
$stractivityclipboard = get_string("activityclipboard", "", addslashes($USER->activitycopyname));
$stractivityclipboard = strip_tags(get_string("activityclipboard", "", addslashes($USER->activitycopyname)));
$strcancel= get_string("cancel");
echo "<tr>";
echo "<td colspan=3 valign=top bgcolor=\"$THEME->cellcontent\" class=\"weeklyoutlineclip\" width=\"100%\">";
@@ -107,13 +125,15 @@
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%\">";
echo format_text($thissection->summary, FORMAT_HTML);
if (isediting($course->id)) {
$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 " <a title=\"$streditsummary\" ".
" href=\"editsection.php?id=$thissection->id\"><img height=11 width=11 src=\"$CFG->pixpath/t/edit.gif\" ".
" border=0 alt=\"$streditsummary\"></a><br />";
}
echo text_to_html($thissection->summary);
echo '<br clear="all">';
print_section($course, $thissection, $mods, $modnamesused);
@@ -199,12 +219,14 @@
echo "<p class=\"weeklydatetext\">$weekday - $endweekday</p>";
echo format_text($thissection->summary, FORMAT_HTML);
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 " <a title=\"$streditsummary\" href=\"editsection.php?id=$thissection->id\">".
"<img src=\"$CFG->pixpath/t/edit.gif\" height=11 width=11 border=0></a><br />";
}
echo text_to_html($thissection->summary);
echo '<br clear="all">';
print_section($course, $thissection, $mods, $modnamesused);
@@ -222,30 +244,30 @@
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 />";
"<img src=\"$CFG->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 />";
"<img src=\"$CFG->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 />";
"<img src=\"$CFG->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 />";
"<img src=\"$CFG->pixpath/i/show.gif\" vspace=3 height=16 width=16 border=0></a><br />";
}
if ($section > 1) { // Add a arrow to move section up
echo "<a href=\"view.php?id=$course->id&section=$section&move=-1\" title=\"$strmoveup\">".
"<img src=\"$pixpath/t/up.gif\" vspace=3 height=11 width=11 border=0></a><br />";
"<img src=\"$CFG->pixpath/t/up.gif\" vspace=3 height=11 width=11 border=0></a><br />";
}
if ($section < $course->numsections) { // Add a arrow to move section down
echo "<a href=\"view.php?id=$course->id&section=$section&move=1\" title=\"$strmovedown\">".
"<img src=\"$pixpath/t/down.gif\" vspace=3 height=11 width=11 border=0></a><br />";
"<img src=\"$CFG->pixpath/t/down.gif\" vspace=3 height=11 width=11 border=0></a><br />";
}
}
+88 -40
View File
@@ -1,9 +1,8 @@
<?PHP // $Id$
// Displays all grades for a course
require_once("../config.php");
require_once("lib.php");
require_once("../lib/psxlsgen.php");
require_once("../config.php");
require_once("lib.php");
require_variable($id); // course id
optional_variable($download, ""); // to download data
@@ -23,11 +22,28 @@
$strmax = get_string("maximumshort");
$stractivityreport = get_string("activityreport");
/// Check to see if groups are being used in this course
if ($groupmode = groupmode($course)) { // Groups are being used
if (isset($_GET['group'])) {
$changegroup = $_GET['group']; /// 0 or higher
} else {
$changegroup = -1; /// This means no group change was specified
}
$currentgroup = get_and_set_current_group($course, $groupmode, $changegroup);
} else {
$currentgroup = false;
}
if ($currentgroup) {
$students = get_group_students($currentgroup, "u.lastname ASC");
} else {
$students = get_course_students($course->id, "u.lastname ASC");
}
/// Get a list of all students
if (!$students = get_course_students($course->id, "u.lastname ASC")) {
print_header("$course->shortname: $strgrades", "$course->fullname",
if (!$students) {
print_header("$course->shortname: $strgrades", "$course->fullname",
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>
-> $strgrades");
print_heading(get_string("nostudentsyet"));
@@ -125,22 +141,35 @@
/// OK, we have all the data, now present it to the user
if ($download == "xls") {
require_once("../lib/excel/Worksheet.php");
require_once("../lib/excel/Workbook.php");
$myxls = new PhpSimpleXlsGen();
$myxls->totalcol = count($columns) + 5;
// HTTP headers
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=".$course->shortname."_$strgrades.xls");
header("Expires: 0");
header("Cache-Control: must-revalidate,post-check=0,pre-check=0");
header("Pragma: public");
/// Creating a workbook
$workbook = new Workbook("-");
$myxls =& $workbook->add_worksheet($strgrades);
/// Print names of all the fields
$myxls->ChangePos(0,0);
$myxls->InsertText(get_string("firstname"));
$myxls->InsertText(get_string("lastname"));
$myxls->write_string(0,0,get_string("firstname"));
$myxls->write_string(0,1,get_string("lastname"));
$myxls->write_string(0,2,get_string("idnumber"));
$myxls->write_string(0,3,get_string("institution"));
$myxls->write_string(0,4,get_string("department"));
$myxls->write_string(0,5,get_string("email"));
$pos=6;
foreach ($columns as $column) {
$myxls->InsertText(strip_tags($column));
$myxls->write_string(0,$pos++,strip_tags($column));
}
$myxls->InsertText(get_string("total"));
$myxls->write_string(0,$pos,get_string("total"));
/// Print all the lines of data.
@@ -148,22 +177,27 @@
foreach ($grades as $studentid => $studentgrades) {
$i++;
$student = $students[$studentid];
$myxls->ChangePos($i,0);
$myxls->InsertText($student->firstname);
$myxls->InsertText($student->lastname);
foreach ($studentgrades as $grade) {
$myxls->InsertText(strip_tags($grade));
if (empty($totals[$student->id])) {
$totals[$student->id] = '';
}
$myxls->InsertNumber($totals[$student->id]);
$myxls->write_string($i,0,$student->firstname);
$myxls->write_string($i,1,$student->lastname);
$myxls->write_string($i,2,$student->idnumber);
$myxls->write_string($i,3,$student->institution);
$myxls->write_string($i,4,$student->department);
$myxls->write_string($i,5,$student->email);
$j=6;
foreach ($studentgrades as $grade) {
$myxls->write_string($i,$j++,strip_tags($grade));
}
$myxls->write_number($i,$j,$totals[$student->id]);
}
$myxls->SendFileName("$course->shortname $strgrades");
$workbook->close();
exit;
} else if ($download == "txt") {
/// Print header to force download
@@ -173,7 +207,12 @@
/// Print names of all the fields
echo get_string("firstname")."\t".get_string("lastname");
echo get_string("firstname")."\t".
get_string("lastname")."\t".
get_string("idnumber")."\t".
get_string("institution")."\t".
get_string("department")."\t".
get_string("email");
foreach ($columns as $column) {
$column = strip_tags($column);
echo "\t$column";
@@ -184,7 +223,10 @@
foreach ($grades as $studentid => $studentgrades) {
$student = $students[$studentid];
echo "$student->firstname\t$student->lastname";
if (empty($totals[$student->id])) {
$totals[$student->id] = '';
}
echo "$student->firstname\t$student->lastname\t$student->idnumber\t$student->institution\t$student->department\t$student->email";
foreach ($studentgrades as $grade) {
$grade = strip_tags($grade);
echo "\t$grade";
@@ -198,12 +240,25 @@
} else { // Just print the web page
print_header("$course->shortname: $strgrades", "$course->fullname",
print_header("$course->shortname: $strgrades", "$course->fullname",
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>
-> $strgrades");
print_heading($strgrades);
setup_and_print_groups($course, $groupmode, "grades.php?id=$course->id");
echo "<TABLE BORDER=0 ALIGN=CENTER><TR>";
echo "<TD>";
$options["id"] = "$course->id";
$options["download"] = "xls";
print_single_button("grades.php", $options, get_string("downloadexcel"));
echo "<TD>";
$options["download"] = "txt";
print_single_button("grades.php", $options, get_string("downloadtext"));
echo "</TABLE>";
$table->head = array_merge(array ("", get_string("firstname"), get_string("lastname")), $columnhtml, get_string("total"));
$table->width = array(35, "");
$table->align = array("LEFT", "RIGHT", "LEFT");
@@ -216,6 +271,9 @@
foreach ($students as $key => $student) {
$studentgrades = $gradeshtml[$student->id];
if (empty($totals[$student->id])) {
$totals[$student->id] = '';
}
$picture = print_user_picture($student->id, $course->id, $student->picture, false, true);
$name = array ("$picture", "$student->firstname", "$student->lastname");
$total = array ($totals[$student->id]);
@@ -225,16 +283,6 @@
print_table($table);
echo "<TABLE BORDER=0 ALIGN=CENTER><TR>";
echo "<TD>";
$options["id"] = "$course->id";
$options["download"] = "xls";
print_single_button("grades.php", $options, get_string("downloadexcel"));
echo "<TD>";
$options["download"] = "txt";
print_single_button("grades.php", $options, get_string("downloadtext"));
echo "</TABLE>";
print_footer($course);
}
+53
View File
@@ -0,0 +1,53 @@
<form method="post" enctype="multipart/form-data" action="group.php">
<table cellpadding=9 cellspacing="0" align="center">
<tr valign="top">
<td align="right"><p><?php print_string("name") ?>:</td>
<td><input type="text" name="name" size=30 value="<?php p($group->name) ?>">
<?php if (isset($err["name"])) formerr($err["name"]); ?>
</td>
</tr>
<tr valign=top>
<td align="right"><P><?php print_string("description") ?>:</td>
<td><?php
print_textarea($usehtmleditor, 10, 50, 660, 200, "description", $group->description);
helpbutton("text", get_string("helptext"));
if (isset($err["description"])) formerr($err["description"]);
?>
</td>
</tr>
<tr valign=top>
<td align="right"><P><?php print_string("hidepicture") ?>:</td>
<td><?php
$options = NULL;
$options[0] = get_string("no");
$options[1] = get_string("yes");
choose_from_menu ($options, "hidepicture", $group->hidepicture, "");
?>
</td>
</tr>
<?php
$maxbytes = get_max_upload_file_size($CFG->maxbytes, $course->maxbytes);
if (!empty($CFG->gdversion) and $maxbytes) {
?>
<tr valign=top>
<td align="right"><p><?php print_string("newpicture") ?>:</td>
<td>
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $maxbytes ?>">
<input type="file" name="imagefile" size=40>
<?php helpbutton("picture", get_string("helppicture"));
print_string("maxsize", "", display_size($maxbytes));
if (isset($err["imagefile"])) formerr($err["imagefile"]);
?>
</td>
</tr>
<?php } ?>
<tr>
<td></td>
<td><input type="submit" value="<?php print_string("savechanges") ?>"></td>
</table>
<input type="hidden" name="group" value="<?php p($group->id) ?>">
<input type="hidden" name="id" value="<?php p($course->id) ?>">
</form>
+130
View File
@@ -0,0 +1,130 @@
<?php // $Id$
/// Shows current group, and allows editing of the group
/// icon and other settings related to that group
require_once('../config.php');
require_once('lib.php');
require_variable($id); // Course id
optional_variable($group); // Optionally look at other groups
optional_variable($edit); // Turn editing on and off
if (! $course = get_record('course', 'id', $id) ) {
error("That's an invalid course id");
}
require_login($course->id);
if ($group) {
if (isteacheredit($course->id) or $course->groupmode == VISIBLEGROUPS) {
if (! $group = get_record("groups", "id", $group, "courseid", $course->id)) {
error('Specified group could not be found!', "groups.php?id=$course->id");
}
} else {
error('Sorry, you don\'t have access to view this group', "view.php?id=$course->id");
}
} else if (! $group = get_current_group($course->id, 'full')) {
error('You are not currently in a group!', "view.php?id=$course->id");
}
if (isteacheredit($course->id) or (isteacher($course->id) and ismember($group->id) ) ) {
$edit = isset($_GET['edit']);
$editbutton = $edit ? "" : update_group_button($course->id, $group->id);
} else {
$edit = false;
$editbutton = "";
}
/// Print the headers of the page
$strgroup = get_string('group');
$strgroups = get_string('groups');
$loggedinas = "<p class=\"logininfo\">".user_login_string($course, $USER)."</p>";
if (isteacheredit($course->id) or $course->groupmode == VISIBLEGROUPS) {
print_header("$strgroup : $group->name", "$course->fullname",
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>
-> <a href=\"groups.php?id=$course->id\">$strgroups</a> -> $group->name",
"", "", true, $editbutton, $loggedinas);
} else {
print_header("$strgroup : $group->name", "$course->fullname",
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>
-> $strgroup -> $group->name", "", "", true, "", $loggedinas);
}
/// If data submitted, then process and store.
if ($form = data_submitted()) {
if (empty($form->name)) {
$edit = true;
$err['name'] = get_string("missingname");
} else {
if (!empty($_FILES['imagefile'])) {
require_once("$CFG->libdir/gdlib.php");
if ($filename = valid_uploaded_file($_FILES['imagefile'])) {
$group->picture = save_profile_image($group->id, $filename, 'groups');
}
}
$group->name = $form->name;
$group->description = $form->description;
$group->hidepicture = $form->hidepicture;
if (!update_record("groups", $group)) {
notify("A strange error occurred while trying to save ");
} else {
redirect("group.php?id=$course->id&group=$group->id", get_string("changessaved"));
}
}
}
/// Are we editing? If so, handle it.
if ($edit) { // We are editing a group's information
if ($usehtmleditor = can_use_richtext_editor()) {
$defaultformat = FORMAT_HTML;
} else {
$defaultformat = FORMAT_MOODLE;
}
include('group-edit.html');
if ($usehtmleditor) {
use_html_editor();
}
print_footer();
exit;
}
/// Just display the information
print_heading($group->name);
echo '<div align="center">';
print_group_picture($group, $course->id, true, false, false);
echo '</div>';
if ($group->description) {
print_simple_box(format_text($group->description), 'center', '50%');
}
echo '<br />';
if ($users = get_group_users($group->id)) {
foreach ($users as $user) {
print_user($user, $course);
}
} else {
print_heading(get_string('nousersyet'));
}
/// Finish off the page
print_footer($course);
?>
+170
View File
@@ -0,0 +1,170 @@
<script language="JavaScript">
<!-- Begin
<?php
foreach ($listmembers as $groupid => $listmember) {
echo "group$groupid = new Object();\n";
$useridstring = "group$groupid.userid = new Array(";
$usernamestring = "group$groupid.username = new Array(";
$max = count($listmember);
$count = 0;
foreach ($listmember as $userid => $username) {
$count++;
$useridstring .= "\"$userid\"";
$usernamestring .= "\"$username\"";
if ($count < $max) {
$useridstring .= ', ';
$usernamestring .= ', ';
}
}
$useridstring .= ");\n";
$usernamestring .= ");\n";
echo $useridstring;
echo $usernamestring;
}
?>
function updateGroup() {
document.form1.groupid.value = document.form2.groups.value;
document.form3.groupid.value = document.form2.groups.value;
}
function updateMembers(selectgroup) {
eval('group=group'+selectgroup.value);
username = group.username;
userid = group.userid;
document.form3['members[]'].length = username.length;
for (i=0;i<username.length;i++) {
document.form3['members[]'].options[i].value = userid[i];
document.form3['members[]'].options[i].text = username[i];
}
updateGroup();
}
function userWindow(selectuser) {
num = 0;
for (var i=0; i<selectuser.options.length; i++) {
if (selectuser.options[i].selected) {
num++;
user = selectuser.options[i].value;
openpopup('/user/view.php?id='+user+'&course=<?php echo $courseid ?>','userinfo'+num,'','');
}
}
return false;
}
function groupWindow(selectgroup) {
num = 0;
for (var i=0; i<selectgroup.options.length; i++) {
if (selectgroup.options[i].selected) {
num++;
group = selectgroup.options[i].value;
openpopup('/course/group.php?id=<?php echo $courseid ?>&group='+group,'groupinfo'+num,'','');
}
}
return false;
}
// end hiding script -->
</script>
<table border="0" cellspacing="2" cellpadding="10" align="center" class="generalbox">
<tr>
<td width="33%" align="center" class="generaltableheader"><?php p($strgroupnonmembers) ?></td>
<td width="33%" align="center" class="generaltableheader"><?php p($strgroups) ?></td>
<td width="33%" align="center" class="generaltableheader"><?php p($strgroupmembersselected) ?></td>
</tr>
<tr align="center" valign="top">
<td class="generalboxcontent"><p>
<form name="form1" id="form1" method="post" action="groups.php">
<input type="hidden" name="id" value="<?php p($course->id) ?>" />
<input type="hidden" name="groupid" value="<?php p($selectedgroup) ?>" />
<select name="nonmembers[]" size="15" multiple="multiple">
<?php
if (!empty($nonmembers)) {
foreach ($nonmembers as $id => $nonmembername) {
echo "<option value=\"$id\">$nonmembername</option>";
}
}
?>
</select>
</p>
<p>
<input type="submit" name="nonmembersadd" value="<?php p($strgroupaddusers) ?> -&gt;"
onclick="updateGroup()" />
</p>
<!--<p>
<input type="submit" name="nonmembersrandom" value="<?php p($strgrouprandomassign) ?> -&gt;" />
</p> -->
<p>
<input type="submit" name="nonmembersinfo" value="<?php p($strgroupinfopeople) ?>"
onclick="return userWindow(document.form1['nonmembers[]']);" />
</p>
</form>
</td>
<td class="generalboxcontent"><p>
<form name="form2" id="form2" method="post" action="groups.php">
<input type="hidden" name="id" value="<?php p($course->id) ?>" />
<select name="groups" size="15" onChange="updateMembers(this)">
<?php
if (!empty($listgroups)) {
foreach ($listgroups as $id => $listgroup) {
$selected = '';
if ($id == $selectedgroup) {
$selected = 'selected="selected"';
}
echo "<option $selected value=\"$id\">$listgroup</option>";
}
}
?>
</select>
</p>
<p>
<input type="submit" name="groupsinfo" value="<?php p($strgroupinfo) ?>"
onclick="return groupWindow(document.form2.groups);"/>
</p>
<p>
<input type="submit" name="groupsremove" value="<?php p($strgroupremove) ?>" />
</p>
<p>
<input name="newgroupname" type="text" size="10" />
<input type="submit" name="groupsadd" value="<?php p($strgroupadd) ?>" />
</p>
</form>
</td>
<td class="generalboxcontent"><p>
<form name="form3" id="form3" method="post" action="groups.php">
<input type="hidden" name="id" value="<?php p($course->id) ?>" />
<input type="hidden" name="groupid" value="<?php p($selectedgroup) ?>" />
<select name="members[]" size="15" multiple="multiple">
<?php
if (!empty($members)) {
foreach ($members as $id => $membername) {
echo "<option value=\"$id\">$membername</option>";
}
}
?>
</select>
</p>
<p>
<input type="submit" name="membersinfo" value="<?php p($strgroupinfomembers) ?>"
onclick="return userWindow(document.form3['members[]']);" />
</p>
<p>
<input type="submit" name="membersremove" value="<?php p($strgroupremovemembers) ?>"
onclick="updateGroup()" />
</p>
</form>
</td>
</tr>
</table>
+50
View File
@@ -0,0 +1,50 @@
<table align="center" class="generalbox" width="70%">
<tr>
<th colspan="2"><?php echo $t->name ?></th>
</tr>
<tr><td class="generalboxcontent" bgcolor="<?php echo $THEME->cellcontent ?>">
<table width="100%">
<tr>
<td valign="top" width="120">
<p><?php echo $t->picture ?></p>
</td>
<td>
<p><?php echo $t->description ?></p>
<?php
if (!empty($t->linkeditprofile)) {
echo '<p style="font-size: small" align="right"><a href="'.$t->linkeditprofile->url.'">'.$t->linkeditprofile->text.'</a>...</p>';
}
?>
</td>
</tr>
<tr bgcolor="<?php echo $THEME->cellcontent ?>">
<td colspan="2" align="left">
<p style="font-size: x-small"><?php
if ($t->users) {
$countusers = count($t->users);
foreach ($t->users as $user) {
echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&course=$t->courseid\">$user->fullname</a>";
$countusers--;
if ($countusers) {
echo ', ';
}
}
}
?>
</p>
</td>
</tr>
<tr bgcolor="<?php echo $THEME->cellcontent ?>">
<td colspan="2" align="right">
<?php
if (!empty($t->linkfullprofile)) {
echo '<p style="font-size: small" align="right"><a href="'.$t->linkfullprofile->url.'">'.$t->linkfullprofile->text.'</a>...</p>';
}
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br />
+230
View File
@@ -0,0 +1,230 @@
<?php // $Id$
/// Shows all the groups in a course.
/// Editing teachers see a nifty interface for defining groups
require_once('../config.php');
require_once('lib.php');
require_variable($id); // Course id
optional_variable($edit); // Turn editing on and off
if (! $course = get_record('course', 'id', $id) ) {
error("That's an invalid course id");
}
require_login($course->id);
if (!isteacheredit($course->id) and $course->groupmode != VISIBLEGROUPS) {
redirect("group.php?id=$course->id"); // Not allowed to see all groups
}
if (isteacheredit($course->id)) {
if (isset($_GET['edit'])) {
if ($edit == "on") {
$USER->groupsediting = true;
} else if ($edit == "off") {
$USER->groupsediting = false;
}
}
} else {
$USER->groupsediting = false;
}
/// Print the header of the page
$strgroup = get_string('group');
$strgroups = get_string('groups');
$streditgroupprofile = get_string('editgroupprofile');
$strgroupmemberssee = get_string('groupmemberssee');
$loggedinas = "<p class=\"logininfo\">".user_login_string($course, $USER)."</p>";
print_header("$course->shortname: $strgroups", "$course->fullname",
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>
-> $strgroups", "", "", true, update_groups_button($course->id), $loggedinas);
/// Get the current list of groups
$groups = get_groups($course->id);
if (!$USER->groupsediting) { /// Display an overview of all groups
if (!$groups) {
print_heading(get_string('groupsnone'));
} else {
$isteacher = isteacher($course->id);
$isteacheredit = isteacheredit($course->id);
foreach ($groups as $group) {
$t = $group;
$t->description = format_text($group->description);
$t->picture = print_group_picture($group, $course->id, true, true, true);
if ($t->users = get_group_users($group->id, 'u.lastname ASC')) {
foreach ($t->users as $key => $user) {
$t->users[$key]->fullname = fullname($user, $isteacher);
}
}
if ($isteacheredit or ($isteacher and ismember($group->id))) {
$t->linkeditprofile->url = "group.php?id=$course->id&group=$group->id&edit=on";
$t->linkeditprofile->text = $streditgroupprofile;
}
$t->linkfullprofile->url = "group.php?id=$course->id&group=$group->id";
$t->linkfullprofile->text = $strgroupmemberssee;
include('groups-summary.html');
}
}
print_footer($course);
exit;
}
/// We are in editing mode. First, process any inputs there may be.
if ($data = data_submitted()) {
if (!empty($data->nonmembersadd)) { /// Add people to a group
if (!empty($data->nonmembers) and !empty($data->groupid)) {
$groupmodified = false;
foreach ($data->nonmembers as $userid) {
if (!user_group($course->id, $userid)) { // Just to make sure (another teacher could be editing)
$record->groupid = $data->groupid;
$record->userid = $userid;
$record->timeadded = time();
if (!insert_record('groups_members', $record)) {
notify("Error occurred while adding user $userid to group $data->groupid");
}
$groupmodified = true;
}
}
if ($groupmodified) {
set_field('groups', 'timemodified', time(), 'id', $data->groupid);
}
}
$selectedgroup = $data->groupid;
} else if (!empty($data->nonmembersrandom)) { /// Add all non members to groups
notify("Random adding of people into groups is not functional yet.");
} else if (!empty($data->nonmembersinfo)) { /// Return info about the selected users
notify("You must turn Javascript on");
} else if (!empty($data->groupsremove)) { /// Remove a group, all members become nonmembers
if (!empty($data->groups)) {
delete_records("groups", "id", $data->groups);
delete_records("groups_members", "groupid", $data->groups);
unset($groups[$data->groups]);
}
} else if (!empty($data->groupsinfo)) { /// Display full info for a group
notify("You must turn Javascript on");
} else if (!empty($data->groupsadd)) { /// Create a new group
if (!empty($data->newgroupname)) {
$newgroup->name = $data->newgroupname;
$newgroup->courseid = $course->id;
$newgroup->lang = current_language();
$newgroup->timecreated = time();
if (!insert_record("groups", $newgroup)) {
notify("Could not insert the new group '$newgroup->name'");
}
$groups = get_groups($course->id);
}
} else if (!empty($data->membersremove)) { /// Remove selected people from a particular group
if (!empty($data->members) and !empty($data->groupid)) {
foreach ($data->members as $userid) {
delete_records('groups_members', 'userid', $userid, "groupid", $data->groupid);
set_field('groups', 'timemodified', time(), 'id', $data->groupid);
}
}
$selectedgroup = $data->groupid;
} else if (!empty($data->membersinfo)) { /// Return info about the selected users
notify("You must turn Javascript on");
}
}
$SESSION->fullnamedisplay = 'firstname lastname';
/// Calculate data ready to create the editing interface
$strgroupnonmembers = get_string('groupnonmembers');
$strgroupmembersselected = get_string('groupmembersselected');
$strgroupremovemembers = get_string('groupremovemembers');
$strgroupinfomembers = get_string('groupinfomembers');
$strgroupadd = get_string('groupadd');
$strgroupremove = get_string('groupremove');
$strgroupinfo = get_string('groupinfo');
$strgroupinfopeople = get_string('groupinfopeople');
$strgrouprandomassign = get_string('grouprandomassign');
$strgroupaddusers = get_string('groupaddusers');
$courseid = $course->id;
$listgroups = array();
$listmembers = array();
$nonmembers = array();
$groupcount = count($groups);
/// First, get everyone into the nonmembers array
if ($students = get_course_students($course->id)) {
foreach ($students as $student) {
$nonmembers[$student->id] = fullname($student, true);
}
unset($students);
}
if ($teachers = get_course_teachers($course->id)) {
foreach ($teachers as $teacher) {
$prefix = '- ';
if (isteacheredit($course->id, $user->id)) {
$prefix = '# ';
}
$nonmembers[$teacher->id] = $prefix.fullname($teacher, true);
}
unset($teachers);
}
/// Pull out all the members into little arrays
if ($groups) {
foreach ($groups as $group) {
$countusers = 0;
$listmembers[$group->id] = array();
if ($groupusers = get_group_users($group->id)) {
foreach ($groupusers as $groupuser) {
$listmembers[$group->id][$groupuser->id] = $nonmembers[$groupuser->id];
unset($nonmembers[$groupuser->id]);
$countusers++;
}
natcasesort($listmembers[$group->id]);
}
$listgroups[$group->id] = $group->name." ($countusers)";
}
natcasesort($listgroups);
}
natcasesort($nonmembers);
if (empty($selectedgroup)) { // Choose the first group by default
if ($selectedgroup = array_shift(array_keys($listgroups))) {
$members = $listmembers[$selectedgroup];
}
} else {
$members = $listmembers[$selectedgroup];
}
/// Print out the complete form
include('groups-edit.html');
print_footer($course);
?>
+36 -18
View File
@@ -5,22 +5,25 @@
require_once("../config.php");
require_once("lib.php");
if (!$site = get_site()) {
error("Site isn't defined!");
}
if ($CFG->forcelogin) {
require_login();
}
if (isadmin()) {
if (isset($_GET['edit'])) {
if ($edit == "on") {
$USER->editing = true;
$USER->categoriesediting = true;
} else if ($edit == "off") {
$USER->editing = false;
$USER->categoriesediting = false;
}
}
}
$adminediting = (isadmin() and !empty($USER->editing));
$adminediting = (isadmin() and !empty($USER->categoriesediting));
/// Unless it's an editing admin, just print the regular listing of courses/categories
@@ -30,8 +33,10 @@
if ($countcategories > 1) {
$strcourses = get_string("courses");
print_header($strcourses, $strcourses, $strcourses, "", "", true, update_categories_button());
print_heading(get_string("categories"));
$strcategories = get_string("categories");
print_header("$site->shortname: $strcategories", $strcourses,
$strcategories, "", "", true, update_categories_button());
print_heading($strcategories);
print_simple_box_start("center", "50%", "#FFFFFF", 5, "categorybox");
print_whole_category_list();
print_simple_box_end();
@@ -44,9 +49,7 @@
if (iscreator()) { // Print link to create a new course
echo "<center><p>";
unset($options);
$option["category"] = $category->id;
print_single_button("edit.php", $options, get_string("addnewcourse"), "get");
print_single_button("edit.php", NULL, get_string("addnewcourse"), "get");
echo "</p></center>";
}
@@ -98,18 +101,33 @@
/// Delete a category if necessary
if (isset($delete)) {
if ($tempcat = get_record("course_categories", "id", $delete)) {
if (delete_records("course_categories", "id", $tempcat->id)) {
notify(get_string("categorydeleted", "", $tempcat->name));
}
if ($children = get_records("course_categories", "parent", $tempcat->id)) {
// Send the children to live with their grandparent
foreach ($children as $childcat) {
if (! set_field("course_categories", "parent", $tempcat->parent, "id", $childcat->id)) {
notify("Could not update a child category!");
if ($deletecat = get_record("course_categories", "id", $delete)) {
/// Send the children categories to live with their grandparent
if ($childcats = get_records("course_categories", "parent", $deletecat->id)) {
foreach ($childcats as $childcat) {
if (! set_field("course_categories", "parent", $deletecat->parent, "id", $childcat->id)) {
error("Could not update a child category!", "index.php");
}
}
}
/// If the grandparent is a valid (non-zero) category, then
/// send the children courses to live with their grandparent as well
if ($deletecat->parent) {
if ($childcourses = get_records("course", "category", $deletecat->id)) {
foreach ($childcourses as $childcourse) {
if (! set_field("course", "category", $deletecat->parent, "id", $childcourse->id)) {
error("Could not update a child course!", "index.php");
}
}
}
}
/// Finally delete the category itself
if (delete_records("course_categories", "id", $deletecat->id)) {
notify(get_string("categorydeleted", "", $deletecat->name));
}
}
}
+2 -2
View File
@@ -37,7 +37,7 @@
echo "<center>";
if ($course->guest) {
$strallowguests = get_string("allowguests");
echo "<p><font size=1><img align=\"absmiddle\" alt=\"\" height=16 width=16 border=0 src=\"$pixpath/i/user.gif\"></a>&nbsp;$strallowguests</font></p>";
echo "<p><font size=1><img align=\"absmiddle\" alt=\"\" height=16 width=16 border=0 src=\"$pixpath/i/guest.gif\"></a>&nbsp;$strallowguests</font></p>";
}
if ($course->password) {
$strrequireskey = get_string("requireskey");
@@ -66,7 +66,7 @@
echo "<br />";
print_simple_box_start("center", "100%");
echo text_to_html($course->summary);
echo filter_text(text_to_html($course->summary),$course->id);
print_simple_box_end();
echo "<br />";
+574 -210
View File
File diff suppressed because it is too large Load Diff
+15 -11
View File
@@ -7,6 +7,9 @@
require_variable($id); // Course ID
optional_variable($user, 0); // User to display
optional_variable($date, 0); // Date to display
optional_variable($modname, ""); // course_module->id
optional_variable($modid, ""); // course_module->id
optional_variable($modaction, ""); // an action as recorded in the logs
optional_variable($page, "0"); // which page to show
optional_variable($perpage, "100"); // how many per page
@@ -46,40 +49,41 @@
if ($course->category) {
print_header("$course->shortname: $strlogs", "$course->fullname",
"<A HREF=\"view.php?id=$course->id\">$course->shortname</A> ->
<A HREF=\"log.php?id=$course->id\">$strlogs</A> -> $userinfo, $dateinfo", "");
"<a href=\"view.php?id=$course->id\">$course->shortname</a> ->
<a href=\"log.php?id=$course->id\">$strlogs</a> -> $userinfo, $dateinfo", "");
} else {
print_header("$course->shortname: $strlogs", "$course->fullname",
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A> ->
<A HREF=\"log.php?id=$course->id\">$strlogs</A> -> $userinfo, $dateinfo", "");
"<a href=\"../$CFG->admin/index.php\">$stradministration</a> ->
<a href=\"log.php?id=$course->id\">$strlogs</a> -> $userinfo, $dateinfo", "");
}
print_heading("$course->fullname: $userinfo, $dateinfo (".usertimezone().")");
print_log_selector_form($course, $user, $date);
print_log_selector_form($course, $user, $date, $modname, $modid, $modaction);
print_log($course, $user, $date, "l.time DESC", $page, $perpage,
"log.php?id=$course->id&chooselog=1&user=$user&date=$date");
"log.php?id=$course->id&chooselog=1&user=$user&date=$date&modid=$modid&modaction=$modaction",
$modname, $modid, $modaction);
} else {
if ($course->category) {
print_header("$course->shortname: $strlogs", "$course->fullname",
"<A HREF=\"view.php?id=$course->id\">$course->shortname</A> -> $strlogs", "");
"<a href=\"view.php?id=$course->id\">$course->shortname</a> -> $strlogs", "");
} else {
print_header("$course->shortname: $strlogs", "$course->fullname",
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A> -> $strlogs", "");
"<a href=\"../$CFG->admin/index.php\">$stradministration</a> -> $strlogs", "");
}
print_heading(get_string("chooselogs").":");
print_log_selector_form($course);
echo "<BR>";
echo "<br />";
print_heading(get_string("chooselivelogs").":");
echo "<CENTER><H3>";
echo "<center><h3>";
link_to_popup_window("/course/loglive.php?id=$course->id","livelog", get_string("livelogs"), 500, 800);
echo "</H3></CENTER>";
echo "</h3></center>";
}
print_footer($course);
+12 -11
View File
@@ -16,10 +16,8 @@
require_login($course->id);
if (!isteacher($course->id)) {
if (! ($type == "usercourse.png" and $user == $USER->id) ) {
error("Sorry, you aren't allowed to see this.");
}
if (! (isteacher($course->id) or ($course->showreports and $USER->id == $user))) {
error("Sorry, you aren't allowed to see this.");
}
if ($user) {
@@ -47,6 +45,14 @@
if ($timenow - $course->startdate > $maxseconds) {
$course->startdate = $timenow - $maxseconds;
}
if (!empty($CFG->loglifetime)) {
$maxseconds = $CFG->loglifetime * 3600 * 24; // seconds
if ($timenow - $course->startdate > $maxseconds) {
$course->startdate = $timenow - $maxseconds;
}
}
$timestart = $coursestart = usergetmidnight($course->startdate);
if ((($timenow - $timestart)/86400.0) > 40) {
@@ -78,13 +84,10 @@
}
}
$maxlogs = max($logs);
$graph = new graph(750, 400);
$a->coursename = $course->shortname;
$a->username = "$user->firstname $user->lastname";
$a->username = fullname($user, true);
$graph->parameter['title'] = get_string("hitsoncourse", "", $a);
$graph->x_data = $days;
@@ -134,12 +137,10 @@
}
}
$maxlogs = max($logs);
$graph = new graph(750, 400);
$a->coursename = $course->shortname;
$a->username = "$user->firstname $user->lastname";
$a->username = fullname($user, true);
$graph->parameter['title'] = get_string("hitsoncoursetoday", "", $a);
$graph->x_data = $hours;
+21 -4
View File
@@ -12,12 +12,20 @@
error("Course ID was incorrect");
}
require_login($course->id);
if ($course->category) {
require_login($course->id);
}
if ($return and $USER->realuser) {
$USER = get_user_info_from_db("id", $USER->realuser);
$USER->loggedin = true;
$USER->site = $CFG->wwwroot;
if (isset($SESSION->oldcurrentgroup)) { // Restore previous "current group"
$SESSION->currentgroup[$course->id] = $SESSION->oldcurrentgroup;
unset($SESSION->oldcurrentgroup);
}
redirect($_SERVER["HTTP_REFERER"]);
exit;
}
@@ -32,18 +40,27 @@
error("This student is not in this course!");
}
if (iscreator($user)) {
error("You can not login as this person!");
}
// Login as this student and return to course home page.
$teacher_name = "$USER->firstname $USER->lastname";
$teacher_name = fullname($USER, true);
$teacher_id = "$USER->id";
$USER = get_user_info_from_db("id", $user);
$USER = get_user_info_from_db("id", $user); // Create the new USER object with all details
$USER->loggedin = true;
$USER->site = $CFG->wwwroot;
$USER->realuser = $teacher_id;
if (isset($SESSION->currentgroup[$course->id])) { // Remember current setting for later
$SESSION->oldcurrentgroup = $SESSION->currentgroup[$course->id];
unset($SESSION->currentgroup[$course->id]);
}
set_moodle_cookie($USER->username);
$student_name = "$USER->firstname $USER->lastname";
$student_name = fullname($USER, true);
add_to_log($course->id, "course", "loginas", "../user/view.php?id=$course->id&user=$user", "$teacher_name -> $student_name");
+133 -37
View File
@@ -27,11 +27,15 @@
if (isset($_POST["course"])) { // add or update form submitted
if (!isteacheredit($mod->course)) {
if (!$course = get_record("course", "id", $mod->course)) {
error("This course doesn't exist");
}
if (!isteacheredit($course->id)) {
error("You can't modify this course!");
}
$modlib = "../mod/$mod->modulename/lib.php";
$modlib = "$CFG->dirroot/mod/$mod->modulename/lib.php";
if (file_exists($modlib)) {
include_once($modlib);
} else {
@@ -40,21 +44,47 @@
$addinstancefunction = $mod->modulename."_add_instance";
$updateinstancefunction = $mod->modulename."_update_instance";
$deleteinstancefunction = $mod->modulename."_delete_instance";
$moderr = "$CFG->dirroot/mod/$mod->modulename/moderr.html";
switch ($mod->mode) {
case "update":
if (! $updateinstancefunction($mod)) {
error("Could not update the $mod->modulename");
$return = $updateinstancefunction($mod);
if (!$return) {
if (file_exists($moderr)) {
$form = $mod;
include_once($moderr);
die;
}
error("Could not update the $mod->modulename", "view.php?id=$course->id");
}
add_to_log($mod->course, "course", "update mod",
if (is_string($return)) {
error($return, "view.php?id=$course->id");
}
add_to_log($course->id, "course", "update mod",
"../mod/$mod->modulename/view.php?id=$mod->coursemodule",
"$mod->modulename $mod->instance");
add_to_log($course->id, $mod->modulename, "update",
"view.php?id=$mod->coursemodule",
"$mod->instance", $mod->coursemodule);
break;
case "add":
if (! $mod->instance = $addinstancefunction($mod)) {
error("Could not add a new instance of $mod->modulename");
$return = $addinstancefunction($mod);
if (!$return) {
if (file_exists($moderr)) {
$form = $mod;
include_once($moderr);
die;
}
error("Could not add a new instance of $mod->modulename", "view.php?id=$course->id");
}
if (is_string($return)) {
error($return, "view.php?id=$course->id");
}
$mod->groupmode = $course->groupmode; /// Default groupmode the same as course
$mod->instance = $return;
// course_modules and course_sections each contain a reference
// to each other, so we have to update one of them twice.
@@ -64,12 +94,22 @@
if (! $sectionid = add_mod_to_section($mod) ) {
error("Could not add the new course module to that section");
}
//We get the section's visible field status
$visible = get_field("course_sections","visible","id",$sectionid);
if (! set_field("course_modules", "visible", $visible, "id", $mod->coursemodule)) {
error("Could not update the course module with the correct visibility");
}
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",
add_to_log($course->id, "course", "add mod",
"../mod/$mod->modulename/view.php?id=$mod->coursemodule",
"$mod->modulename $mod->instance");
add_to_log($course->id, $mod->modulename, "add",
"view.php?id=$mod->coursemodule",
"$mod->instance", $mod->coursemodule);
break;
case "delete":
if (! $deleteinstancefunction($mod->instance)) {
@@ -81,29 +121,29 @@
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",
add_to_log($course->id, "course", "delete mod",
"view.php?id=$mod->course",
"$mod->modulename $mod->instance");
"$mod->modulename $mod->instance", $mod->coursemodule);
break;
default:
error("No mode defined");
}
rebuild_course_cache($mod->course);
rebuild_course_cache($course->id);
if (!empty($SESSION->returnpage)) {
$return = $SESSION->returnpage;
unset($SESSION->returnpage);
redirect($return);
} else {
redirect("view.php?id=$mod->course");
redirect("view.php?id=$course->id");
}
exit;
}
if (isset($move)) {
if (isset($_GET['move'])) {
require_variable($id);
@@ -115,7 +155,7 @@
error("You can't modify this course!");
}
move_module($cm, $move);
move_module($cm, $_GET['move']);
rebuild_course_cache($cm->course);
@@ -127,20 +167,20 @@
}
exit;
} else if (isset($movetosection) or isset($moveto)) {
} else if (isset($_GET['movetosection']) or isset($_GET['moveto'])) {
if (! $cm = get_record("course_modules", "id", $USER->activitycopy)) {
error("The copied course module doesn't exist!");
}
if (isset($movetosection)) {
if (! $section = get_record("course_sections", "id", $movetosection)) {
if (isset($_GET['movetosection'])) {
if (! $section = get_record("course_sections", "id", $_GET['movetosection'])) {
error("This section doesn't exist");
}
$beforecm = NULL;
} else { // normal moveto
if (! $beforecm = get_record("course_modules", "id", $moveto)) {
if (! $beforecm = get_record("course_modules", "id", $_GET['moveto'])) {
error("The destination course module doesn't exist");
}
if (! $section = get_record("course_sections", "id", $beforecm->section)) {
@@ -171,9 +211,35 @@
redirect("view.php?id=$section->course");
}
} else if (isset($hide)) {
} else if (isset($_GET['indent'])) {
if (! $cm = get_record("course_modules", "id", $hide)) {
require_variable($id);
if (! $cm = get_record("course_modules", "id", $id)) {
error("This course module doesn't exist");
}
$cm->indent += $_GET['indent'];
if ($cm->indent < 0) {
$cm->indent = 0;
}
if (!set_field("course_modules", "indent", $cm->indent, "id", $cm->id)) {
error("Could not update the indent level on that course module");
}
$site = get_site();
if ($site->id == $cm->course) {
redirect($CFG->wwwroot);
} else {
redirect("view.php?id=$cm->course");
}
exit;
} else if (isset($_GET['hide'])) {
if (! $cm = get_record("course_modules", "id", $_GET['hide'])) {
error("This course module doesn't exist");
}
@@ -193,9 +259,9 @@
}
exit;
} else if (isset($show)) {
} else if (isset($_GET['show'])) {
if (! $cm = get_record("course_modules", "id", $show)) {
if (! $cm = get_record("course_modules", "id", $_GET['show'])) {
error("This course module doesn't exist");
}
@@ -225,9 +291,31 @@
}
exit;
} else if (isset($copy)) { // value = course module
} else if (isset($_GET['groupmode'])) {
if (! $cm = get_record("course_modules", "id", $copy)) {
if (! $cm = get_record("course_modules", "id", $_GET['id'])) {
error("This course module doesn't exist");
}
if (!isteacheredit($cm->course)) {
error("You can't modify this course!");
}
set_groupmode_for_module($cm->id, $_GET['groupmode']);
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($_GET['copy'])) { // value = course module
if (! $cm = get_record("course_modules", "id", $_GET['copy'])) {
error("This course module doesn't exist");
}
@@ -253,7 +341,7 @@
redirect("view.php?id=$cm->course");
} else if (isset($cancelcopy)) { // value = course module
} else if (isset($_GET['cancelcopy'])) { // value = course module
$courseid = $USER->activitycopycourse;
@@ -263,9 +351,9 @@
redirect("view.php?id=$courseid");
} else if (isset($delete)) { // value = course module
} else if (isset($_GET['delete'])) { // value = course module
if (! $cm = get_record("course_modules", "id", $delete)) {
if (! $cm = get_record("course_modules", "id", $_GET['delete'])) {
error("This course module doesn't exist");
}
@@ -293,7 +381,7 @@
"$CFG->wwwroot/course/view.php?id=$course->id");
}
$fullmodulename = strtolower(get_string("modulename", $module->name));
$fullmodulename = get_string("modulename", $module->name);
$form->coursemodule = $cm->id;
$form->section = $cm->section;
@@ -319,9 +407,9 @@
exit;
} else if (isset($update)) { // value = course module
} else if (isset($_GET['update'])) { // value = course module
if (! $cm = get_record("course_modules", "id", $update)) {
if (! $cm = get_record("course_modules", "id", $_GET['update'])) {
error("This course module doesn't exist");
}
@@ -369,9 +457,9 @@
}
} else if (isset($add)) {
} else if (isset($_GET['add'])) {
if (!$add) {
if (empty($_GET['add'])) {
redirect($_SERVER["HTTP_REFERER"]);
die;
}
@@ -383,7 +471,7 @@
error("This course doesn't exist");
}
if (! $module = get_record("modules", "name", $add)) {
if (! $module = get_record("modules", "name", $_GET['add'])) {
error("This module type doesn't exist");
}
@@ -396,7 +484,7 @@
$form->mode = "add";
$sectionname = get_string("name$course->format");
$fullmodulename = strtolower(get_string("modulename", $module->name));
$fullmodulename = get_string("modulename", $module->name);
if ($form->section) {
$heading->what = $fullmodulename;
@@ -417,14 +505,20 @@
$streditinga = get_string("editinga", "moodle", $fullmodulename);
$strmodulenameplural = get_string("modulenameplural", $module->name);
if ($module->name == "label") {
$focuscursor = "";
} else {
$focuscursor = "form.name";
}
if ($course->category) {
print_header("$course->shortname: $streditinga", "$course->fullname",
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A> ->
<A HREF=\"$CFG->wwwroot/mod/$module->name/index.php?id=$course->id\">$strmodulenameplural</A> ->
$streditinga", "form.name", "", false);
$streditinga", $focuscursor, "", false);
} else {
print_header("$course->shortname: $streditinga", "$course->fullname",
"$streditinga", "form.name", "", false);
"$streditinga", $focuscursor, "", false);
}
unset($SESSION->modform); // Clear any old ones that may be hanging around.
@@ -433,7 +527,9 @@
if (file_exists($modform)) {
print_heading_with_help($pageheading, "mods", $module->name);
$icon = "<img align=absmiddle height=16 width=16 src=\"$CFG->modpixpath/$module->name/icon.gif\">&nbsp;";
print_heading_with_help($pageheading, "mods", $module->name, $icon);
print_simple_box_start("center", "", "$THEME->cellheading");
include_once($modform);
print_simple_box_end();
+131
View File
@@ -0,0 +1,131 @@
<?PHP // $Id$
// Display user activity reports for a course (totals)
require_once("../config.php");
require_once("lib.php");
$modes = array("outline", "complete", "todaylogs", "alllogs");
require_variable($id); // course id
optional_variable($page, "0");
optional_variable($perpage, "100");
require_login();
if (! $course = get_record("course", "id", $id)) {
error("Course id is incorrect.");
}
if (! (isteacher($course->id) or ($course->showreports and $USER->id == $user->id))) {
error("You are not allowed to look at this page");
}
add_to_log($course->id, "course", "course report", "course.php?id=$course->id",$course->id);
$stractivityreport = get_string("activityreport");
$strparticipants = get_string("participants");
$stroutline = get_string("outline");
$strcomplete = get_string("complete");
$stralllogs = get_string("alllogs");
$strtodaylogs = get_string("todaylogs");
if ($course->category) {
print_header("$course->shortname: $stractivityreport", "$course->fullname",
"<A HREF=\"../course/view.php?id=$course->id\">$course->shortname</A> ->
$stractivityreport");
} else {
print_header("$course->shortname: $stractivityreport ($mode)", "$course->fullname",
"<A HREF=\"../user/view.php?id=$user->id&course=$course->id\">$user->firstname $user->lastname</A> ->
$stractivityreport -> $strmode");
}
print_heading("$course->fullname");
echo "<table cellpadding=10 align=center><tr>";
echo "<td>$stractivityreport: </td>";
echo "</tr></table>";
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);
$sections = get_all_sections($course->id);
for ($i=0; $i<=$course->numsections; $i++) {
if (isset($sections[$i])) { // should always be true
$section = $sections[$i];
if ($section->sequence) {
echo "<HR>";
echo "<H2>";
switch ($course->format) {
case "weeks": print_string("week"); break;
case "topics": print_string("topic"); break;
default: print_string("section"); break;
}
echo " $i</H2>";
echo "<UL>";
echo "<TABLE CELLPADDING=4 CELLSPACING=0>";
$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";
$result = null;
if ($logs = get_records_select("log", "module='$mod->modname'
AND action LIKE 'view%' AND info='$mod->instance'", "time ASC")) {
$numviews = count($logs);
$lastlog = array_pop($logs);
$result->info = get_string("numviews", "", $numviews);
$result->time = $lastlog->time;
}
print_outline_row($mod, $instance, $result);
}
echo "</TABLE>";
print_simple_box_end();
echo "</UL>";
}
}
}
print_footer($course);
function print_outline_row($mod, $instance, $result) {
$image = "<IMG SRC=\"../mod/$mod->modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"$mod->modfullname\">";
echo "<TR>";
echo "<TD VALIGN=top>$image</TD>";
echo "<TD VALIGN=top width=300>";
echo " <A TITLE=\"$mod->modfullname\"";
echo " HREF=\"../mod/$mod->modname/view.php?id=$mod->id\">$instance->name</A></TD>";
echo "<TD>&nbsp;&nbsp;&nbsp;</TD>";
echo "<TD VALIGN=top BGCOLOR=white>";
if (isset($result->info)) {
echo "$result->info";
} else {
echo "<P ALIGN=CENTER>-</P>";
}
echo "</TD>";
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)</TD>";
}
echo "</TR>";
}
?>
+263 -57
View File
@@ -7,6 +7,8 @@
require_variable($id);
optional_variable($user);
if (! $course = get_record("course", "id", $id) ) {
error("That's an invalid course id");
}
@@ -15,87 +17,291 @@
add_to_log($course->id, "course", "recent", "recent.php?id=$course->id", "$course->id");
if (empty($THEME->custompix)) {
$pixpath = "../pix";
$modpixpath = "../mod";
} else {
$pixpath = "../theme/$CFG->theme/pix";
$modpixpath = "../theme/$CFG->theme/pix/mod";
}
$strrecentactivity = get_string("recentactivity");
$loggedinas = "<p class=\"logininfo\">".user_login_string($course, $USER)."</p>";
print_header("$course->fullname: $strrecentactivity", "$course->fullname",
"<a href=\"view.php?id=$course->id\">$course->shortname</a> -> $strrecentactivity",
"", "", true, "", $loggedinas);
if (!empty($_GET['chooserecent'])) {
$userinfo = get_string("allparticipants");
$dateinfo = get_string("alldays");
if ($user) {
if (!$u = get_record("user", "id", $user) ) {
error("That's an invalid user!");
}
$userinfo = "$u->firstname $u->lastname";
}
if ($date)
$dateinfo = userdate($date, get_string("strftimedaydate"));
if ($course->category) {
print_header("$course->shortname: $strrecentactivity", "$course->fullname",
"<a href=\"view.php?id=$course->id\">$course->shortname</a> ->
<a href=\"recent.php?id=$course->id\">$strrecentactivity</a> -> $userinfo, $dateinfo", "");
} else {
print_header("$course->shortname: $strrecentactivity", "$course->fullname",
"<a href=\"../$CFG->admin/index.php\">$stradministration</a> ->
<a href=\"recent.php?id=$course->id\">$strrecentactivity</a> -> $userinfo, $dateinfo", "");
}
print_heading("$course->fullname: $userinfo, $dateinfo (".usertimezone().")");
$advancedfilter = 1;
print_recent_selector_form($course, $advancedfilter, $user, $date, $modname, $modid, $modaction, $selectedgroup, $sortby);
} else {
if (empty($date)) { // no date picked, default to last login time
$date = $USER->lastlogin;
}
if ($course->category) {
print_header("$course->shortname: $strrecentactivity", "$course->fullname",
"<a href=\"view.php?id=$course->id\">$course->shortname</a> -> $strrecentactivity", "");
} else {
print_header("$course->shortname: $strrecentactivity", "$course->fullname",
"<a href=\"../$CFG->admin/index.php\">$stradministration</a> -> $strrecentactivity", "");
}
print_heading(get_string("activitysince", "", userdate($date)));
print_recent_selector_form($course, $advancedfilter);
}
$tmpmodid = $modid;
switch ($tmpmodid) {
case "activity/Assignments" : $filter = "assignment"; break;
case "activity/Chats" : $filter = "chat"; break;
case "activity/Forums" : $filter = "forum"; break;
case "activity/Quizzes" : $filter = "quiz"; break;
case "activity/Workshops" : $filter = "workshop"; break;
default : $filter = "";
}
$activities = array();
$sections = array();
switch ($course->format) {
case "weeks": $sectiontitle = get_string("week"); break;
case "topics": $sectiontitle = get_string("topic"); break;
default: $sectiontitle = get_string("section"); break;
}
$index = 0;
if (is_numeric($modid)) { // you chose a single activity
$sections[0]->sequence = "$modid";
} else { // you chose a group of activities
if (isteacher($user)) {
$hiddenfilter = "";
} else {
$hiddenfilter = " AND cs.visible = '1' ";
}
$sections = get_records_sql("SELECT cs.id, cs.section, cs.sequence, cs.summary, cs.visible
FROM {$CFG->prefix}course_sections cs
WHERE course = '$course->id' $hiddenfilter
ORDER by section");
}
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);
print_heading("Since: Last Login | 1 day | 7 days | 14 days | 21 days | 30 days");
if (!empty($sections)) {
if (empty($days)) {
$timestart = $USER->lastlogin;
} else {
$timestart = time() - ($days * 3600 * 24);
}
echo "<hr>";
$i = 0;
print_heading(get_string("activitysince", "", userdate($timestart)));
if (!empty($filter)) {
$activityfilter = "AND m.name = '$filter'";
} else {
$activityfilter = "";
}
$sections = get_all_sections($course->id);
if (isteacher($user)) {
$hiddenfilter = "";
} else {
$hiddenfilter = " AND cm.visible = '1' ";
}
for ($i=0; $i<=$course->numsections; $i++) {
foreach ($sections as $section) {
if (isset($sections[$i])) { // should always be true
$section = $sections[$i];
if ($section->sequence) {
echo "<hr>";
echo "<h2>";
switch ($course->format) {
case "weeks": print_string("week"); break;
case "topics": print_string("topic"); break;
default: print_string("section"); break;
if ($i <= $course->numsections) {
$activity->type = "section";
if ($i) {
$activity->name = $sectiontitle . " $i";
} else {
$activity->name = '';
}
echo " $i</h2>";
$activity->visible = $section->visible;
$activities[$index] = $activity;
}
$index++;
$i++;
echo "<ul>";
$sectionmods = explode(",", $section->sequence);
$sectionmods = explode(",", $section->sequence);
foreach ($sectionmods as $sectionmod) {
foreach ($sectionmods as $sectionmod) {
if (empty($mods[$sectionmod])) {
continue;
}
$mod = $mods[$sectionmod];
if (empty($mods[$sectionmod])) {
continue;
}
$mod = $mods[$sectionmod];
$instance = get_record("$mod->modname", "id", "$mod->instance");
$instance = get_record("$mod->modname", "id", "$mod->instance");
$libfile = "$CFG->dirroot/mod/$mod->modname/lib.php";
$coursemod = get_record_sql("SELECT m.id, m.name, cm.groupmode, cm.visible
FROM {$CFG->prefix}course_modules cm,
{$CFG->prefix}modules m
WHERE course = '$course->id' $hiddenfilter
AND m.id = cm.module $activityfilter
AND cm.id = '$sectionmod'");
if (file_exists($libfile)) {
require_once($libfile);
$print_recent_instance_activity = $mod->modname."_print_recent_instance_activity";
if (function_exists($print_recent_instance_activity)) {
$image = "<img src=\"$modpixpath/$mod->modname/icon.gif\" ".
"height=16 width=16 alt=\"$mod->modfullname\">";
echo "<h4>$image $mod->modfullname: ".
"<a href=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">".
"$instance->name</a></h4>";
echo "<ul>";
$print_recent_instance_activity($instance, $timestart);
echo "</ul>";
}
$groupmode = groupmode($course, $coursemod);
switch ($groupmode) {
case SEPARATEGROUPS : $groupid = mygroupid($course->id); break;
case VISIBLEGROUPS :
if ($selectedgroup == "allgroups") {
$groupid = "";
} else {
$groupid = $selectedgroup;
}
break;
case NOGROUPS :
default : $groupid = "";
}
$libfile = "$CFG->dirroot/mod/$coursemod->name/lib.php";
if (file_exists($libfile)) {
require_once($libfile);
$get_recent_mod_activity = $coursemod->name."_get_recent_mod_activity";
if (function_exists($get_recent_mod_activity)) {
$activity->type = "activity";
$activity->name = $instance->name;
$activity->visible = $coursemod->visible;
$activity->content->fullname = $mod->modfullname;
$activity->content->modname = $mod->modname;
$activity->content->modid =$mod->id;
$activities[$index] = $activity;
$index++;
$get_recent_mod_activity($activities, $index, $date, $course->id, $sectionmod, $user, $groupid);
}
}
echo "</ul>";
}
}
}
$detail = true;
switch ($sortby) {
case "datedesc" : usort($activities, "compare_activities_by_time_desc"); break;
case "dateasc" : usort($activities, "compare_activities_by_time_asc"); break;
case "default" :
default : $detail = false; $sortby = "default";
}
if (!empty($activities)) {
$newsection = true;
$lastsection = "";
$newinstance = true;
$lastinstance = "";
$inbox = false;
$section = 0;
if (isteacher($user)) {
$teacher = true;
} else {
$teacher = false;
}
$activity_count = count($activities);
foreach ($activities as $key => $activity) {
// peak at next activity. If it's another section, don't print this one!
// this means there are no activities in the current section
if (($activity->type == "section") &&
(($activity_count == ($key + 1)) ||
($activities[$key+1]->type == "section"))) {
continue;
}
if (($activity->type == "section") && ($sortby == "default")) {
if ($inbox) {
print_simple_box_end();
print_spacer(30);
}
print_simple_box_start("center", "90%");
echo "<h2>$activity->name</h2>";
$inbox = true;
} else if ($activity->type == "activity") {
if ($sortby == "default") {
if ($teacher && $activity->visible == 0) {
$linkformat = 'class="dimmed"';
} else {
$linkformat = '';
}
$image = "<img src=\"$CFG->modpixpath/" . $activity->content->modname . "/icon.gif\"" .
"height=16 width=16 alt=\"" . $activity->content->modfullname . "\">";
echo "<ul><h4>$image " . $activity->content->modfullname .
"<a href=\"$CFG->wwwroot/mod/" . $activity->content->modname . "/view.php?" .
"id=" . $activity->content->modid . "\" $linkformat>" .
$activity->name . "</a></h4></ul>";
}
} else {
if (!$inbox) {
print_simple_box_start("center", "90%");
$inbox = true;
}
$print_recent_mod_activity = $activity->type."_print_recent_mod_activity";
if (function_exists($print_recent_mod_activity)) {
echo '<ul><ul>';
$print_recent_mod_activity($activity, $course->id, $detail);
echo '</ul></ul>';
}
}
}
if ($inbox) {
print_simple_box_end();
}
} else {
echo "<h4><center>" . get_string("norecentactivity") . "</center></h2>";
}
// fix modid for selection form
$modid =$tmpmodid;
print_footer($course);
?>
function compare_activities_by_time_desc($a, $b) {
if ($a->timestamp == $b->timestamp)
return 0;
return ($a->timestamp > $b->timestamp) ? -1 : 1;
}
function compare_activities_by_time_asc($a, $b) {
if ($a->timestamp == $b->timestamp)
return 0;
return ($a->timestamp < $b->timestamp) ? -1 : 1;
}
?>
+14
View File
@@ -52,6 +52,13 @@
if ($scales = get_records("scale", "courseid", "$course->id", "name ASC")) {
print_heading($strcustomscales);
if (isteacheredit($course->id)) {
echo "<p align=\"center\">(";
print_string("scalestip");
echo ")</p>";
}
foreach ($scales as $scale) {
$scalemenu = make_menu_from_list($scale->scale);
@@ -64,6 +71,13 @@
print_simple_box_end();
echo "<hr />";
}
} else {
if (isteacheredit($course->id)) {
echo "<p align=\"center\">(";
print_string("scalestip");
echo ")</p>";
}
}
if ($scales = get_records("scale", "courseid", "0", "name ASC")) {
-6
View File
@@ -23,12 +23,6 @@
$site = get_site();
if (empty($THEME->custompix)) {
$pixpath = "$CFG->wwwroot/pix";
} else {
$pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix";
}
$displaylist = array();
$parentlist = array();
make_categories_list($displaylist, $parentlist, "");
+9 -7
View File
@@ -20,8 +20,8 @@
require_login($course->id);
if (!isteacher($course->id)) {
error("You must be a teacher in this course, or an admin");
if (!isteacheredit($course->id)) {
error("You must be an editing teacher in this course, or an admin");
}
$strassignstudents = get_string("assignstudents");
@@ -65,7 +65,7 @@
if (!empty($remove)) {
if (! unenrol_student($remove, $course->id)) {
error("Could not add that student to this course!");
error("Could not remove that student from this course!");
}
}
@@ -98,7 +98,8 @@
$studentarray = array();
foreach ($students as $student) {
$studentarray[] = $student->id;
echo "<p align=right>$student->firstname $student->lastname, $student->email &nbsp;&nbsp; <a href=\"student.php?id=$course->id&remove=$student->id\" title=\"$strremovestudent\"><img src=\"../pix/t/right.gif\" border=0></a></p>";
$fullname = fullname($student, true);
echo "<p align=right>$fullname, $student->email &nbsp;&nbsp; <a href=\"student.php?id=$course->id&remove=$student->id\" title=\"$strremovestudent\"><img src=\"../pix/t/right.gif\" border=0></a></p>";
}
$studentlist = implode(",",$studentarray);
unset($studentarray);
@@ -128,14 +129,15 @@
}
foreach ($users as $user) {
echo "<p align=left><a href=\"{$_SERVER['PHP_SELF']}?id=$course->id&add=$user->id\"".
$fullname = fullname($user, true);
echo "<p align=left><a href=\"student.php?id=$course->id&add=$user->id\"".
"title=\"$straddstudent\"><img src=\"../pix/t/left.gif\"".
"border=0></a>&nbsp;&nbsp;$user->firstname $user->lastname, $user->email";
"border=0></a>&nbsp;&nbsp;$fullname, $user->email";
}
}
if ($search or $usercount > MAX_USERS_PER_PAGE) {
echo "<form action={$_SERVER['PHP_SELF']} method=post>";
echo "<form action=student.php 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\">";
+2 -2
View File
@@ -156,7 +156,7 @@
$teacher->role = $course->teacher;
}
$table->data[] = array ($picture, "$teacher->firstname $teacher->lastname", $authority,
$table->data[] = array ($picture, fullname($teacher, true), $authority,
"<input type=text name=\"r$teacher->id\" value=\"$teacher->role\" size=30>",
$editall, $removelink);
}
@@ -203,7 +203,7 @@
foreach ($users as $user) {
$addlink = "<a href=\"teacher.php?id=$course->id&add=$user->id\">$straddteacher</a>";
$picture = print_user_picture($user->id, $course->id, $user->picture, false, true);
$table->data[] = array ($picture, "$user->firstname $user->lastname", $user->email, $addlink);
$table->data[] = array ($picture, fullname($user, true), $user->email, $addlink);
}
print_table($table);
}
+5 -1
View File
@@ -24,6 +24,10 @@
error("You must be a teacher to do this");
}
if ($user->id == $USER->id and !$CFG->allowunenroll) {
error("You are not allowed to unenroll");
}
if (isset($confirm)) {
if (! unenrol_student($user->id, $course->id)) {
@@ -49,7 +53,7 @@
if ($user->id == $USER->id) {
$strunenrolsure = get_string("unenrolsure", "", get_string("yourself"));
} else {
$strunenrolsure = get_string("unenrolsure", "", "$user->firstname $user->lastname");
$strunenrolsure = get_string("unenrolsure", "", fullname($user, true));
}
notice_yesno ($strunenrolsure, "unenrol.php?id=$id&user=$user->id&confirm=yes", "$HTTP_REFERER");
+8 -7
View File
@@ -19,14 +19,14 @@
error("Course id is incorrect.");
}
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) or ($course->showreports 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");
@@ -36,19 +36,20 @@
$stralllogs = get_string("alllogs");
$strtodaylogs = get_string("todaylogs");
$strmode = get_string($mode);
$fullname = fullname($user, true);
if ($course->category) {
print_header("$course->shortname: $stractivityreport ($mode)", "$course->fullname",
"<A HREF=\"../course/view.php?id=$course->id\">$course->shortname</A> ->
<A HREF=\"../user/index.php?id=$course->id\">$strparticipants</A> ->
<A HREF=\"../user/view.php?id=$user->id&course=$course->id\">$user->firstname $user->lastname</A> ->
<A HREF=\"../user/view.php?id=$user->id&course=$course->id\">$fullname</A> ->
$stractivityreport -> $strmode");
} else {
print_header("$course->shortname: $stractivityreport ($mode)", "$course->fullname",
"<A HREF=\"../user/view.php?id=$user->id&course=$course->id\">$user->firstname $user->lastname</A> ->
"<A HREF=\"../user/view.php?id=$user->id&course=$course->id\">$fullname</A> ->
$stractivityreport -> $strmode");
}
print_heading("$user->firstname $user->lastname");
print_heading($fullname);
echo "<table cellpadding=10 align=center><tr>";
echo "<td>$stractivityreport: </td>";
+6 -14
View File
@@ -12,7 +12,7 @@
error("Must specify course id or short name");
}
if ($name) {
if (!empty($_GET['name'])) {
if (! $course = get_record("course", "shortname", $name) ) {
error("That's an invalid short course name");
}
@@ -60,20 +60,12 @@
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");
$strcourse = 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), $loggedinas);
print_header("$strcourse: $course->fullname", "$course->fullname", "$course->shortname",
"", "", true, update_course_icon($course->id), $loggedinas);
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);
@@ -97,11 +89,11 @@
}
}
if (!file_exists("$CFG->dirroot/course/format/$course->format.php")) { // Default format is weeks
if (!file_exists("$CFG->dirroot/course/format/$course->format/format.php")) { // Default format is weeks
$course->format = "weeks";
}
require("$CFG->dirroot/course/format/$course->format.php"); // Include the actual course format
require("$CFG->dirroot/course/format/$course->format/format.php"); // Include the actual course format
print_footer();
+2 -2
View File
@@ -1,7 +1,7 @@
Moodle - Modular Object-Oriented Dynamic Learning Environment
http://moodle.com
http://moodle.org
Copyright (C) 2000-2002 Martin Dougiamas martin@dougiamas.com
Copyright (C) 1999-2004 Martin Dougiamas martin@dougiamas.com
http://dougiamas.com
This program is free software; you can redistribute it and/or modify
+6 -3
View File
@@ -10,10 +10,13 @@
print_header();
echo "<font size=2 face=\"san-serif\">";
foreach ($string as $file => $filename) {
echo "<li><a target=\"main\" href=\"$CFG->wwwroot/doc/?file=$file\">$filename</a></li>";
if (substr($file,0,1) == "-") {
echo '<p style="font-size:small;margin-bottom:0px;font-family:Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;">'.
$filename.'</p>';
} else {
echo "<li style=\"font-size:small\"><a target=\"main\" href=\"$CFG->wwwroot/doc/?file=$file\">$filename</a></li>";
}
}
echo "</font>";
?>
+119
View File
@@ -0,0 +1,119 @@
body, td, th, li {
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
}
th {
font-weight: bold;
}
a:link {
text-decoration: none;
color: blue;
}
a:visited {
text-decoration: none;
color: blue;
}
a:hover {
text-decoration: underline;
color: red;
}
form {
margin-bottom: 0;
}
li {
margin-bottom: 10px;
}
.question {
font-size: medium;
font-weight: bold;
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
border: 1px dotted;
padding: 10px;
background-color: #EEEEEE;
}
.answer {
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
font-size: medium;
border: none;
padding-left: 40px;
}
.normaltext {
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
font-size: medium;
border: none;
margin-left: 30px;
}
.answercode {
font-family: "Courier New", Courier, mono;
font-size: small;
border: none;
padding-left: 60px;
}
.questionlink {
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
font-size: medium;
border: none;
padding-left: 40px;
}
.examplecode {
font-family: "Courier New", Courier, mono;
font-size: small;
border: thin dashed #999999;
background-color: #FBFBFB;
margin: auto;
padding: 30px;
height: auto;
width: auto;
}
h1 {
font-weight: bold;
color: #000000;
background-color: #CCCCCC;
padding: 5px;
font-size: large;
border-width: 1px;
border-color: #CCCCCC;
-moz-border-radius: 10px;
}
h2 {
font-weight: bold;
color: #FFFFFF;
background-color: #666666;
padding: 5px;
font-size: medium;
border-width: 1px;
border-color: #666666;
-moz-border-radius: 10px;
}
h3 {
font-weight: normal;
color: #FFFFFF;
background-color: #666666;
padding: 5px;
font-size: medium;
-moz-border-radius: 10px;
}
.spaced {
margin-bottom: 30px;
}
ul {
margin-top: 10px;
}
+30 -4
View File
@@ -17,11 +17,17 @@
error("No file parameters!");
}
$pathinfo = urldecode($pathinfo);
if (! $args = parse_slash_arguments($pathinfo)) {
error("No valid arguments supplied");
}
$numargs = count($args);
if ($numargs < 2 or empty($args[1])) {
error("No valid arguments supplied");
}
$courseid = (integer)$args[0];
$course = get_record("course", "id", $courseid);
@@ -35,10 +41,9 @@
$pathname = "$CFG->dataroot$pathinfo";
$filename = $args[$numargs-1];
$mimetype = mimeinfo("type", $filename);
if (file_exists($pathname)) {
$lastmodified = filemtime($pathname);
$mimetype = mimeinfo("type", $filename);
header("Last-Modified: " . gmdate("D, d M Y H:i:s", $lastmodified) . " GMT");
header("Expires: " . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT");
@@ -46,8 +51,29 @@
header("Pragma: ");
header("Content-disposition: inline; filename=$filename");
header("Content-length: ".filesize($pathname));
header("Content-type: $mimetype");
readfile("$pathname");
if (empty($CFG->filteruploadedfiles)) {
header("Content-type: $mimetype");
readfile($pathname);
} else { /// Try and put the file through filters
if ($mimetype == "text/html") {
header("Content-type: text/html");
echo format_text(implode('', file($pathname)), FORMAT_HTML, NULL, $courseid);
} else if ($mimetype == "text/plain") {
header("Content-type: text/html");
$options->newlines = false;
echo "<pre>";
echo format_text(implode('', file($pathname)), FORMAT_MOODLE, $options, $courseid);
echo "</pre>";
} else { /// Just send it out raw
header("Content-type: $mimetype");
readfile($pathname);
}
}
} else {
error("Sorry, but the file you are looking for was not found ($pathname)", "course/view.php?id=$courseid");
}
+22 -16
View File
@@ -20,8 +20,8 @@
require_login($course->id);
if (! isteacher($course->id) ) {
error("Only teachers can edit files");
if (! isteacheredit($course->id) ) {
error("You need to be a teacher with editing privileges");
}
function html_footer() {
@@ -51,12 +51,12 @@
$numdirs = count($dirs);
$link = "";
$navigation = "";
for ($i=1; $i<$numdirs; $i++) {
for ($i=1; $i<$numdirs-1; $i++) {
$navigation .= " -> ";
$link .= "/".urlencode($dirs[$i]);
$navigation .= "<a href=\"index.php?id=$course->id&wdir=$link\">".$dirs[$i]."</a>";
}
$fullnav = "<a href=\"index.php?id=$course->id&wdir=/\">$strfiles</a> $navigation";
$fullnav = "<a href=\"index.php?id=$course->id&wdir=/\">$strfiles</a> $navigation -> ".$dirs[$numdirs-1];
}
if ($course->id == $site->id) {
@@ -98,6 +98,12 @@
$wdir="/";
}
if ($wdir == "/backupdata") {
if (! make_upload_directory("$course->id/backupdata")) { // Backup folder
error("Could not create backupdata folder. The site administrator needs to fix the file permissions");
}
}
switch ($action) {
@@ -129,7 +135,7 @@
displaydir($wdir);
} else {
$upload_max_filesize = get_max_upload_file_size();
$upload_max_filesize = get_max_upload_file_size($CFG->maxbytes); // Restricted by site setting
$filesize = display_size($upload_max_filesize);
$struploadafile = get_string("uploadafile");
@@ -329,7 +335,7 @@
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\">";
echo " <INPUT TYPE=hidden NAME=file VALUE=\"$file\">";
echo " <INPUT TYPE=hidden NAME=action VALUE=edit>";
print_textarea($usehtmleditor, 25, 80, 680, 400, "text", $contents);
print_textarea($usehtmleditor, 25, 80, 680, 400, "text", addslashes($contents));
echo "</TD></TR><TR><TD>";
echo " <INPUT TYPE=submit VALUE=\"".get_string("savechanges")."\">";
echo "</FORM>";
@@ -360,7 +366,7 @@
foreach ($USER->filelist as $file) {
$files[] = "$basedir/$file";
}
include_once('../lib/pclzip/pclzip.lib.php');
include_once("$CFG->libdir/pclzip/pclzip.lib.php");
$archive = new PclZip("$basedir/$wdir/$name");
if (($list = $archive->create($files,'',"$basedir/$wdir/")) == 0) {
error($archive->errorInfo(true));
@@ -426,7 +432,7 @@
$file = basename($file);
if (empty($CFG->unzip)) { // Use built-in php-based unzip function
include_once('../lib/pclzip/pclzip.lib.php');
include_once("$CFG->libdir/pclzip/pclzip.lib.php");
$archive = new PclZip("$basedir/$wdir/$file");
if (!$list = $archive->extract("$basedir/$wdir")) {
error($archive->errorInfo(true));
@@ -487,7 +493,7 @@
echo "<P ALIGN=CENTER>$strlistfiles:</P>";
$file = basename($file);
include_once('../lib/pclzip/pclzip.lib.php');
include_once("$CFG->libdir/pclzip/pclzip.lib.php");
$archive = new PclZip("$basedir/$wdir/$file");
if (!$list = $archive->listContent("$basedir/$wdir")) {
notify($archive->errorInfo(true));
@@ -612,11 +618,11 @@ function clearfilelist() {
function printfilelist($filelist) {
global $basedir;
global $CFG, $basedir;
foreach ($filelist as $file) {
if (is_dir($basedir.$file)) {
echo "<IMG SRC=\"pix/folder.gif\" HEIGHT=16 WIDTH=16> $file<BR>";
echo "<img src=\"$CFG->pixpath/f/folder.gif\" height=16 width=16> $file<br>";
$subfilelist = array();
$currdir = opendir($basedir.$file);
while ($subfile = readdir($currdir)) {
@@ -628,7 +634,7 @@ function printfilelist($filelist) {
} else {
$icon = mimeinfo("icon", $file);
echo "<IMG SRC=\"pix/$icon\" HEIGHT=16 WIDTH=16> $file<BR>";
echo "<img src=\"$CFG->pixpath/f/$icon\" height=16 width=16> $file<br>";
}
}
}
@@ -709,12 +715,12 @@ function displaydir ($wdir) {
$filename = $fullpath."/".$dir;
$fileurl = rawurlencode($wdir."/".$dir);
$filesafe = rawurlencode($dir);
$filedate = userdate(filectime($filename), "%d %b %Y, %I:%M %p");
$filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p");
echo "<TR>";
print_cell("center", "<INPUT TYPE=checkbox NAME=\"file$count\" VALUE=\"$fileurl\">");
print_cell("left", "<A HREF=\"index.php?id=$id&wdir=$fileurl\"><IMG SRC=\"pix/folder.gif\" HEIGHT=16 WIDTH=16 BORDER=0 ALT=\"Folder\"></A> <A HREF=\"index.php?id=$id&wdir=$fileurl\">".htmlspecialchars($dir)."</A>");
print_cell("left", "<A HREF=\"index.php?id=$id&wdir=$fileurl\"><IMG SRC=\"$CFG->pixpath/f/folder.gif\" HEIGHT=16 WIDTH=16 BORDER=0 ALT=\"Folder\"></A> <A HREF=\"index.php?id=$id&wdir=$fileurl\">".htmlspecialchars($dir)."</A>");
print_cell("right", "-");
print_cell("right", $filedate);
print_cell("right", "<A HREF=\"index.php?id=$id&wdir=$wdir&file=$filesafe&action=rename\">$strrename</A>");
@@ -735,7 +741,7 @@ function displaydir ($wdir) {
$fileurl = "$wdir/$file";
$filesafe = rawurlencode($file);
$fileurlsafe = rawurlencode($fileurl);
$filedate = userdate(filectime($filename), "%d %b %Y, %I:%M %p");
$filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p");
echo "<tr>";
@@ -747,7 +753,7 @@ function displaydir ($wdir) {
$ffurl = "/file.php?file=/$id$fileurl";
}
link_to_popup_window ($ffurl, "display",
"<IMG SRC=\"pix/$icon\" HEIGHT=16 WIDTH=16 BORDER=0 ALT=\"File\">",
"<IMG SRC=\"$CFG->pixpath/f/$icon\" HEIGHT=16 WIDTH=16 BORDER=0 ALT=\"File\">",
480, 640);
echo "<font size=\"-1\" face=\"Arial, Helvetica\">";
link_to_popup_window ($ffurl, "display",
+3
View File
@@ -3,6 +3,7 @@
function mimeinfo($element, $filename) {
$mimeinfo = array (
"xxx" => array ("type"=>"document/unknown", "icon"=>"unknown.gif"),
"3gp" => array ("type"=>"video/quicktime", "icon"=>"video.gif"),
"ai" => array ("type"=>"application/postscript", "icon"=>"image.gif"),
"aif" => array ("type"=>"audio/x-aiff", "icon"=>"audio.gif"),
"aiff" => array ("type"=>"audio/x-aiff", "icon"=>"audio.gif"),
@@ -67,6 +68,8 @@ function mimeinfo($element, $filename) {
"tsv" => array ("type"=>"text/tab-separated-values", "icon"=>"text.gif"),
"txt" => array ("type"=>"text/plain", "icon"=>"text.gif"),
"wav" => array ("type"=>"audio/wav", "icon"=>"audio.gif"),
"wmv" => array ("type"=>"video/x-ms-wmv", "icon"=>"avi.gif"),
"asf" => array ("type"=>"video/x-ms-asf", "icon"=>"avi.gif"),
"xls" => array ("type"=>"application/vnd.ms-excel", "icon"=>"excel.gif"),
"xml" => array ("type"=>"text/xml", "icon"=>"xml.gif"),
"xsl" => array ("type"=>"text/xml", "icon"=>"xml.gif"),
+651
View File
@@ -0,0 +1,651 @@
## Last modification: 8/3/00 by akp
## Originally written by Daniel Martin, Dept of Math, John Hopkins
## Additions and modifications were made by James Martino, Dept of Math, John Hopkins
## Additions and modifications were made by Arnold Pizer, Dept of Math, Univ of Rochester
#use Data::Dumper;
package AlgParser;
use HTML::Entities;
%close = ();
sub new {
my $package = shift;
my (%ret);
$ret{string} = "";
$ret{posarray} = [];
$ret{parseerror} = "";
$ret{parseresult} = [];
bless \%ret, $package;
return \%ret;
}
sub inittokenizer {
my($self, $string) = @_;
$self->{string} =~ m/\G.*$/g;
$self->{string} = undef;
$self->{string} = $string;
$self->{string} =~ m/\G.*$/g;
$self->{string} =~ m/^/g;
}
$close{'{'} = '}';
$close{'['} = ']';
$close{'('} = ')';
$binoper3 = '(?:\\^|\\*\\*)';
$binoper2 = '[/*_,]';
$binoper1 = '[-+=><%!#]';
$openparen = '[{(\\[]';
$closeparen = '[})\\]]';
$varname = '[A-Za-z](?:_[0-9]+)?';
$specialvalue = '(?:e|pi|da|db|dc|de|df|dg|dh|di|dj|dk|dl|dm|dn|do|dp|dq|dr|ds|dt|du|dv|dw|dx|dy|dz|infty|alpha|bita|gamma|zita|thita|iota|kappa|lambda|mu|nu|xi|rho|sigma|tau|phi|chi|psi|omega|zepslon|zdelta|xeta|zupslon)';
$numberplain = '(?:\d+(?:\.\d*)?|\.\d+)';
$numberE = '(?:' . $numberplain . 'E[-+]?\d+)';
$number = '(?:' . $numberE . '|' . $numberplain . ')';
#
# DPVC -- 2003/03/31
# added missing trig and inverse functions
#
#$trigfname = '(?:cosh|sinh|tanh|cot|(?:a(?:rc)?)?cos|(?:a(?:rc)?)?sin|' .
# '(?:a(?:rc)?)?tan|sech?)';
$trigfname = '(?:(?:a(?:rc)?)?(?:sin|cos|tan|sec|csc|cot)h?)';
#
# End DPVC
#
$otherfunc = '(?:exp|abs|logten|log|ln|sqrt|sgn|step|fact|int|lim|fun[a-zA-Z])';
$funcname = '(?:' . $otherfunc . '|' . $trigfname . ')';
$tokenregexp = "(?:($binoper3)|($binoper2)|($binoper1)|($openparen)|" .
"($closeparen)|($funcname)|($specialvalue)|($varname)|" .
"($numberE)|($number))";
sub nexttoken {
my($self) = shift;
$self->{string} =~ m/\G\s+/gc;
my($p1) = pos($self->{string}) || 0;
if(scalar($self->{string} =~ m/\G$tokenregexp/gc)) {
push @{$self->{posarray}}, [$p1, pos($self->{string})];
if (defined($1)) {return ['binop3', $1];}
if (defined($2)) {return ['binop2', $2];}
if (defined($3)) {return ['binop1', $3];}
if (defined($4)) {return ['openp', $4];}
if (defined($5)) {return ['closep', $5];}
if (defined($6)) {return ['func1', $6];}
if (defined($7)) {return ['special', $7];}
if (defined($8)) {return ['varname', $8];}
if (defined($9)) {return ['numberE', $9];}
if (defined($10)) {return ['number', $10];}
}
else {
push @{$self->{posarray}}, [$p1, undef];
return undef;
}
}
sub parse {
my $self = shift;
$self->{parseerror} = "";
$self->{posarray} = [];
$self->{parseresult} = ['top', undef];
my (@backtrace) = (\$self->{parseresult});
my (@pushback) = ();
my $currentref = \$self->{parseresult}->[1];
my $curenttok;
my $sstring = shift;
$self->inittokenizer($sstring);
$currenttok = $self->nexttoken;
if (!$currenttok) {
if ($self->{string} =~ m/\G$/g) {
return $self->error("empty");
} else {
my($mark) = pop @{$self->{posarray}};
my $position = 1+$mark->[0];
return $self->error("Illegal character at position $position", $mark);
}
}
# so I can assume we got a token
local $_;
while ($currenttok) {
$_ = $currenttok->[0];
/binop1/ && do {
# check if we have a binary or unary operation here.
if (defined(${$currentref})) {
# binary - walk up the tree until we hit an open paren or the top
while (${$currentref}->[0] !~ /^(openp|top)/) {
$currentref = pop @backtrace;
}
my $index = ((${$currentref}->[0] eq 'top')?1:3);
${$currentref}->[$index] = ['binop1', $currenttok->[1],
${$currentref}->[$index], undef];
push @backtrace, $currentref;
push @backtrace, \${$currentref}->[$index];
$currentref = \${$currentref}->[$index]->[3];
} else {
# unary
${$currentref} = ['unop1', $currenttok->[1], undef];
push @backtrace, $currentref;
$currentref = \${$currentref}->[2];
}
};
/binop2/ && do {
if (defined(${$currentref})) {
# walk up the tree until an open paren, the top, binop1 or unop1
# I decide arbitrarily that -3*4 should be parsed as -(3*4)
# instead of as (-3)*4. Not that it makes a difference.
while (${$currentref}->[0] !~ /^(openp|top|binop1)/) {
$currentref = pop @backtrace;
}
my $a = ${$currentref}->[0];
my $index = (($a eq 'top')?1:3);
${$currentref}->[$index] = ['binop2', $currenttok->[1],
${$currentref}->[$index], undef];
push @backtrace, $currentref;
push @backtrace, \${$currentref}->[$index];
$currentref = \${$currentref}->[$index]->[3];
} else {
# Error
my($mark) = pop @{$self->{posarray}};
my $position =1+$mark->[0];
return $self->error("Didn't expect " . $currenttok->[1] .
" at position $position" , $mark);
}
};
/binop3/ && do {
if (defined(${$currentref})) {
# walk up the tree until we need to stop
# Note that the right-associated nature of ^ means we need to
# stop walking backwards when we hit a ^ as well.
while (${$currentref}->[0] !~ /^(openp|top|binop[123]|unop1)/) {
$currentref = pop @backtrace;
}
my $a = ${$currentref}->[0];
my $index = ($a eq 'top')?1:($a eq 'unop1')?2:3;
${$currentref}->[$index] = ['binop3', $currenttok->[1],
${$currentref}->[$index], undef];
push @backtrace, $currentref;
push @backtrace, \${$currentref}->[$index];
$currentref = \${$currentref}->[$index]->[3];
} else {
# Error
my($mark) = pop @{$self->{posarray}};
my $position = 1+$mark->[0];
return $self->error("Didn't expect " . $currenttok->[1] .
" at position $position", $mark);
}
};
/openp/ && do {
if (defined(${$currentref})) {
# we weren't expecting this - must be implicit
# multiplication.
push @pushback, $currenttok;
$currenttok = ['binop2', 'implicit'];
next;
} else {
my($me) = pop @{$self->{posarray}};
${$currentref} = [$currenttok->[0], $currenttok->[1], $me, undef];
push @backtrace, $currentref;
$currentref = \${$currentref}->[3];
}
};
/func1/ && do {
if (defined(${$currentref})) {
# we weren't expecting this - must be implicit
# multiplication.
push @pushback, $currenttok;
$currenttok = ['binop2', 'implicit'];
next;
} else {
# just like a unary operator
${$currentref} = [$currenttok->[0], $currenttok->[1], undef];
push @backtrace, $currentref;
$currentref = \${$currentref}->[2];
}
};
/closep/ && do {
if (defined(${$currentref})) {
# walk up the tree until we need to stop
while (${$currentref}->[0] !~ /^(openp|top)/) {
$currentref = pop @backtrace;
}
my $a = ${$currentref}->[0];
if ($a eq 'top') {
my($mark) = pop @{$self->{posarray}};
my $position = 1+$mark->[0];
return $self->error("Unmatched close " . $currenttok->[1] .
" at position $position", $mark);
} elsif ($close{${$currentref}->[1]} ne $currenttok->[1]) {
my($mark) = pop @{$self->{posarray}};
my $position = 1+$mark->[0];
return $self->error("Mismatched parens at position $position"
, ${$currentref}->[2], $mark);
} else {
${$currentref}->[0] = 'closep';
${$currentref}->[2] = pop @{${$currentref}};
}
} else {
# Error - something like (3+4*)
my($mark) = pop @{$self->{posarray}};
my $position = 1+$mark->[0];
return $self->error("Premature close " . $currenttok->[1] .
" at position $position", $mark);
}
};
/special|varname|numberE?/ && do {
if (defined(${$currentref})) {
# we weren't expecting this - must be implicit
# multiplication.
push @pushback, $currenttok;
$currenttok = ['binop2', 'implicit'];
next;
} else {
${$currentref} = [$currenttok->[0], $currenttok->[1]];
}
};
if (@pushback) {
$currenttok = pop @pushback;
} else {
$currenttok = $self->nexttoken;
}
}
# ok, we stopped parsing. Now we need to see why.
if ($self->{parseresult}->[0] eq 'top') {
$self->{parseresult} = $self->arraytoexpr($self->{parseresult}->[1]);
} else {
return $self->error("Internal consistency error; not at top when done");
}
if ($self->{string} =~ m/\G\s*$/g) {
if (!defined(${$currentref})) {
$self->{string} .= " ";
return $self->error("I was expecting more at the end of the line",
[length($self->{string})-1, length($self->{string})]);
} else {
# check that all the parens were closed
while (@backtrace) {
$currentref = pop @backtrace;
if (${$currentref}->[0] eq 'openp') {
my($mark) = ${$currentref}->[2];
my $position = 1+$mark->[0];
return $self->error("Unclosed parentheses beginning at position $position"
, $mark);
}
}
# Ok, we must really have parsed something
return $self->{parseresult};
}
} else {
my($mark) = pop @{$self->{posarray}};
my $position = 1+$mark->[0];
return $self->error("Illegal character at position $position",$mark);
}
}
sub arraytoexpr {
my ($self) = shift;
return Expr->fromarray(@_);
}
sub error {
my($self, $errstr, @markers) = @_;
# print STDERR Data::Dumper->Dump([\@markers],
# ['$markers']);
$self->{parseerror} = $errstr;
my($htmledstring) = '<tt class="parseinput">';
my($str) = $self->{string};
# print STDERR Data::Dumper->Dump([$str], ['$str']);
my($lastpos) = 0;
$str =~ s/ /\240/g;
while(@markers) {
my($ref) = shift @markers;
my($pos1) = $ref->[0];
my($pos2) = $ref->[1];
if (!defined($pos2)) {$pos2 = $pos1+1;}
$htmledstring .= encode_entities(substr($str,$lastpos,$pos1-$lastpos)) .
'<b class="parsehilight">' .
encode_entities(substr($str,$pos1,$pos2-$pos1)) .
'</b>';
$lastpos = $pos2;
}
# print STDERR Data::Dumper->Dump([$str, $htmledstring, $lastpos],
# ['$str', '$htmledstring', '$lastpos']);
$htmledstring .= encode_entities(substr($str,$lastpos));
$htmledstring .= '</tt>';
# $self->{htmlerror} = '<p class="parseerr">' . "\n" .
# '<span class="parsedesc">' .
# encode_entities($errstr) . '</span><br>' . "\n" .
# $htmledstring . "\n" . '</p>' . "\n";
$self->{htmlerror} = $htmledstring ;
$self->{htmlerror} = 'empty' if $errstr eq 'empty';
$self->{error_msg} = $errstr;
# warn $errstr . "\n";
return undef;
}
sub tostring {
my ($self) = shift;
return $self->{parseresult}->tostring(@_);
}
sub tolatex {
my ($self) = shift;
return $self->{parseresult}->tolatex(@_);
}
sub tolatexstring { return tolatex(@_);}
sub exprtolatexstr {
return exprtolatex(@_);
}
sub exprtolatex {
my($expr) = shift;
my($exprobj);
if ((ref $expr) eq 'ARRAY') {
$exprobj = Expr->new(@$expr);
} else {
$exprobj = $expr;
}
return $exprobj->tolatex();
}
sub exprtostr {
my($expr) = shift;
my($exprobj);
if ((ref $expr) eq 'ARRAY') {
$exprobj = Expr->new(@$expr);
} else {
$exprobj = $expr;
}
return $exprobj->tostring();
}
sub normalize {
my ($self, $degree) = @_;
$self->{parseresult} = $self->{parseresult}->normalize($degree);
}
sub normalize_expr {
my($expr, $degree) = @_;
my($exprobj);
if ((ref $expr) eq 'ARRAY') {
$exprobj = Expr->new(@$expr);
} else {
$exprobj = $expr;
}
return $exprobj->normalize($degree);
}
package AlgParserWithImplicitExpand;
@ISA=qw(AlgParser);
sub arraytoexpr {
my ($self) = shift;
my ($foo) = ExprWithImplicitExpand->fromarray(@_);
# print STDERR Data::Dumper->Dump([$foo],['retval']);
return $foo;
}
package Expr;
sub new {
my($class) = shift;
my(@args) = @_;
my($ret) = [@args];
return (bless $ret, $class);
}
sub head {
my($self) = shift;
return ($self->[0]);
}
sub normalize {
#print STDERR "normalize\n";
#print STDERR Data::Dumper->Dump([@_]);
my($self, $degree) = @_;
my($class) = ref $self;
$degree = $degree || 0;
my($type, @args) = @$self;
local $_;
$_ = $type;
my ($ret) = [$type, @args];
if(/closep/) {
$ret = $args[1]->normalize($degree);
} elsif (/unop1/) {
$ret = $class->new($type, $args[0], $args[1]->normalize($degree));
} elsif (/binop/) {
$ret = $class->new($type, $args[0], $args[1]->normalize($degree),
$args[2]->normalize($degree));
} elsif (/func1/) {
$args[0] =~ s/^arc/a/;
$ret = $class->new($type, $args[0], $args[1]->normalize($degree));
}
if ($degree < 0) {return $ret;}
($type, @args) = @$ret;
$ret = $class->new($type, @args);
$_ = $type;
if (/binop1/ && ($args[2]->[0] =~ 'unop1')) {
my($h1, $h2) = ($args[0], $args[2]->[1]);
my($s1, $s2) = ($h1 eq '-', $h2 eq '-');
my($eventual) = ($s1==$s2);
if ($eventual) {
$ret = $class->new('binop1', '+', $args[1], $args[2]->[2] );
} else {
$ret = $class->new('binop1', '-', $args[1], $args[2]->[2] );
}
} elsif (/binop2/ && ($args[1]->[0] =~ 'unop1')) {
$ret = $class->new('unop1', '-',
$class->new($type, $args[0], $args[1]->[2],
$args[2])->normalize($degree) );
} elsif (/binop[12]/ && ($args[2]->[0] eq $type) &&
($args[0] =~ /[+*]/)) {
# Remove frivolous right-association
# For example, fix 3+(4-5) or 3*(4x)
$ret = $class->new($type, $args[2]->[1],
$class->new($type, $args[0], $args[1],
$args[2]->[2])->normalize($degree),
$args[2]->[3]);
} elsif (/unop1/ && ($args[0] eq '+')) {
$ret = $args[1];
} elsif (/unop1/ && ($args[1]->[0] =~ 'unop1')) {
$ret = $args[1]->[2];
}
if ($degree > 0) {
}
return $ret;
}
sub tostring {
# print STDERR "Expr::tostring\n";
# print STDERR Data::Dumper->Dump([@_]);
my($self) = shift;
my($type, @args) = @$self;
local $_;
$_ = $type;
/binop1/ && do {
my ($p1, $p2) = ('','');
if ($args[2]->[0] eq 'binop1') {($p1,$p2)=qw{ ( ) };}
return ($args[1]->tostring() . $args[0] . $p1 .
$args[2]->tostring() . $p2);
};
/unop1/ && do {
my ($p1, $p2) = ('','');
if ($args[1]->[0] =~ /binop1/) {($p1,$p2)=qw{ ( ) };}
return ($args[0] . $p1 . $args[1]->tostring() . $p2);
};
/binop2/ && do {
my ($p1, $p2, $p3, $p4)=('','','','');
if ($args[0] =~ /implicit/) {$args[0] = ' ';}
if ($args[1]->[0] =~ /binop1/) {($p1,$p2)=qw{ ( ) };}
# if ($args[2]->[0] =~ /binop[12]/) {($p3,$p4)=qw{ ( ) };}
if ($args[2]->[0] =~ /binop[12]|unop1/) {($p3,$p4)=qw{ ( ) };}
return ($p1 . $args[1]->tostring() . $p2 . $args[0] . $p3 .
$args[2]->tostring() . $p4);
};
/binop3/ && do {
my ($p1, $p2, $p3, $p4)=('','','','');
# if ($args[1]->[0] =~ /binop[123]|numberE/) {($p1,$p2)=qw{ ( ) };}
if ($args[1]->[0] =~ /binop[123]|unop1|numberE/) {($p1,$p2)=qw{ ( ) };}
# if ($args[2]->[0] =~ /binop[12]|numberE/) {($p3,$p4)=qw{ ( ) };}
if ($args[2]->[0] =~ /binop[12]|unop1|numberE/) {($p3,$p4)=qw{ ( ) };}
return ($p1 . $args[1]->tostring() . $p2 . $args[0] . $p3 .
$args[2]->tostring() . $p4);
};
/func1/ && do {
return ($args[0] . '(' . $args[1]->tostring() . ')');
};
/special|varname|numberE?/ && return $args[0];
/closep/ && do {
my(%close) = %AlgParser::close;
return ($args[0] . $args[1]->tostring() . $close{$args[0]});
};
}
sub tolatex {
my($self) = shift;
my($type, @args) = @$self;
local $_;
$_ = $type;
/binop1/ && do {
my ($p1, $p2) = ('','');
if ($args[2]->[0] eq 'binop1') {($p1,$p2)=qw{ \left( \right) };}
return ($args[1]->tolatex() . $args[0] . $p1 .
$args[2]->tolatex() . $p2);
};
/unop1/ && do {
my ($p1, $p2) = ('','');
if ($args[1]->[0] =~ /binop1/) {($p1,$p2)=qw{ \left( \right) };}
return ($args[0] . $p1 . $args[1]->tolatex() . $p2);
};
/binop2/ && do {
my ($p1, $p2, $p3, $p4) = ('','','','');
if ($args[0] =~ /implicit/) {
if ( (($args[1]->head eq qq(number)) &&
($args[2]->head eq qq(number))) ||
(($args[1]->head eq qq(binop2)) &&
($args[1]->[2]->head eq qq(number))) ) {
$args[0] = '\\,';
} else {
$args[0] = ' ';
}
}
if ($args[1]->[0] =~ /binop1|numberE/)
{($p1,$p2)=qw{ \left( \right) };}
# if ($args[2]->[0] =~ /binop[12]|numberE/)
if ($args[2]->[0] =~ /binop[12]|numberE|unop1/)
{($p3,$p4)=qw{ \left( \right) };}
if ($args[0] eq '/'){
# return('\frac{' . $p1 . $args[1]->tolatex() . $p2 . '}'.
# '{' . $p3 . $args[2]->tolatex() . $p4 . '}' );
return('\frac{' . $args[1]->tolatex() . '}'.
'{' . $args[2]->tolatex() . '}' );
}
else{
return ($p1 . $args[1]->tolatex() . $p2 . $args[0] . $p3 .
$args[2]->tolatex() . $p4);
}
};
/binop3/ && do {
my ($p1, $p2, $p3, $p4)=('','','','');
# if ($args[1]->[0] =~ /binop[123]|numberE/) {($p1,$p2)=qw{ \left( \right) };}
if ($args[1]->[0] =~ /binop[123]|unop1|numberE/) {($p1,$p2)=qw{ \left( \right) };}
# Not necessary in latex
# if ($args[2]->[0] =~ /binop[12]/) {($p3,$p4)=qw{ \left( \right) };}
return ($p1 . $args[1]->tolatex() . $p2 . "^{" . $p3 .
$args[2]->tolatex() . $p4 . "}");
};
/func1/ && do {
my($p1,$p2);
if($args[0] eq "sqrt"){($p1,$p2)=qw{ \left{ \right} };}
else {($p1,$p2)=qw{ \left( \right) };}
#
# DPVC -- 2003/03/31
# added missing trig functions
#
#$specialfunc = '(?:abs|logten|asin|acos|atan|sech|sgn|step|fact)';
$specialfunc = '(?:abs|logten|a(?:sin|cos|tan|sec|csc|cot)h?|sgn|step|fact)';
#
# End DPVC
#
if ($args[0] =~ /$specialfunc/) {
return ('\mbox{' . $args[0] .'}'. $p1 . $args[1]->tolatex() . $p2);
}
else {
return ('\\' . $args[0] . $p1 . $args[1]->tolatex() . $p2);
}
};
/special/ && do {
if ($args[0] eq 'pi') {return '\pi';} else {return $args[0];}
};
/varname|(:?number$)/ && return $args[0];
/numberE/ && do {
$args[0] =~ m/($AlgParser::numberplain)E([-+]?\d+)/;
return ($1 . '\times 10^{' . $2 . '}');
};
/closep/ && do {
my($backslash) = '';
my(%close) = %AlgParser::close;
if ($args[0] eq '{') {$backslash = '\\';}
#This is for editors to match: }
return ('\left' . $backslash . $args[0] . $args[1]->tolatex() .
'\right' . $backslash . $close{$args[0]});
};
}
sub fromarray {
my($class) = shift;
my($expr) = shift;
if ((ref $expr) ne qq{ARRAY}) {
die "Program error; fromarray not passed an array ref.";
}
my($type, @args) = @$expr;
foreach my $i (@args) {
if (ref $i) {
$i = $class->fromarray($i);
}
}
return $class->new($type, @args);
}
package ExprWithImplicitExpand;
@ISA=qw(Expr);
sub tostring {
# print STDERR "ExprWIE::tostring\n";
# print STDERR Data::Dumper->Dump([@_]);
my ($self) = shift;
my($type, @args) = @$self;
if (($type eq qq(binop2)) && ($args[0] eq qq(implicit))) {
my ($p1, $p2, $p3, $p4)=('','','','');
if ($args[1]->head =~ /binop1/) {($p1,$p2)=qw{ ( ) };}
# if ($args[2]->head =~ /binop[12]/) {($p3,$p4)=qw{ ( ) };}
if ($args[2]->head =~ /binop[12]|unop1/) {($p3,$p4)=qw{ ( ) };}
return ($p1 . $args[1]->tostring() . $p2 . '*' . $p3 .
$args[2]->tostring() . $p4);
} else {
return $self->SUPER::tostring(@_);
}
}
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/perl
use lib '.';
use AlgParser;
my $parser = new AlgParserWithImplicitExpand;
my $ret;
$ret = $parser -> parse($ARGV[0]);
if ( ref($ret) ) {
$parser -> tostring();
$parser -> normalize();
print $parser -> tolatex();
} else {
print $parser->{htmlerror};
}
+332
View File
@@ -0,0 +1,332 @@
<?PHP // $Id$
// This function fetches math. images from the data directory
// If not, it obtains the corresponding TeX expression from the cache_tex db table
// and uses mimeTeX to create the image file
$nomoodlecookie = true; // Because it interferes with caching
require_once("../../config.php");
$CFG->texfilterdir = "filter/tex";
$CFG->algebrafilterdir = "filter/algebra";
$CFG->algebraimagedir = "filter/algebra";
$query = urldecode($_SERVER['QUERY_STRING']);
error_reporting(E_ALL);
if ($query) {
$output = $query;
$splitpos = strpos($query,'&')-8;
$algebra = substr($query,8,$splitpos);
$md5 = md5($algebra);
if (strpos($query,'ShowDB') || strpos($query,'DeleteDB')) {
$texcache = get_record("cache_filters","filter","algebra", "md5key", $md5);
}
if (strpos($query,'ShowDB')) {
if ($texcache) {
$output = "DB cache_filters entry for $algebra\n";
$output .= "id = $texcache->id\n";
$output .= "filter = $texcache->filter\n";
$output .= "version = $texcache->version\n";
$output .= "md5key = $texcache->md5key\n";
$output .= "rawtext = $texcache->rawtext\n";
$output .= "timemodified = $texcache->timemodified\n";
} else {
$output = "DB cache_filters entry for $algebra not found\n";
}
}
if (strpos($query,'DeleteDB')) {
if ($texcache) {
$output = "Deleting DB cache_filters entry for $algebra\n";
$result = delete_records("cache_filters","id",$texcache->id);
if ($result) {
$result = 1;
} else {
$result = 0;
}
$output .= "Number of records deleted = $result\n";
} else {
$output = "Could not delete DB cache_filters entry for $algebra\nbecause it could not be found.\n";
}
}
if (strpos($query,'TeXStage1')) {
$output = algebra2tex($algebra);
}
if (strpos($query,'TeXStage2')) {
$output = algebra2tex($algebra);
$output = refineTeX($output);
}
if (strpos($query,'ShowImage')) {
$output = algebra2tex($algebra);
$output = refineTeX($output);
tex2image($output, $md5);
} else {
outputText($output);
}
exit;
}
function algebra2tex($algebra) {
Global $CFG;
$algebra = str_replace('&lt;','<',$algebra);
$algebra = str_replace('&gt;','>',$algebra);
$algebra = str_replace('<>','#',$algebra);
$algebra = str_replace('<=','%',$algebra);
$algebra = str_replace('>=','!',$algebra);
$algebra = str_replace('delta','zdelta',$algebra);
$algebra = str_replace('beta','bita',$algebra);
$algebra = str_replace('theta','thita',$algebra);
$algebra = str_replace('zeta','zita',$algebra);
$algebra = str_replace('eta','xeta',$algebra);
$algebra = str_replace('epsilon','zepslon',$algebra);
$algebra = str_replace('upsilon','zupslon',$algebra);
$algebra = preg_replace('!\r\n?!',' ',$algebra);
if ( (PHP_OS == "WINNT") || (PHP_OS == "WIN32") || (PHP_OS == "Windows") ) {
$algebra = "\"". str_replace('"','\"',$algebra) . "\"";
$cmd = "cd $CFG->dirroot/$CFG->algebrafilterdir & algebra2tex.pl $algebra";
} else {
$algebra = escapeshellarg($algebra);
$cmd = "cd $CFG->dirroot/$CFG->algebrafilterdir; ./algebra2tex.pl $algebra";
}
$texexp = `$cmd`;
return $texexp;
}
function refineTeX($texexp) {
$texexp = str_replace('#','\not= ',$texexp);
$texexp = str_replace('%','\leq ',$texexp);
$texexp = str_replace('!','\geq ',$texexp);
$texexp = str_replace('\left{','{',$texexp);
$texexp = str_replace('\right}','}',$texexp);
$texexp = str_replace('\fun',' ',$texexp);
$texexp = str_replace('infty','\infty',$texexp);
$texexp = str_replace('alpha','\alpha',$texexp);
$texexp = str_replace('gamma','\gamma',$texexp);
$texexp = str_replace('iota','\iota',$texexp);
$texexp = str_replace('kappa','\kappa',$texexp);
$texexp = str_replace('lambda','\lambda',$texexp);
$texexp = str_replace('mu','\mu',$texexp);
$texexp = str_replace('nu','\nu',$texexp);
$texexp = str_replace('xi','\xi',$texexp);
$texexp = str_replace('rho','\rho',$texexp);
$texexp = str_replace('sigma','\sigma',$texexp);
$texexp = str_replace('tau','\tau',$texexp);
$texexp = str_replace('phi','\phi',$texexp);
$texexp = str_replace('chi','\chi',$texexp);
$texexp = str_replace('psi','\psi',$texexp);
$texexp = str_replace('omega','\omega',$texexp);
$texexp = str_replace('zdelta','\delta',$texexp);
$texexp = str_replace('bita','\beta',$texexp);
$texexp = str_replace('thita','\theta',$texexp);
$texexp = str_replace('zita','\zeta',$texexp);
$texexp = str_replace('xeta','\eta',$texexp);
$texexp = str_replace('zepslon','\epsilon',$texexp);
$texexp = str_replace('zupslon','\upsilon',$texexp);
$texexp = str_replace('\mbox{logten}','\mbox{log}_{10}',$texexp);
$texexp = str_replace('\mbox{acos}','\mbox{cos}^{-1}',$texexp);
$texexp = str_replace('\mbox{asin}','\mbox{sin}^{-1}',$texexp);
$texexp = str_replace('\mbox{atan}','\mbox{tan}^{-1}',$texexp);
$texexp = str_replace('\mbox{asec}','\mbox{sec}^{-1}',$texexp);
$texexp = str_replace('\mbox{acsc}','\mbox{csc}^{-1}',$texexp);
$texexp = str_replace('\mbox{acot}','\mbox{cot}^{-1}',$texexp);
$texexp = str_replace('\mbox{acosh}','\mbox{cosh}^{-1}',$texexp);
$texexp = str_replace('\mbox{asinh}','\mbox{sinh}^{-1}',$texexp);
$texexp = str_replace('\mbox{atanh}','\mbox{tanh}^{-1}',$texexp);
$texexp = str_replace('\mbox{asech}','\mbox{sech}^{-1}',$texexp);
$texexp = str_replace('\mbox{acsch}','\mbox{csch}^{-1}',$texexp);
$texexp = str_replace('\mbox{acoth}','\mbox{coth}^{-1}',$texexp);
$texexp = preg_replace('/\\\sqrt{(.+?),(.+?)}/s','\sqrt['. "\$2]{\$1}",$texexp);
$texexp = preg_replace('/\\\mbox{abs}\\\left\((.+?)\\\right\)/s',"|\$1|",$texexp);
$texexp = preg_replace('/\\\log\\\left\((.+?),(.+?)\\\right\)/s','\log_{'. "\$2}\\left(\$1\\right)",$texexp);
$texexp = preg_replace('/(\\\cos|\\\sin|\\\tan|\\\sec|\\\csc|\\\cot)([h]*)\\\left\((.+?),(.+?)\\\right\)/s',"\$1\$2^{". "\$4}\\left(\$3\\right)",$texexp);
$texexp = preg_replace('/\\\int\\\left\((.+?),(.+?),(.+?)\\\right\)/s','\int_'. "{\$2}^{\$3}\$1 ",$texexp);
$texexp = preg_replace('/\\\int\\\left\((.+?d[a-z])\\\right\)/s','\int '. "\$1 ",$texexp);
$texexp = preg_replace('/\\\lim\\\left\((.+?),(.+?),(.+?)\\\right\)/s','\lim_'. "{\$2\\to \$3}\$1 ",$texexp);
return $texexp;
}
function outputText($texexp) {
header("Content-type: text/html");
echo "<html><body><pre>\n";
if ($texexp) {
$texexp = str_replace('<','&lt;',$texexp);
$texexp = str_replace('>','&gt;',$texexp);
$texexp = str_replace('"','&quot;',$texexp);
echo "$texexp\n\n";
} else {
echo "No text output available\n\n";
}
echo "</pre></body></html>\n";
}
function tex2image($texexp, $md5) {
global $CFG;
$error_message1 = "Your system is not configured to run mimeTeX. ";
$error_message1 .= "You need to download the appropriate<br> executable ";
$error_message1 .= "from <a href=\"http://moodle.org/download/mimetex/\">";
$error_message1 .= "http://moodle.org/download/mimetex/</a>, or obtain the ";
$error_message1 .= "C source<br> from <a href=\"http://www.forkosh.com/mimetex.zip\">";
$error_message1 .= "http://www.forkosh.com/mimetex.zip</a>, compile it and ";
$error_message1 .= "put the executable into your<br> moodle/filter/tex/ directory. ";
$error_message1 .= "You also need to edit your moodle/filter/algebra/pix.php file<br>";
$error_message1 .= ' by adding the line<br><pre> case "' . PHP_OS . "\":\n";
$error_message1 .= " \$cmd = \"\\\\\"\$CFG->dirroot/\$CFG->texfilterdir/";
$error_message1 .= 'mimetex.' . strtolower(PHP_OS) . "\\\\\" -e \\\\\"\$pathname\\\\\" \". escapeshellarg(\$texexp);";
$error_message1 .= "</pre>You also need to add this to your algebradebug.php file.";
if ($texexp) {
$texexp = '\Large ' . $texexp;
$lifetime = 86400;
$image = $md5 . ".gif";
$filetype = 'image/gif';
if (!file_exists("$CFG->dataroot/$CFG->algebraimagedir")) {
make_upload_directory($CFG->algebraimagedir);
}
$pathname = "$CFG->dataroot/$CFG->algebraimagedir/$image";
if (file_exists($pathname)) {
unlink($pathname);
}
$commandpath = "";
$cmd = "";
switch (PHP_OS) {
case "Linux":
$commandpath="$CFG->dirroot/$CFG->texfilterdir/mimetex.linux";
$cmd = "\"$CFG->dirroot/$CFG->texfilterdir/mimetex.linux\" -e \"$pathname\" ". escapeshellarg($texexp);
break;
case "WINNT":
case "WIN32":
case "Windows":
$commandpath="$CFG->dirroot/$CFG->texfilterdir/mimetex.exe";
$texexp = str_replace('"','\"',$texexp);
$cmd = str_replace(' ','^ ',$commandpath);
$cmd .= " ++ -e \"$pathname\" \"$texexp\"";
break;
case "Darwin":
$commandpath="$CFG->dirroot/$CFG->texfilterdir/mimetex.darwin";
$cmd = "\"$CFG->dirroot/$CFG->texfilterdir/mimetex.darwin\" -e \"$pathname\" ". escapeshellarg($texexp);
break;
}
if (!$cmd) {
error($error_message1);
}
system($cmd, $status);
}
if ($texexp && file_exists($pathname)) {
$lastmodified = filemtime($pathname);
header("Last-Modified: " . gmdate("D, d M Y H:i:s", $lastmodified) . " GMT");
header("Expires: " . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT");
header("Cache-control: max_age = $lifetime"); // a day
header("Pragma: ");
header("Content-disposition: inline; filename=$image");
header("Content-length: ".filesize($pathname));
header("Content-type: $filetype");
readfile("$pathname");
} else {
$ecmd = "$cmd 2>&1";
echo `$ecmd` . "<br>\n";
echo "The shell command<br>$cmd<br>returned status = $status<br>\n";
if ($status == 4) {
echo "Status corresponds to illegal instruction<br>\n";
} else if ($status == 11) {
echo "Status corresponds to bus error<br>\n";
} else if ($status == 22) {
echo "Status corresponds to abnormal termination<br>\n";
}
if (file_exists($commandpath)) {
echo "File size of mimetex executable $commandpath is " . filesize($commandpath) . "<br>";
echo "The file permissions are: " . decoct(fileperms($commandpath)) . "<br>";
if (function_exists("md5_file")) {
echo "The md5 checksum of the file is " . md5_file($commandpath) . "<br>";
} else {
$handle = fopen($commandpath,"rb");
$contents = fread($handle,16384);
fclose($handle);
echo "The md5 checksum of the first 16384 bytes is " . md5($contents) . "<br>";
}
} else {
echo "mimetex executable $commandpath not found!<br>";
}
echo "Image not found!";
}
}
?>
<html>
<head><title>Algebra Filter Debugger</title></head>
<body>
<p>Please enter an algebraic expression <b>without</b> any surrounding @@ into
the text box below. (Click <a href="#help">here for help.</a>)
<form action="algebradebug.php" method="get"
target="inlineframe">
<center>
<input type="text" name="algebra" size=50
value="sin(z)/(x^2+y^2)">
</center>
<ol>
<li>First click on this button <input type="submit" name="ShowDB" value="Show DB Entry">
to see the cache_filters database entry for this expression.</li>
<li>If the database entry looks corrupt, click on this button to delete it:
<input type="submit" name="DeleteDB" value="Delete DB Entry"></li>
<li>Now click on this button <input type="submit" name="TeXStage1" value="First Stage Tex Translation">.
A preliminary translation into TeX will appear in the box below.</li>
<li>Next click on this button <input type="submit" name="TeXStage2" value="Second Stage Tex Translation">.
A more refined translation into TeX will appear in the box below.</li>
<li>Finally click on this button <input type="submit" name="ShowImage" value="Show Image">
to show a graphic image of the algebraic expression.</li>
</ol>
</form> <br> <br>
<center>
<iframe name="inlineframe" align="middle" width="80%" height="200">
&lt;p&gt;Something is wrong...&lt;/p&gt;
</iframe>
</center> <br>
<hr>
<a name="help">
<h2>Debugging Help</h2>
</a>
<p>First here is a brief overview on how the algebra filter works. It
takes an algebra expression and first translates it into TeX. It first
looks for the TeX translation in the Moodle database in the table cache_filters
in the field rawtext. If not found, it passes the algebraic expression to the
Perl script algebra2tex.pl, which also uses the Perl library AlgParser.pm.
It then saves the TeX translation in the database for subsequent uses and
passes the TeX to the mimetex executable to be converted to a gif image.
Here are a few common things that can go wrong and some suggestions on how
you might try to fix them.</p>
<ol>
<li>Something had gone wrong on a previous occasion when the filter tried to
translate this expression. Then the database entry for that expression contains
a bad TeX translation in the rawtext field (usually blank). You can fix this
by clicking on &quot;Delete DB Entry&quot;</li>
<li>The First Stage TeX Translation gives a &quot;No text output available&quot;
message. If your server is running Windows, this may be due to the fact that
you haven't installed Perl or didn't install it correctly. If your server is
running some version of Unix (e.g. Linux), then this may be due to your Perl
binary being installed in a nonstandard location. To fix this edit the first
line of the algebra2tex.pl script. Another possible problem which may affect
both Unix and Windows servers is that the web server doesn't have execute permission
on the algebra2tex.pl script. In that case change permissions accordingly</li>
<li>The Second Stage TeX Translation produces malformed TeX. This indicates
a bug in the algebra filter. Post the original algebraic expression and the
bad TeX translation in the <a href="http://moodle.org/mod/forum/view.php?id=752">
Mathematics Tools</a> forum in the Using Moodle course on moodle.org.</li>
<li>The TeX to gif image conversion process does not work. If your server is
running Unix, a likely cause is that the mimetex binary you are using is
incompatible with your operating system. You can try compiling it from the
C sources downloaded from <a href="http://www.forkosh.com/mimetex.zip">
http://www.forkosh.com/mimetex.zip</a>, or looking for an appropriate
binary at <a href="http://moodle.org/download/mimetex/">
http://moodle.org/download/mimetex/</a>. You may then also need to
edit your moodle/filter/algebra/pix.php file to add
<br /><?PHP echo "case &quot;" . PHP_OS . "&quot;:" ;?><br ?> to the list of operating systems
in the switch (PHP_OS) statement. Windows users may have a problem properly
unzipping mimetex.exe. Make sure that mimetex.exe is is <b>PRECISELY</b>
328192 bytes in size. If not, download fresh copy from
<a href="http://moodle.org/download/mimetex/windows/mimetex.exe">
http://moodle.org/download/mimetex/windows/mimetex.exe</a>. Lastly check
the execute permissions on your mimetex binary, as outlined in item 2 above.</li>
</ol>
</body>
</html>
+229
View File
@@ -0,0 +1,229 @@
<?PHP
/////////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Filter for converting simple calculator-type algebraic //
// expressions to cached gif images //
// //
// Copyright (C) 2004 Zbigniew Fiedorowicz fiedorow@math.ohio-state.edu //
// Originally based on code provided by Bruno Vernier bruno@vsbeducation.ca//
// 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 //
// //
/////////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------------
// NOTE: This Moodle text filter converts algebraic expressions delimited
// by either @@...@@ or by <algebra...>...</algebra> tags
// first converts it to TeX using WeBWorK algebra parser Perl library
// AlgParser.pm, part of the WeBWorK distribution obtained from
// http://webhost.math.rochester.edu/downloadwebwork/
// then converts the TeX to gif images using
// mimetex.cgi obtained from http://www.forkosh.com/mimetex.html authored by
// John Forkosh john@forkosh.com. The mimetex.cgi ELF binary compiled for Linux i386
// as well as AlgParser.pm are included with this distribution.
// Note that there may be patent restrictions on the production of gif images
// in Canada and some parts of Western Europe and Japan until July 2004.
//-------------------------------------------------------------------------
// You will then need to edit your moodle/config.php to invoke mathml_filter.php
//-------------------------------------------------------------------------
/// Edit these lines to correspond to your installation
// File path to the directory where mathml_filter.php resides
$CFG->algebrafilterdir = "filter/algebra";
/// These lines are important - the variable must match the name
/// of the actual function below
$textfilter_function='algebra_filter';
if (function_exists($textfilter_function)) {
return;
}
function string_file_picture_algebra($imagefile, $tex= "", $height="", $width="") {
// Given the path to a picture file in a course, or a URL,
// this function includes the picture in the page.
global $CFG;
$output = "";
if ($tex) {
$tex = str_replace('&','&amp;',$tex);
$tex = str_replace('<','&lt;',$tex);
$tex = str_replace('>','&gt;',$tex);
$tex = str_replace('"','&quot;',$tex);
$tex = str_replace("\'",'&#39;',$tex);
$title = "title=\"$tex\"";
}
if ($height) {
$height = "height=\"$height\"";
}
if ($width) {
$width = "width=\"$width\"";
}
if ($imagefile) {
$output .= "<img border=\"0\" $title $height $width src=\"";
if ($CFG->slasharguments) { // Use this method if possible for better caching
$output .= "$CFG->wwwroot/$CFG->algebrafilterdir/pix.php/$imagefile";
} else {
$output .= "$CFG->wwwroot/$CFG->algebrafilterdir/pix.php?file=$imagefile";
}
$output .= "\" />";
} else {
$output .= "Error: must pass URL or course";
}
return $output;
}
function algebra_filter ($courseid, $text) {
global $CFG;
/// Do a quick check using stripos to avoid unnecessary wor
if (!preg_match('/<algebra/i',$text) && !strstr($text,'@@')) {
return $text;
}
# //restrict filtering to forum 130 (Maths Tools on moodle.org)
# $scriptname = $_SERVER['SCRIPT_NAME'];
# if (!strstr($scriptname,'/forum/')) {
# return $text;
# }
# if (strstr($scriptname,'post.php')) {
# $parent = forum_get_post_full($_GET['reply']);
# $discussion = get_record("forum_discussions","id",$parent->discussion);
# } else if (strstr($scriptname,'discuss.php')) {
# $discussion = get_record("forum_discussions","id",$_GET['d'] );
# } else {
# return $text;
# }
# if ($discussion->forum != 130) {
# return $text;
# }
$text .= ' ';
preg_match_all('/@(@@+)([^@])/',$text,$matches);
for ($i=0;$i<count($matches[0]);$i++) {
$replacement = str_replace('@','&#x00040;',$matches[1][$i]).$matches[2][$i];
$text = str_replace($matches[0][$i],$replacement,$text);
}
if (isadmin()) { error_reporting (E_ALL); }; //for debugging
// <algebra> some algebraic input expression </algebra>
// or @@ some algebraic input expression @@
preg_match_all('/<algebra>(.+?)<\/algebra>|@@(.+?)@@/is', $text, $matches);
for ($i=0; $i<count($matches[0]); $i++) {
$algebra = $matches[1][$i] . $matches[2][$i];
$algebra = str_replace('<nolink>','',$algebra);
$algebra = str_replace('</nolink>','',$algebra);
$md5 = md5($algebra);
$filename = $md5 . ".gif";
if (! $texcache = get_record("cache_filters","filter","algebra", "md5key", $md5)) {
$algebra = str_replace('&lt;','<',$algebra);
$algebra = str_replace('&gt;','>',$algebra);
$algebra = str_replace('<>','#',$algebra);
$algebra = str_replace('<=','%',$algebra);
$algebra = str_replace('>=','!',$algebra);
$algebra = str_replace('delta','zdelta',$algebra);
$algebra = str_replace('beta','bita',$algebra);
$algebra = str_replace('theta','thita',$algebra);
$algebra = str_replace('zeta','zita',$algebra);
$algebra = str_replace('eta','xeta',$algebra);
$algebra = str_replace('epsilon','zepslon',$algebra);
$algebra = str_replace('upsilon','zupslon',$algebra);
$algebra = preg_replace('!\r\n?!',' ',$algebra);
if ( (PHP_OS == "WINNT") || (PHP_OS == "WIN32") || (PHP_OS == "Windows") ) {
$algebra = "\"". str_replace('"','\"',$algebra) . "\"";
$cmd = "cd $CFG->dirroot/$CFG->algebrafilterdir & algebra2tex.pl $algebra";
} else {
$algebra = escapeshellarg($algebra);
$cmd = "cd $CFG->dirroot/$CFG->algebrafilterdir; ./algebra2tex.pl $algebra";
}
$texexp = `$cmd`;
if (preg_match('/parsehilight/',$texexp)) {
$text = str_replace( $matches[0][$i],"<b>Syntax error:</b> " . $texexp,$text);
} else if ($texexp) {
$texexp = str_replace('#','\not= ',$texexp);
$texexp = str_replace('%','\leq ',$texexp);
$texexp = str_replace('!','\geq ',$texexp);
$texexp = str_replace('\left{','{',$texexp);
$texexp = str_replace('\right}','}',$texexp);
$texexp = str_replace('\fun',' ',$texexp);
$texexp = str_replace('infty','\infty',$texexp);
$texexp = str_replace('alpha','\alpha',$texexp);
$texexp = str_replace('gamma','\gamma',$texexp);
$texexp = str_replace('iota','\iota',$texexp);
$texexp = str_replace('kappa','\kappa',$texexp);
$texexp = str_replace('lambda','\lambda',$texexp);
$texexp = str_replace('mu','\mu',$texexp);
$texexp = str_replace('nu','\nu',$texexp);
$texexp = str_replace('xi','\xi',$texexp);
$texexp = str_replace('rho','\rho',$texexp);
$texexp = str_replace('sigma','\sigma',$texexp);
$texexp = str_replace('tau','\tau',$texexp);
$texexp = str_replace('phi','\phi',$texexp);
$texexp = str_replace('chi','\chi',$texexp);
$texexp = str_replace('psi','\psi',$texexp);
$texexp = str_replace('omega','\omega',$texexp);
$texexp = str_replace('zdelta','\delta',$texexp);
$texexp = str_replace('bita','\beta',$texexp);
$texexp = str_replace('thita','\theta',$texexp);
$texexp = str_replace('zita','\zeta',$texexp);
$texexp = str_replace('xeta','\eta',$texexp);
$texexp = str_replace('zepslon','\epsilon',$texexp);
$texexp = str_replace('zupslon','\upsilon',$texexp);
$texexp = str_replace('\mbox{logten}','\mbox{log}_{10}',$texexp);
$texexp = str_replace('\mbox{acos}','\mbox{cos}^{-1}',$texexp);
$texexp = str_replace('\mbox{asin}','\mbox{sin}^{-1}',$texexp);
$texexp = str_replace('\mbox{atan}','\mbox{tan}^{-1}',$texexp);
$texexp = str_replace('\mbox{asec}','\mbox{sec}^{-1}',$texexp);
$texexp = str_replace('\mbox{acsc}','\mbox{csc}^{-1}',$texexp);
$texexp = str_replace('\mbox{acot}','\mbox{cot}^{-1}',$texexp);
$texexp = str_replace('\mbox{acosh}','\mbox{cosh}^{-1}',$texexp);
$texexp = str_replace('\mbox{asinh}','\mbox{sinh}^{-1}',$texexp);
$texexp = str_replace('\mbox{atanh}','\mbox{tanh}^{-1}',$texexp);
$texexp = str_replace('\mbox{asech}','\mbox{sech}^{-1}',$texexp);
$texexp = str_replace('\mbox{acsch}','\mbox{csch}^{-1}',$texexp);
$texexp = str_replace('\mbox{acoth}','\mbox{coth}^{-1}',$texexp);
//$texexp = preg_replace('/\\\frac{(.+?)}{\\\left\((.+?)\\\right\)}/s','\frac{'."\$1}{\$2}",$texexp);
$texexp = preg_replace('/\\\sqrt{(.+?),(.+?)}/s','\sqrt['. "\$2]{\$1}",$texexp);
$texexp = preg_replace('/\\\mbox{abs}\\\left\((.+?)\\\right\)/s',"|\$1|",$texexp);
$texexp = preg_replace('/\\\log\\\left\((.+?),(.+?)\\\right\)/s','\log_{'. "\$2}\\left(\$1\\right)",$texexp);
$texexp = preg_replace('/(\\\cos|\\\sin|\\\tan|\\\sec|\\\csc|\\\cot)([h]*)\\\left\((.+?),(.+?)\\\right\)/s',"\$1\$2^{". "\$4}\\left(\$3\\right)",$texexp);
$texexp = preg_replace('/\\\int\\\left\((.+?),(.+?),(.+?)\\\right\)/s','\int_'. "{\$2}^{\$3}\$1 ",$texexp);
$texexp = preg_replace('/\\\int\\\left\((.+?d[a-z])\\\right\)/s','\int '. "\$1 ",$texexp);
$texexp = preg_replace('/\\\lim\\\left\((.+?),(.+?),(.+?)\\\right\)/s','\lim_'. "{\$2\\to \$3}\$1 ",$texexp);
$texcache->filter = 'algebra';
$texcache->version = 1;
$texcache->md5key = $md5;
$texcache->rawtext = addslashes($texexp);
$texcache->timemodified = time();
insert_record("cache_filters",$texcache);
$text = str_replace( $matches[0][$i], string_file_picture_algebra($filename, $texexp), $text);
} else {
$text = str_replace( $matches[0][$i],"<b>Undetermined error:</b> ",$text);
}
} else {
$text = str_replace( $matches[0][$i], string_file_picture_algebra($filename, $texcache->rawtext), $text);
}
}
return $text;
}
?>
+102
View File
@@ -0,0 +1,102 @@
<?PHP // $Id$
// This function fetches math. images from the data directory
// If not, it obtains the corresponding TeX expression from the cache_tex db table
// and uses mimeTeX to create the image file
$nomoodlecookie = true; // Because it interferes with caching
require_once("../../config.php");
$CFG->algebrafilterdir = "filter/algebra";
$CFG->texfilterdir = "filter/tex";
$CFG->algebraimagedir = "filter/algebra";
error_reporting(E_ALL);
$lifetime = 86400;
if (isset($file)) { // workaround for situations where / syntax doesn't work
$pathinfo = '/' . $file;
} else {
$pathinfo = get_slash_arguments("pix.php");
}
if (! $args = parse_slash_arguments($pathinfo)) {
error("No valid arguments supplied");
}
$numargs = count($args);
if ($numargs == 1) {
$image = $args[0];
$pathname = "$CFG->dataroot/$CFG->algebraimagedir/$image";
$filetype = "image/gif";
} else {
error("No valid arguments supplied");
}
if (!file_exists($pathname)) {
$md5 = str_replace('.gif','',$image);
if ($texcache = get_record("cache_filters", "filter", "algebra", "md5key", $md5)) {
if (!file_exists("$CFG->dataroot/$CFG->algebraimagedir")) {
make_upload_directory($CFG->algebraimagedir);
}
$texexp = $texcache->rawtext;
$texexp = str_replace('&lt;','<',$texexp);
$texexp = str_replace('&gt;','>',$texexp);
$texexp = preg_replace('!\r\n?!',' ',$texexp);
$texexp = '\Large ' . $texexp;
if ((PHP_OS == "WINNT") || (PHP_OS == "WIN32") || (PHP_OS == "Windows")) {
$texexp = str_replace('"','\"',$texexp);
$cmd = "$CFG->dirroot/$CFG->texfilterdir/mimetex.exe";
$cmd = str_replace(' ','^ ',$cmd);
$cmd .= " ++ -e \"$pathname\" \"$texexp\"";
} else if (is_executable("$CFG->dirroot/$CFG->texfilterdir/mimetex")) { /// Use the custom binary
$cmd = "$CFG->dirroot/$CFG->texfilterdir/mimetex -e $pathname ". escapeshellarg($texexp);
} else { /// Auto-detect the right TeX binary
switch (PHP_OS) {
case "Linux":
$cmd = "\"$CFG->dirroot/$CFG->texfilterdir/mimetex.linux\" -e \"$pathname\" ". escapeshellarg($texexp);
break;
case "Darwin":
$cmd = "\"$CFG->dirroot/$CFG->texfilterdir/mimetex.darwin\" -e \"$pathname\" ". escapeshellarg($texexp);
break;
default: /// Nothing was found, so tell them how to fix it.
echo "Make sure you have an appropriate MimeTeX binary here:\n\n";
echo " $CFG->dirroot/$CFG->texfilterdir/mimetex\n\n";
echo "and that it has the right permissions set on it as executable program.\n\n";
echo "You can get the latest binaries for your ".PHP_OS." platform from: \n\n";
echo " http://moodle.org/download/mimetex/";
exit;
break;
}
}
system($cmd, $status);
}
}
if (file_exists($pathname)) {
$lastmodified = filemtime($pathname);
header("Last-Modified: " . gmdate("D, d M Y H:i:s", $lastmodified) . " GMT");
header("Expires: " . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT");
header("Cache-control: max_age = $lifetime"); // a day
header("Pragma: ");
header("Content-disposition: inline; filename=$image");
header("Content-length: ".filesize($pathname));
header("Content-type: $filetype");
readfile("$pathname");
} else {
echo "The shell command<br>$cmd<br>returned status = $status<br>\n";
echo "Image not found!<br>";
echo "Please try the <a href=\"$CFG->wwwroot/filter/algebra/algebradebug.php\">debugging script</a>";
}
exit;
?>
+17
View File
@@ -0,0 +1,17 @@
//////////////////////////
// //
// Censorship Filter //
// //
//////////////////////////
This is a very simple Text Filter that searches text
being output to the screen, replacing "bad" words
with other words.
To activate this filter, add a line like this to your
config.php:
$CFG->textfilter1 = 'filter/censor/censor.php';
To customise the word list, edit cursor.php.
+37
View File
@@ -0,0 +1,37 @@
<?php // $id$
//////////////////////////////////////////////////////////////
// Censorship filtering
//
// This very simple example of a Text Filter will parse
// printed text, replacing words with other words
//
// To activate this filter, add a line like this to your
// list of filters in your Filter configuration:
//
// filter/censor/filter.php
//
//////////////////////////////////////////////////////////////
/// These lines are important - the variable must match the name
/// of the actual function below
$textfilter_function = 'censor_filter';
if (function_exists($textfilter_function)) {
return;
}
/// This is the filtering function itself. It accepts the
/// courseid and the text to be filtered (in HTML form).
function censor_filter($courseid, $text) {
static $search = array('fuck', 'cunt', 'shit', 'wank', 'cock');
static $replace = array('f***', 'c***', 's***', 'w***', 'c***');
return str_ireplace($search, $replace, $text);
}
?>
+50
View File
@@ -0,0 +1,50 @@
<?php // $id$
//////////////////////////////////////////////////////////////
// Media plugin filtering
//
// This filter will replace any links to a media file with
// a media plugin that plays that media inline
//
// To activate this filter, add a line like this to your
// list of filters in your Filter configuration:
//
// filter/mediaplugin/filter.php
//
//////////////////////////////////////////////////////////////
/// These lines are important - the variable must match the name
/// of the actual function below
$textfilter_function = 'mediaplugin_filter';
if (function_exists($textfilter_function)) {
return;
}
/// This is the filtering function itself. It accepts the
/// courseid and the text to be filtered (in HTML form).
function mediaplugin_filter($courseid, $text) {
global $CFG;
$search = '/<a(.*?)href=\"(.*?)\.mp3\"([^>]*)>(.*?)<\/a>/i';
$replace = '\\0&nbsp;<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
$replace .= ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';
$replace .= ' width="35" height="18" id="mp3player" align="">';
$replace .= " <param name=movie value=\"$CFG->wwwroot/filter/mediaplugin/mp3player.swf?src=\\2.mp3\">";
$replace .= ' <param name=quality value=high>';
$replace .= ' <param name=bgcolor value="#333333">';
$replace .= " <embed src=\"$CFG->wwwroot/filter/mediaplugin/mp3player.swf?src=\\2.mp3\" ";
$replace .= " quality=high bgcolor=\"#333333\" width=\"35\" height=\"18\" name=\"mp3player\" ";
$replace .= ' type="application/x-shockwave-flash" ';
$replace .= ' pluginspage="http://www.macromedia.com/go/getflashplayer">';
$replace .= '</embed>';
$replace .= '</object>&nbsp;';
return preg_replace($search, $replace, $text);
}
?>
Binary file not shown.
BIN
View File
Binary file not shown.

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