Compare commits

..

2894 Commits

Author SHA1 Message Date
moodler 9b4f94bd92 Bumping to 1.6.2 for releasing 2006-09-12 16:05:51 +00:00
moodler a88c450679 Merged fix from HEAD 2006-09-12 14:28:04 +00:00
bobopinna 6a973240af added support to hyphen and tilde in CMIIdentifier 2006-09-12 08:46:23 +00:00
moodler 3e3c6eec08 Automatic installer.php lang files by installer_builder (20060912) 2006-09-12 02:48:41 +00:00
exe-cutor 8de4f2e23e Again added get_first_string ... 2006-09-11 09:05:35 +00:00
stronk7 9d3089562a 1.6 installer langs files added. 2006-09-11 08:28:49 +00:00
moodler 77ec0e627e Automatic installer.php lang files by installer_builder (20060911) 2006-09-11 08:12:16 +00:00
stronk7 abf39fb332 file installer.php was added on branch MOODLE_16_STABLE on 2006-09-11 08:28:54 +0000 2006-09-11 08:09:58 +00:00
skodak 2877856383 validate local redirection actions in jumpto.php SC#310; backported from HEAD 2006-09-11 07:13:03 +00:00
gbateson f03e81eb03 removed reportselector.html as it was unused and has been replaced by reportcontent.html and reportformat.html 2006-09-10 05:27:41 +00:00
gbateson 75e59b1a22 correct a small formatting error in "Show Legend" -> "No" explanation 2006-09-10 05:25:13 +00:00
mark-nielsen e2eb506371 MDL-5430 - branch table redirect problem 2006-09-09 17:25:21 +00:00
mark-nielsen 9f811896b8 Security fix for grading Essays. Mentioned in MDL-6477 2006-09-08 18:01:12 +00:00
skodak a12743a49b fixed typo - trailing backslash; backported from HEAD 2006-09-08 15:51:40 +00:00
thepurpleblob e8131aa214 Added Clifford Tham's changes - Thanks Clifford :-)
Also fixed some notices
2006-09-08 10:21:51 +00:00
skodak faafe84561 fixed serious breakage during upgrades caused by double redirects 2006-09-07 20:33:03 +00:00
skodak df8ac6d2e6 forced conversion to proper numeric type in _adodb_column_sql() SC#259; backported from HEAD 2006-09-07 10:21:43 +00:00
skodak c98d228b96 allow less verbose operation of forget_password.php SC#282, backported from HEAD 2006-09-07 05:50:05 +00:00
vyshane 9180b308f4 Added $CFG->pagepath so that editing questions will link to the relevant question types in moodle docs. Fix for bug MDL-5866. 2006-09-06 08:50:50 +00:00
skodak 586e08ac32 backported detection of potentially insecure dataroot location SC#295 2006-09-05 22:38:59 +00:00
skodak 13ad4e12e1 fix for bug MDL-5403 , you can now force redirect with 0 delay even when header already printed 2006-09-05 21:51:31 +00:00
moodler f83a24b87b Stripping tags from titles MDL-6431 2006-09-05 03:14:02 +00:00
moodler bf08108c94 Added $CFG->coursesperpage which changes default paging of category listing 2006-09-05 03:03:42 +00:00
gustav_delius f610ac5e18 Had to comment out the line that updates the timemodified field when a discussion is moved from one forum to another one because the timemodified field is used to sort the list of discussions and also to provide the "Last post" date. It should really be renamed to something like "timeoflastpost". 2006-09-04 22:00:26 +00:00
moodler bfd5c5d7f6 Change the format of the email signup link to make it work better on Hotmail 2006-09-04 02:25:35 +00:00
moodler 5decc6f064 DOn't process stats if it's blocked 2006-09-03 15:44:25 +00:00
moodler f598a45f2e Added a hidden $CFG->disablestatsprocessing variable to disable stats completely 2006-09-03 15:42:05 +00:00
gustav_delius eb9b7f1a3e Take out invalid </tr>. While this makes the html valid some work should still be done on the layout of this. 2006-09-03 12:22:02 +00:00
gustav_delius 4508fdd282 The file countries.php does not exist in lang/en, only in lang/en_utf8. Therefore the fallback default in the function get_list_of_countries() should always be en_utf8. 2006-09-03 11:39:54 +00:00
gustav_delius 6a2f9ca922 Remove undefined variable notice 2006-09-03 11:22:48 +00:00
moodler a565cb2f8e Automatic installer.php lang files by installer_builder (20060902) 2006-09-02 02:44:29 +00:00
gustav_delius bf9cdc2b90 Fix by Jesse Scott so that database sessions respect sessiontimeout setting. Closing bug 5912 2006-09-01 20:27:54 +00:00
ethem 19660487d0 + Don't show AVS message if not applicable.
+ Email message that translated instead of english if cc will be autoconfigured.
2006-09-01 14:39:52 +00:00
gbateson 5ab3937c6e correct the detection of HotPot 2.0 backups (from Moodle 1.5) 2006-09-01 03:58:09 +00:00
ethem 22fa4da34f New feature: Autoconfigure credit card types, if the merchant does not accept this type of credit card; Backported from HEAD. 2006-08-31 07:35:16 +00:00
ethem 0ee1574512 New feature: Autoconfigure credit card types, if the merchant does not accept this type of credit card; Backported from HEAD. 2006-08-31 07:29:44 +00:00
skodak b02b2f70d7 better input validation in files/index.php SC#307; backported from HEAD 2006-08-30 08:04:43 +00:00
gbateson 0679583490 convert relative URLs to absolute URLs in quiz questions and answers 2006-08-30 07:54:48 +00:00
moodler 5ba8b19939 Automatic installer.php lang files by installer_builder (20060830) 2006-08-30 02:46:44 +00:00
skodak 4d21686218 better handling of anchor name in docs index SC#306; backported from HEAD 2006-08-29 20:39:24 +00:00
ethem 79cd394c82 fixo 2006-08-29 08:11:04 +00:00
skodak 18e2de4313 show detailed log messages only when debug is not off SC#303; backported from HEAD 2006-08-28 21:34:39 +00:00
skodak 0eeec1a96f create safer .htaccess SC#302; backported from HEAD 2006-08-28 21:13:12 +00:00
mark-nielsen 4e2cbb28e5 MDL-6325 Bug Fix 2006-08-28 20:01:13 +00:00
gustav_delius 5a521aa30f Small correction in the documentation for the $CFG global 2006-08-28 08:59:57 +00:00
moodler 01b9db69e2 Automatic installer.php lang files by installer_builder (20060826) 2006-08-26 02:50:02 +00:00
mark-nielsen 91bfeb65ea MDL-6323 - Fixed - changed feedback to response 2006-08-25 22:51:24 +00:00
mark-nielsen 16ae471c30 Removed undefined index notices by using empty to make sure the index exists 2006-08-25 18:27:12 +00:00
danmarsden e22b34ec32 MDL-4493 issue with 405 pages for IIS users - must specify actual page, as the notice function does a post - you cannot use the POST Verb on a directory in IIS. 2006-08-24 02:10:01 +00:00
tjhunt 7025366210 MDL-6338 - Short answer questions with ' in the answer don't work. Yet another unpleasant quiz bug caused by the current broken way we do things with addslashes. 2006-08-23 18:53:40 +00:00
stronk7 e133c32ff3 Adding one PHP close tag that has been missing (but working) since years! 2006-08-23 15:18:20 +00:00
stronk7 84e6ee9c38 Bump to 1.6.2 (no DB changes) 2006-08-23 15:04:05 +00:00
thepurpleblob 4c831b7078 bug MDL-5458
XML format now supports Essay questions
Improved the comments
2006-08-23 14:54:05 +00:00
skodak cd79115069 debug off level is now 5 instead of 7 to prevent E_WARNING on production sites SC#294 2006-08-22 22:19:54 +00:00
skodak cd1e684b2c fixed trailing whitespace in last commit :-( 2006-08-22 22:09:33 +00:00
skodak d67514acb8 Rewritten help.php by Tim Hunt with minor fixes - SC#292 2006-08-22 22:03:08 +00:00
tjhunt 0d4537c796 SC 299 2006-08-22 21:33:27 +00:00
skodak fdb76e639f fixed some notices in scheduled backup 2006-08-21 20:38:44 +00:00
stronk7 e59fded4ef Solved hh (horrible-hidden) bug in backup_scheduled code.
Credits go to Thirot Jean-Luc. http://moodle.org/mod/forum/discuss.php?d=52156
2006-08-21 19:06:38 +00:00
tjhunt 8529d9b6d8 Bug #6305 - Quiz settings form field order could be better - proper fix this time.
Sorry, I screwed up with the previous revision. This is the proper fix. Diff this with revision 1.61 to see what the change really is, and ignore 1.61.2.1.
2006-08-21 10:07:48 +00:00
tjhunt c23339e968 Bug #6305 - Quiz settings form field order could be better. 2006-08-20 20:10:15 +00:00
tjhunt 5fc3c306f4 Bug #6303 - True / False applies penalty factor wrongly. 2006-08-20 15:37:06 +00:00
moodler 207793f82f Automatic installer.php lang files by installer_builder (20060819) 2006-08-19 02:47:51 +00:00
tjhunt 2b64c31597 Bug #6293 - Cannot regrade a question when a teacher has added a comment with a ' Stupid, wreched, datalib. Why can't datalib take care of addslashes, so the whole of the rest of the code can forget about it? That is how a database abstraction layer should work. I know, it is pointless to moan about it, but it has just cost me 3 hours, so I feel I have earned the right to moan. 2006-08-18 22:34:25 +00:00
tjhunt f7abe85cc0 Code cleanup. 2006-08-18 22:25:39 +00:00
tjhunt 5cd1517bc3 Fix some Eclipse code warnings. 2006-08-18 21:21:59 +00:00
ethem 7ecefcb090 Colorize refunds and show refunded total.
Red: Refunded/Pending Settlement
Green: Refunded/Settled
Black: Cancelled

Backported from HEAD(1.25-1.26)
2006-08-18 16:11:30 +00:00
ethem 7a23b4d63c Display capture/void/delete instead of 'Yes'. 2006-08-18 14:48:41 +00:00
tjhunt 00c5890a15 Bug #3481 - wildcard problem in cloze question. Thanks to Joseph Rezeau. 2006-08-18 10:28:15 +00:00
tjhunt 45cd0cfde8 Changed include to use dirroot not wwwroot. 2006-08-18 08:05:45 +00:00
skodak 0a861d4506 Bug #6276 - Multiple questions not showing up from scale page 2006-08-17 21:33:26 +00:00
tjhunt dcd2895639 Bug #6277 - Missed function renaming in question/format/multianswer. 2006-08-17 17:37:54 +00:00
ethem b88378acb9 Allow teachers to cancel refunded transactions if admin set up $CFG->an_teachermanagepay.
enrol_authorize.courseid must be passed to authorize_get_status_action function; Joined 2 tables to get courseid field.
2006-08-17 15:30:20 +00:00
moodler 06bbfff66e Automatic installer.php lang files by installer_builder (20060817) 2006-08-17 02:54:23 +00:00
tjhunt da4714358a Bug #6267 - questionlib.php delete_question infinite loop with rantom questions. Thanks to mbockol at carleton dot edu. 2006-08-16 16:16:42 +00:00
moodler 48e2bf159a Automatic installer.php lang files by installer_builder (20060816) 2006-08-16 02:52:23 +00:00
thepurpleblob 48b358ba56 Bug #6231. Question name truncated to 250 characters. 2006-08-15 14:38:38 +00:00
skodak 029d0a28bd $CFG->debug=0 from config.php is not overriden by setup.php anymore SC#293 2006-08-14 20:55:58 +00:00
skodak c26ac7924f adding proper checks that the requested help file exists SC#292 2006-08-14 20:07:35 +00:00
moodler 51034f13f8 In rare cases (some timezones?) this while loop went forever because
$timestart == $nextmidnight

which led to disks filling up   :-(
2006-08-14 15:19:36 +00:00
moodler a1ecd20a19 Merged fixes from HEAD 2006-08-14 09:01:31 +00:00
skodak a7ea2d7dcc prevent access to filters when disabled in filter settings SC#291 2006-08-14 06:22:15 +00:00
tjhunt 915db857b8 SC 289, small, but non-exploitable hole in backup permissions checking. 2006-08-13 20:25:46 +00:00
moodler 6c05439a08 Automatic installer.php lang files by installer_builder (20060813) 2006-08-13 02:51:13 +00:00
skodak b5c240e397 fixed format_text caching - now respects text format, current language and course id (lang fix is needed for my multilang filter rewrite ;-) 2006-08-12 12:41:55 +00:00
stronk7 e8e814e5c7 An example of how one unitialized variable can generate really
dificult-to-trace bugs. Thanks to Jens Gammelgaard and support  B-)
(http://moodle.org/bugs/bug.php?op=show&bugid=6233)
2006-08-12 09:12:15 +00:00
bobopinna 0fc2503718 Fixed a problem during scorm update.
Now tracks are deleted only if the scoes are really changed
2006-08-11 12:21:23 +00:00
thepurpleblob f5c2ff517f Correctly reflect 1.6 match grades change and make it more clear about blank line usage - bug #6231 2006-08-11 10:42:19 +00:00
stronk7 74948bb2e7 Changing //TRANSLIT to //IGNORE because some weird bug
in the OS iconv libraries was breaking some texts.
2006-08-11 09:34:47 +00:00
thepurpleblob ec7a860ff5 Removed credits section (along with very out of date 'last-updated' bit). Doesn't seem appropriate any more. 2006-08-11 08:10:15 +00:00
skodak 0f69811d98 new function get_coursemodule_from_id() is now used for obtaining of valid $cm from coursemodule id SC#283; backported from HEAD 2006-08-10 15:30:49 +00:00
moodler 0b038e2d43 Automatic installer.php lang files by installer_builder (20060810) 2006-08-10 03:02:49 +00:00
toyomoyo 02f0217c20 fix a bug when user's lang is not set, fall back to site lang 2006-08-10 02:41:19 +00:00
skodak 105a8f399f obfuscation of the email addresses 2006-08-09 20:39:24 +00:00
skodak c071606525 Bug #6199 - A typo in edit.php 2006-08-09 19:45:41 +00:00
skodak dfa8b0f06a Bug #4936 - Highlighting a question text fragment with different color 2006-08-09 19:29:34 +00:00
skodak 8953a3b44f Bug #6225 - Moodle bug #4658 Breaks assignment type: Upload Single 2006-08-09 18:35:42 +00:00
skodak 6223b2eb1e Bug #6106 - HTML editor inserting unwanted hard return between images 2006-08-09 09:36:01 +00:00
bobopinna f4f18fb00c Fixed a bug in AICC package importing 2006-08-08 07:25:19 +00:00
moodler 98830278dc Automatic installer.php lang files by installer_builder (20060808) 2006-08-08 02:50:28 +00:00
skodak 2928e3d2d6 Swf now disabled by default in Mediaplugin and added explanation SC#284 2006-08-07 14:48:51 +00:00
moodler ea07be815b Automatic installer.php lang files by installer_builder (20060806) 2006-08-06 02:52:42 +00:00
bobopinna 10d7f1525d fixed a problem with Explorer and popup windows 2006-08-04 13:49:00 +00:00
bobopinna d51d6583a7 Fixed a problem with explorer and popup windows 2006-08-04 13:41:54 +00:00
bobopinna 6703e4af2d removed object tags. I'm thinking to return to frameset... 2006-08-04 13:01:35 +00:00
martinlanghoff 530c61afe7 login: forgot password now works for guest again (bug #6214) 2006-08-04 06:11:34 +00:00
martinlanghoff 58c98fa207 mod/assignment if we are not using a numeric scale and a custom scale
return that as the max grade


Author: Jun Yamog <jun@catalyst.net.nz>
2006-08-04 05:47:37 +00:00
tjhunt beb6c6cdb7 Bug #6206 - Quiz can't be created on some mysql configurations 2006-08-03 16:30:21 +00:00
tjhunt 964f6d4f17 Bug #6048 - Fix 'are you sure you want to start an attempt' warning. Backported from HEAD. 2006-08-03 14:51:34 +00:00
moodler 905c6f3261 Pushing beyond 1.6.1 2006-08-02 06:18:26 +00:00
moodler e1210ad3c3 Automatic installer.php lang files by installer_builder (20060802) 2006-08-02 02:49:38 +00:00
toyomoyo 2492b30859 fix for 6178 2006-08-01 05:10:33 +00:00
ethem 8e9f9bec69 Don't show authorize.net password for security reasons. 2006-07-31 12:30:44 +00:00
skodak 47c8660050 Bug #6146 - Smiley popup can not be translated 2006-07-31 10:26:18 +00:00
skodak 8860ceb4d2 fixed warning when no referer available 2006-07-31 10:04:18 +00:00
skodak a45c1d139a Bug #6168 - missing link for course request - fixed 2006-07-31 09:17:53 +00:00
skodak ecdb04ca06 Bug #6168 - missing link for course request 2006-07-31 09:14:13 +00:00
martinlanghoff 0f7fcc8377 Backing out fix for bug #4874 2006-07-31 05:56:48 +00:00
martinlanghoff 4b8df782c6 Bug #6147 - Upgrade from 1.5.x breaks with Postgres 7.4.x
Even though Postgres 7.4.x is officially supported, several upgrade scripts use syntax that only works in Postgres 8.x. and it's impossible to finish the upgrade.

The attached patch fixes those scripts.

Saludos. I?aki.

Author: I?aki Arenaza
Review: Jun Yamog, Martin Langhoff
2006-07-31 05:38:20 +00:00
martinlanghoff 3ad4a1097b assignment: count_user_files() no longer creates extraneous dirs (bug#4658)
Applied the fix by Samuli.Karevaara, from the bug report - the directory is checked for existence beforehand.
Previously it was created if it didn't exist, then the files within it were counted.


Author: Luke Hudson <luke@catalyst.net.nz>
2006-07-31 04:57:08 +00:00
martinlanghoff 21c2f2ef29 wiki: Added a link to force reloading of the page (WR#515)
The link allows the page to be reloaded, which saves people from only seeing the cached copy. This is the equivalent of doing Shift+Reload in most
browsers.


Author: Luke Hudson <luke@catalyst.net.nz>
2006-07-31 04:55:59 +00:00
martinlanghoff c58f4f10b3 forum: notification of a moved dicussion (bug#4874)
Moving a discussion now leaves a notification message in the
original location with a link to the new location.


Author: Luke Hudson <luke@catalyst.net.nz>
2006-07-31 04:54:06 +00:00
julmis 9978506b11 Removing formathtml function since it is never going to work. 2006-07-30 23:16:12 +00:00
julmis 980b1e04bc Trying to get rid of insert link bug once and for all 2006-07-30 23:07:49 +00:00
skodak 0fc71cc508 SC #280 force downloading of database files 2006-07-30 22:43:58 +00:00
skodak 9a0d8fd2b3 Bug #6170 - Glossary bug: it displays nothing when autolinking to non-ascii text and other minor cleanup 2006-07-30 22:23:43 +00:00
skodak d2b00aae1d Bug #6170 - Glossary bug: it displays nothing when autolinking to non-ascii text and other minor cleanup 2006-07-30 22:18:14 +00:00
skodak 2a94a64a06 Bug #6135 - Reduce unnecessary use of strtolower to make non-English languages look better 2006-07-30 21:46:31 +00:00
skodak d7a5c75f30 Bug #6176 - locale setting on config variables page not functioning correctly 2006-07-30 10:30:07 +00:00
moodler 54ac3dd31a Automatic installer.php lang files by installer_builder (20060730) 2006-07-30 02:49:23 +00:00
skodak be029bdf25 Bug #6181 - icelandic doesn't migrate 2006-07-29 09:43:36 +00:00
skodak b573d77752 Bug #6183 - typo in clean_param() description 2006-07-28 20:56:21 +00:00
urs_hunkler db5219aacd adding missing icons 2006-07-27 19:51:21 +00:00
skodak 9a2539db21 Fixed Call to undefined function: print_progress() in /usr/share/moodle/admin/upgradeforumread.php 2006-07-27 11:48:19 +00:00
ethem dd241f341a Select records as tablename.fieldname when joining tables.
Someone, can add  these fields userid,courseid to course table . :)
2006-07-27 11:23:25 +00:00
ethem fe2bc06329 Bug: Column 'timecreated' in where clause is ambiguous.
We joins 2 tables: course and enrol_authorize.
We didn't select course.timecreated, but it gives this error.
2006-07-27 10:49:54 +00:00
moodler 58643a8110 Automatic installer.php lang files by installer_builder (20060727) 2006-07-27 02:52:30 +00:00
moodler 1a10d9049f Automatic installer.php lang files by installer_builder (20060726) 2006-07-26 02:45:50 +00:00
ethem 4221b8647c Cron error: When authorizenetlib.php require enrol.php, it includes admin/enrol.php. Interesting. Solved as $CFG->dirroot.'/enrol/authorize/enrol.php 2006-07-25 17:34:00 +00:00
ethem 8fd49aa444 New string: costdefaultdesc
<strong>In course settings, enter -1</strong> to cost field to use this default cost.
2006-07-25 17:03:55 +00:00
ethem d91f79789a New string: costdefaultdesc
<strong>In course settings, enter -1</strong> to cost field to use this default cost.
2006-07-25 16:58:22 +00:00
ethem 5eeebefba9 Sometimes ssl connections are slow. Increase max_execution_time to 5 minutes. 2006-07-24 16:27:51 +00:00
tjhunt 87cb44ac9f Bug #6157 - lang strings using concatenation, not $a. 2006-07-24 14:35:03 +00:00
ethem 644600315c * Update record as soon as possible. If update/insert record fails email to admin to have update manually.
* ignore_user_abort(true) at critical section (before fwrite($fp, "POST /gateway/transact.dll).
   This is last change to ignore request for user.
 * Made some functions "static" to call function directly. So, no need new enrolment_plugin_authorize() instance.
   Now, these are static:
   get_list_of_creditcards, zero_cost, get_course_cost, prevent_double_paid, email_to_admin, check_openssl_loaded
 * Some mtrace cleanup. Removed default new line.

This is big work. When PHP5 is required for moodle in the future, I will add static modifier to functions.
Now and future, this plugin is/will unbreakable. :)
2006-07-24 11:42:17 +00:00
skodak 905fdcaa31 Bug #6159 Site settings interface typo - Combo list - my first commit form UK MoodleMoot :-) 2006-07-24 10:31:21 +00:00
danmarsden a97a4a87bd Bug #5882 ldap enrolment doesn't work. $USER->student getting munged 2006-07-24 00:32:06 +00:00
danmarsden c3d36a923f Bug 6130 session has bad entries causes calendar to fail showing events
Workaround untill Session is fixed properly.
2006-07-24 00:14:07 +00:00
danmarsden 3cfe476b39 Fixes for Bug 5749 and Bug 5750
summary of bug 5749 and 5750
fixes for: function causes timeout when deleting temporary files for large scorm objects
scorm\validate.php calls function scorm_delete_files from scorm\lib.php - but lib.php not included in validate.php

Validation of Scorm objects broken - adds entry in modules database even when scorm object is not created.
2006-07-23 23:40:00 +00:00
danmarsden 146a1735ac Fix for Bug 6119 - gives error when choice full, and user submits a choice they have already selected 2006-07-23 22:12:40 +00:00
danmarsden 8dc6117433 fix for Bug #4733 title gets garbled when html inside title. 2006-07-23 22:03:39 +00:00
moodler 08f72e477c Automatic installer.php lang files by installer_builder (20060722) 2006-07-22 02:46:09 +00:00
tjhunt d1c93d9605 Replace a few odd tabs with spaces. 2006-07-21 08:01:34 +00:00
stronk7 eede7619ef Bump to 1.6.1. No DB changes. 2006-07-21 07:55:35 +00:00
tjhunt bf6f63ae00 Bug #5946 - matching question php notice 2006-07-21 07:19:04 +00:00
urs_hunkler 2f1dff3561 corrected bug with teacher rights 2006-07-21 04:53:08 +00:00
urs_hunkler d0b4e8226f corrected a bug with teacher rights 2006-07-21 04:49:47 +00:00
gbateson 889d2b5ead microincrement version to 2.1.21 2006-07-21 00:10:29 +00:00
moodler 43935e12c9 Bump to 1.6.1 2006-07-20 23:43:47 +00:00
skodak ad44e5c049 fixed minor PHP5 compatibility problem with clone() 2006-07-20 06:53:29 +00:00
skodak 4075eb10da Bug #6075 - file admin/index.php is ISO encoded - headers broken by ob_end_flush(), fixed version check 2006-07-20 06:38:12 +00:00
skodak 10bafd3d21 Bug #6141 - Cron output is not plain text - <pre> and missing encoding, minor lang issues 2006-07-20 06:35:25 +00:00
skodak 605737cdfb Bug #6097 - HTML editor and brackets - fixes lesson problems 2006-07-20 06:30:10 +00:00
ikawhero 595eda8d9c Fixed typo. 2006-07-20 00:42:56 +00:00
skodak 56def90b83 yet another fix for course list for guests 2006-07-19 13:57:57 +00:00
skodak 74f6a9fb7e fixed course list for guests 2006-07-19 13:43:40 +00:00
skodak 8e764b36b1 admin should not see list of courses on the frontpage when there are too many of them 2006-07-19 13:33:18 +00:00
skodak 93f973f08b fixed course/index.php category display affected by previous commit - improved category and course list display on front page 2006-07-19 13:15:11 +00:00
skodak 4e7d821b34 section not always moved when requested - page reloading prevented by anchor; added random parameter to force reloading 2006-07-19 12:49:55 +00:00
skodak 31c46027aa Bug #6093 - Removed course sections re-appear after moving existing sections 2006-07-19 12:28:41 +00:00
skodak 4e2b4b1bc2 Improved category and course list display on front page- see bug Bug #5965 - Frontpage Category List also showing courses; new Combo List(categories + courses), fixed categories list and separate settings for not logged in / logged in users 2006-07-19 12:01:38 +00:00
moodler 2fa6e1ff26 Added missing global 2006-07-19 10:17:48 +00:00
moodler e63dc8ea91 Just simplifying logic a little 2006-07-19 10:16:15 +00:00
skodak 8c251d1a93 Bug #6136 - Hard coded admin paths 2006-07-19 07:59:16 +00:00
stronk7 4985c39b50 minor bump to perform some changes on grade_letter 2006-07-18 16:23:28 +00:00
stronk7 4f1c93d6dc Fixing one recently added DB upgrade. Please be careful on STABLE! ;-) 2006-07-18 16:22:36 +00:00
tjhunt 96ef5c792a Fixed typo which caused images in questions to fail to display if NOT using slasharguments. Merged from HEAD - original checkin was 1.49 to 1.50 by danstowell. 2006-07-18 15:37:17 +00:00
tjhunt e10e4fdd55 Bug #6033 - missing string for unknown questiontype. Also tidied up some messy code. 2006-07-18 15:27:50 +00:00
tjhunt f2ea23a1bd SC#277 2006-07-18 13:32:54 +00:00
tjhunt 6b319a8087 Bug #6116 - Quiz database upgrade scripts call renamed function by the old name. 2006-07-18 10:58:40 +00:00
urs_hunkler 172d326c41 enhancements and bugfixes, works now in Safari and Konqueror 2006-07-18 09:06:06 +00:00
urs_hunkler 8d6c9a68b1 some style updates 2006-07-18 07:22:06 +00:00
skodak e2337127eb Bug #2149 - admin/creators.html javascript error 2006-07-18 07:16:29 +00:00
skodak 462a25fe75 Bug #6134 - error of coding, in function grade_download_form() 2006-07-18 06:42:21 +00:00
martinlanghoff 8a774fddb7 Close Bug #5670 - get_courses_page() - remove costly and redundant DISTINCT
get_courses_page() uses get_records_sql() which means that it will actually
break if the first field requested isn't c.id. This in turn means that
the DISTINCT is not needed at all.

So let's go fast again!
2006-07-18 04:35:45 +00:00
martinlanghoff 059366fe22 Course restore - Restrict shortname to <= 15 characters, like the database table.
Author: Donal McMullan <donal@catalyst.net.nz>
2006-07-18 03:32:51 +00:00
moodler 834f10e9b2 Automatic installer.php lang files by installer_builder (20060718) 2006-07-18 02:42:48 +00:00
toyomoyo 14080bd00a fixed a bug where user can view site posts when not logged in 2006-07-18 02:27:17 +00:00
martinlanghoff 23ea06dfbe auth/db: When using internal passwords we must register auth_update_user_password()
Now users can update their password correctly. We did have this before, I
wonder if it got dropped in a merge.
2006-07-18 01:34:19 +00:00
martinlanghoff 8d2529e59e auth/db: use auth_validate_form() to set auth_db_stdchangepassword when passtype is 'internal'
When using the 'internal' password handling, set auth_db_stdchangepassword
so we allow users to change their password normally.
2006-07-18 01:33:45 +00:00
martinlanghoff 8f527a42ee auth: extend API to support auth_validate_form()
Now Auth plugins can register auth_validate_form to get a chance
to validate config form input. Needed on MOODLE_16_STABLE to fix
a bug with auth/db.

The auth API must follow suit with the enrol API, where we can safely
do method_exists().
2006-07-18 01:31:45 +00:00
jgraham909 f8100e3629 Fix for grade_letter table and how MySQL version 5.0.3+ handles DECIMAL
fields

Versions: 5.0.3+ truncate to 99.99 if a value of 100.00 or greater is
input for grade_high or grade_low.

See the following for more info:
http://dev.mysql.com/doc/refman/5.0/en/precision-math-decimal-changes.html
2006-07-17 22:38:58 +00:00
skodak 25cbc9d08f Bug #1395 - Calandar view.php should respect forcelogin 2006-07-17 21:07:06 +00:00
skodak 88e912b1b1 Bug #6129 - Incorrect glossary import file size limit 2006-07-17 13:34:17 +00:00
tjhunt 31222bc4ef Bug 5840 - Image not displayed in Cloze question. 2006-07-17 08:47:29 +00:00
skodak 34db6d30a0 Bug #6120 - Course creation - loginproblem 2006-07-17 08:38:45 +00:00
skodak 63d337cf47 correction - bug 6130, not 3130 2006-07-17 07:29:46 +00:00
skodak 285105fbf1 workaround by Dan for bug #3130, fixed some warnings 2006-07-17 07:28:54 +00:00
martinlanghoff b1682ee480 enrol API: Updated documentation 2006-07-17 06:01:31 +00:00
stronk7 226f066ed5 Close properly the showentry page. Bug 5986.
(http://moodle.org/bugs/bug.php?op=show&bugid=5986)
2006-07-16 08:59:33 +00:00
gbateson 08a1da2bb9 micro-increment version number to v2.1.21 2006-07-16 06:54:53 +00:00
gbateson 9b2f93bcf3 add double quotes to index fields to avoid reserved words errors in pg7. correct setting of default values in HotPot 2006050201 which was incompatible with pg7.3 2006-07-16 06:53:41 +00:00
moodler ec64d5223d Automatic installer.php lang files by installer_builder (20060716) 2006-07-16 02:40:00 +00:00
gbateson 6ce20e4d58 initialized objects using new stdClass() and adjusted use use of empty() and isset() in hotpot_restore_records() function 2006-07-15 14:28:22 +00:00
gbateson e48bc9eb25 fixed setting of empty secondary fields during restore (bug 6113) 2006-07-15 13:47:09 +00:00
stronk7 74b29acec4 Soled bug 6089 plus some minor iteration savings...
(http://moodle.org/bugs/bug.php?op=show&bugid=6089)
2006-07-15 08:38:19 +00:00
skodak 613b02036f Bug #6080 - Loancalc block doesn't define a footer string 2006-07-14 21:04:27 +00:00
skodak 495f166ec4 todo: add detection of incorrect chars in wwwroot 2006-07-14 20:56:16 +00:00
tjhunt d0f8a899f8 Bug 6111 - Rewrite the code for making an indented list of question categories, becase the existing code was so horrible. 2006-07-14 15:32:57 +00:00
moodler 0183254bc5 Automatic installer.php lang files by installer_builder (20060714) 2006-07-14 02:39:22 +00:00
skodak bbdb1c3815 Bug #6099 - Restore alternatively failing on data module - fixed status codes of module restore process 2006-07-13 15:33:37 +00:00
moodler e9dbe49121 Document $CFG->allowvisiblecoursesinhiddencategories 2006-07-13 14:17:49 +00:00
moodler e714706c42 In Moodle 1.6 the behaviour of course access was changed so that visible
courses would be invisible if they were within a hidden category.

However, the old behaviour was useful in many instances, so I've added
a $CFG->coursesinhiddencategoriesarehidden that will return to that old
behaviour if required.
2006-07-13 13:58:14 +00:00
moodler f450edd426 Updates to assignment language file to support upload assignment type
(which is not in 1.6, it's 1.7, but should work in 1.6 in case people
want to try it already)
2006-07-13 07:42:13 +00:00
mark-nielsen 09447862c0 [BugFix] Bug #5466 - Cluster and End of Cluster pages no longer display scores in extended editing view. Also added page type display for cluster and end of cluster pages in the extended editing view (which is displayed for all other pages as well). 2006-07-13 00:34:20 +00:00
skodak 96856b5798 Bug #6087 - alphabetic problem in glossary 2006-07-12 20:28:21 +00:00
moodler 28e58deb41 Automatic installer.php lang files by installer_builder (20060712) 2006-07-12 08:18:08 +00:00
moodler ab6508500c FIxed bad lines 2006-07-12 08:12:16 +00:00
moodler 0b32ca3ba0 Removed bad lines 2006-07-12 08:11:24 +00:00
moodler 9a2e6ce88c Automatic installer.php lang files by installer_builder (20060712) 2006-07-12 08:08:58 +00:00
martinlanghoff 070a7cc0c2 Fixing up broken language packs for sm and to in install. 2006-07-12 06:31:46 +00:00
skodak 2277cfb8fb fixed printing of filenames from zip archives - SC#273 2006-07-12 05:54:37 +00:00
martinlanghoff 551d2b59bf chat: Prevent user from submitting a 2nd message before his 1st is received.
Some users reported that mod/chat was silently dropping some messages. The
user's browser may not be able to keep up with the rate at which he submits
chat messages. This update keeps things sane.

Author: Donal McMullan <donal@catalyst.net.nz>
2006-07-12 02:28:37 +00:00
tjhunt 7203acd306 Bug #6077 - Teacher saving their grades destroys student essay! 2006-07-11 16:10:56 +00:00
moodler 07f579d0bd Automatic installer.php lang files by installer_builder (20060711) 2006-07-11 14:22:47 +00:00
moodler 732581eb56 Manually fixed 2006-07-11 14:14:15 +00:00
skodak 344c23c0ef better cleaning of $file parameter SC#276 2006-07-11 13:18:59 +00:00
skodak b515688ddb workaround for Bug #6035 - editing quiz in one tab changes quiz in other 2006-07-11 13:00:34 +00:00
skodak 76f8821cfc Bug #6067 - The restore process behaves differently depending on which module contains the absolute links 2006-07-11 10:00:02 +00:00
moodler 95e34d9299 new installer.php files added. (stronk7) 2006-07-11 09:41:13 +00:00
toyomoyo bc77686a08 changed feedback in the function that handles user table 2006-07-11 03:35:19 +00:00
moodler 720669a6db Automatic installer.php lang files by installer_builder (20060711) 2006-07-11 02:39:43 +00:00
skodak d6b7aa9c25 Bug #5988 - Branch Tables in 1.6+ (Lesson Module) 2006-07-10 22:38:45 +00:00
skodak 4287b1f51b Bug #5732 - Lesson Scores &quot;out of XX&quot; marks report incorrect mark 2006-07-10 21:51:20 +00:00
ethem 2dc90eb90e - authorize_expired function added to lessen the code.
- All functions in authorize plugin are named with authorize_ prefix.
2006-07-10 09:43:00 +00:00
moodler 243c0e302a Merged fixes from HEAD for missing backup data 2006-07-09 16:26:37 +00:00
mudrd8mz f392379a36 Replaced by improved lang.php from HEAD which is now considered as stable. 2006-07-09 15:20:34 +00:00
skodak 8fdaba4020 Bug #6050 - import glossary entries to new glossary not creating new glossary 2006-07-07 19:53:28 +00:00
thepurpleblob 7e1a25bbdd Note that 'span' tags are permitted as well as 'lang' in multi-language
filter
2006-07-07 10:36:01 +00:00
skodak d8b7f70be3 fixed warning in glossary export 2006-07-06 21:25:42 +00:00
skodak ca567fc69b Bug #5820 - IE returns unsecure items with SSL on login 2006-07-06 15:51:17 +00:00
thepurpleblob ef1c5c394e Bug #4375 - did not work correctly in blocks. 2006-07-06 14:00:43 +00:00
ethem f5a4f9a980 Some outputting debugging info for cron. 2006-07-06 13:23:05 +00:00
ethem 905c4d38ad Performance for welcome message sending to students.
Order by students.
Dear student, welcome to these courses:
Coursename1
Coursename2
Coursename3

This sends an email for each student.
2006-07-06 11:57:43 +00:00
ethem 2044f30ec3 New string: welcometocoursesemail 2006-07-06 11:53:02 +00:00
tjhunt 52bf72770c Bug 6031 - missing parameter for warningmissingtype in libquestionlib.php 2006-07-06 11:09:03 +00:00
skodak 3294198a19 Bug #4698 - Login block is broken!, improved cookie test 2006-07-06 10:09:34 +00:00
tjhunt 68f039dedf 6030 - Can't move question categories back to the top level. 2006-07-06 10:07:02 +00:00
skodak 8c68b750a8 Bug #5921 - editing forum post bug 2006-07-06 10:00:08 +00:00
skodak de288c6099 Bug #5615 - Assigment listing shows duplicate names with paged display 2006-07-06 09:46:49 +00:00
thepurpleblob 39c18c39d1 Bug #4838 - removing spurious blank line at end 2006-07-06 08:36:38 +00:00
martinlanghoff 05a289bf1f wiki: fix for IE6 bug with HTMLArea, where the text area is not drawn
IE6 measures a page element and - sometimes - it does this before the
element is drawn, so the dimensions it finds are zero. This update sets
sensible minimum for the width.

Author:  Donal McMullan <donal@catalyst.net.nz>
2006-07-06 05:35:47 +00:00
martinlanghoff 904bd828c7 wiki: Fix for broken view on new (empty) wiki pages.
The wiki should display the 'edit' screen when a user tries to view a page
that doesn't exist. This output should not be filtered.

Author: Donal McMullan
2006-07-06 05:06:07 +00:00
ethem 27b1d9d581 Daily cron seperated from main cron for performance.
To do:
Performance for welcome message sending to students. Group by student and courses. Like this:
Dear student, welcome to these courses:
1- Coursename 1
2- Coursename 2
3- Coursename 3
2006-07-05 16:54:43 +00:00
thepurpleblob cdc03b2a02 Bug #6011 - fixed bug dropping question name from cloze questions. 2006-07-05 12:38:51 +00:00
thepurpleblob 87e2569a2b Fix for bug #6013. Unable to import blackboard. Some of the changes
in moving to question banks had broken the format.
Also tidied up some notices.
2006-07-05 10:55:24 +00:00
tjhunt e4f8392813 Bug 6019: Quiz timer does not submit the form when it reaches zero. 2006-07-05 10:43:13 +00:00
skodak ce4af6df62 changed memory limit test in healthcenter 2006-07-05 08:37:32 +00:00
skodak a520b47745 healthcenter fixes - new extra whitespace detection, fixed automatic slasharguments detection 2006-07-05 07:41:51 +00:00
toyomoyo e1ddd943fb fixing a bug where global lang is not respected in user table 2006-07-05 01:53:43 +00:00
skodak cb43ec58fb fix for mysqladmin links 2006-07-04 09:39:21 +00:00
skodak c72387b7a0 removing healthcenter link in MOODLE_16_STABLE 2006-07-04 09:30:27 +00:00
skodak 57ba975b11 Bug #5909 - Fix use of user_group() because it returns arrays now - part 2 forum search fixed too 2006-07-04 08:30:16 +00:00
skodak 2cfa6389c8 fixed $site->id warning 2006-07-04 06:04:35 +00:00
skodak fc62b3ed36 Bug #6007 - &quot;The requested URL /course/report/log/view.php was not found on this server&quot; 2006-07-04 05:25:39 +00:00
moodler 825eadf070 Automatic installer.php lang files by installer_builder (20060704) 2006-07-04 02:39:44 +00:00
skodak 25e80a87f9 Bug #5909 - Fix use of user_group() because it returns arrays now - part 1 2006-07-03 21:07:41 +00:00
skodak fdfffda00f Bug #5974 - Course overview report should not error when stats are not up to date; fixed by changing the return value from stats_check_uptodate(), NULL is now OK, string value describes error and adding notify() where needed 2006-07-03 15:42:29 +00:00
skodak 173de2e8fa Bug #5991 - The calendar does not show the month's first day's event 2006-07-03 09:09:15 +00:00
skodak 9f1eaeda4f Bug #5995 - poor English in expiry notice 2006-07-03 07:18:58 +00:00
skodak daf27b51b4 Bug #5996 - block+resource=problem 2006-07-03 06:25:40 +00:00
moodler 2fe6249d41 Automatic installer.php lang files by installer_builder (20060701) 2006-07-01 02:39:58 +00:00
skodak 27e7895379 slashargument fix for healthcenter, better diagnostic messages; renamed file.php/pic.jpg option to file.php/1/pic.jpg because the course number is mandatory -continued 2006-06-30 13:39:04 +00:00
skodak 0b7911a748 slashargument fix for healthcenter, better diagnostic messages; renamed file.php/pic.jpg option to file.php/1/pic.jpg because the course number is mandatory 2006-06-30 13:38:05 +00:00
skodak 92a6edf143 cleanup in admin/index.php; preparation for health center, loginas gui, password salts 2006-06-30 12:54:41 +00:00
skodak 4a4c960d99 fixed // in course root when browsing files 2006-06-30 11:55:41 +00:00
tjhunt 2f12aae186 Bug 5967 - Missing lang strings and help for quiz reports. 2006-06-30 10:27:17 +00:00
skodak 1530745ba6 Bug #5961 - small grammar error 2006-06-30 07:33:16 +00:00
skodak bd93091c8a Bug #5802 - Incorrect length in http partial content (206) packets. 2006-06-30 07:21:55 +00:00
moodler 609784e0aa Automatic installer.php lang files by installer_builder (20060630) 2006-06-30 02:42:55 +00:00
skodak 7c58698a8a Bug #5937 - Fix nonascii chars in graphs:
* text is converted to unicode - no html entities anymore
 * then all nonascii chars are converted to decimal number entites
 * default.ttf is searched in dataroot/lang and local language packs too
 * removed lang_decode() - obsoleded by proper entity converison above
 * updated documentation in lang/en_utf8/fonts/README.txt
2006-06-29 21:19:10 +00:00
ethem 0cf39f9160 Put back last commit. If cost is 0, it always falls back to manual method. 2006-06-29 19:15:26 +00:00
ethem e65b5a1dce Bug #5941, Petr's patch is incorrect. Rewritten.
If course cost is 0 then always fall back to manual method. This is not authorize problem if enrolment key is empty and guest access with key.
2006-06-29 18:59:49 +00:00
ethem ec4fda2d3d Bug #5941, Petr's patch is incorrect. Rewritten.
If course cost is 0 then fall back manual method.
2006-06-29 18:13:03 +00:00
moodler e8b5984085 new installer.php file added. (stronk7) 2006-06-29 16:53:32 +00:00
ethem 0dafbf714a $teacher is used in manual form. No need global. 2006-06-29 15:00:17 +00:00
ethem 381cc85743 get_student_courses and get_teacher_courses functions added for future reference.
Cron description added.
2006-06-29 12:39:42 +00:00
ethem f59c789b28 Don't show choose method string if course cost is 0. 2006-06-29 11:25:04 +00:00
ethem f6c29f43ae New string. No cost yet. 2006-06-29 11:10:27 +00:00
ethem e99b6fb404 Interactive plugins (authorize and paypal ) must use 'manual'.
Some patches must be applied to lib/db.
http://moodle.org/bugs/bug.php?op=show&bugid=5941
Look: version.patch, lib_db.patch

Eloy, your question about enrol fields for interactive plugins were solved.
Now, we sure we never use authorize and paypal field for backup and restore.
Because manual is active and cannot be disabled when restoring.
Bug #5358 - Add support for enrol systems in backup/restore
http://moodle.org/bugs/bug.php?op=show&bugid=5358&pos=0
2006-06-29 10:24:08 +00:00
ethem a395180a81 Bug #5941 - Myriad of problems with Paypal enrollmemts, au_enrol.patch 2006-06-29 09:46:10 +00:00
skodak ce72ff9018 Bug #5944 - error message when moving thread 2006-06-29 08:00:48 +00:00
skodak 4314bcdd89 Bug #5952 - bad links in &quot;about wysiwyg editor&quot; 2006-06-29 07:19:44 +00:00
skodak d23f9f5d48 Bug #5953 - problem in /auth/ldap/lib.php 2006-06-29 07:03:38 +00:00
skodak 1eb6f0cd22 Bug #5955 - link to help item for html editor looks funny 2006-06-29 06:59:26 +00:00
skodak fee582844b Bug #5959 - save and view takes to wrong place 2006-06-29 06:52:48 +00:00
skodak 1c813b4080 Bug #5960 - can't delete or edit comments 2006-06-29 06:47:35 +00:00
moodler 993d8956ea Automatic installer.php lang files by installer_builder (20060629) 2006-06-29 02:40:22 +00:00
tjhunt e067c3a1f0 Bug #5918 - essay question comments from teachers lost in 1.6 upgrade. Thanks to Mark Nielsen the suggestion of how to fix. 2006-06-28 17:13:17 +00:00
skodak 1a833b5836 Bug #5941 - Myriad of problems with Paypal enrollmemts, part 3 - fixed 'login as student' button, now plain guest login action 2006-06-28 15:36:53 +00:00
skodak 48653e6c05 Bug #5941 - Myriad of problems with Paypal enrollmemts, part 2 - Login as guest not shown to guests and there is login link instead of paypal button for guests 2006-06-28 15:25:05 +00:00
skodak 804cc92184 minor loginas cleanup 2006-06-28 14:57:44 +00:00
ethem e5cf77cd19 Multienrol FIX: Move error message from this to manual plugin to show error message. This plugin is never inherited anymore. Each time, we create new manual_plugin() and this causes hiding error message. 2006-06-28 14:47:01 +00:00
skodak 0ea68a9cdd Bug #5941 - Myriad of problems with Paypal enrollmemts, part 1 2006-06-28 12:42:43 +00:00
tjhunt 6d812d61a2 Bug #5922 - comment from manualgraded questions lost during regrade. Thanks to Jean-Michel Vedrine for the fix. 2006-06-28 11:40:56 +00:00
tjhunt a9f56a8f0d Bug #5945: Lang string name missmatch when starting quiz attempt. 2006-06-28 10:10:28 +00:00
moodler 2dc8a5c519 Automatic installer.php lang files by installer_builder (20060628) 2006-06-28 02:39:18 +00:00
skodak 7bd9c89714 Bug #5927 - extending enrollments doesn't 2006-06-26 21:57:42 +00:00
skodak 24999ce035 Bug #5931 - blocks block database 2006-06-26 21:34:13 +00:00
skodak 31053d630f assignments on mymoodle page, Bug #5839 - Found more than one record in get_record_sql ! 2006-06-26 16:15:29 +00:00
skodak 01ac5c3191 fixed broken stats image link, Bug #5924 - User profile statistics tab 2006-06-26 13:47:52 +00:00
tjhunt 6aeb5a1f35 Bug 5889 - Regrading a quiz wipes student answers. Thanks to Jean-Michel Vedrine for the fix. 2006-06-26 11:21:08 +00:00
toyomoyo a73a0a6d8c fix for 5916, when blogs disabled do not print link of blog in profile 2006-06-26 08:30:32 +00:00
skodak d3d91e9a72 fixed Turkish problems see, Bug #5878 - Teachers can't add blog and blocks. 2006-06-26 07:21:13 +00:00
vyshane f64475c360 Using notify instead of error to display error message when purging of RSS
files fail during a discussion move between forums.
2006-06-26 03:59:28 +00:00
stronk7 459154ffbd Some minor changes in order to avoid some notices... 2006-06-25 10:15:31 +00:00
julmis b7504102dc commenting out ob_gzhandler. 2006-06-23 19:50:42 +00:00
toyomoyo 4590fe5598 added support for custom langs, and Eloy's change to 1000 record, see HEAD commit message 2006-06-23 01:51:36 +00:00
toyomoyo f7c1de925b added support for custom lang packs, and Eloy's change to 1000 records before system responds. Please see his commit msg on HEAD for details. 2006-06-23 01:48:18 +00:00
thepurpleblob 07ccf0a68d Fixed mix-up between MikTeX and MimeTeX. 2006-06-21 10:18:51 +00:00
toyomoyo 6408f30173 fix for 5881, no closing tag 2006-06-21 03:12:54 +00:00
moodler bdaee88fac Automatic installer.php lang files by installer_builder (20060621) 2006-06-21 02:43:53 +00:00
ethem 552f0e47dc Very small change. A little performance for cron if admin enabled sending email for pending orders expiring.
1- If dailysettlement is 00:05 and cron executes at this time, nothing will occur. If it is executes at 00:10 it works. I think "<" works faster then "<=" :))
2- Don't compare course->ids by authorize->courseid, because courses are grouped by courseid. We sure each line is unique.
3- Only get pendingorderexpiring strings for sending email if course teachers exist.
2006-06-20 17:07:56 +00:00
moodler 84331e061f Bump past 1.6 2006-06-20 14:58:55 +00:00
stronk7 de43be04ae helper string to explain $CFG->doctonewwindow added. 2006-06-20 14:22:14 +00:00
stronk7 54374e63f0 Now docs are showed in a new window based on $CFG->doctonewwindow 2006-06-20 13:51:47 +00:00
stronk7 294c6adb0a Added new option to decide if docs will be showed in a new window. 2006-06-20 13:40:27 +00:00
moodler 1c05b46ac2 Added back homelink to standard theme 2006-06-19 16:30:00 +00:00
moodler ddc6b0e31d Merged error fix for RSS deletion 2006-06-19 16:21:33 +00:00
moodler 1d9a81c347 OKAY! THIS IS IT! MOODLE 1.6! 2006-06-19 15:35:50 +00:00
moodler 262ec64be3 New tags file 2006-06-19 15:33:01 +00:00
moodler 4541181369 When the tags block is shown in a course context, then make the
links to blogs stay in the same context.
2006-06-19 14:16:42 +00:00
moodler 4d0036e8be Don't show users tab if you can't go there 2006-06-19 13:51:58 +00:00
moodler 0e83e4f5ca FIxed some missing headers 2006-06-19 13:34:46 +00:00
toyomoyo d40b3e1034 changed &amp;copy; to &#169 to validate better 2006-06-19 03:52:23 +00:00
toyomoyo 72343793f6 give IE a bit more time 2006-06-19 03:29:15 +00:00
moodler d4e8a03c53 Added new class FPDF_Protection (see Bug #5855). Code submitted by chardelle at lifeworkouts dot com, commited by vy-shane at moodle dot com. 2006-06-19 02:39:05 +00:00
moodler 6c979e8a24 Some changes to improve the UTF migration output a little 2006-06-18 10:09:12 +00:00
moodler 794e4a05a3 The forum search form was always wrapping no matter what I tried.
I swapped the textbox and helpbutton around (and got rid of one more table)
2006-06-18 08:20:48 +00:00
moodler d067b2005b Moved the "helplink" CSS span outside the help text and image. No effect on themes. 2006-06-18 08:09:51 +00:00
moodler c6d79e46d9 FIxed up the print_header calls 2006-06-18 07:44:21 +00:00
moodler 2b8a5e83ac Fix for resource parameters for users not logged in 2006-06-16 09:41:41 +00:00
moodler 2a1e7c302c Added check for $CFG->disablemycourses 2006-06-16 04:29:22 +00:00
toyomoyo 59b4825741 fixing centering of tabs on blog page 2006-06-16 02:58:44 +00:00
mjollnir_ 38d0c10e3c participants list last access filter should only show for teachers! I noticed this on moodle.org this morning :| 2006-06-15 21:33:06 +00:00
ethem 50d2685d0e $a->course: course information added. 2006-06-15 14:19:49 +00:00
ethem f187b7f98b $a->course: course information added. 2006-06-15 14:06:53 +00:00
ethem 0726456942 pendingordersemailteacher string added 2006-06-15 13:34:30 +00:00
ethem 1bf6b1cc18 pendingordersemailteacher string added 2006-06-15 13:29:10 +00:00
ethem efbd1fc514 When the number of pending orders expiring are sent to the teachers via email, which one is important? The number of the orders or the total of the amounts. 2006-06-15 12:23:46 +00:00
ethem 9900b2f103 If we enabled manual-capture and teachers can manage payment and teachers can be notified about pending orders expiring,
admins can also chooise that what is the sort of importance of expiring orders? 'Sum of total' or 'Count of orders' are emailed first.
You know that the amount of money is important :)
2006-06-15 10:30:55 +00:00
ethem 2716e73e9e Order by order count. Courses that have many orders are emailed first. 2006-06-15 07:45:18 +00:00
toyomoyo abe51bbed9 fix for 5633 2006-06-15 06:32:26 +00:00
toyomoyo cd09750495 fix for 5814 2006-06-15 03:23:47 +00:00
ethem 3377c60427 Email subject for pending orders expiring. 2006-06-14 16:30:46 +00:00
ethem 5242595975 Email subject for pending orders expiring. 2006-06-14 16:19:23 +00:00
tjhunt 2605a5ba8f Moved constant definitions out of function, so they are not run repeatedly giving lots of warnings. 2006-06-14 15:34:22 +00:00
tjhunt 1aa43ea576 Corrected reference to lang string. 2006-06-14 15:30:55 +00:00
ethem f12b2a7d5d If admin set up 'Teachers can manage the payments of the course' and enabled 'Manual-Capture', course teachers are notified about pending orders expiring. 2006-06-14 11:52:01 +00:00
ethem 834d5863b9 If admin set up 'Teachers can manage the payments of the course' and enabled 'Manual-Capture', course teachers are notified about pending orders expiring. 2006-06-14 11:33:00 +00:00
moodler c8825cfd2d Fix for bug:
Notice: Undefined property: id in /home/moodle/public_html/certificate/mod/forum/discuss.php on line 38

when user is not logged in and want to view a forum of type news.
2006-06-14 08:44:36 +00:00
moodler 380b3b305c Added missing $a to print_error 2006-06-14 03:15:34 +00:00
moodler 2ae294c9d6 Automatic installer.php lang files by installer_builder (20060614) 2006-06-14 02:37:39 +00:00
tjhunt cb82934b8d * Quiz module sometimes left the user staring at a blank page. Now there is an error message. 2006-06-13 18:58:17 +00:00
tjhunt c1c70a909a Bug #5812 - Standard theme font size CSS not sufficiently defensive 2006-06-13 18:52:17 +00:00
ethem 541ba098e7 Link to Payment Management page? 2006-06-13 18:29:28 +00:00
ethem c298a8b8e0 Link to help file 'Order Review'. 2006-06-13 18:02:24 +00:00
ethem 94863d1946 Help file for 'Order Review'. Merged from HEAD 2006-06-13 17:52:58 +00:00
ethem 6b8155d4a8 file orderreview.html was added on branch MOODLE_16_STABLE on 2006-06-13 17:52:58 +0000 2006-06-13 17:51:11 +00:00
ethem d9e4f9eb2a Handle also formatted time 00:30 for settlement time. 2006-06-13 15:59:11 +00:00
ethem d864c083c2 Predict the time of settlement at first time. Probably, admin user set up own country timezone and we can use this time as settlement time.
Function used: get_user_timezone_offset()
2006-06-13 15:24:28 +00:00
tjhunt 80970e2938 Bug #5810 missing ' > 7' in debug test. 2006-06-13 14:36:08 +00:00
vyshane c196e0f3cb Merged from 1.5. Fix for Bug #5767 - Section links block is removed from
course view after settings update.
2006-06-13 07:47:51 +00:00
tjhunt 5a6dba91bb Fix restore notice. 2006-06-12 15:35:28 +00:00
tjhunt 4600286cd2 Bug #5793: remember whether Show all has been clicked in the question bank. 2006-06-12 13:51:11 +00:00
tjhunt 4bbd7130f1 Bug #5790: Answer order for MC qtype not specified. Fix. Thanks to Peter Bulmer. 2006-06-12 11:03:11 +00:00
toyomoyo b862c77e93 proper html for help file 2006-06-12 07:24:24 +00:00
toyomoyo 1a149c0d33 a few mismatches between db and this html 2006-06-12 07:17:59 +00:00
toyomoyo 84f3391271 adding help file 2006-06-12 04:07:27 +00:00
moodler 1f66b55e6e Fixed hardcoded style widths in all formats 2006-06-11 06:47:43 +00:00
moodler 4339f32452 Removing hardcoded style widths and replaced with table widths, which improves page build appearance 2006-06-11 06:42:42 +00:00
stronk7 00b8db5f4f Due to one potential bug in PHP under Win32 (http://bugs.php.net/37775)
the [[cntrl]] pcre class was breaking some chars. Changed to a safer
alternative. Bug 5777.
(http://moodle.org/bugs/bug.php?op=show&bugid=5777)
2006-06-10 23:31:21 +00:00
stronk7 b0bba0e704 Change the moodle_strtolower() function to use textlib services.
Also, mark it as deprecated, code should use text services directly.
Partially, bug 5777. It continues under investigation.
(http://moodle.org/bugs/bug.php?op=show&bugid=5777)
2006-06-10 10:38:27 +00:00
moodler d501331e75 Automatic installer.php lang files by installer_builder (20060610) 2006-06-10 02:36:19 +00:00
moodler ac9ed861a4 Automatic installer.php lang files by installer_builder (20060610) 2006-06-09 18:58:21 +00:00
moodler effa8cd5d1 Automatic installer.php lang files by installer_builder (20060610) 2006-06-09 17:19:42 +00:00
stronk7 3dbdb64c89 The absolutely incredible bug! It was working being wrong! Bug 5775.
(http://moodle.org/bugs/bug.php?op=show&bugid=5775)
2006-06-09 14:21:49 +00:00
ethem 660e6d5f9d Sending email for pending orders expiring string (adminemailexpired) seperated.
Settings moved to adminemailexpsetting.
2006-06-09 11:24:09 +00:00
ethem 277ea82b49 Sending email for pending orders expiring string (adminemailexpired) seperated.
Settings moved to adminemailexpsetting.
2006-06-09 11:18:16 +00:00
ethem dce99d41f4 Show 'name on card' string instead of moodle.php's user string. 2006-06-09 10:56:54 +00:00
ethem 44c4e47a1c Some config sections 'Order Review' moved to
an_teachermanagepay -> Site-Wide Settings
an_emailexpired: -> Email-Sending Settings
an_cutoff: -> Authorize.net Settings
2006-06-09 10:25:24 +00:00
stronk7 ba4f9b230f Moving from lastIP to lastip everywhere. Bug 5763.
(http://moodle.org/bugs/bug.php?op=show&bugid=5763)
2006-06-09 10:00:47 +00:00
stronk7 2ba777cd5a Moving from lastIP to lastip everywhere. Bug 5763.
(http://moodle.org/bugs/bug.php?op=show&bugid=5763)
2006-06-09 09:43:59 +00:00
stronk7 03b40486ca Avoid empty processing both for PLAIN_SQL_UPDATE and PHP_FUNCTION
Merged from HEAD
2006-06-09 09:18:35 +00:00
toyomoyo ea257a167e typo should be 0 not 1 2006-06-09 02:52:05 +00:00
toyomoyo a666b9dbcf disable the blog tag if blog is disabled 2006-06-09 02:44:49 +00:00
bobopinna 986a50e26d change advanced to parameters 2006-06-08 15:35:06 +00:00
bobopinna 625c8a70aa Fixed some language refinements 2006-06-08 15:24:23 +00:00
moodler 66a14b7292 Help content for available tags. 2006-06-08 08:26:50 +00:00
skodak 0a265f0fcd Bug #5663 - errors after changing grade weight 2006-06-08 06:38:08 +00:00
skodak be8137a81b Fixed course searching 2006-06-08 06:23:34 +00:00
vyshane 8bdb6d99a8 Added missing string norecentactivity. 2006-06-08 06:18:06 +00:00
toyomoyo 07c8c52cbf bug fix for 5748 2006-06-08 04:07:24 +00:00
toyomoyo b588ef46f4 changed recordset size to 50 2006-06-08 02:45:48 +00:00
stronk7 cdb048acd7 Solve one issue with skipped courses and email to admin
being set every xx minutes. Bug 5621.
(http://moodle.org/bugs/bug.php?op=show&bugid=5621)
2006-06-07 22:17:31 +00:00
ethem dd9a68560e Unnecesary strings removed. 2006-06-07 18:42:47 +00:00
skodak c731399ff1 Bug #5522 - question/restorelib.php error 2006-06-07 14:56:36 +00:00
skodak c8d483b80c incorrect course number in categories after course delete 2006-06-07 14:04:55 +00:00
vyshane 75775efcf7 Fix for Bug #5131 - RSS Feeds and Moving Discussions. 2006-06-07 08:16:01 +00:00
toyomoyo de8c6852d3 fix for 5720 2006-06-07 06:03:41 +00:00
toyomoyo 36d7c02847 fix for 5720 2006-06-07 05:56:59 +00:00
vyshane 64375cb146 Fixed bug: SCORM module window options were not being saved properly - array
values used instead of keys in scorm_option2text().
2006-06-07 04:34:29 +00:00
toyomoyo 1f7569c38a some javescript progress bar changes, 1) status updates correctly when resuming 2) table numbers is not hardcoded anymore 2006-06-07 04:30:50 +00:00
toyomoyo d636096334 changes are made to facilitate the migration of user table by row. function migrate2utf_user is added. This only affects mysql atm. Please help test and report bugs! 2006-06-07 04:09:37 +00:00
skodak 1f1a9a809c Bug #5659 - Problem with build-in buttons when creating templates 2006-06-06 20:54:16 +00:00
skodak fe19f91525 Bug #5734 - Enrolled students can't access metacourse after unhiding while logged in 2006-06-06 19:00:51 +00:00
tjhunt aea38264b5 Fix notices when you restore a course with an empty forum. 2006-06-06 17:23:42 +00:00
tjhunt 44e2500992 Bug #5559: revised fix - using better CSS class names. 2006-06-06 17:07:58 +00:00
stronk7 ecf140979f Adding two new strings for RESTRICTED tests in environmenlib. 2006-06-06 16:56:16 +00:00
stronk7 9531202c10 Now environmentlib supports RESTRICT sections (to be able to deny
any general test with more detail (the opposite to the BYPASS section)
(http://moodle.org/bugs/bug.php?op=show&bugid=5653)

Merged from MOODLE_15_STABLE
2006-06-06 16:15:35 +00:00
skodak a5436ee747 Bug #5535 - Database module backup error in 1.5.4, patch submitted by Patrick Pollet 2006-06-06 15:11:34 +00:00
bobopinna 826067335c Fixed some regular expression Bug 5041 2006-06-06 14:33:10 +00:00
tjhunt d5306794ec Fix for calculated questions where each one builds on the last. 2006-06-06 14:27:45 +00:00
tjhunt 89905101b7 Fix notices from the quiz module on backup and restore. 2006-06-06 14:13:55 +00:00
tjhunt f6849778a7 Make cron a bit more rebust by changing the way the require is done. 2006-06-06 14:10:33 +00:00
skodak c0f904046c Bug #5678 - Question marks, single quotes in field name cause trouble - cleaning hack ported from clean_filename() 2006-06-06 10:15:49 +00:00
tjhunt 23da79eff2 Fix notice. 2006-06-06 10:10:07 +00:00
skodak 176d1229af Bug #5680 - Fixed duplicate field names 2006-06-06 09:34:23 +00:00
skodak 6aef11722c Bug #5444 - Import PowerPoint - PHP5 clone bug 2006-06-06 08:52:51 +00:00
vyshane 5218d67aca New stats admin report. This shares code with /course/report/stats. Basically
the same report, but in an admin context.
2006-06-06 04:18:16 +00:00
vyshane 9b037d3842 New files with required code after refactoring this report module. 2006-06-06 04:13:44 +00:00
vyshane 6481349eb3 Refactored this report module so that we can also use it from
/admin/reports/stats.
2006-06-06 04:09:31 +00:00
tjhunt 9abb0f813a Bug #5672: Make calculated questions less confusing to create. 2006-06-05 16:56:31 +00:00
tjhunt 914d8f5801 Fixed reference to incorrect language string. 2006-06-05 14:14:12 +00:00
ethem 7a553f06a3 Some cron performance. Run clean-ups and send email daily on settlement date.
an_nextmail config deleted, instead of old config new an_dailysettlement inserted into config_plugins table.
2006-06-05 12:58:16 +00:00
skodak a9fd047eea Bug #5725 - Assignment grading pop up windows do not close, broken by 4976 2006-06-05 12:17:20 +00:00
bobopinna b225c41b53 Fixed a typo 2006-06-05 08:23:34 +00:00
bobopinna 2d0ee29b15 Added class name for IFRAME element 2006-06-05 07:40:18 +00:00
bobopinna 0bfac2fe7a Fixed a modified name for some constants 2006-06-05 07:19:07 +00:00
skodak c7d9b99dae Bug #5715 - error message in messaging - notice lastaccess 2006-06-04 23:10:32 +00:00
skodak f87c87b9ba Bug #5721 - students cannot take quiz when course language set to French 2006-06-04 23:00:00 +00:00
skodak 88c0c27c83 fixed warning when no students graded yet (caused by useless assignment) 2006-06-04 21:34:14 +00:00
stronk7 395c75becd make_default_scale() now searches properly under
both dataroot and dirroot, defaulting to en_utf8. Bug 5719.
(http://moodle.org/bugs/bug.php?op=show&bugid=5719)
2006-06-04 15:17:03 +00:00
stronk7 b02e4ee384 report XXXX actions added. Bug 5714.
(http://moodle.org/bugs/bug.php?op=show&bugid=5714)
2006-06-04 00:35:04 +00:00
stronk7 fae3f45758 course report xxxx actions now are supported on restore. Bug 5714.
(http://moodle.org/bugs/bug.php?op=show&bugid=5714)
2006-06-04 00:00:02 +00:00
skodak 5d46f73a3c Bug #5716 - Impossible to turn off highlighted current topic 2006-06-03 23:46:50 +00:00
stronk7 1ac7d05730 course report xxxx actions must send courseid in the info field. Bug 5714.
(http://moodle.org/bugs/bug.php?op=show&bugid=5714)
2006-06-03 20:33:44 +00:00
stronk7 27f60090f6 And some more (the last) notices out! Bug 5713.
(http://moodle.org/bugs/bug.php?op=show&bugid=5713)
2006-06-03 20:16:19 +00:00
stronk7 28dc928f43 And one more collection of innocent notices avoided. Bug 5712.
(http://moodle.org/bugs/bug.php?op=show&bugid=5712)
2006-06-03 20:00:10 +00:00
skodak 7fe8550e18 clarification for restrict modules option - bug #5688 2006-06-03 19:57:42 +00:00
stronk7 c9aecec6be And another notice in restore out. Bug 5711.
(http://moodle.org/bugs/bug.php?op=show&bugid=5711)
2006-06-03 19:48:50 +00:00
stronk7 69b693dbc9 One less notice. Bug 5710.
(http://moodle.org/bugs/bug.php?op=show&bugid=5710)
2006-06-03 19:44:15 +00:00
stronk7 0803379406 Avoid one notice in backup. Bug 5709.
(http://moodle.org/bugs/bug.php?op=show&bugid=5709&)
2006-06-03 18:59:35 +00:00
stronk7 4eb4b874ba Adding support to the forum user report action
in restore. Bug 3854.
(http://moodle.org/bugs/bug.php?op=show&bugid=3854)
2006-06-03 17:44:05 +00:00
skodak aff589d128 Making sure timelimit is converted to integer before being written to database, otherwise postgreSQL complains. Closing bug 5401; merged from MOODLE_15_STABLE 2006-06-02 16:01:05 +00:00
tjhunt c4c9a5d860 Bug #5559: Move CLOZE qtype hightight colours into CSS insted of hardcoding, so themes can override. 2006-06-02 15:37:10 +00:00
nfreear 805720ebd3 Fix, bug 5614 - added ALT text for link icons (x 5), based on TITLE. 2006-06-02 13:11:38 +00:00
ethem af70ea6a96 Merged from HEAD. 2006-06-02 09:48:27 +00:00
thepurpleblob ae8df5acdf Added CLOZE question support.
Thanks to Joseph Rezeau for this one!
2006-06-02 09:44:13 +00:00
vyshane 1e900c139d Fixed bug: php warnings when there are no users in the selected course. 2006-06-02 07:35:36 +00:00
skodak ef93a24f23 fixed warning and removed ugly hack in attachment path 2006-06-02 06:47:26 +00:00
vyshane 47737013d3 Fix for Bug #5682 - 'Reset template' button in CSS template adds HTML 2006-06-02 04:27:42 +00:00
vyshane 476b3195fa Added missing language string. 2006-06-02 04:19:06 +00:00
toyomoyo ed7ce12186 fix for 5686, include_once course/lib.php in case it doesn't get included when interrupted 2006-06-02 02:53:31 +00:00
stronk7 de78b7e81b Adding propper support for the forum->user report log action. It was
a bit wrong. Code credits go to Petr!
2006-06-01 23:11:55 +00:00
skodak bf48c7abcd fixed problem in restricted modules - mods were accessed using strtolower(translated module name) instead of directory name as usual, it partially worked for English 2006-06-01 19:48:37 +00:00
skodak 26e6e8c048 fixed - unable to disable blocks 2006-06-01 19:12:42 +00:00
ethem d0bdb4d3c9 Documentation for status codes and actions. 2006-06-01 16:05:29 +00:00
skodak 7af4d79611 Bug #5643 - add Yahoo online status to user profile 2006-06-01 15:18:10 +00:00
skodak 49f020ec0c Bug #5684 - frameset page in UTF8 doesn't appear on IE 2006-06-01 14:49:31 +00:00
thepurpleblob a4bb593422 Fixing bugs #5676 and #5677
Text strings not properly escaped in a couple of places.
Conditional check inserted for optional units data in numerical questions.
2006-06-01 10:12:00 +00:00
ethem d799a9aef2 Just some tidy-ups 2006-06-01 08:44:01 +00:00
vyshane 6b611eb82d Fix for Bug #5552 - Filters conf. table looks awful. 2006-06-01 08:08:23 +00:00
ethem 1e04f3179a Just some tidy-ups 2006-06-01 07:38:23 +00:00
skodak ec7418d3ce Bug #5661 - mymoodle redirect problem 2006-06-01 05:39:46 +00:00
vyshane 6d895ae5e9 Fixed missing string 2006-06-01 04:07:23 +00:00
vyshane b194dfbf15 Fix for get_string(), which was not building the path to the language files
for reports correctly.
2006-06-01 03:05:18 +00:00
toyomoyo 278bd07a17 bug fix for 5352, setting ignore_user_abort to false 2006-06-01 02:30:20 +00:00
danmarsden 2aa86d2d33 BUG 5662 - bad check for 1.6 version. 2006-05-31 20:25:37 +00:00
stronk7 74e97cf096 Prevent doubleslashes once and again in paths. Also prevent them when writing config.php 2006-05-31 17:50:42 +00:00
tjhunt d86503c7cf Fix for bug 5379: Item analysis report should not have a hard coded list of question types.
Please test this if you have a moodle install with some unusual question types. Thanks.
2006-05-31 15:53:12 +00:00
julmis ee16e98eb1 Another try to fix IE's problem to load editable iframe. 2006-05-31 11:35:32 +00:00
moodler 800085d9ae Don't show stupid warnings to teachers 2006-05-31 08:24:28 +00:00
toyomoyo c8937fb8ea changepassword obsolete 2006-05-31 07:23:11 +00:00
toyomoyo 08d1ef9d83 changepassword is obsolete 2006-05-31 07:11:16 +00:00
toyomoyo 2fd3511227 changepassword obsolete 2006-05-31 06:57:58 +00:00
toyomoyo 3abe15dd14 change password obsolete 2006-05-31 06:41:55 +00:00
toyomoyo 213b568441 always allow admin to check the force password change box, if using internal_auth 2006-05-31 06:28:07 +00:00
stronk7 91a036b599 Users with messages (and messages) are only included in
SITEID backup. Bug 5658.
(http://moodle.org/bugs/bug.php?op=show&bugid=5658)

Merged from MOODLE_15_STABLE
2006-05-30 16:57:20 +00:00
nfreear 5484222182 Fix bug 5628 (Farsi RTL language), modify '.accesshide' style so top is large negative, not left. 2006-05-30 11:16:52 +00:00
skodak 321a23004b blacklist PHP 5.0.x in installation precheck 2006-05-30 09:49:22 +00:00
skodak 272fecfce4 blacklist PHP 5.0.x in installation precheck 2006-05-30 09:37:26 +00:00
ethem ffccc532c6 If config wwwroot starts with 'https', ignore config loginhttps value.
Dependency: Bug #5647
2006-05-30 08:25:57 +00:00
skodak ad6ae2c4e5 fixed typo - randomsmatch notice bug 5652 2006-05-30 06:27:59 +00:00
toyomoyo 76816913ed fix for 5648, utf-8 migration bug 2006-05-30 02:50:16 +00:00
martinlanghoff 4c74601224 auth/ldap: better handling of empty values from ldap 2006-05-30 00:42:53 +00:00
stronk7 b4c8301258 Bump or I'll forget it. 2006-05-29 22:49:54 +00:00
skodak c446109283 fixed warning from clone($SITE) during site setup 2006-05-29 20:30:07 +00:00
stronk7 b4ab174902 Normalize oracle driver name.
Merged from HEAD.
2006-05-29 17:43:07 +00:00
stronk7 2deb9e2501 Adding environmental checks for 1.7 (mssql and oracle added)
Merged from HEAD
2006-05-29 17:38:48 +00:00
moodler be02c7520a Improved title 2006-05-29 09:55:07 +00:00
moodler 364f1151a6 Updated some "my moodle" strings 2006-05-29 09:39:55 +00:00
moodler fb3a583b2b Improved the appearance of the My Moodle page with some CSS 2006-05-29 09:27:01 +00:00
moodler 83bf9af99e DOn't even show assignments without a due date 2006-05-29 09:20:53 +00:00
moodler a00095da48 FIxed some bugs 2006-05-29 09:09:22 +00:00
moodler 3ed4068ee1 Cleaned up admin reports a little 2006-05-29 09:03:13 +00:00
skodak 949f570992 Bug #5620 - MyMoodle shows bogus Assignment due date 2006-05-29 08:36:52 +00:00
moodler 2bef2c7dca FIxed admin block link for reports 2006-05-29 08:35:33 +00:00
moodler 36e32ba459 Checking in skodak's fixes to help blocks in more contexts (esp MyMoodle) 2006-05-29 08:15:23 +00:00
moodler baa1209e37 Merged from HEAD, better definition of $COURSE 2006-05-29 07:34:55 +00:00
skodak 4878c5a6d2 fixed array warning when editting blocks 2006-05-29 06:03:17 +00:00
skodak 5d4353a158 global $course fix 2006-05-29 05:55:39 +00:00
wildgirl 446088fa5d Updated small MP3 player to handle autoPlay (by Andrew Walker, Alton College) 2006-05-28 20:20:55 +00:00
skodak 33f519119b sanitize submitted numerical values 2006-05-26 11:52:35 +00:00
skodak 7acc6626c5 sanitize submitted numerical values 2006-05-26 11:46:32 +00:00
skodak e616f403eb sanitize submitted numerical values 2006-05-26 11:38:16 +00:00
skodak b51b3dd05c sanitize submitted numerical values 2006-05-26 11:31:16 +00:00
skodak e4fd3f4f06 Bug #5619 - Assignment Feedback mail lacks linefeed 2006-05-26 09:06:05 +00:00
skodak bce3627ed9 Bug #4647 - Undefined property in lib/statslib.php 2006-05-26 08:59:52 +00:00
skodak 567596e8c2 Bug #5456 - Item Analysis fails to calculate results for random question type 2006-05-26 06:54:22 +00:00
skodak f703afe925 Bug #5472 - Download quiz grades in Excel format does not show correct foelds 2006-05-26 06:47:32 +00:00
skodak 6483738028 Bug #5612 - language string missing in blog 2006-05-25 19:23:54 +00:00
skodak 086018ae01 Bug #5582 - sort by numerical field doesn't work properly with decimals 2006-05-25 15:55:55 +00:00
nfreear ae04fba0cd Ongoing fix, bug 5614 - added ALT text for link icons, based on TITLE. 2006-05-25 15:50:19 +00:00
skodak db9529f65f Bug #5416 - sorting by question column in overview report plugin broken - please test 2006-05-25 09:59:06 +00:00
skodak 97ae5efdf0 Bug #5566 - wrong display of student's answers in MATCHING question type 2006-05-25 08:12:30 +00:00
skodak a636a125da Bug #4779 - lib/moodlelib.php: typo 2006-05-25 06:33:01 +00:00
vyshane b3ed98f7ba Changed string to make it more general so we can use it for error message that
is shown when a student tries to add an entry and no fields are defined.
2006-05-25 05:16:43 +00:00
vyshane 46941b6043 Fix for bug: when students try to add an entry while no field is defined, the
foreach barfs on the value of $fields, which is false.
2006-05-25 05:14:53 +00:00
gbateson 670cced63a added blank lines for to improve readability 2006-05-25 05:14:49 +00:00
toyomoyo f6c74641dd backup-restore, utfmigrate for rsstitletemplate field 2006-05-25 02:29:15 +00:00
toyomoyo 3141843a1a dropping backticks 2006-05-25 02:06:44 +00:00
toyomoyo 4da8b58b36 forgot to check this in 2006-05-25 01:43:32 +00:00
gbateson 7c8304a6c9 clarified the wording in point (5) of the "TO USE" section 2006-05-25 00:00:34 +00:00
skodak fee588e503 fixed my yet another bug 2006-05-24 21:53:46 +00:00
skodak 42e2fba317 fixed broken operations in subfolders - result of my recent patching :-( :-( bug #5603 2006-05-24 21:49:25 +00:00
skodak 48c54e90ce Bug #5604 - LDAP error notice when users update profile 2006-05-24 21:11:56 +00:00
skodak dad92a063d fixed warnings on save profile 2006-05-24 21:04:33 +00:00
skodak 9033ed3212 Bug #5587 - Redirect fails after a failed login and proper variable initialisation 2006-05-24 20:54:59 +00:00
skodak 146132bffc fixed bug #5562 I hope 2006-05-24 18:55:41 +00:00
gbateson 331c6f4620 fixed typos in $string['configshowtimes'] 2006-05-24 11:22:07 +00:00
toyomoyo ed501d3e98 added a rsstitle field 2006-05-24 07:01:33 +00:00
toyomoyo d2780b2594 added rsstitletemplate field 2006-05-24 06:14:16 +00:00
toyomoyo 3054f2faf2 renaming reads and writes to statsreads and statswrites 2006-05-24 05:02:09 +00:00
vyshane 3c0fd35102 Fix for undefined property notice when cron.php is run. 2006-05-24 03:06:16 +00:00
stronk7 67e55d7e0b Solving one SQL error in data_get_participants()
plus some improved readability.
2006-05-23 22:30:58 +00:00
stronk7 5b0d565bcd course_modules->deleted and user->guid are now out.
(they disappeared from DB ages ago)
2006-05-23 22:04:50 +00:00
skodak ade83600e1 fix for printing of multiple group pictures bug #5548 2006-05-23 19:16:04 +00:00
skodak b87862b89a fixed bug #5593 - logged in nested in <p> and <div> 2006-05-23 18:58:37 +00:00
skodak 30faf003ba fixed file backup and converted other forgotten "assignments" 2006-05-23 18:37:05 +00:00
skodak c9a53bb206 fixed broken SQL that was throwing errors in backup 2006-05-23 18:14:56 +00:00
skodak 6fb6c9d960 fixed bug 5594 - can not save group details 2006-05-23 17:59:19 +00:00
skodak 5d502dc3e4 fixed warning 2006-05-23 13:32:43 +00:00
skodak 30d36e2f3e fixed incorrect output buffer use - bug #5590 2006-05-23 10:54:43 +00:00
skodak 989e230b3d fixed RSS feeds warning bug #5591 2006-05-23 10:24:40 +00:00
skodak f45b5a05c0 make sure variables are properly cleaned 2006-05-23 09:46:56 +00:00
skodak 48cd99809d proper initialisation of $oldquestionid 2006-05-23 09:31:04 +00:00
skodak 6ebca3c77e removed reliance on register globals 2006-05-23 09:10:23 +00:00
skodak 2e311d898c extra cleaning of variables 2006-05-23 09:00:58 +00:00
stronk7 a87bbde1a1 Allowing also numbers and underscores in sessioncookie.
Merged from MOODLE_15_STABLE
2006-05-22 17:54:13 +00:00
skodak 71777355b1 fixed register globals issues for $sort SC #256 2006-05-22 16:51:56 +00:00
tjhunt 01d50616ee Fix for Bug #5588 - Editing a question after sorting leads to an error. 2006-05-22 15:42:42 +00:00
skodak d44136dee7 fixed bug #5578 - remove login as button for other teachers in course 2006-05-22 13:14:14 +00:00
tjhunt 5c9fe50894 Fix an undefined variable notice. 2006-05-22 13:04:17 +00:00
tjhunt e620c033cb Fix an undefined variable notice. 2006-05-22 11:19:32 +00:00
nfreear d3b5c5f081 Ongoing, fix bug 5400, navbar/breadcrumb TABLE to DIV, to improve semantics. 2006-05-22 09:11:10 +00:00
skodak 6936ef91df fixed bug #5572 missing PARAM_CLEAN 2006-05-22 05:59:06 +00:00
toyomoyo 3f94709321 fix for 5551, can not edit post when set to 1 discussion 2006-05-22 02:38:11 +00:00
gbateson 6428434a5f fixed typo: clck -> click 2006-05-22 00:21:00 +00:00
gbateson 9bb14972af modified CVS URLs to start http://moodle.cvs.sourceforge.net 2006-05-22 00:19:51 +00:00
gbateson 01f3128264 Give Up button modified to send results and set status to abandoned. Microincrement version to 2006052200 (release = v2.1.20) 2006-05-22 00:07:33 +00:00
skodak 3e55705455 fixed register globals issue with $loginasguest 2006-05-21 20:50:50 +00:00
skodak 889209d1fa fixed redirection to https:// for edit profile and change password when loginhttps on 2006-05-21 20:34:31 +00:00
skodak efc346b5ca temporary workaround for bug #5534, html editor now disabled for IE when loginhttps on and wwwroot starts with http:// 2006-05-21 20:20:45 +00:00
skodak 5eb64d447e removed isset 2006-05-21 10:10:54 +00:00
skodak 9446d15749 fixed register globals issue with $text 2006-05-21 08:08:48 +00:00
skodak dc28278d18 proper initialisation of passwordchangeurl 2006-05-21 07:50:21 +00:00
skodak d04f1621e8 proper initialisation of sqlsortkey SC#258 2006-05-21 07:42:05 +00:00
koenr ef38765d91 adding missing </p> and one point 2006-05-20 19:14:13 +00:00
skodak 7c3c8b7249 fixed register globals issues in course/search.php 2006-05-20 18:39:48 +00:00
skodak eb676fdf9a proper initialisation of $focus SC#257 2006-05-20 18:18:30 +00:00
skodak bf55369e5d do not show pending courses button for nonadmins bug #5564 2006-05-20 18:07:25 +00:00
skodak 56a6a9ff49 fixed cleaning of path in custom scripts SC#221 2006-05-20 17:21:44 +00:00
stronk7 91e4976c08 Bump to Beta5 2006-05-20 00:10:13 +00:00
skodak 299560a9fc fixed block width calculation 2006-05-19 21:00:28 +00:00
skodak 23cb8a304c submission in post.php cleanup, fixes for bugs #5530, #5484 and SC#252 2006-05-19 20:15:44 +00:00
skodak 9c71eb42b8 fixed - disabled autologinguest not always respected in require_login() SC#255 2006-05-19 19:10:19 +00:00
nfreear f642809590 Ongoing, fix bug 5400, DIV to H1, to improve semantics. 2006-05-19 13:24:48 +00:00
nfreear 3edb646260 Fix bug 5434 - hardcoded missing Alt text, with a warning comment. 2006-05-19 10:29:08 +00:00
vyshane 7828580904 Fix for Bug #5541 2006-05-19 06:23:16 +00:00
mark-nielsen 2711fbb039 [BugFix] Bug #5405 - made a new function that grades a lesson for a specific user's attempt. This is then used for grad
ing lessons at the end of a lesson, for ongoing score feature and for updating the grade for essay question grading.

This new grading algorithm now enforces the lesson setting Max attempts when custom scoring is turned Off

Changed the reporting of minquestions setting to match the help file.  Now it is question based instead of attempt based
.

Changed the reporting of ongoing score to use the new grade function.
2006-05-19 00:59:22 +00:00
mark-nielsen d226adef8b [BugFix] Bug #5405 - made a new function that grades a lesson for a specific user's attempt. This is then used for grad
ing lessons at the end of a lesson, for ongoing score feature and for updating the grade for essay question grading.

This new grading algorithm now enforces the lesson setting Max attempts when custom scoring is turned Off

Changed the reporting of minquestions setting to match the help file.  Now it is question based instead of attempt based
.

Changed the reporting of ongoing score to use the new grade function.
2006-05-19 00:54:15 +00:00
skodak 88aba6189b deprecated nvl() function similar to optional_variable() - fixed missing global $CFG 2006-05-18 22:10:40 +00:00
skodak e371190c10 deprecated nvl() function similar to optional_variable() 2006-05-18 22:09:25 +00:00
dwoolhead dd3b147a87 Bug 5536 Replaced references to hide by show 2006-05-18 16:10:33 +00:00
ethem 653c70a063 Removed </td>. Help button appears on top :))
Merged from HEAD
2006-05-18 10:04:42 +00:00
ethem bb75ef114c I have just found a cute function called print_checkbox. :)
Merged from HEAD.
2006-05-18 07:58:54 +00:00
skodak f220d982f2 fixed bug #5533, could not choose from file root 2006-05-18 05:46:58 +00:00
martinlanghoff 1db555e84d login: Changing passwords now works when logged in as guest 2006-05-18 00:53:08 +00:00
skodak 2c97ca5d59 admins can now edit user images even when $CFG->disableuserimages = true; see bug #5494 and SC#253 2006-05-17 18:57:18 +00:00
skodak 4a1f1588f0 fixed version number 2006-05-17 18:15:43 +00:00
skodak 2b5c23c82b fixed some warnings and removed ugly hack error_reporting(E_ALL ^ E_NOTICE); that was only hiding warnings in this and other code
I am going to watch forums and bug tracker and fix any other problems that may surface before the release
2006-05-17 18:05:28 +00:00
tjhunt e1b8eb512c Convert tabs to spaces in files where there were only a few rogue tabs. 2006-05-17 16:37:14 +00:00
exe-cutor fca3ef18aa Removed all tabs 2006-05-17 12:37:13 +00:00
exe-cutor d2c77a0dc0 Fixed some typos 2006-05-17 12:33:01 +00:00
tjhunt f76e87652c Fix URL syntax error when slasharguments is off. 2006-05-17 11:29:31 +00:00
tjhunt 108145970d Fix wrong variable name. 2006-05-17 11:28:59 +00:00
ethem d4d1873933 action.php renamed to authorizenetlib.php 2006-05-17 08:12:41 +00:00
martinlanghoff 52a85b5475 moodle16cleanup: lib/db correct prefix, patch by Tim Hunt for bug 5515 2006-05-17 06:26:32 +00:00
martinlanghoff 6f1c69ec02 mod/choice mod/lesson mod/scorm moodle16cleanup: Added notification
for cleanup that may fail if one is starting fresh from moodle 1.5.3+,
previous cleanup before 1.5.3 is not needed
2006-05-17 06:25:46 +00:00
martinlanghoff f184d1610b moodle16cleanup: mod/forum correctly dropping the constraint, so it does
not report an error during upgrade
2006-05-17 06:25:20 +00:00
martinlanghoff 7832d94156 moodle16cleanup: mod/quiz correctly sync the constraints and indexes
which was not changed when it was moved from quiz module to question lib
2006-05-17 06:24:59 +00:00
martinlanghoff 289b648803 moodle16cleanup: mod/quiz uniqueid does not exists, taking upgrade script
from mysql.php ver 2005070202. dropping some unused tables during the
transition from quiz to question lib
2006-05-17 06:24:28 +00:00
martinlanghoff c86c9b30c5 moodle16cleanup: lib/db correctly put the default values, change the
length of log_display.module which is just 20 chars on postgres7.sql
2006-05-17 06:20:52 +00:00
martinlanghoff a722923c62 moodle16cleanup: backup/ set the correct column datatype and default value 2006-05-17 06:20:37 +00:00
martinlanghoff ae3f15fac1 moodle16cleanup: blocks/rss_client set the correct column default value 2006-05-17 06:20:09 +00:00
martinlanghoff d5b0187a32 moodle16cleanup: enrol/authorize not null set which is similar to mysql
and that was upgraded on postgres7.php
2006-05-17 06:19:50 +00:00
martinlanghoff 100aa1d7be moodle16cleanup: mod/hotpot set the correct column datatype and default
value
2006-05-17 06:19:34 +00:00
martinlanghoff 4ff35d69bc moodle16cleanup: mod/lesson drop unused table lesson_essay, set the
correct column datatype and default value
2006-05-17 06:19:17 +00:00
martinlanghoff ec29c403be moodle16cleanup: mod/dialog we need to drop some more dialog module tables 2006-05-17 06:18:43 +00:00
martinlanghoff a576feacb8 moodle16cleanup: mod/scorm drop a weird check constraint that is showing
up after upgrade
2006-05-17 06:18:16 +00:00
martinlanghoff 9c44a6972c moodle16cleanup: mod/scrom set the correct defaults and correctly recreate
the new check constraint
2006-05-17 06:17:53 +00:00
martinlanghoff 1ce5928d35 moodle16cleanup: mod/scorm version column should not be dropped, it must
exist. it was not upgraded as with mysql.php 2005041600
2006-05-17 06:17:32 +00:00
martinlanghoff 35c30e915e moodle16cleanup: mod/wiki synch upgrade script and .sql with mysql
counterpart, drop the not null constraint to sync with postgres7.sql
2006-05-17 06:17:06 +00:00
martinlanghoff f59139d640 moodle16cleanup: mod/forum added notification message 2006-05-17 06:15:48 +00:00
martinlanghoff b4bdcbe535 blocklib: cache (and used cached) block instances properly in $pageblocks
Now blocks_have_content() caches instantiated block objects inside $pageblocks
and blocks_print_blocks() uses them if available. This behaviour now matches
the documentation: blocks instances are created only once, get_content()
may be invoked several times.

A better fix would be to cache the _output_ of the block (the ->content
property) but it may bite us if any block is counting on being called twice.

Discussion at: http://moodle.org/mod/forum/discuss.php?d=45867
2006-05-17 04:51:12 +00:00
skodak b6d175eeb7 I hope this is the last patch for header already printed trouble in error() and redirect() 2006-05-16 20:29:20 +00:00
ethem a7084ab10b confirm_sesskey() implementation for capture,delete,refund and void. I hope it works. :)
Merged from HEAD.
2006-05-16 15:37:06 +00:00
ethem 6a4c28904a Allow showing error message when insert_record fails. 2006-05-16 15:00:08 +00:00
ethem d0e1fd06c5 Manual capture settings for sending email: cron=enabled, an_review=checked, an_capture_day=0, an_emailexpired=1-5
merged from HEAD
2006-05-16 11:40:00 +00:00
nfreear 287a93580b Fix bug 5477 "Strange 'you are here'...", <span> now <h2> in function print_navigation. 2006-05-16 11:31:50 +00:00
ethem 53fedccb0b (Manual capture settings: cron=enabled, an_review=checked, an_capture_day=0)
Merged from HEAD.
2006-05-16 10:46:55 +00:00
thepurpleblob a08ccf0a61 Added note that export now exports all subcategories. 2006-05-16 09:38:03 +00:00
toyomoyo df8baa04c3 forgot to take out comment 2006-05-16 08:22:03 +00:00
toyomoyo 3b0e0d4df4 fix for 5513 2006-05-16 07:57:54 +00:00
vyshane 250ea6271e Fixed bug #5467. Converted newlines to UNIX format, tabs to spaces and removed
extra newlines at the end of php scripts.
2006-05-16 07:04:05 +00:00
vyshane f356fbe45e Fix for grade_drop_lowest (missed from last fix for bug 5354) 2006-05-16 06:57:08 +00:00
vyshane 37f401637b Fixed Bug #5354 - Gradebook [DropXLowest and Exclude] 2006-05-16 05:49:59 +00:00
mark-nielsen 13f944bc55 [BugFix] Bug 5485 - problem with regular expressions with simple analysis 2006-05-16 03:04:44 +00:00
stronk7 3e21f15895 Updated to latest version (1.56). Bug 5165.
(http://moodle.org/bugs/bug.php?op=show&bugid=5165)
2006-05-15 23:29:13 +00:00
danmarsden fc410020b8 Fixes bug 5464 also makes response clearer to students -see:
http://moodle.org/mod/forum/discuss.php?d=45504

also finishes off Bug 662
2006-05-15 23:21:39 +00:00
mjollnir_ 200460b0c8 mod/quiz/view No-longer display final grade when quiz settings forbid it.
Changed view.php so that it checked if there were any attempts with
concealed grades before printing the student's overall score.
Credit: Peter Bulmer <peter.bulmer@catalyst.net.nz>
2006-05-15 21:51:30 +00:00
skodak d1014faf32 fixed problem when set both loginhttps and https in wwwroot, closes bug #5507 and #3848 2006-05-15 21:32:21 +00:00
gustav_delius b692cb65b7 Answers to essay questions are now saved correctly when navigating to another page, fixing bug 4478 2006-05-15 20:27:04 +00:00
mark-nielsen 3f566d8f2e [BugFix] Bug 5505 - function lesson_print_tree now checks for teacher editing priv before printing editing icons. Had to change arguments for this function as well which is the edit in view.php.
lesson.php how checks for teacher editing priv for all actions except for continue.  This is just in case the user hacks the URL.
2006-05-15 19:05:58 +00:00
stronk7 46beca01b3 Avoid [[namesite]] to appear when ADDING site activities.
I sent this on May 8th! :-(
2006-05-15 17:52:39 +00:00
stronk7 0257c6d6b0 Changing session->data to medium text. Bug 5406.
(http://moodle.org/bugs/bug.php?op=show&bugid=5406)

IMPORTANT: I sent this to CVS on May, 8th and changes have dissapear!
           It could be possible than other commits sent near SF crash
           were affected too!
2006-05-15 17:28:02 +00:00
stronk7 b10192c1e4 Changing session->data to medium text. Bug 5406.
(http://moodle.org/bugs/bug.php?op=show&bugid=5406)

IMPORTANT: I sent this to CVS on May, 8th and changes had dissapear!
           It could be possible than other commits sent near SF crash
           were affected too!
2006-05-15 17:26:38 +00:00
skodak 0772879f24 fix my previous incorrect short tag fix, fixed register globals, IP address used as mail user when not logged in 2006-05-15 15:44:36 +00:00
skodak 5563b4e151 fixed short php tags 2006-05-15 15:10:49 +00:00
skodak ffcce04152 changed cleaning of entry title, now matches handling of forum post titles 2006-05-15 15:03:44 +00:00
skodak b374d60430 better cleaning of post title SC#251 revisited 2006-05-15 14:47:09 +00:00
skodak 848e124eab better cleaning of post title SC#251 2006-05-15 14:31:09 +00:00
exe-cutor a53b09c16b Fixed an inconsistent link 2006-05-15 12:18:40 +00:00
toyomoyo 8374432bdb fix for 5493 2006-05-15 02:58:43 +00:00
toyomoyo 18ab64ef11 tidying up constants 2006-05-15 02:56:56 +00:00
toyomoyo e1b6fbf2eb fix for 4404 2006-05-15 02:25:42 +00:00
toyomoyo a37df0735f fix for 5465 2006-05-15 02:01:54 +00:00
skodak 8b0c3b6551 fixed secure forms handling when POST url contained GET parameters (cookieless mode and some other forms) 2006-05-14 20:57:01 +00:00
skodak 5ee7e12e26 fixed bug #5489 - can not edit file, minor bugfixes and whitespace cleanup 2006-05-14 19:08:34 +00:00
skodak f4aaf2f7b5 fixed whitespace and Id tag 2006-05-14 17:21:02 +00:00
skodak c385f70296 I hope final fix for warnings when using error() after print_header() with buffering on, solution was to flush all buffers and reenable SID rewrite when needed. 2006-05-14 17:10:35 +00:00
gbateson 00fe4b8045 microincrement version number to v2.1.19 2006-05-14 08:34:23 +00:00
gustav_delius 0472d056f6 Removing obsolete defaults 2006-05-13 17:04:11 +00:00
gustav_delius 07f8831194 Introduce question_attempts table, closing bug 5468
Fixed incorrect check for whether to update state or insert new one in save_question_session()
Deal with manually graded states correctly during regrading
Increase state sequence number during manual grading
Supplied missing userid to quiz_save_best_grade() during manual grading
2006-05-13 16:41:22 +00:00
ethem a7f53e74f6 Fix: Redirect to order details page 10 seconds later, not home page. 2006-05-13 16:14:36 +00:00
gustav_delius 8a6733ead1 Updated comments and made sure teacher preview gets restarted when changes are saved, fixing bug 5478 2006-05-13 10:34:02 +00:00
ethem e5bafac7d2 *** empty log message *** 2006-05-13 08:55:38 +00:00
ethem f101e4f736 Language direction is important. Changed as: <b>AVS Result:</b> $a 2006-05-13 08:51:12 +00:00
thepurpleblob 53b824ef1f Fixes for bugs #5435 - subcategories were not exported and
#5470 - true/false questions not exported due to internal format
change.
2006-05-13 08:47:57 +00:00
ethem 672007443c More readable coding. Now, I understand everything. :) 2006-05-13 08:30:06 +00:00
ethem 1180c98509 Deleting test transactions are not good. They may be in proggress. Let's update WHERE transid<>'0'. 2006-05-13 05:58:17 +00:00
ethem 337f36b459 Fix: Don't show newly created orders prior to 2 minutes.
They may be still in proggress and these aren't test transacions(transid=0).
We check timecreated field to prevent this.
2006-05-12 19:48:42 +00:00
ethem be1ed90464 Fix: Delete test transactions before update status as AN_STATUS_AUTHCAPTURE. 2006-05-12 18:32:02 +00:00
ethem 55c0d5b8a4 Status: 'New' string. Merged from HEAD. 2006-05-12 17:23:59 +00:00
stronk7 aa912c49e2 Changing session->data to medium text. Bug 5406.
(http://moodle.org/bugs/bug.php?op=show&bugid=5406)
2006-05-08 16:36:40 +00:00
nfreear 8abfee6962 Fixes bug 5412 "Recent Activity block, New Users, markup should be a list" - style and lib.php: print_recent_activity. 2006-05-08 11:24:35 +00:00
thepurpleblob f1068df6c6 Moved some category functions back to questionlib. Original move
caused all sorts of problems.
2006-05-08 10:40:42 +00:00
thepurpleblob 3b438e0db9 Moved some of the category functions back here. Caused much
more grief than I anticipated.
2006-05-08 10:38:03 +00:00
toyomoyo 6d699a924d fix for 5438 2006-05-08 07:07:51 +00:00
vyshane f6de1e03d7 Fix for Bug #5441. Typo was causing an undefined variable notice. 2006-05-08 03:53:49 +00:00
vyshane 0416a3be25 Changed field length to 20 for module field in log table (Bug #5419). 2006-05-08 03:07:27 +00:00
moodler 1e4f7f125b Updated hints about stable versions 2006-05-08 01:47:25 +00:00
stronk7 1b2472e584 glossary print view is now valid XHTML. 2006-05-07 10:48:10 +00:00
stronk7 51aca6a92f Now, when a single forum is restored and no user data was created,
the initial discussion/post is automatically generated. Bug 5418.
(http://moodle.org/bugs/bug.php?op=show&bugid=5418)

Merged from MOODLE_15_STABLE
2006-05-06 16:55:38 +00:00
ethem 04803a039d Admin can setup which credit card types will be accepted. 2006-05-05 18:25:03 +00:00
ethem 8d101bc522 Admin can setup which credit card types will be accepted. 2006-05-05 18:09:38 +00:00
stronk7 474c8d3f00 Now the help link in the admin block points to Docs. Bug 4803.
(http://moodle.org/bugs/bug.php?op=show&bugid=4803)
2006-05-05 17:54:59 +00:00
vyshane e48f4e502d Fix for Bug #5419 - Inconsistency between log_display and log tables. 2006-05-05 08:01:27 +00:00
toyomoyo 00b9ff724b fix for 4478 2006-05-05 06:43:36 +00:00
toyomoyo d5be1194cb fix for 5428 2006-05-05 05:13:12 +00:00
thepurpleblob d3176779c8 htmlentities() replaced by s() 2006-05-04 11:15:11 +00:00
stronk7 8e4485c69b Anything against the ISO-8859-1 word? 2006-05-04 10:38:17 +00:00
toyomoyo e565767d24 fix for 5426, inconsistent prefixes, and lengthened some index to varchar(100) during migration 2006-05-04 09:36:32 +00:00
ethem aca29171b4 Enable 'Authorize.net plugin' and setup cron properly; or uncheck an_review again. 2006-05-04 08:15:29 +00:00
toyomoyo 1710f639ae fix for 3644 2006-05-04 06:56:24 +00:00
moodler 711d6de23f Whoops, proper merge now 2006-05-04 05:47:27 +00:00
moodler fdee3caacb Merged fixes from stable 2006-05-04 04:42:18 +00:00
vyshane 0c19b8fd99 Fix for Bug #4805 2006-05-04 04:25:22 +00:00
toyomoyo 1bad990a14 fix for 5417 2006-05-04 02:22:37 +00:00
stronk7 155a4e17a2 Now more quiz actions are restored properly:
-preview
 -start attempt
 -close attempt
 -continue attempt (too long. See Bug 5419)
Bug 5122
(http://moodle.org/bugs/bug.php?op=show&bugid=5122)
2006-05-03 23:45:55 +00:00
stronk7 11a5d6c147 Fixing some non-production values I left after testing.
Thanks James!
2006-05-03 22:03:06 +00:00
stronk7 ca5b6b6506 XHTML validation. Bug 5332.
(http://moodle.org/bugs/bug.php?op=show&bugid=5332)
2006-05-03 18:20:09 +00:00
urs_hunkler d0fcd925f9 patch: 2 if propertyIsEnumerable blocks added to make HTMLeditor work with the prototype AJAX library 2006-05-03 18:14:42 +00:00
stronk7 b985f62858 1.6 compliance added
Merged from HEAD
2006-05-03 17:57:26 +00:00
stronk7 e793cddc22 Solving some changes in course-view and sections... 2006-05-03 17:47:29 +00:00
andreabix ad293d8bd3 1.6 compliance added 2006-05-03 17:28:18 +00:00
ethem a7c3596182 First authorize backup library for version 1.7 2006-05-03 17:09:52 +00:00
stronk7 c01fdc543e Merging from MOODLE_16_STABLE wow!!!! 2006-05-03 16:37:37 +00:00
moodler 44d57cc35a Updated version for Moodle 1.7 dev 2006-05-03 15:32:41 +00:00
moodler be01f6239e Old checkin that got missed 2006-05-03 14:24:41 +00:00
thepurpleblob f6beb499b6 Now includes question/editlib.php
NOTE: This might well be the wrong thing to do and need
backed out, but until I hear otherwise it gets quiz working again!!
2006-05-03 12:27:06 +00:00
moodler 418db328a0 Fixed: Bug #5164 - Assignment email lacks student name 2006-05-03 08:19:53 +00:00
toyomoyo 3925a20afe fix for 5409 2006-05-03 08:05:58 +00:00
mjollnir_ d57cf4c132 question/type/qtype hide scores when requested by teacher
Changed question/type/questiontype.php such that when review.php
displays a state-by-state review of answers submitted,
scores are not displayed unless allowed by quiz options.

Credit: Peter Bulmer <peter.bulmer@catalyst.net.nz>
2006-05-03 02:44:25 +00:00
moodler c4292470ba Add a warning when trying to restore a pre-1.6 backup on a
1.6 Unicode Moodle, with a link to the docs.
2006-05-03 02:00:32 +00:00
mits e9ac3bd4c0 fixed based on standard theme. 2006-05-02 18:52:13 +00:00
mark-nielsen 432c2219f5 [BugFix] Bug #5396 - Found that the css float was causing the odd problem. Removed extra styles for the button layout and changed the divs around the buttons to spans
Also improved some logic in the button processing for branch tables
2006-05-02 17:05:29 +00:00
stronk7 e6af2cad22 Added two new functions: set_column() and set_row()
(http://moodle.org/mod/forum/discuss.php?d=44634)
2006-05-02 15:28:02 +00:00
thepurpleblob 4267f47b49 Changed require due to moved category functions 2006-05-02 15:23:48 +00:00
stronk7 a167667798 Adding back some recently deleted styles related with the IMS-CP resource.
It seems that the latest commit (merge) deleted a bunch of styles!!!!
(notified by email to commiter)
2006-05-02 14:59:17 +00:00
nfreear 06742c425b Fix ongoing, bug 5400, "Accessibility modifications not propagated to themes" (OU-Bugz: 1006) 2006-05-02 14:44:28 +00:00
nfreear c7ae8c5da7 Fix ongoing, bug 5400, "Accessibility modifications not propagated to themes". 2006-05-02 14:32:39 +00:00
thepurpleblob 9c802dff19 Bunch of category functions moved to question/editlib.php 2006-05-02 12:26:36 +00:00
thepurpleblob 4fbfd9711c Bunch of category functions moved from lib/questionlib.php 2006-05-02 12:26:03 +00:00
thepurpleblob 947217d725 Small clean up, and fix a link to a required file for robustness. 2006-05-02 09:04:38 +00:00
gustav_delius 3b62b2ba13 Fixed column names. Thanks Jean-Michel. See bug 5262 2006-05-02 08:37:46 +00:00
toyomoyo f0edf8c274 manual merge from stable 2006-05-02 07:57:20 +00:00
moodler 152a90601b Merged fixes from stable (undoing category visibility changes) 2006-05-02 07:56:25 +00:00
ethem df4ba5a1b9 1 - adminhelpcapture & adminhelpreview strings removed from enrol_authorize.php
2 - captureday.html & review.html files added to help/enrol/authorize
2006-05-02 07:13:15 +00:00
moodler acfc768e3e COnverted from DOS format 2006-05-02 06:00:35 +00:00
martinlanghoff 274f009184 mod/chat - fix another instance where empty $USER->lastIP was affecting us
The original commit was:

mod/chat - use empty value instead of erroring out if $USER->lastIP and getremoteaddr() don't yield any interesting value

Sometimes we can't get any useful IP for the user -- and this may even be a
valid situation. So fudge an empty value -- the DB needs it as the IP field
is NOT NULL.
2006-05-02 05:20:35 +00:00
gbateson 2cea2a74b4 fixed handling of square brackets in JCloze on older PHP sites. Micro-increment version to 2006050200 (v2.1.19) 2006-05-02 05:18:01 +00:00
toyomoyo 92a019ac04 added logging for blog views 2006-05-02 02:44:35 +00:00
stronk7 10d89cf1d1 Now, hidden courses that haven't been modified in the last month
are skipped by the scheduled backup. Credit goes to James. Bug 4694.
(http://moodle.org/bugs/bug.php?op=show&bugid=4694)
2006-05-01 23:26:12 +00:00
stronk7 e3ba25b4c0 New string for scheduled backups... 2006-05-01 23:23:59 +00:00
stronk7 bb4a5741d1 Isolating debug and perfdebug behaviours...now
each one controls its own output.
2006-05-01 23:16:48 +00:00
gustav_delius 0c1e3a145f Changing the category on the import or export page also changes it on the question edit page, closing bug 5348 again 2006-05-01 22:26:06 +00:00
skodak aaeaa4b007 fixed alternative salt index range - now allowed 1...20 2006-05-01 21:32:49 +00:00
skodak 6d706916bd double header in error() workaround 2006-05-01 21:31:12 +00:00
michaelpenne 02f071d147 lesson_default table had become out of synch with the lesson table. Needed to add new columns.
Updated backup and restore to include the new values

Fixed a bug in restore where it would restore 1 lesson_default per lesson.  Now only stores one per course.

Went through all the backuplib.php, restorelib.php, mysql.sql and postgres7.sql to make sure everything was in synch and being backed up and restored.
2006-05-01 19:02:38 +00:00
paca70 e7226b2bc8 Removed comma 2006-05-01 12:56:57 +00:00
toyomoyo 332135efd0 fix for 5386 2006-05-01 07:49:28 +00:00
thepurpleblob 6e5a360ad1 Question object not always initialised. Bug #5369 2006-05-01 07:35:33 +00:00
toyomoyo e44f4173b7 fix for 5003, 5302 2006-05-01 06:56:38 +00:00
toyomoyo 14148bc2db fixing blog logs, also added code to prevent browsing blogs using other user's userid 2006-05-01 06:23:41 +00:00
moodler bd7be234ee FIxed blog log URLs 2006-05-01 06:04:22 +00:00
toyomoyo b13ee30ead fix for 5385 2006-05-01 05:33:47 +00:00
toyomoyo 351576e4df fix for 5384, added a link for tags in the blog_menu block 2006-05-01 03:53:16 +00:00
moodler 90fcfc0ada Fixed some blog styles 2006-05-01 03:41:40 +00:00
moodler dd0863ddf4 Fixed links on blog pages 2006-05-01 03:34:51 +00:00
moodler b0bc8e3008 More little fixes to links and headers 2006-05-01 03:30:55 +00:00
moodler 44fdf0f301 Some typos 2006-05-01 03:25:07 +00:00
moodler 37610bf9dd FIxed some headers 2006-05-01 03:24:05 +00:00
toyomoyo 5a50c2b2f4 replacing hardcoded url with $CFG->wwwroot 2006-05-01 03:19:13 +00:00
moodler 83fb561f0c Cleaning up the header a bit 2006-05-01 03:12:17 +00:00
moodler 6279c33fbd Some fixes for the links in the blog tags block 2006-05-01 03:11:45 +00:00
mark-nielsen 53354ec03c Due to changes in Quiz which allows commenting and manual grading of all question types, essay no longer needs its two tables: question_essay and question_essay_states
backuplib.php removed backup code related to question_essay_states
type/essay/db/mysql.sql and postgres7.sql removed all SQL
type/essay/display.html improved essay display
type/essay/questiontype.php, editquestion.php, and editquestion.html removed all uses
of the two tables - this resulted in a great simplification of the essay question type
2006-05-01 02:56:06 +00:00
toyomoyo 116bd4ec0d changes made to accomodate adodb_logsql table. bug 5003 2006-05-01 02:42:36 +00:00
toyomoyo 8d92d7ad71 info column is missing a key 2006-05-01 02:34:29 +00:00
moodler 82c8137db9 Added css for blog class audience 2006-05-01 02:21:39 +00:00
moodler 776d8f1581 Moved blog_tags block styles to the block itself 2006-05-01 02:01:37 +00:00
moodler 7fdc360c1e New style for blog audience info 2006-05-01 02:00:06 +00:00
skodak 4908ad3ebf added optional salting of user passwords stored in internal table - first part; admin UI and docs coming soon (SC#236) 2006-04-30 21:02:28 +00:00
urs_hunkler df74830cfd cleaned and enhanced CSS for quiz 2006-04-30 17:39:58 +00:00
urs_hunkler 43015b3b6a cleaned and enhanced CSS for questions 2006-04-30 17:39:02 +00:00
gustav_delius 7d042862c8 Warning strings for missing questions or question types. Misprint in string name fixed. 2006-04-30 17:33:30 +00:00
gustav_delius 2b44d03f81 Error message for when a questiontype is missing is prepended to question text. 2006-04-30 17:33:00 +00:00
gustav_delius f57c624262 Use the missingtype question type to print the explanation message when a random question is missing 2006-04-30 17:31:33 +00:00
gustav_delius 2be604b665 Missingtype now also works without notices when the missing question has no answers. 2006-04-30 17:30:22 +00:00
gustav_delius ed28abca24 Don't throw a php error when there are no question answers in the default question type. 2006-04-30 17:13:44 +00:00
gustav_delius 4572d78f71 When a teacher deletes a question that was already used as a random question in a quiz the student now gets a useful message about the fact rather than just a php error. 2006-04-30 16:59:23 +00:00
gustav_delius 28a8ec9148 Make sure that the newgraded field always points to a valid state. 2006-04-30 16:23:55 +00:00
gustav_delius 2e9b6d157c Fixed bug 5192 2006-04-30 16:15:04 +00:00
gustav_delius 1a1293edd7 Making sure grading and feedback use the same way of testing responses, thanks to Joseph, bug 5134 2006-04-30 15:11:13 +00:00
gustav_delius b518c69e3b Question preview now handles duplicate responses properly 2006-04-30 12:07:08 +00:00
gustav_delius ca56222d50 Fixed and simplified the logic in the response processing. Remove the walking through previous graded states. 2006-04-30 11:45:14 +00:00
stronk7 f84b602b44 Too much restrictive optional_param was producing
some undesired efects with formats. Bug 4858.
(http://moodle.org/bugs/bug.php?op=show&bugid=4858)

Merged from MOODLE_15_STABLE
2006-04-30 10:07:36 +00:00
stronk7 60b5242a53 entrylist format now show the 'send ratings' button. Bug 4915.
(http://moodle.org/bugs/bug.php?op=show&bugid=4915)
2006-04-30 09:41:19 +00:00
gustav_delius c4c11af898 Now that the shuffling within a question can be controlled also at question level the default at the module level needs to be set to true, otherwise people can not test the question setting. 2006-04-30 08:11:49 +00:00
gustav_delius 7a38b61bfa Fixing empty lines 2006-04-29 20:01:27 +00:00
gustav_delius 26f6d51c88 Fixed empty lines 2006-04-29 19:52:44 +00:00
gustav_delius a159b825a3 Fixed empty lines 2006-04-29 19:46:41 +00:00
gustav_delius 99dc4f381c Removed empty lines 2006-04-29 19:36:56 +00:00
stronk7 d639dbf762 Some more table/form mixed things remains in two forms. The rest
validates OK now. Bug 5371 created for the validation problem!
(http://moodle.org/bugs/bug.php?op=show&bugid=5371)
2006-04-29 16:39:02 +00:00
stronk7 954ec82fd0 body and html close were being printed twice! Number of XHTML
errors highly reduced by the form-table mix remains...
2006-04-29 15:54:52 +00:00
stronk7 755a1c4b02 XHTML closing some input tags. But this page doesn't validate at
all because the table/form intermixed tags!
2006-04-29 15:40:46 +00:00
stronk7 85e20335a6 Avoid [[namesite]] to appear when editing site activities. Bug 5370.
(http://moodle.org/bugs/bug.php?op=show&bugid=5370)
2006-04-29 15:13:31 +00:00
stronk7 97cc77e090 Initial revision 2006-04-29 12:22:58 +00:00
mark-nielsen be1af5b770 Moved the require login and isteacher checks to infront of the form data processing 2006-04-29 07:37:52 +00:00
mark-nielsen 6cd88ca593 REMOVED: This feature is no longer in the lesson settings screen. This functionality has moved to report.php 2006-04-29 01:42:28 +00:00
mark-nielsen fe9588b971 Deleted lang entry for Deleting student attempts in the lesson settings page. This functionality has been moved to report.php 2006-04-29 01:40:18 +00:00
mark-nielsen 31eb5b5335 [Removed] the Delete user attempts option in the Lesson settings (changes to mod and lib)
[Added] new functionality to report.php to delete individual student attempts
[Fixed] High scores text in view.php when no high scores were recorded needed to be centered
2006-04-29 01:37:50 +00:00
stronk7 062a84a62a Columns cannot be null anymore. Bug 5343.
(http://moodle.org/bugs/bug.php?op=show&bugid=5343)

Please document it in coding guidelines!!!
2006-04-28 23:42:12 +00:00
stronk7 2ce22ad858 Bump to beta4! ;-) 2006-04-28 17:57:46 +00:00
stronk7 e857af01f8 No need to display the iframe because now it's never hidden. 2006-04-28 13:18:49 +00:00
gustav_delius 3f13e16094 Removed the answershuffle field from the random short answer question because in a random question this options is irrelevant. 2006-04-28 09:44:13 +00:00
gustav_delius 4ff35ad41e Small improvement to help files 2006-04-28 09:43:19 +00:00
thepurpleblob c515fcf73e Removed mystery (probably diagnostic) message 2006-04-28 09:39:13 +00:00
thepurpleblob a9b16aff8d Now ignore hidden questions. Bug #4988 2006-04-28 09:36:17 +00:00
gustav_delius b59126298d Just a small comment to avoid problems in the future 2006-04-28 09:34:33 +00:00
ethem 0168503ab2 Direct access to this script is forbidden. 2006-04-28 07:20:25 +00:00
toyomoyo 993763bf17 1.6 Beta 4! 2006-04-28 05:54:27 +00:00
toyomoyo 0327c40abb bug fix for 5303. hope i didn't break anything >_< 2006-04-28 03:18:56 +00:00
moodler 92718cce32 Make sure we can see all installed languages regardless of langlist 2006-04-28 02:29:36 +00:00
gbateson e5d1941db7 set negative values to 0, on unsigned numeric fields 2006-04-28 02:11:52 +00:00
gbateson c9441e34ca allow negative score and weighting in hotpot_responses table 2006-04-28 02:06:58 +00:00
toyomoyo 008060c43e fix for 5305 2006-04-28 01:55:12 +00:00
gbateson 8955d22ac6 optimization fo the removal of orphan records 2006-04-28 01:37:17 +00:00
gbateson 9f02edcad8 small fix for the removal of orphan records 2006-04-28 01:20:05 +00:00
gbateson 340a5808e9 fix undefined variable $db 2006-04-28 00:59:57 +00:00
gbateson 192e8f6650 remove orphans records, if any, from hotpot tables, reduce size of "score" and "weighting" fields in "hotpot_responses" table, and set default value on ALL string fields in HotPot tables. New version number is 2006042800 (v2.1.18) 2006-04-28 00:56:14 +00:00
mjollnir_ 88a6724534 Fixing missing global in quiz pg upgrade 2006-04-27 23:25:06 +00:00
patrickslee 83e8edb463 Fixed wrong encoding detection logic in install.php 2006-04-27 23:17:25 +00:00
stronk7 81c2aa8051 Checking one table and one column that, uder some servers didn't get
correctly upgraded. Bug 5321. PG need testing!
(http://moodle.org/bugs/bug.php?op=show&bugid=5321)
2006-04-27 22:56:25 +00:00
skodak d154ed0cf4 fixed bug #4189 - visible not changed 2006-04-27 21:35:02 +00:00
skodak 8f414ab8aa fixed some long standing and some new problems and SC#249, please consider backporting into STABLE 2006-04-27 21:30:18 +00:00
gbateson 55b2126228 force remaining NULL fields into NOT NULL '0'/'' 2006-04-27 21:22:43 +00:00
skodak 7d32e9ded0 fixed bug #5298, missing string 'importfromothercourses' 2006-04-27 20:27:20 +00:00
skodak b4a93f74bf fixed marker handling, no sesskey error anymore - bug #5340 2006-04-27 20:06:41 +00:00
stronk7 7071d6d908 Deleted a bunch of js code and trying another (the last) way
to resize the iframe properly. Tests at home 100% reliable.
I hope it'll work ok remotely... Depending of results  we'll
decide the final system.
2006-04-27 19:45:00 +00:00
mark-nielsen 718dbada67 [Fix] Notices were being printed in PHP5 for NULL objects. Checking for NULL now before using in multichoice and truefalse questions 2006-04-27 16:48:38 +00:00
mark-nielsen 066c0af9bf [Fix] Error with PHP5. Needed to clone the lesson object before saving the $default object 2006-04-27 16:20:55 +00:00
nfreear b656d9226c Subtle fix to style-selectors/ background colours
- Bug 5161 "Course format weekscss looks unfinished".
2006-04-27 16:03:24 +00:00
ethem ee80cc094c lib.php : restore & backup functions removed. 2006-04-27 15:48:55 +00:00
ethem 53bf37b4f6 Backup library. 2006-04-27 13:41:53 +00:00
gbateson 530cd21dc2 Fix "data truncated errors" by setting set NULL values in int field to 0 before changing to NOT NULL DEFAULT 0 2006-04-27 08:45:34 +00:00
vyshane a42ca12218 Fix for Bug #5346. 2006-04-27 07:52:40 +00:00
gustav_delius 125bb7003e sortorder is now remembered between pages, fixing bug 5328 2006-04-27 07:46:34 +00:00
gustav_delius 239d373ff9 Had to change attribute of select tag from disabled to readonly in order to get the feedback popups to work, see bug 5338 2006-04-27 07:21:55 +00:00
gustav_delius a60a7b0d21 Fixing filtering of category names, now using PARAM_NOTAGS. Fixing bug 5349 2006-04-27 06:55:38 +00:00
gustav_delius dc454ef428 question category is not remembered correctly by import and export pages, fixing bug 5348 2006-04-27 06:42:10 +00:00
toyomoyo 7396321249 fix for 4976 2006-04-27 04:12:58 +00:00
vyshane 137624c78d Fix for Bug #5022 - Hidden resource/activity modules still show up in jump
menu. Forced course catch rebuild if a module is hidden or shown.
2006-04-27 03:31:10 +00:00
toyomoyo f69f1b498a trying to fix bug 5266 2006-04-27 02:34:16 +00:00
stronk7 d8606dc543 Defining width and height seems to improve resizing
behaviour under some browsers (source: some blogs)
It also helps when resize doesn't work, defaulting
to a nice size.
2006-04-26 22:18:47 +00:00
skodak eac8ac87c7 fixed notice and corrected the use of new s() and p() 2006-04-26 21:25:50 +00:00
skodak 3f73372fe5 fixed warning when no stats data yet 2006-04-26 21:13:45 +00:00
gustav_delius 754d6f1bb3 Corrected location of restorelibpre15.php, see http://moodle.org/mod/forum/discuss.php?d=44156 2006-04-26 20:32:54 +00:00
gustav_delius 50530eb782 The information from question_rqp_types table should not be loaded every time questionlib.php is loaded but only when the questiontype menu is actually needed. 2006-04-26 20:29:32 +00:00
gustav_delius a2c0f03e5e I incorrectly had renamed quiz_ to question_ in some places. 2006-04-26 20:05:21 +00:00
ethem e13958e08b Don't use $courseid in require_login(). User may want to see old orders. Course enrolment is not required. 2006-04-26 17:39:13 +00:00
ethem a37c274b90 Use global parameters in authorize_print_orders(): $courseid & $userid 2006-04-26 17:29:52 +00:00
ethem 71f7797f28 Don't duplicate header. 2006-04-26 17:16:34 +00:00
moodler 6f7d1382eb Just tidying up, and removed the logs link (it's in reports) 2006-04-26 16:09:43 +00:00
moodler 0b0ac96794 Just some tidy-ups 2006-04-26 16:03:16 +00:00
ethem e66012b563 Penny made it this way on purpose, apparently, to make it work properly on Postgresql, so it reverted. 2006-04-26 15:23:01 +00:00
urs_hunkler 8c75d90f8d bug #5347 - JS code after page end??? corrected 2006-04-26 15:00:22 +00:00
nfreear 31d35603ce Fix bug 5345 "Calendar block overflows in 'weekscss' course format." 2006-04-26 13:56:39 +00:00
ethem f506249f70 Merged from MOODLE_15_STABLE. First time install detection. 2006-04-26 12:38:09 +00:00
moodler 0e1baec9a7 Allow colors to the editor 2006-04-26 08:18:42 +00:00
moodler 7c8b82a9a7 Set default value for message_emailformat 2006-04-26 08:17:11 +00:00
toyomoyo 49487025ea just in case message_emailformat is not set 2006-04-26 08:07:12 +00:00
toyomoyo cb24115c8e trying to change all the default NULL fields to NOT NULL default '0'/'', hope i didn't mess up. Please report any bugs asap! 2006-04-26 05:48:04 +00:00
moodler 5ae598c757 Use the fullclone function instead of clone() because objects are in an array bug 5339 2006-04-26 04:40:14 +00:00
moodler 35ca0d6a45 Add a new function fullclone() to forcibly make a complete copy of a structure 2006-04-26 04:39:34 +00:00
gbateson 2e2a27a9bc changed line 10 to: $index = "{$table}_{$field}_idx"; (bug 5315) 2006-04-26 03:26:12 +00:00
gbateson 4f6a57d173 change single quotes to double quotes. Probable fix for bug 5315 2006-04-26 03:07:38 +00:00
vyshane d70d141846 Fix for: Bug #5337 - [[allchanges]] missing
Added allchanges lang string.
2006-04-26 02:48:57 +00:00
stronk7 81c7ef5ada Supresing footer() output in this page because it continues causing
important problems under Safari and I really think it isn't critical
to have it here at all costs.
2006-04-26 00:09:00 +00:00
stronk7 d860c55c84 Handle some debugs properly. 2006-04-25 23:52:42 +00:00
stronk7 d9f9d943b5 Now the deploy-all button works! 2006-04-25 23:47:46 +00:00
martinlanghoff 50fc296d8d auth/cas: dos2unix on index_form.html - bug #5053 2006-04-25 23:15:08 +00:00
stronk7 9fe25ab4f1 Diference between moodle.xml file not found and moodle.xml file
incorrect at restore time. Bug 5334.
(http://moodle.org/bugs/bug.php?op=show&bugid=5334)
2006-04-25 22:55:29 +00:00
martinlanghoff b76169a214 filterlib/filter_phrases() - try to escape magic characters used internally by the filter mechanism -- Bug#5236 / WR#422
This is an attempt to fix filter problems caused by glossary matches on %
(which also affect matches on * and #). Works for the sample cases I have,
but we may be breaking subtly in other places.
2006-04-25 22:47:42 +00:00
mjollnir_ b8a25300b6 Fixing bug #5148: I don't know how this worked for restore and not for import, but it works for both now 2006-04-25 20:47:44 +00:00
stronk7 5adb5b02db And the standard footer is back again. Andrew Walker, the
JavaScript Superman did the work! B-) Tested under FF, IE
and Safari.
2006-04-25 15:44:34 +00:00
stronk7 4d939c7283 Bypass div#footer style in resource view pages to get
all the space avaliable, making an exception in the
global one.
2006-04-25 15:35:39 +00:00
moodler f2dcfac0fd Make these icons transparent 2006-04-25 14:01:13 +00:00
moodler 3131d5c6de Removed overview.php 2006-04-25 13:19:52 +00:00
dwoolhead 38943071f0 With appropriate error reporting, adding a label to a section of a course results in an E_NOTICE message temporarily appearing on the screen, because the module object name property is not set. Prevent message being displayed by checking that property is set before testing its value 2006-04-25 11:48:39 +00:00
stronk7 206548dc4b Apply latest changes from resource type to repository
(double head out, cool resize javascript, XHTML and
navigation menu)

TODO: Fix the 'deploy all' button
2006-04-24 23:55:29 +00:00
stronk7 dc04f6e346 Now navigation menu is properly created (XHTML + 508) 2006-04-24 22:17:10 +00:00
ethem 7dcf558cde Locallib.php can be only used by index.php. 2006-04-24 17:15:13 +00:00
ethem cb845f37ae Put back. String 'returns'&'noreturns' are used only in one order. Not general. 2006-04-24 17:03:42 +00:00
ethem db763a8a91 String 'returns'&'noreturns' added to authorize strings array. (get string fast) 2006-04-24 16:54:59 +00:00
ethem efd0eb0d29 String 'all' added to strings array. 2006-04-24 16:46:39 +00:00
ethem db70762f01 $CFG removed 2006-04-24 16:31:02 +00:00
stronk7 f809df70ce Avoided some notices when one block has been deleted from moodle/blocks
and from blocks admin page and their instances haven't been deleted.

We should build some sort of check to do all the house-cleaning of "orphaned"
blocks, perhaps each time we arrive to the blocks admin page.
2006-04-24 15:01:35 +00:00
stronk7 77ea1a858e In this theme, peformance info only will be showed if it's enabled.
Others seems to bypass this setting if debug is enabled!
2006-04-24 14:32:50 +00:00
vyshane 5f672a4dd8 Fixed inserts for log_display. 2006-04-24 09:05:08 +00:00
vyshane 928a87338d Fixing inserts for log_display. 2006-04-24 09:00:42 +00:00
vyshane c343bc8831 Fixing inserts for log_display table. 2006-04-24 08:55:29 +00:00
vyshane fccaec1f5b Inserts for log_display. 2006-04-24 08:43:29 +00:00
toyomoyo a2655f6527 make some variables global for 5305 2006-04-24 08:38:11 +00:00
vyshane 93642edd6a Fixed inserts for log_display. 2006-04-24 08:38:03 +00:00
vyshane 43e2425857 Fixed log_display inserts. 2006-04-24 08:28:21 +00:00
vyshane 670b1364a0 Fixed inserts for log_display. 2006-04-24 08:26:33 +00:00
vyshane 1b51a8ed9c Fixed inserts for log_display table. 2006-04-24 08:23:19 +00:00
vyshane f53d75517e Fixed inserts for log_display table 2006-04-24 08:11:35 +00:00
toyomoyo f21cc86bca changed formats for log_display table 2006-04-24 08:10:55 +00:00
vyshane cf29432dcd Fixing inserts for log_display table. 2006-04-24 08:09:00 +00:00
vyshane 4dd8464f3d Fixed insert statements for log_display table 2006-04-24 08:02:17 +00:00
toyomoyo 4dca83214b new format for log_display 2006-04-24 08:00:51 +00:00
toyomoyo 7e7d06f30b changing new format for log_display 2006-04-24 07:58:53 +00:00
vyshane cfd2188118 Fixed insert error for log_display 2006-04-24 07:55:06 +00:00
vyshane cfd8facee6 Added primary key definition for log_display 2006-04-24 07:44:27 +00:00
gbateson da6bacb7e2 fix bug 5304 2006-04-24 06:54:44 +00:00
bobopinna bb3af8d431 Added memory to toc's collaps/expand mode 2006-04-24 06:42:45 +00:00
toyomoyo 3dba170e7d adding dropindex and addindex for modified tags table 2006-04-24 06:20:30 +00:00
moodler f4e7407d42 *** empty log message *** 2006-04-24 06:12:32 +00:00
toyomoyo 808f9930b3 adding proper _idx postfix 2006-04-24 06:00:37 +00:00
toyomoyo 31513aa13e changing tags->text to varchar 20, created index on tags(type, userid), and tags(text) 2006-04-24 05:53:06 +00:00
toyomoyo 9fad492eb5 some small fixes, mostly for 5174 2006-04-24 03:36:02 +00:00
moodler ea21c1f460 Fixed bug 5271 - icon tag missing in Upcoming Events block 2006-04-24 03:26:01 +00:00
vyshane 36e6706eb0 Bumped version number for last changes 2006-04-24 02:28:02 +00:00
vyshane 721cb8678d Bug #5254 - live logs
Cleanup for duplicate module/action combinations. Added id field for
log_display table and added an index moduleaction.
2006-04-24 02:24:18 +00:00
toyomoyo 9a7f3cad99 fix for 5205 2006-04-24 02:20:06 +00:00
toyomoyo 4c3b42f7c5 just in case someone has the index elemeny and not element 2006-04-24 02:17:16 +00:00
moodler 8634bc275d Fixed bug 5300 and removed moodle docs link from help pages 2006-04-24 01:58:31 +00:00
gbateson 6774380b24 set default value for varchar 255 fields, to fix "truncated" errors in utf8 migration. Fields affected: hotpot.studentfeedbackurl, hotpot_responses.correct/wrong/ignored 2006-04-24 01:44:08 +00:00
stronk7 b2ff86070d Changed list style for ims-cp to gain some room... 2006-04-24 00:14:20 +00:00
stronk7 b692e95816 Looking much better now! B-)
More tests tomorrow (IE, mainly)
2006-04-24 00:11:59 +00:00
patrickslee 2544a80de1 PostgreSQL 8 compatibility fix for database character set detecting 2006-04-23 23:39:56 +00:00
skodak b96f1ad6d5 fixed typo bug #4527 2006-04-23 23:16:02 +00:00
skodak 69e3c41688 page parameter cleanup 2006-04-23 21:07:44 +00:00
skodak d2b23346c9 block editing now uses PARAM_BOOL 2006-04-23 20:58:06 +00:00
skodak 5d00b3ad99 page parameter cleanup 2006-04-23 20:33:01 +00:00
urs_hunkler 2ca8a6c672 Bug #4315 - Use current_theme() instead of the $CFG-theme 2006-04-23 19:02:17 +00:00
stronk7 25b7cdf308 Finishing with ims cp styles, I think... :-/ 2006-04-23 18:19:50 +00:00
stronk7 0e8d48e9d5 Now the resize script supports both resources with and
without navigation menu.
2006-04-23 17:22:45 +00:00
stronk7 375da10d09 Latest ims cp styles added. 2006-04-23 17:01:06 +00:00
stronk7 57eb7bb905 Styles are now 100% out from here. 2006-04-23 17:00:18 +00:00
gustav_delius 1e7b7003f2 Deal with modules that are missing their language strings 2006-04-23 15:20:26 +00:00
gbateson 3da3e957f9 micro-increment version number to 2006042101 (release = v2.1.16) 2006-04-23 11:55:02 +00:00
gbateson df795ee950 two fixes connected with UTF migration: (i) remove $CFG->prefix from all index names, (ii) force type of "name" field in "hotpot_questions" table to "text" 2006-04-23 11:53:38 +00:00
gbateson ec161357c9 set $result even when $fromenc=="utf-8", to fix "unassigned variable" errors 2006-04-23 11:51:17 +00:00
stronk7 af6f079c3c Moving some harcoded styles in ims cp to standard 2006-04-23 11:49:33 +00:00
gbateson 5320d678e9 type of "name" field in "hotpot_questions" table should be "text" after migrate 2006-04-23 11:48:58 +00:00
stronk7 6a4fa81362 Moving some styles harcoded in the ims cp to standard... 2006-04-23 11:48:50 +00:00
skodak 45c4e0b73d moved php end tag out from comment 2006-04-23 11:45:37 +00:00
skodak 1182171459 moved php end tag from comment revisited 2006-04-23 11:40:25 +00:00
skodak 6550339d39 moved php end tag from comment 2006-04-23 11:37:57 +00:00
skodak 904ee206f1 fixed short tag 2006-04-23 11:32:25 +00:00
stronk7 b3c9d32ae1 Beautify a bit the footer, taking out that horrible standard 100px space! ;-) 2006-04-23 10:58:00 +00:00
ethem 023c3f0ee2 Some indexes were added in 15_STABLE. So, don't show an error message again if indexes are already exist. 2006-04-23 10:15:01 +00:00
stronk7 3f5e294b97 Now the resize script hasn't anymore harcoded widths. 2006-04-23 09:59:04 +00:00
urs_hunkler ffdf8977c9 removed invalid css property 2006-04-23 07:14:45 +00:00
moodler 6c3d3b0a97 DOn't show some notces on new install 2006-04-23 04:45:20 +00:00
stronk7 0a1cf79f5f TOC needs _parent because it's rendered in the iframe. 2006-04-23 02:21:00 +00:00
stronk7 dce3a7cb61 Now double-headers are out 100%
Some incorrect targets are out.
Scorm API (dummy) is working fine.

TODO: Move css styles to standard.
2006-04-23 01:57:02 +00:00
stronk7 282bf4a3f3 Moving script to a proper place (for XHTML validation)
(although the page still continues with some errors)
2006-04-22 22:52:34 +00:00
stronk7 13615e23c6 Avoid some warnings... 2006-04-22 22:51:15 +00:00
skodak 9cae379921 fixed typo, undefined $ents 2006-04-22 17:33:22 +00:00
skodak f393f545d1 typo - fixed undefined $courseid 2006-04-22 17:29:46 +00:00
skodak 117987949a fixed undefined $timenow 2006-04-22 17:28:18 +00:00
skodak 54bb46f55b fixed undefined $course 2006-04-22 17:25:37 +00:00
skodak 6cf4cbbdf9 added FIX ME notice for inclusion of format.php 2006-04-22 17:21:21 +00:00
skodak 463468bc96 fixed typo in ismember() - nasty one!
and some warnings get_directory_size()
2006-04-22 16:45:12 +00:00
skodak 9e092ff827 fixed typo and s() 2006-04-22 16:36:35 +00:00
skodak e77ea6403a fixed missing xxx_param() and broken path 2006-04-22 16:35:32 +00:00
skodak 7ceed560da added FIX ME notice into grade_get_users_by_group(), I did not fix it because I do not know what this function should return 2006-04-22 16:12:58 +00:00
skodak fea68f909e fixed undefined $error in error message 2006-04-22 16:02:49 +00:00
skodak af38593211 fixed auth_user_exists(), now works the same as the one in ldap plugin 2006-04-22 16:01:02 +00:00
skodak de177d8f2d FIX ME notice for $cas_validate that should be IMHO global, but it works anyway 2006-04-22 15:55:20 +00:00
skodak ad497eea7b fixed undefined pg encoding in warning and undefined main teacher lang when no teacher in course 2006-04-22 15:51:00 +00:00
skodak d850b4e621 typo in switch 2006-04-22 13:38:24 +00:00
thepurpleblob 6c554ff60a Spurious database prefixes in front of index names removed. Bug #5282 2006-04-21 13:27:08 +00:00
nfreear 0c012545aa Fix for Bug #5281, "Validation: '&amp;' in course (topics) format, 'Jump to' drop-down". 2006-04-21 13:08:03 +00:00
thepurpleblob bfcbee55fe Noted that xml format can now handle images. 2006-04-21 12:56:51 +00:00
thepurpleblob d08e16b2a5 Moodle xml format can now export and import the actual image files, encoding
in 'base64' format.
2006-04-21 12:35:57 +00:00
toyomoyo 2712ac665c fix for 5205 2006-04-21 07:55:57 +00:00
toyomoyo 7d8b709473 oops 2006-04-21 07:52:30 +00:00
toyomoyo 34d495d1ba fix for bug 5205 2006-04-21 07:47:14 +00:00
moodler c125d80c3e Fixed Bug #5012 - assignment type uploadsingle does not log view actions 2006-04-21 07:01:01 +00:00
gustav_delius 4111194d9e Use delete_question() to delete question, bug 5275 2006-04-21 06:50:51 +00:00
toyomoyo 7218c216b9 another try 2006-04-21 05:43:17 +00:00
moodler e15ef2602d Some performance improvements see bug 5032 2006-04-21 05:39:20 +00:00
toyomoyo 28498a3558 just a line for testing 2006-04-21 05:35:46 +00:00
toyomoyo bee40515da fix for 5216 2006-04-21 05:17:08 +00:00
moodler 7c830e314b Fix Bug #1604 - the error/index.php can't be translate 2006-04-21 04:42:26 +00:00
moodler a0a6424c75 formatting fix :-) Really I'm just testing the CVS mailing script 2006-04-21 04:10:12 +00:00
mjollnir_ 9e3e6be8e7 Only force topic section in front page if ALL options are set to hide, not if we have news 2006-04-21 03:09:58 +00:00
toyomoyo e315e16c68 nothing much here either 2006-04-21 02:47:01 +00:00
toyomoyo 8ae1314c61 nothing much here 2006-04-21 02:37:28 +00:00
moodler 1939c80a54 Bug #5274 - HTML Editor Full Screen, Wrong Image location 2006-04-21 02:26:29 +00:00
moodler 9e0f5d2abf Added save changes button at top (Bug #1043 - submit button at top of journal report) 2006-04-21 02:23:33 +00:00
toyomoyo 2285084197 added a string for no rights to delete a tag 2006-04-21 02:07:38 +00:00
toyomoyo 1d27654a19 fixed an issue where when the user has no personal tags defined, he/she sees an empty line in tags page 2006-04-21 02:07:10 +00:00
moodler a80722bc33 Fix for double escapeshellarg in bug 5258 - Thanks Andy! 2006-04-21 01:51:46 +00:00
gustav_delius 6037288eeb Fixed code that relied on globals hack. Fixed bug 5261 2006-04-20 23:10:45 +00:00
skodak 1f411afd1f lots of typos fixed, graph in stats, parameter cleanup etc., somebody could cleanup the page layout of those report/xxx/mod.php files ;-) 2006-04-20 22:36:22 +00:00
martinlanghoff 78fbaeaeed weblib: validate_email() -- emails with a trailing dot in the local-part (user.@host.com) are invalid 2006-04-20 22:32:00 +00:00
urs_hunkler 1ffd3647bd removed width for multichoice feedback 2006-04-20 19:11:20 +00:00
skodak 3f2d13ff26 fixed typos 2006-04-20 19:07:08 +00:00
moodler fbab16a7e2 Fixed some error strings bug 2618 2006-04-20 14:04:51 +00:00
thepurpleblob d17bee46ce Fixed typo preventing images being displayed. 2006-04-20 12:36:31 +00:00
urs_hunkler 0e2b7205f5 removed width for multichoice feedback 2006-04-20 08:37:00 +00:00
moodler 6663109659 Fix for bug 5223 - might need testing 2006-04-20 08:25:49 +00:00
moodler 08bdcd3974 Added more common mail charsets to choose from bug 5229 2006-04-20 08:21:58 +00:00
moodler 31256b56b3 Sitemailcharset should be empty string 2006-04-20 08:19:36 +00:00
moodler 02c649e69e Make email address denying work a little more rigorously. bug 5250 2006-04-20 08:17:11 +00:00
moodler 20a730762f No need for noapprovalrequired string 2006-04-20 07:55:07 +00:00
toyomoyo 0459675f96 added a simple message to warn moodlers that if they are using contrib modules or blocks with no migration sript, the data will not be converted. 2006-04-20 07:35:36 +00:00
toyomoyo e080039ebe just in case of there's no course 2006-04-20 07:34:06 +00:00
toyomoyo 8de65352a4 there's some changes, to accomodate 5194. More testing is needed on all versions of mysql 2006-04-20 06:57:26 +00:00
wildgirl 4c85af7b01 Added a check for is_object($item) to prevent possible warnings in preview_ims_generate_toc
Restored use of textlib in preview_ims_generate_toc
2006-04-20 06:53:07 +00:00
wildgirl 676fb87edc Added a check for isset($this->resource->reference) to prevent warnings in resource_ims
Added a check for is_object($item) to prevent warnings in ims_generate_toc
Restored use of textlib in ims_generate_toc
2006-04-20 06:51:55 +00:00
toyomoyo 8c9814f9d8 added a feature that automatically adds 2 default blocks for new blog users. (block_menu and block_tags blocks) 2006-04-20 06:35:39 +00:00
moodler ec536d7a48 Make sure the number is stored as a proper number 2006-04-20 04:07:50 +00:00
moodler 59f3b71781 New number field type 2006-04-20 04:02:30 +00:00
moodler 9b940db6d4 New strings for Number field 2006-04-20 03:28:43 +00:00
toyomoyo 56c5918727 fix for 5257 2006-04-20 02:33:04 +00:00
toyomoyo 2f5196e720 fix for 5256 2006-04-20 02:26:23 +00:00
toyomoyo d174882071 fix for 5256 2006-04-20 02:25:09 +00:00
toyomoyo 0b11c2b70f but fix for 5256 2006-04-20 02:20:32 +00:00
toyomoyo 48e79fd146 some clean up 2006-04-20 02:14:17 +00:00
mjollnir_ 60188cee2b assign admins page should respect MAX_USERS_PER_PAGE 2006-04-20 00:19:17 +00:00
martinlanghoff f83edcb114 mod/chat - use empty value instead of erroring out if $USER->lastIP and getremoteaddr() don't yield any interesting value
Sometimes we can't get any useful IP for the user -- and this may even be a
valid situation. So fudge an empty value -- the DB needs it as the IP field
is NOT NULL.
2006-04-19 21:22:36 +00:00
skodak ef45822122 some extra cleaning of comments and feedback before storage. normaly the text is cleaned before display, this is just a preventive measure because I did not want to study this code all day ;-) 2006-04-19 20:21:42 +00:00
skodak 34ffb5cae2 some extra cleaning of comments and feedback before storage. normaly the text is cleaned before display, this is just a preventive measure because I did not want to study this code all day ;-) 2006-04-19 20:10:04 +00:00
skodak d2963541e2 Security related parameter cleanup in workshop code, please test it. No bug fixes... 2006-04-19 19:48:46 +00:00
skodak 7282d18cf0 isguest() must be checked AFTER require_login() because the user may not be logged in yet ;-) 2006-04-19 19:42:47 +00:00
urs_hunkler d133007141 added CSS for multichoice feedback 2006-04-19 17:13:37 +00:00
moodler d3a752872f Fix for bug 5029 from Tim Takemoto 2006-04-19 12:54:34 +00:00
moodler 7b54f5636d Fix group picture in HTML mail when no CSS is used 2006-04-19 12:47:30 +00:00
nfreear a7c385e606 Accessibility: bug 5078, "Update calendar blocks in courses to match the changes in site page". Fix function, calendar_top_controls. 2006-04-19 09:07:30 +00:00
nfreear e642ed1244 Accessibility: bug 5078, "Update calendar blocks in courses to match the changes in site page". 2006-04-19 08:55:20 +00:00
toyomoyo 8bcd295c3d bumping up version, chaing user->firstname, user->lastname, course->shortname to varchar(100) 2006-04-19 08:18:35 +00:00
moodler 09f00e5383 FInally fixed chat layout bug 2006-04-19 07:57:14 +00:00
moodler 733a73f0d3 Added chat formatting 2006-04-19 07:51:39 +00:00
gbateson 30b8cc87e1 fixed bug which prevented display of JCross clues on PHP 5.1.2 2006-04-19 06:20:37 +00:00
vyshane feb00a54d0 Setting $data->listtemplateheader and $data->listtemplatefooter to '' if we
are resetting the listtemplate.
2006-04-19 04:21:23 +00:00
vyshane 8d4a31bd3c Removed javascript for resetting templates. We reload the page to reset
templates.
2006-04-19 02:54:07 +00:00
mjollnir_ fbc525bc0b Correcting code to remove warning originating from earlier commit
Peter Bulmer peterbulmer@catalyst.net.nz
2006-04-19 02:31:32 +00:00
martinlanghoff 930413b133 mod/chat: Normal method - introducing "Stream" updates.
This is an alternative version of jsupdate.php that acts
as a long-running daemon. It will feed/stall/feed JS updates
to the client. From the module configuration select "Stream"
updates.

The client connection is not forever though. Once we reach
CHAT_MAX_CLIENT_UPDATES (currently 1000), it will force
the client to re-fetch it.

This buys us all the benefits that chatd has, minus the setup,
as we are using apache to do the daemon handling.

Chat still defaults to the normal update method, which is now
optimised to take advantage of keepalives -- so this change is
safe. The instructions in the config page also indicate that this
mode may not be well supported everywhere. It hasn't been
tested on IIS for starters.

In terms of relative cost -- if each hit on jsupdate.php incurs
on ~20 db queries and delivers one update to the client, each hit
on jsupdate takes ~20 queries, and then roughly 2~3 queries to
serve each of the next 1000 updates. On busy sites, the difference
is huge.

There is still room for enhancements in both keepalive and stream
update methods. I am pretty sure we can trim DB queries more.
2006-04-19 02:20:48 +00:00
gustav_delius d1873436d2 Fixed small typo in help file, bug 5243 2006-04-18 23:15:11 +00:00
gustav_delius c1f52a2f81 Change of words suggested in bug 5245 2006-04-18 23:00:04 +00:00
gustav_delius a9d80ad800 Fixed small typo in help file. 2006-04-18 22:58:00 +00:00
mjollnir_ eb55a1bfb9 Avoiding warning in last commit:
mod/quiz/index changes to only display quiz grades when teacher allows
Changes to index.php to only allow student to view overall quiz scores when
teacher has not set options forbidding this, and it can't give away what
scores were for attempts where results should still be hidden.
Credit: Peter Bulmer peterbulmer@catalyst.net.nz
2006-04-18 22:57:28 +00:00
mjollnir_ 40377b188b mod/quiz/index changes to only display quiz grades when teacher allows
Changes to index.php to only allow student to view overall quiz scores when
teacher has not set options forbidding this, and it can't give away what
scores were for attempts where results should still be hidden.
Credit: Peter Bulmer peterbulmer@catalyst.net.nz
2006-04-18 22:55:28 +00:00
mjollnir_ d78a1cf6d8 mod/quiz/locallib bugfix get_qn_options now uses more sensible defaults.
Previously get_question_options used options for
after-attempt-while-quiz-open, when called while a attempt was still in
progress.  Changed it to use options for immediately-after-attempt instead.
Credit: Peter Bulmer peterbulmer@catalyst.net.nz
2006-04-18 22:54:51 +00:00
mjollnir_ 309c0d55b2 mod/quiz/view changes to only display attempt grades when teacher allows.
Changed view.php to only display grades when the teacher has not set
options forbidding it.  Further, where there is some attempts that are
allowed to be displayed, and others not, highligting of the highest score,
and printing of the overall grade allocation has been disabled to ensure
the hidden grade is not revealed.
Credit: Peter Bulmer peterbulmer@catalyst.net.nz
2006-04-18 22:54:10 +00:00
gustav_delius f7fccc0362 Make sure category from correct course is shown. 2006-04-18 22:53:38 +00:00
mjollnir_ 15db443c87 mod/quiz/review only display grade summary if student allowed to see scores
Change to review.php so that the student will only see the grade summary
if they are allowed to view their scores - as determined by quiz options
set by the teacher.
Credit: Peter Bulmer peterbulmer@catalyst.net.nz
2006-04-18 22:50:04 +00:00
mjollnir_ 9f7f01db04 mod/quiz/review quiz options loaded once per pageload, not once per qn.
Moved loading of quiz review options from loop iterating over each qn to be
displayed, to the top of the pageload.  Should give efficency gains
on quizes with long pages, as well as making the options available
earlier in the process.
Credit: Peter Bulmer peterbulmer@catalyst.net.nz
2006-04-18 22:47:56 +00:00
martinlanghoff d13ef2fbdc mod/chat - cope with missing $USER->lastIP
$USER->lastIP is sometimes not set properly during login, fetch it if we can
or error out clearly -- we won't be able to login the user to the chat if
we don't have an IP address to match him/her against.
2006-04-18 22:40:56 +00:00
gustav_delius 9977aa0f4a Don't forget the prefix_ for table names 2006-04-18 21:49:14 +00:00
martinlanghoff 04ddd06c1d admin/cron.php - fix typo
Nothing like being pedantic on a tuesday afternoon...
2006-04-18 21:22:04 +00:00
urs_hunkler eedff4f447 IMS CP styling 2006-04-18 19:59:04 +00:00
wildgirl 45f4544f31 Updated IMS CP help file (bug 4628) 2006-04-18 18:17:36 +00:00
wildgirl 2f5d8f3eff Updated IMS CP help file (bug 4628) and added repository help file 2006-04-18 18:15:32 +00:00
wildgirl 06ebc30fb6 Added IMS CP strings 2006-04-18 18:09:11 +00:00
wildgirl 824c9dc7c6 resource.class.php changes:
1. Added logic to process repository paths. A repository path is marked with a # as the first character of the reference field.
2. Added a new error code for repository items not being deployed / bad reference.

ims.html change:
Added a button to link to the repository browser.

New files:
finder.php ? browser for the repository
preview.php ? cut down display routine from resource.class.php, forces sidemenu etc.
repository_deploy.php ? deploy for repository items (same results as deploy.php)
repository_config.php (repository disabled by default)
resize.js - for iframe resizing
dummyapi.js - dummy SCORM API

(Tom's work, with help from Andy)
2006-04-18 18:04:30 +00:00
thepurpleblob 2c49e71073 Paramater cleaning for category name too restrictive for non-ascii
language encodings. Bug #5224
2006-04-18 14:20:02 +00:00
gbateson 1872962d5c corrected handling of tables within JCloze text (a lot of vertical space was being added) 2006-04-18 12:20:18 +00:00
nfreear e80e9f20d4 Clean up code (Bugs 5027, 5161), 'weekscss' course format. 2006-04-18 11:02:21 +00:00
nfreear 498bdc51f2 Fix, Bug 5161 "Course format weekscss looks unfinished". Added ommitted 'hidden' style, background-color. 2006-04-18 11:00:25 +00:00
moodler 0b9e9783a3 Fixed bug #5230 and the hardcoded admin folder 2006-04-18 09:46:35 +00:00
moodler f619f8c8ab FIx for slashes problem in bug 5222 (and some others) 2006-04-18 09:16:22 +00:00
toyomoyo dec0d49c7e typo 2006-04-18 09:08:53 +00:00
toyomoyo 4e93938edb fix for 5204 2006-04-18 09:05:07 +00:00
moodler 5379d24992 A little HTML hint since styles are not working here for me somehow 2006-04-18 07:28:44 +00:00
moodler 44a38081c7 Better style for picture next to chat text 2006-04-18 07:27:11 +00:00
toyomoyo fd8d5ba75f fix for 5207 2006-04-18 07:22:18 +00:00
moodler 78c98892d1 More efficient chat listings (less database calling) 2006-04-18 07:14:21 +00:00
toyomoyo 2b9fd72cc3 fix for 5210 2006-04-18 07:12:39 +00:00
toyomoyo 8f23f49004 fix for 5209 2006-04-18 06:43:29 +00:00
toyomoyo 98ae4e63da block unicode migration bugs 2006-04-18 06:17:30 +00:00
vyshane d553ae9f74 "Reset template" button now only resets the template textarea with the default
template. User needs to hit "Save template" to save the changes.
2006-04-18 06:11:38 +00:00
toyomoyo 5bce15857e added a comment 2006-04-18 03:45:23 +00:00
toyomoyo 025bec3169 the table_column function ate my auto_increments 2006-04-18 03:30:57 +00:00
mjollnir_ ee234b5cac Putting back in the fix for authorize enrol plugin not originally having correct pg version number and table sync with mysql tables and version number 2006-04-18 02:50:46 +00:00
toyomoyo a2d09dee4b bug #5234, so I took out has_config, this block has no config globals right? 2006-04-18 02:37:44 +00:00
toyomoyo f4c85f469a various small changes 2006-04-18 01:59:13 +00:00
toyomoyo 7077ca8399 blog access rights fix, forgot to check in last week 2006-04-18 01:30:00 +00:00
skodak f4598dacd2 fixed bug #5225, fix provided by hachiman 2006-04-17 21:26:05 +00:00
skodak 200514e282 some bugfixing and proper conversion to new xxx_param() functions - SC#148 2006-04-17 21:14:50 +00:00
martinlanghoff a6d1886fa5 mod/chat: Normal method -- collate 2 SELECTs into one
We really don't need to ask about the user table _twice_ here. Just ask for the
right fields, and done.
2006-04-17 21:06:28 +00:00
martinlanghoff 46c859760c mod/chat: Normal method -- faster, lighter DB updates
Use set_field() keyed on PK instead of update_record() or set_field()
keyed on non-PKs.
2006-04-17 21:05:51 +00:00
martinlanghoff c5e817f02c mod/chat - Normal method - users pane only uses keepalive when refreshing fast
To avoid wasting server resources, user's pane now only uses keepalive
when the refresh is lower than apache's timeout.
2006-04-17 21:05:17 +00:00
martinlanghoff 6169ea259a mod/chat - Normal method now supports HTTP Keep-Alive - users pane
User's pane now also uses keepalives -- if the refresh freq is below
the disconnect timeout, then it is a win. Otherwise it wastes memory
at the server end.
2006-04-17 21:04:47 +00:00
martinlanghoff dfd1d9e272 mod/chat - Normal method now support HTTP Keep-Alive
By using output buffering, we now support HTTP Keep-Alive, which means
that each client gets tightly bound to a single apache child - this means
that we get

 + lower resource usage on the webserver
 + _much_ lower resource usage on webserver and dbserver if pconnects are used
 + a good case for further caching (memcache/mmcache)

Using ab via localhost or fast LAN using keepalives is actually slower from the
client perspective -- still lighter on the server. Via slower links (DSL/modem)
the responses are faster.
2006-04-17 21:04:19 +00:00
martinlanghoff 4d5525c650 mod/chat: make http-chat more database friendly and change msg insertion to use POST
+ we are now more conservative in the fields it asks from the db
+ also more conservative with upates to chat_users
+ messages are now added via POST requests instead of GET
2006-04-17 21:03:44 +00:00
skodak 960855b9a1 fixed double header warning in redirect() 2006-04-17 20:40:33 +00:00
gustav_delius 54b3626b9f Moved all question deletion code to showbank.php. Fixed bug 5186 2006-04-17 05:31:21 +00:00
moodler 402e1a9643 Tidied up the upgrade dialog 2006-04-16 16:56:09 +00:00
moodler d87a9d7338 Fixed the upgrade_plugins function so that it automatically
handles the .sql file for first installation (just like activities)
2006-04-16 16:50:55 +00:00
moodler 0236ec73be Don't show tabs when creating admin user 2006-04-16 16:49:28 +00:00
moodler 9e458bb388 Moodle Docs link on home page could be a bit confusing 2006-04-16 16:21:50 +00:00
moodler 9bb4d21fa5 No agreement to license sends you to docs.moodle.org 2006-04-16 16:09:12 +00:00
moodler 16ad40e145 Fix for chat character sets bug 5010 2006-04-16 16:01:40 +00:00
moodler bd507453f7 The install script should always be Unicode. 2006-04-16 15:58:24 +00:00
moodler f666830caf Removed blank line 2006-04-16 15:56:36 +00:00
gbateson 23efbfa15e improved readability of reg. exp. in adjust_media_urls function 2006-04-16 02:10:14 +00:00
stronk7 ff62d70dc6 Two more uses of format_string() agains entry->concept 2006-04-15 19:28:26 +00:00
stronk7 deb59b8f95 Filter one more string if filterall is enabled. 2006-04-15 19:24:44 +00:00
stronk7 a7117f3ac1 Added one missing string 2006-04-15 19:21:36 +00:00
stronk7 717f14b627 strstr(string haystack,string needle). We were doing the opossite. Bug 5037.
(http://moodle.org/bugs/bug.php?op=show&bugid=5037)
2006-04-15 17:30:23 +00:00
gbateson 0e6e81a4a8 fix "Force Plugins" behavior to correctly detect media players in JavaScript 2006-04-15 08:17:30 +00:00
moodler 9e08cf6ed1 DOn't show intro on first page of single view 2006-04-15 06:02:21 +00:00
moodler 3f9672d37c FIxes for bug 5197 2006-04-15 02:41:27 +00:00
skodak 354d3295d4 removed outdated xxx_param() functions 2006-04-14 15:57:59 +00:00
moodler b1e64385dc During installation, if the database isn't UTF and it is empty,
then try and set it to UTF automatically.

I did MySQL only, can someone tackle this for PostgreSQL?
2006-04-14 11:57:11 +00:00
julmis b5a5d9f668 Another fix for creating links. 2006-04-14 09:57:41 +00:00
skodak f8a5159a2b changes needed for new s() and p() - see bug #2338 2006-04-14 08:02:32 +00:00
gbateson 498695122a modified instructions for uploading to "lang" directory, to reflect the fact that the default Moodle 1.6 location for the "lang" directory is now within $CFG->dataroot 2006-04-14 07:34:59 +00:00
moodler 99d1acbcef Default blog level is site level 2006-04-14 06:39:14 +00:00
moodler 37fa421efc FIx license display 2006-04-14 06:38:52 +00:00
moodler b6d31b4696 FIxed an alt string 2006-04-14 04:58:09 +00:00
moodler 2ebc8a57bd RSS feed based on modified date, not created date 2006-04-14 04:53:45 +00:00
mjollnir_ 86e75a7b77 Disable gui for forum timed posts since we are not quite ready for it. All code is still there but hidden & controlled by a config var forum_enabletimedposts. 2006-04-14 04:51:43 +00:00
moodler 3d28412786 After discussion with Penny I think it's best to not include the forum
timed posts in 1.6 for now.   It still needs some work and we are
running out of time.
2006-04-14 04:47:43 +00:00
gustav_delius 05803bf170 Removed settings tab, see bug 5189 2006-04-13 21:35:24 +00:00
skodak e8d1c9ed2b stripslashes_safe() improvement - now works also for arrays and objects see bug #2338 2006-04-13 21:27:01 +00:00
gustav_delius bd9964841d Fixed bug 5187 that led to error when creating cloze question 2006-04-13 21:23:15 +00:00
nfreear f2d660dcb2 Major fix for Bug 5027, "Three-col layout breaks when window is narrow" (also, Bug 5161). 'weekscss' course format. 2006-04-13 16:07:12 +00:00
nfreear c87b4c8765 Clean up code (Bugs 5027, 5161), 'weekscss' course format. 2006-04-13 14:37:32 +00:00
nfreear 1528decaae Major fix for Bug 5027, "Three-col layout breaks when window is narrow" (also, Bug 5161). 'weekscss' course format. 2006-04-13 14:28:36 +00:00
thepurpleblob 2df8ab6146 A few changes to improve readability/correctness. 2006-04-13 12:20:39 +00:00
thepurpleblob 8c65c93e50 New string - importfromthisfile 2006-04-13 12:11:12 +00:00
thepurpleblob 296cb5b57b More logical wording on button to import from local file 2006-04-13 12:10:28 +00:00
moodler 8ad644551d Merged fixes from stable 2006-04-13 12:05:37 +00:00
moodler f852d652cf FIx for bug 5188 - seach with no results -> dead end 2006-04-13 10:41:12 +00:00
thepurpleblob 2784b98278 Don't compare floats for equality! Bug #5176 2006-04-13 10:29:20 +00:00
nfreear 64fdc686d8 (Bug tracker 4997) Clean up code comments. 2006-04-13 09:44:33 +00:00
moodler 1925b16db8 Don't prefill username in shibboleth bug 5184 2006-04-13 09:00:05 +00:00
moodler d95f4c3fef SOme help file polishing 2006-04-13 08:55:34 +00:00
moodler 499ed21564 FIxed a typo 2006-04-13 08:49:31 +00:00
vyshane 33e727b7a4 Bug #5163 - user/action_redir.php should print properly formatted error
messages
2006-04-13 08:48:51 +00:00
vyshane 78dd16f5bd Added unknownuseraction string 2006-04-13 08:48:14 +00:00
thepurpleblob 25ee4157c8 missing courseid parameter in "grades not not add up to 100%" check. 2006-04-13 08:45:11 +00:00
moodler 99cc88d159 Added a new string idnumber course to allow more customisation bug 4337 2006-04-13 08:44:20 +00:00
moodler 44abf704cc Improved blog strings 2006-04-13 06:41:49 +00:00
moodler 9cabc6e4af Fixed tag names in blog 2006-04-13 05:55:03 +00:00
moodler 0b2d7e7eca New style for draft blog posts 2006-04-13 05:54:44 +00:00
moodler 9ea589879b Style for the errorcode link in errors 2006-04-13 05:46:24 +00:00
moodler 87fa2e3f8a Fixes to make print_error more useful, suggested by Sam
It can now take a module argument, and can support different link locations
2006-04-13 05:42:47 +00:00
vyshane 998cc5b645 Added default values for not nulls. 2006-04-13 03:19:00 +00:00
vyshane d3fa8cfb9d Added default values for not nulls 2006-04-13 03:16:41 +00:00
vyshane 5e3572ff0b Added default values for not nulls. 2006-04-13 03:11:32 +00:00
vyshane ab6d44896a Added default value for not null. 2006-04-13 02:55:27 +00:00
toyomoyo ba63b0ad7e warning for guest when viewing blogs 2006-04-13 02:48:14 +00:00
moodler de89899b1d Was trying Eloy's suggestion here http://moodle.org/mod/forum/discuss.php?d=43041
but wasn't working for some reason ... checking in as commented to work on later.
The lkudge seems to be working pretty well for now.
2006-04-13 01:34:26 +00:00
toyomoyo 3e8398408f fix for #5173 2006-04-13 01:32:10 +00:00
gustav_delius da1cc5a44e Fixed problem with slashes, bug 5177 2006-04-13 00:37:14 +00:00
gustav_delius d6d29245e7 Now there is an option to see all attempts, even for users who have since unenrolled. That is necessary in order to be able to delete these attempts, see http://moodle.org/mod/forum/discuss.php?d=34421 2006-04-13 00:02:36 +00:00
gustav_delius ffa6ed53e4 Fixed display of information about existing attempts. 2006-04-12 23:24:58 +00:00
gustav_delius 375ab4586f use function from questionlib.php to delete attempt data 2006-04-12 22:57:01 +00:00
gustav_delius 78517b5a6b Don't show users who have unenrolled.
Show display options also when current options lead to empty table.
2006-04-12 22:48:58 +00:00
stronk7 b0a8b898f9 Difference between copy, the verb and copy, the noun, because they
are different in a lot of languages. Bug 5172.
(http://moodle.org/bugs/bug.php?op=show&bugid=5172)
2006-04-12 21:53:45 +00:00
danmarsden 22d56e8015 need to check vars aren't empty b4 using them! - another one! 2006-04-12 21:15:10 +00:00
skodak 2475a6c26d minor coding style fixes 2006-04-12 21:02:03 +00:00
urs_hunkler 8c5b0637ce added the CSS for the bullets for lists within activities for the start pages and the course page. made teh CSS more specific than David proposed it. 2006-04-12 20:27:30 +00:00
urs_hunkler e062995380 copied list handling CSS from cssweek format section to general course section and added handling for section lists on the index page 2006-04-12 19:56:42 +00:00
stronk7 d4a42ff494 New optional parameter to s() and p() allowing to specify
if we want to strip slashes (data coming from forms) or no
(data coming from DB, the default). Bug 2338.
(http://moodle.org/bugs/bug.php?op=show&bugid=2338)
2006-04-12 17:39:23 +00:00
skodak f2a365b976 general cleanup of xxx_parameter() functions 2006-04-12 16:59:51 +00:00
skodak eb59ac2777 PARAM_BOOL now accepts "yes/no" too 2006-04-12 16:55:47 +00:00
skodak a8ff614fb8 general cleanup of xxx_parameter() functions; fixed broken requesting of courses 2006-04-12 16:41:10 +00:00
skodak f27d105cc6 final fix for category and courses edit button 2006-04-12 16:28:11 +00:00
exe-cutor f26baa3e2b Fixed the case where a user would manually log in with an unknown username 2006-04-12 14:54:01 +00:00
nfreear 32346db21f 2006-04-12 13:22:19 +00:00
nfreear d242c402d7 Initial fix, Bug 5161 "Course format weekscss looks unfinished". Includes making CSS-selectors #course-view .section .side more specific (td.side). 2006-04-12 11:14:03 +00:00
nfreear cbc18ef9dc Initial fix, Bug 5161 "Course format weekscss looks unfinished". Includes making CSS-selectors #course-view .section .side more specific (td.side). 2006-04-12 10:54:48 +00:00
moodler dd899b917d Fixed up print_error according to original plan
see also http://moodle.org/mod/forum/discuss.php?d=43712
2006-04-12 09:32:19 +00:00
nfreear a99404f074 Accessibility: fix to .headerskip, new class .debugwarn. 2006-04-12 09:14:46 +00:00
ethem 4d3b0ddc0a lib.php renamed to locallib.php 2006-04-12 09:13:20 +00:00
vyshane 4b10570aef Added default value for enum that has been defined as not null. 2006-04-12 09:01:07 +00:00
toyomoyo 6524adcffd some more small fixes 2006-04-12 08:58:49 +00:00
moodler fbec0acb3e Strip tags from final RSS feed name 2006-04-12 08:58:20 +00:00
moodler 22060485bf FIx notices and logic when deleting files and checking resources. bug 5156 2006-04-12 08:53:24 +00:00
vyshane 63b816ab56 Added default values for not null columns in table creation sql 2006-04-12 08:44:59 +00:00
moodler 93528ae1f6 Restored topic numbers to topic format. Who deleted them?????! 2006-04-12 08:06:37 +00:00
moodler 5509b4cdc0 Fixes to make the courses look nice again after the accessibility
style changes seemed to have destroyed things a bit
2006-04-12 07:57:03 +00:00
moodler dc3a69ecb3 The "hide" icon was hidden on the weekly format due to a new
style added called "hide".
2006-04-12 07:37:36 +00:00
skodak 4aa2077b02 general cleanup of xxx_parameter() functions - fixed typo 2006-04-12 07:25:46 +00:00
skodak 6bf7fe6cf0 general cleanup of xxx_parameter() functions 2006-04-12 07:25:09 +00:00
vyshane 22b266cac7 Bug #4879 - small fix for maxbytes help blurb 2006-04-12 07:09:56 +00:00
moodler d76be18f76 Fixed some tidy warnings. 2006-04-12 06:56:01 +00:00
bobopinna 008bfd2795 Added utf8 conversion 2006-04-12 06:15:29 +00:00
bobopinna 9ff41f7ed0 Fixed navigation bar links for SCORM course format 2006-04-12 06:13:29 +00:00
bobopinna df88f4ea9d Fixed navigation bar link for SCORM course format 2006-04-12 06:12:16 +00:00
bobopinna 82c3173ea5 Fixed a typo 2006-04-12 06:08:48 +00:00
bobopinna d74b87919f Fixed empty tags check 2006-04-12 06:05:25 +00:00
bobopinna 586de5a08a Fixed default stage size 2006-04-12 06:04:15 +00:00
toyomoyo bd70af134d fixing rsslib, and added code to check if rss not enabled, blog rss button will not be printed 2006-04-12 06:04:06 +00:00
bobopinna 5046492815 Added multi attempt support 2006-04-12 06:03:46 +00:00
bobopinna a91433f9ec Added debug messages 2006-04-12 06:02:08 +00:00
toyomoyo b744c0c3ec took out a print header that was generating a warning 2006-04-12 04:14:45 +00:00
toyomoyo 26f8fcd0f4 took out blog_isLogged_In function 2006-04-12 04:10:24 +00:00
toyomoyo a1856aff0b html issues 2006-04-12 04:03:57 +00:00
vyshane 02f66c4202 Fixed Bug #5021 - Unhiding an entire Module unhides all it's child resources,
even in hidden sections.
2006-04-12 03:11:34 +00:00
toyomoyo 9ffcd15f3a various small things 2006-04-12 03:02:53 +00:00
toyomoyo 25881d1e2c fixed a bug where non admins can't add blocks to own blog page 2006-04-12 02:27:14 +00:00
toyomoyo 752d035b41 removing some classes 2006-04-12 02:06:57 +00:00
toyomoyo c2ee4e8788 various changes and cleaning, removing BlogEntry, BlogInfo, BlogFilter class next, things could be broken 2006-04-12 02:05:46 +00:00
moodler 106da8c6e0 Explicit link to home page 2006-04-12 01:32:15 +00:00
stronk7 766ad62808 Solve some notices that were breaking Excel generation under
some PHP versions. As bug is well documented but PEAR code hasn't
been changed in origin, we'll patch it here. Changes will
merge smoothly in the future, I think.
(Moode Bug: http://moodle.org/bugs/bug.php?op=show&bugid=4763)
(PEAR Bug: http://pear.php.net/bugs/bug.php?id=6509)
2006-04-11 22:49:09 +00:00
gustav_delius 89a6e4358a Fixed parameter type for $confirm 2006-04-11 22:22:31 +00:00
gustav_delius 2e8973e779 Teachers now can preview timelimited quizzes even after the closing date 2006-04-11 21:49:43 +00:00
skodak 0cdae0dcaa general cleanup of xxx_parameter() functions + fixed several register globals problems 2006-04-11 21:41:21 +00:00
gustav_delius 44582764af Fixed recoding of parent field for random questions 2006-04-11 21:40:28 +00:00
gustav_delius ab620fbf2b Added call to optional_param() 2006-04-11 20:42:31 +00:00
skodak 9d6a11f8ff general cleanup of xxx_parameter() functions + fixed logic of edit button - now interconnected with category.php 2006-04-11 20:39:30 +00:00
skodak ea8faba9dc general cleanup of xxx_parameter() functions + other minor fixes 2006-04-11 20:24:52 +00:00
skodak 2451dcc3aa added proper parameter type in confirm_sesskey() 2006-04-11 20:07:57 +00:00
stronk7 1b1858d260 htmlentities() to s() 2006-04-11 16:09:52 +00:00
stronk7 3725cc8a58 htmlentities() to s() 2006-04-11 15:42:08 +00:00
stronk7 23407fb76b htmlentities() to s() 2006-04-11 15:34:29 +00:00
bobopinna 5fe1f8afb4 Added support to multi attempts 2006-04-11 13:51:10 +00:00
moodler 648539c55b Fixed missig string for blog config 2006-04-11 13:16:23 +00:00
moodler bc739a0104 Don't save empty comments 2006-04-11 13:10:30 +00:00
moodler b4c3ed39d7 New string for empty comments 2006-04-11 13:10:15 +00:00
moodler edaa546ad5 Don't clean final HTML template output, the input should be sanitised. 2006-04-11 13:00:13 +00:00
ethem 9b47e0018e Make function names as library name. 2006-04-11 12:37:41 +00:00
ethem c9ca150d82 Make function names as library name. 2006-04-11 12:37:41 +00:00
moodler 702424ae72 Fix language strings (records -> Entries) 2006-04-11 12:37:29 +00:00
moodler a05a5e5d61 Consistently use Entries instead of Records 2006-04-11 12:36:12 +00:00
moodler 7ebb0d488f Guests should not see comment boxes 2006-04-11 12:32:23 +00:00
moodler 198c27b376 Submit button was causing bug 4986 2006-04-11 12:29:19 +00:00
vyshane 7477f2505b Fix for Bug #5021 - Unhiding an entire Module unhides all it's child
resources, even in hidden sections
2006-04-11 08:30:10 +00:00
stronk7 8e6184dc8e Strip the "_utf8" suffix in one more place. Thanks Mina!
(http://moodle.org/bugs/bug.php?op=show&bugid=4924)
2006-04-11 07:55:26 +00:00
moodler df71bfb49c MOved/cleaned fixpix.php to pix/redirect.php 2006-04-11 07:53:59 +00:00
moodler c204f5fea1 Made the empty recordset array cache global, so that various functions can
manipulate it.    See bug 5077.
2006-04-11 07:43:05 +00:00
gustav_delius 424dba12cf Fixed typo preventing the editing of multianswer questions. 2006-04-11 07:16:10 +00:00
moodler 12ef2c40d9 Added a new field to cache "old" course_module visibility when
the whole module is disabled (see bug 5021)
2006-04-11 07:04:55 +00:00
mjollnir_ 03c9562b40 Moving attachments attached to forum posts when moving threads between forums was broken when dataroot is over an nfs mount (important for clustering!)... this fixes it but please can somebody test this on windows 2006-04-11 05:19:56 +00:00
mark-nielsen 804d664acf [BugFix] Bug #5072: user name now links to user profile, Attempts column changed to Completed On, new column with link Grade to grade all attempts. Other table changes include collapsible columns and its id has been changed to attempts to reuse styles for the attempts table. 2006-04-11 02:20:58 +00:00
mark-nielsen 6e63c77795 [Fix] question_process_comment now processes the correct form values
[Fix] changed the print_string to get_string so it may be passed to notify
[Change] The close window button is now centered
[Change] Refreshes the parent window when the close window button is pushed
2006-04-11 02:02:44 +00:00
stronk7 1a8bdfc430 Strip the "_utf8" suffix from language names in list of languages.
Special info showed for non-utf8 English.
(http://moodle.org/bugs/bug.php?op=show&bugid=4924)
2006-04-10 23:07:37 +00:00
stronk7 6346748fec Strip the "_utf8" suffix from language names in list of languages.
(http://moodle.org/bugs/bug.php?op=show&bugid=4924)
2006-04-10 22:53:53 +00:00
wildgirl 750c694604 Config menu for extra options added. Javascript added to force some sensible options. (Tom's work) 2006-04-10 22:31:30 +00:00
wildgirl 2cc0d2a8ff 1. Converted display function from frames to divs and an iframe to hold the content.
2. Added an (optional) side navigation bar.
3. Added several options to add more flexibility. Option to fast-forward submenus.
(Tom's work)
2006-04-10 22:30:22 +00:00
stronk7 5a606b3944 Prevent edition of langconfig.php from Moodle editor. Part of 4924.
(http://moodle.org/bugs/bug.php?op=show&bugid=4924)
2006-04-10 22:15:57 +00:00
gustav_delius cbe20043b5 Whenever a question is edited the version field is set to question_hash(), see bug 2958. 2006-04-10 22:10:32 +00:00
gustav_delius 9d4cbe5615 Manual grading report plugin is now no longer essay-specific. 2006-04-10 20:28:46 +00:00
gustav_delius 097bd3f5e8 No longer print the comment boxes for each question in review because it was too slow. We are back to opening the comment box in a popup window. 2006-04-10 19:58:34 +00:00
gustav_delius 34b40897db Added action 'continue attempt' to log_display 2006-04-10 19:13:21 +00:00
stronk7 8d4ba8f0a5 Inform to the restore process that we are arriving from the form page. 2006-04-10 19:03:31 +00:00
stronk7 c3cb69e5f4 Now restore checks that we are coming from the form page to delete any
previously stored $SESSION->restore data.

Also, the "restore to existing" feature is working again. It was broken
because of the pseudo-register-globals hack. Now course_id is retrieved
with the standar param() methods.

Bug 5145 was the original cause for investingating this.
(http://moodle.org/bugs/bug.php?op=show&bugid=5145)
2006-04-10 19:02:39 +00:00
mits efef8f690d made gradient.jpg control more simple. 2006-04-10 18:37:49 +00:00
stronk7 6917949483 Deleting $SESSION structures before starting manual restore. 2006-04-10 18:34:37 +00:00
stronk7 8847a82e25 Deleting $SESSION structures before starting import. 2006-04-10 18:13:18 +00:00
urs_hunkler eb628ba2f8 resizable icons 2006-04-10 17:48:46 +00:00
urs_hunkler 5990290185 ~chameleon.php contains all code neccessary to add the Chameleon engine to any theme. 2006-04-10 17:40:28 +00:00
urs_hunkler 186142b0c5 config.php header.html styles_layout.css user_styles.css:
_ changes in to make Chameloen work as a sessiontheme
_ changes to make it easier to implement the Chameleon engine into existing themes
2006-04-10 17:38:23 +00:00
moodler de251840b4 Added some feedback to the picture thumbnail regneneration bug 5011 2006-04-10 16:46:52 +00:00
stronk7 82ad36a7e9 Deleted wrong ca_utf8_old imported file! :-(
(my fault due to a local process)
2006-04-10 16:40:14 +00:00
moodler f0cb18e627 Fix for bug 5144 (nickname field) 2006-04-10 16:12:53 +00:00
moodler e575c0597d Added a notify in debugging mode for a double print_header() 2006-04-10 16:00:34 +00:00
moodler 886cb1e596 Some of the accessibility changes broke some shading 2006-04-10 15:49:28 +00:00
moodler 255d103389 Replace the add course button that somehow disappeared from 1.5 2006-04-10 15:41:57 +00:00
moodler f870b674a1 Take the course listing out of the default site page
because the default setting on site.php is to have it
in the middle of the page.
2006-04-10 15:38:34 +00:00
moodler a7460097db Just some cosmetic code 2006-04-10 15:00:39 +00:00
moodler 32613b509f Added a little static variable to print_header to prevent it being called twice 2006-04-10 14:40:39 +00:00
sam_marshall bb2848749a Changing to use require_param meant that restore session was not cleared, causing a 2nd restore in succession of same backup to fail. One-line tweak fixes it - I think (I think it's ok but filed as bug 5145 so the appropriate person can check if I messed up) 2006-04-10 11:49:48 +00:00
sam_marshall 96463e677e Another Postgres install fix (this time it was using mdl_ instead of prefix_) 2006-04-10 09:55:31 +00:00
sam_marshall 3a2c772f4e Fixed syntax error (extra comma) in Postgres version of quiz sql 2006-04-10 09:48:47 +00:00
vyshane 3f763c86cf Fixed Bug #5057 - hidden teachers aren't completely hidden 2006-04-10 08:49:15 +00:00
moodler b525bd2009 Better fix for bug 5082. Noticeboxes are now:
#notice.generalbox
2006-04-10 08:32:27 +00:00
moodler 21e2acab15 Added generalbox to noticebox on notices - bug 5082 2006-04-10 08:27:53 +00:00
moodler 315e4e83f9 Fixed XHTML notices with &amp; 2006-04-10 08:10:13 +00:00
moodler e56122e9fd FIxed "sesskey" error in bug 5139 2006-04-10 07:49:55 +00:00
toyomoyo 0dc2e2aefc changed param_alpha to param_notags, otherwise can not support tags in non-lation 2006-04-10 07:29:47 +00:00
toyomoyo eccfc1cac0 small fix and cleaning 2006-04-10 07:27:03 +00:00
moodler 71470b3bf1 Convert the text cache to use a blob, so that there are no character set
issues:   see bug 5136
2006-04-10 07:17:26 +00:00
toyomoyo 19407a4274 agreelicence was not set 2006-04-10 06:35:10 +00:00
toyomoyo 89be4ee2ac bumping up version to change int(11) to int(10) 2006-04-10 06:26:59 +00:00
toyomoyo dffaf68202 changed some int(11) to int(10) 2006-04-10 06:26:07 +00:00
toyomoyo 16ae46f6c5 migration for blogs and tags 2006-04-10 06:08:13 +00:00
vyshane 56253c2d66 Fixing bug (Postgres related):
ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
2006-04-10 05:59:48 +00:00
toyomoyo a35af29014 question->qtype 2006-04-10 05:08:19 +00:00
toyomoyo 25dbd2ff64 convertion to unicode data_content -> content(1 to 4) 2006-04-10 05:03:38 +00:00
vyshane 0bcf4732fa Fixed Bug #5071 - The script uploaduser.php ignores the rest of records after
the first one
2006-04-10 04:54:34 +00:00
moodler 30c9e6947d Reverting changes to print_simple_box for now until the new div can be
rolled out without problems.  See bug 4943
2006-04-10 01:39:38 +00:00
stronk7 ea07c59442 Add one space in the list of langs used to allow the text to flush. 2006-04-09 23:37:14 +00:00
stronk7 96b74b0ac4 Initial revision 2006-04-09 23:36:53 +00:00
gustav_delius 848d886edb Small change to question_print_comment_box() to allow multiple boxes on one page 2006-04-09 22:48:58 +00:00
gustav_delius cf156ab045 Taking out random question hack that is no longer needed. 2006-04-09 22:43:22 +00:00
gustav_delius 7ff90101a6 Simplify text on submit button 2006-04-09 22:31:59 +00:00
gustav_delius 955567ad2f Make sure all random questions have their parent field correctly set, just in case something went wrong here in the past. This may have been the cause of bug 5137 2006-04-09 21:59:55 +00:00
gustav_delius 7a0b035bf9 Make student name into a link on the review page 2006-04-09 21:58:58 +00:00
stronk7 c05a30bc19 Preventig bug affecting sites with modified wwwroot and
custom admin dir. Bug 5031.
(http://moodle.org/bugs/bug.php?op=show&bugid=5031)
2006-04-09 21:39:49 +00:00
gustav_delius 1d7e093418 Small fix so that unattempted questions would never be marked 2006-04-09 21:35:44 +00:00
skodak a37b4c5b10 fixed double prefix bug 2006-04-09 21:25:30 +00:00
stronk7 c356bb409d Suppress pivot output from Date view. It hasn't too much sense there. 2006-04-09 11:06:19 +00:00
stronk7 30691fc3c3 Solve some upperpivot notices and wrong behaviours. More coming... 2006-04-09 10:59:39 +00:00
urs_hunkler 7b1f6431a3 removed !important from border definition of the sideblock calender to be able to style it in the theme 2006-04-09 10:49:14 +00:00
stronk7 f7f735b877 Some defaults applied to paramenters was preventing defaults based
on formats to work properly.
2006-04-09 10:45:14 +00:00
stronk7 2cf1011b25 Now searchbox table is closed by hand, because print_simple_box_xxx()
methods (div based) were breaking things a bit here. Bug 5087)
(http://moodle.org/bugs/bug.php?op=show&bugid=5087)
2006-04-09 09:11:18 +00:00
moodler 34b9ce2572 Removing unnecessary boxes 2006-04-09 07:50:19 +00:00
moodler 8d1727ec2c Some missing blog strings 2006-04-09 07:47:55 +00:00
moodler f517208d9e Add a navmenu to the loginas page 2006-04-09 07:25:57 +00:00
moodler 7ea8ea7faa Added some missing optional_params (bug 5125) Thanks Scott Elliott for the fix 2006-04-09 02:06:26 +00:00
mark-nielsen a472184c7b Updated questiontype.php to make essay compatible with manual grading (aka removed a lot of code).
Adding display.html as a display html template for the essay question type

TODO: drop the question_essay_states table and migrate comments to question_sessions
2006-04-08 21:51:29 +00:00
mark-nielsen dbb3c4c6ea Added $prefix to form fields so that this code could be used with manual grading 2006-04-08 21:48:31 +00:00
mark-nielsen caca24d5d3 Minor updates:
comments no longer print inside the question (only in the textfield)
  fixed problem with quotes by adding addslashes
2006-04-08 21:46:59 +00:00
mark-nielsen e99b375972 Updated the form handling code. This report is now functional again. 2006-04-08 20:55:03 +00:00
mits 27d18ac626 modified based onf standard theme. 2006-04-08 20:51:38 +00:00
mark-nielsen fbe4d5ce51 Updated viewquestion to be more generic and moved it to its own function 2006-04-08 18:56:39 +00:00
mark-nielsen 0a52521122 Updated the viewquestions action to be more generic so that any manually graded question type would be compatible.
Moved viewquestions code to function view_questions.  This is an attempt to make the code much more readable.  All action code will eventually be moved to its own function.
2006-04-08 18:24:49 +00:00
urs_hunkler 53fa54d9e0 removed the empty span from header.html and added the clearfix class to the navbar and to the header divs. this repairs Bug #5051 2006-04-08 17:12:05 +00:00
moodler 3dec563cec Fix for bug 5132, search now no longer prevents display of
arbitrary single records
2006-04-08 16:33:16 +00:00
moodler 82d1796197 Just to avoid browsing of block directory 2006-04-08 16:05:38 +00:00
urs_hunkler 9c5cec188f corrected font-style: none to normal 2006-04-08 15:53:28 +00:00
urs_hunkler 5b2f6e51f9 copied back the CSS for the timer positioning from version 1.12 2006-04-08 15:06:36 +00:00
gustav_delius 7c404f9b2b Fixed some small xhtml problems and removed a warning 2006-04-08 14:20:52 +00:00
urs_hunkler 2d91754b33 copied back the CSS for Item analysis and for grading 2006-04-08 12:25:06 +00:00
mark-nielsen 6e49714287 Changed the Make comment or override grade link display the comment field and grade field in review.php instead of popup 2006-04-08 10:29:25 +00:00
gustav_delius 2a2aba273f submit button for teacher comment is now included in question_print_comment_box 2006-04-08 08:22:18 +00:00
mark-nielsen 42b245d1ca Moved the submit button to question_print_comment_box in lib/questionlib.php 2006-04-08 08:16:04 +00:00
gustav_delius ec65c6ad7c This has extra code to exclude preview attempts from the grading 2006-04-08 08:13:26 +00:00
stronk7 6ed15ea50a Now get_config() is executed after "set names", so textual data retrieved
from the config table has the proper encoding. Bug 5043.
(http://moodle.org/bugs/bug.php?op=show&bugid=5043)
2006-04-07 23:57:38 +00:00
stronk7 820743c5b1 Moving $CFG->ostype and $CFG->os setting, because
report_session_error() was being executed before setting
such variables and moodle_setlocale() need them.
(http://moodle.org/mod/forum/discuss.php?d=43466)
2006-04-07 22:58:07 +00:00
urs_hunkler 4875732b9e Introduced a new class=mdl-align with the CSS text-align: center as a base to replace the DEPRECATED center tags in Moodle 2006-04-07 16:21:27 +00:00
urs_hunkler d975f343ba replaced DEPRECATED center tag with a div. introduced a new class=mdl-align with the CSS text-align: center 2006-04-07 16:17:17 +00:00
gustav_delius b6e907a245 Manual grading 2006-04-07 16:00:29 +00:00
moodler 08777eaf25 Set the last modified time of the style sheet to the current time 2006-04-07 15:07:52 +00:00
moodler 6bf277d7c5 Fixing a typo: http://moodle.org/mod/forum/discuss.php?d=41814#199162 2006-04-07 15:03:51 +00:00
moodler ff1dc0465b Merged fixes for forum_user_can_view_post from stable 2006-04-07 14:54:52 +00:00
ethem 362bdbf790 static $timediff30. Call once only. 2006-04-07 11:23:10 +00:00
nfreear a2e2bf643a Fix MB 5099, "Make CSS requests expire in IE", fix 'max-age=' as per http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html, override $lastmodified parameter (OU-Bugz: 851) 2006-04-07 10:18:03 +00:00
urs_hunkler 78a71c31f8 changed the CSS to add backward compatinility for headers using tables.related to #bug4913 2006-04-07 08:46:11 +00:00
gustav_delius 03c541cb9a class clearfix is the medicine against collapsing divs, see bug 5119 2006-04-07 07:55:48 +00:00
ethem 09bf9535de print_simple_box_start with width 2006-04-07 07:34:32 +00:00
moodler 98f92a5491 FIxed a string 2006-04-07 07:03:03 +00:00
moodler 63701c7802 FIxed activity reporting for database activities 2006-04-07 07:02:53 +00:00
gustav_delius 5f4f608811 Replaced layout table around question by div. Doesn't display right in firefox yet. 2006-04-07 06:08:55 +00:00
gustav_delius 934eea9e43 Introduce field for teacher comments, in preparation for manual grading. I am afraid I forgot to commit this yesterday, so now it is possible that some new beta testers installed Moodle without this new field. 2006-04-07 05:28:18 +00:00
mark-nielsen 31f6b26d4f [BugFix] Action was using global variables - now is fetched with optional_param 2006-04-06 23:03:08 +00:00
mits 8fbfacd946 To show navbar background-image on admin page correctly added "width:100%;". 2006-04-06 21:19:44 +00:00
danmarsden 6c5a77bbb7 couple of bugs when no data returned. 2006-04-06 20:42:35 +00:00
gustav_delius 6463e8a6b6 Fixing a large number of tidy warnings 2006-04-06 20:35:49 +00:00
gustav_delius 755bddf118 Improvements to response history. Three small bug fixes. 2006-04-06 19:59:02 +00:00
nfreear 408b65dd44 Fix 2, bug 4943: "print_simple_box behaviour changed". Centred is now default alignment; for centred no-width specified, width=30em. 2006-04-06 17:21:04 +00:00
moodler 0143db5788 More clean ups 2006-04-06 17:12:55 +00:00
gustav_delius 80bbc7d7d1 Some code cleanup, relying more on the functions from questionlib.php. Not currently functional, awaiting the central manual grading feature. 2006-04-06 16:45:14 +00:00
gustav_delius 01bd54e0cb Jean-Michel's fix to the get_actual_responses() method 2006-04-06 16:43:41 +00:00
gustav_delius 3a5a6f59a3 Introduce field for teacher comments, in preparation for manual grading 2006-04-06 16:42:00 +00:00
moodler b4f3e56cc1 Fixes from Dan Stowell to support thumbnail images, with some modifications
from me to remove unnecessary messages.    bug 5011
2006-04-06 16:20:50 +00:00
moodler d9d282e493 Fixing some documentation.
get_records etc are not inefficient if used correctly, and result in MUCH
more readable code that get_recordset does.

I'm already starting to see code being submitted that takes these
instructions literally and it looks like Java.  :-(
2006-04-06 15:26:44 +00:00
danstowell 2201638882 Minor improvements to IMS-E enrol - better handling of empty <userid></userid> 2006-04-06 14:06:40 +00:00
gustav_delius a488b9325c Replace require_variable() by required_param() 2006-04-06 12:56:37 +00:00
gustav_delius e49a8d099e Supply default values for more arguments of question_list() 2006-04-06 12:54:48 +00:00
urs_hunkler 7e4f53c80c changed the CSS for navbutton to position the 2 buttons side by side. #bug4913 2006-04-06 07:35:40 +00:00
moodler 7e73ff00cf Some info about the PHP license and PEAR (we are going to keep it in Moodle) 2006-04-06 06:31:38 +00:00
moodler 91555ae462 FIxed some box sizes, and added hooks for Matt Oquists portfolio stuff 2006-04-06 01:38:52 +00:00
patrickslee faf2851fd9 Override doc link for postgresql migration 2006-04-05 23:41:59 +00:00
stronk7 391f527040 Hehe, setup itself was using register_globals hack! ;-)
Now the lang menu is working again.

Note: I've used the PARAM_SAFEDIR flag because it's the
only one supporting alpha+digits+underscore. Its name
doesn't seem to be perfect for this. Perhaps we should
create some alias?
2006-04-05 23:29:46 +00:00
stronk7 768cf7d5d1 Now graphlib also works with ttf fonts installed under
moodledata/lang dir. Rest of functionality not modified.
2006-04-05 23:03:18 +00:00
stronk7 c829776d34 Default TrueType font updated from (http://www.nongnu.org/freefont/)
It seems to support all the European character sets (latin + cyrillic +
greek). The rest will need to add their custom font to the langpack.
2006-04-05 22:48:14 +00:00
stronk7 03595aab1a Small change in MySQL. Seems to work better under any version
(tested over MySQL 4.1.12, 4.1.16, 5.0.18 and 5.0.19) Bug 5055.
(http://moodle.org/bugs/bug.php?op=show&bugid=5055)
2006-04-05 22:14:24 +00:00
gustav_delius 22c08850d7 Fixing stupid typos from previous commit 2006-04-05 20:02:37 +00:00
gustav_delius 4feb8730d7 Fix to make it work without globals hack 2006-04-05 19:43:42 +00:00
gustav_delius ded180686e Fix to make it work without globals hack 2006-04-05 19:35:51 +00:00
gustav_delius e8a4049ddd Removed some unnecessary code 2006-04-05 18:52:37 +00:00
gustav_delius 3ab76e6562 Don't duplicate site name in navigation bar 2006-04-05 17:37:59 +00:00
thepurpleblob 0183742eeb bug #2569. 'Open dialogues' and 'Closed dialogues' now have their own strings
rather than contatenating existing ones.
2006-04-05 13:48:01 +00:00
moodler 60f92a4330 Added a missing index for some sites (bug 5100) 2006-04-05 13:45:14 +00:00
ethem 743d932c11 Hide order details if an action emerges. (actions: capture, delete, refund, void) 2006-04-05 10:08:57 +00:00
gustav_delius 9c7c8d63f4 Prevent student from seeing quiz when closed, bug 5070 2006-04-05 09:43:29 +00:00
ethem 913a69687b Auto-capture strings changed to scheduled-capture. 2006-04-05 08:43:04 +00:00
moodler 9a7a199fd0 No need to restrict where RSS feeds can be displayed 2006-04-05 08:35:40 +00:00
ethem 0bf8ea6aa0 Show errors in original language.
You can't do this action: native_action
2006-04-05 08:28:12 +00:00
moodler 236d839ff1 Fixed some pretty major HTML errors :-) bug 5089 2006-04-05 08:19:09 +00:00
vyshane 3014ee9ccf Fixed bug: Bug #5081 - meta courses - teacher can't add child courses 2006-04-05 08:12:08 +00:00
gustav_delius 87b18f4ab7 Fixed call to required_param() 2006-04-05 07:46:52 +00:00
vyshane a1b85c9ba5 Added isset($course) test to get rid of notice 2006-04-05 07:41:12 +00:00
gustav_delius 20d6d84d43 Fixed call to required_param() 2006-04-05 07:39:32 +00:00
moodler 202a96d2c8 HTML fixes for bug 5092 2006-04-05 07:37:48 +00:00
moodler a9ac269967 FIxed some warnings bug 5091 2006-04-05 07:27:58 +00:00
moodler 9ee20a32f6 FIxed blank trailing lines (bug 5095) 2006-04-05 06:14:28 +00:00
gustav_delius 7baa9c8016 Fixing the name of the PostgreSQL files 2006-04-05 06:11:40 +00:00
gustav_delius 0a5b58af89 Many bugfixes accummulated during CVS outage, more to come. 2006-04-05 05:53:18 +00:00
vyshane edc13d625b Fixed Bug #5080 - admin/environment.php use a new and different class for the
list table
2006-04-05 05:43:19 +00:00
ethem ece1fbeeb2 Use consts when an user performs an action. 2006-04-05 05:28:56 +00:00
ethem 4440d7a432 Some indexes were added in 15_STABLE. So, don't show a warning message if index already exists. 2006-04-05 05:20:59 +00:00
vyshane 5723bc6f09 Fix for Bug #4910 - stringnames with - . and / don't show up in translation editor
Modified /admin/lang.php to allow us to still use periods in language string keys. The lang.php script just replaces the periods with ##46# for the form inputs and then puts the periods back in before saving to the language file.

This means that there is no need to update language files at all. They will just work even with periods in the string keys.
2006-04-05 04:07:16 +00:00
mjollnir_ 9c9aeef15c Fixing postgres unicode migration for mac os x and multiple postgres installations 2006-04-05 03:54:12 +00:00
moodler 960beea394 Merging fixes from stable 2006-04-05 03:19:36 +00:00
moodler 980a5b3a63 Fix the log graphs which had been broken by the reports move 2006-04-05 03:17:20 +00:00
moodler 8820365c74 Make the links more robust (index.php) 2006-04-05 03:02:57 +00:00
moodler 30bb54dc0e New strings 2006-04-05 02:53:10 +00:00
moodler a5aef8f1ce Latest tags 2006-04-05 02:47:17 +00:00
moodler c4226e0dac Some fixes for links on admin page, and release notes now a link to Moodle Docs 2006-04-05 02:46:05 +00:00
moodler d2fa35a80d FIxed a typo from long time ago in popup windows from logs 2006-04-05 02:45:13 +00:00
moodler cb342045ec The globals hack is history! 2006-04-05 02:44:33 +00:00
moodler a9924bb134 Fix for sites not using proxies 2006-04-05 02:43:41 +00:00
moodler c9a0f50828 Smaller, cleaner images 2006-04-05 02:42:54 +00:00
moodler ba76a8f5cf Fixing some Javascript errors on IE 2006-04-05 02:40:34 +00:00
moodler 9bdedea400 Changed how the "edited by" message appears in the posts edited by admin 2006-04-05 02:15:10 +00:00
moodler a5a9cd99b4 News items on home page should be sorted by date of first post 2006-04-05 01:54:41 +00:00
moodler da0cfb95de FIxed resizable icons in CSS 2006-04-05 01:53:59 +00:00
moodler 53dc0dfb6a Fixed a string name 2006-04-05 01:40:24 +00:00
moodler 7c05ae7aa8 Various fixes 2006-04-05 01:40:02 +00:00
moodler 64452eb438 Various fixes that have accumulated 2006-04-05 01:38:06 +00:00
gbateson a3d40ea8ae define PARAM_SAFEDIR (constant) and clean_param (function) if required for compatibility with Moodle 1.3 or earlier 2006-04-05 01:28:12 +00:00
danmarsden 3e11b9f44a missed one. 2006-04-04 23:36:13 +00:00
danmarsden acaf7b86e3 Bug Fixes for:
Bug 5042
Bug 4600
Bug 4021
Bad code - need to check vars aren't empty b4 using them!
2006-04-04 23:03:15 +00:00
moodler 382671bbdf Fixed tabs logic flow 2006-03-30 07:54:31 +00:00
moodler 4c2dab47a0 Fixed up some tabs names 2006-03-30 07:45:40 +00:00
moodler 0f2178550e Had to change some strings 2006-03-30 07:45:22 +00:00
bobopinna a2464082c4 Fixed two problems in AICC import 2006-03-30 06:19:52 +00:00
moodler 1d8a829a54 Better pages for hidden activities 2006-03-30 04:46:12 +00:00
moodler 3d1c33ef01 Some better security when database is hidden 2006-03-30 04:37:16 +00:00
moodler b9957ccb1d Changes to match file class changes 2006-03-30 04:26:50 +00:00
moodler ad3fba9c0d Added a missing string 2006-03-30 04:02:00 +00:00
moodler 02024106fa more years in the list 2006-03-30 03:55:24 +00:00
moodler a2f96d3e55 Use better variable names in file class 2006-03-30 03:54:39 +00:00
gbateson c20b623804 make compatible with PHP 5.1.2 by removing variable assignments in calls to functions e.g. myfunction($a=1); Micro-incremented version number to 2.1.15 2006-03-30 03:17:51 +00:00
stronk7 475e9de86f SITE and SITEID were calculated *before* 'set names' so they weren't
fetched properly from DB. Moving such block of code from datalib.php
to setup.php to execute it *after* 'set names'. Credit goes to Skodak B-)
2006-03-29 23:38:46 +00:00
stronk7 dfa76a46e3 Automatic installer.php by installer_builder (20060329) 2006-03-29 21:20:18 +00:00
moodler 353bbad47a Let's call it this, tomorrow. :-) 2006-03-29 18:52:42 +00:00
moodler cc6b0be44b Whoops, wrong line, I am tired. :-) 2006-03-29 18:38:18 +00:00
moodler 5f04c615d7 Template order makes more sense this way :-) 2006-03-29 18:36:31 +00:00
moodler c4e576f1ff Some new strings for CSS 2006-03-29 18:30:03 +00:00
moodler 68635e6f6d Support for a new CSS template, allowing you to use CSS in the other templates 2006-03-29 18:29:16 +00:00
moodler 01fe47f640 Fixed a notice 2006-03-29 18:00:58 +00:00
moodler f07fa64418 Of $COURSE you can't redefine constants :) 2006-03-29 17:56:35 +00:00
moodler 20e294eeda Added field for CSS for database templates 2006-03-29 17:42:42 +00:00
moodler 3387cc5c3f New strings 2006-03-29 17:37:25 +00:00
moodler 52373fe74d Fixes for comments 2006-03-29 17:36:20 +00:00
stronk7 447ed99612 Bump! 2006-03-29 17:27:29 +00:00
nfreear 52309a36da Bug 4995, 'Calendar, colour combinations give poor contrast'. Fix: increase contrast, darker link/weekend colors, lighter event backgrounds, original duration borders. 2006-03-29 16:46:30 +00:00
stronk7 063716bad9 Now new lang packs won't be available until UTF-8
migration was performed. Until then, only "en" and
old lang packs will be available.

The opposite is also true: only new lang packs will be available
once the UTF-8 migration was performed.
2006-03-29 16:18:46 +00:00
moodler 004bd0cc39 Some cleanups to the flow 2006-03-29 16:03:05 +00:00
moodler 00a67d879c Just removing a space 2006-03-29 15:39:21 +00:00
moodler 8a58a8e17f Starting the global COURSEID.
require_login seems to be the best place to capture this, however
I'm sure there are a few little places where it won't work.

We need to hunt these places down and fix them, because I would
like to rely on COURSEID and remove all the "global $course" hacks
that are floating around.

Probably later we need the full object $COURSE as well (to match $SITE)
2006-03-29 15:38:29 +00:00
moodler 688e209c5c Language fixes (capitalisation) 2006-03-29 15:06:36 +00:00
moodler 2eb27f07f3 Fixed some output 2006-03-29 15:03:58 +00:00
moodler ba6b47d3bf Small fix to prevent a notice, seems to still work 2006-03-29 15:00:47 +00:00
moodler c452097e15 Slightly fixing some bodgy boxes 2006-03-29 14:52:14 +00:00
nfreear 72a877f8c9 Bugtracker 5023, fixes 'Database upgrade issue: 'relation "backup_files_u" already exists in...' Added, {$CFG->prefix} 2006-03-29 11:33:59 +00:00
ikawhero b0aea051fc Added string for tabs. Cleaned up some others. 2006-03-29 10:07:21 +00:00
ikawhero d095e22f4a Smart add entry tab 2006-03-29 10:05:03 +00:00
moodler 5b3c8a00ce New string 2006-03-29 08:51:00 +00:00
moodler 3d45b8e557 Bunch of fixes including:
- separate browse / detail tabs
   - cleaner logic
   - proper sorting in all scenrios
   - settings stored in the sessions
   - better cleaner URLs
2006-03-29 08:49:28 +00:00
gustav_delius 3082b744ac Moving <td>, fixing bug 5019 2006-03-29 08:45:36 +00:00
patrickslee 08e1fad13f Completed postgres binary upgrade block for wiki module 2006-03-29 05:16:59 +00:00
gbateson a83f9d2264 fix SQL query that didn't work in PG (bug 4989) 2006-03-29 05:14:49 +00:00
patrickslee e989c7699a Convert fields refs and content in wiki_pages to binary for postgres 2006-03-29 04:48:30 +00:00
moodler c6f32032ea added ['confirmstartattemptnotimelimit'] 2006-03-29 03:05:27 +00:00
stronk7 2070370cfa Typo. 2006-03-28 23:31:12 +00:00
stronk7 1f1e3288ca Only decode from utf8 if we aren't running under utf8.
Please test it. Thanks!
2006-03-28 19:22:35 +00:00
stronk7 107919b0d6 Only decode from utf8 if we aren't running under utf8.
Please, test it. Thanks!
2006-03-28 19:18:38 +00:00
stronk7 5c30945a81 Only decode from utf8 if we aren't running under utf8.
(anyway we need a setting to decide the original encoding
and to be perfect)
2006-03-28 19:14:23 +00:00
stronk7 ef138cea77 Only convert to UTF8 if we aren't running under UTF8.
Please, test this is correct, thanks!
2006-03-28 18:53:16 +00:00
stronk7 1d5a7c4b0a Some changes to make proper UTF-8 encoding only if necesary.
We need to move all the **_tag functions to a central place ASAP
(backup are better to be used as central)
Also, I don't know why the author is now out from the feeds...
2006-03-28 18:46:07 +00:00
tjhunt ee35e0b855 Allow the display of course logs to be filtered by type of action. 2006-03-28 17:33:40 +00:00
stronk7 5db97a46a5 We don't need to convert to Unicode if Moodle is running under Unicode.
(anyway, we need a new field inside each authentication system to be
able to define the external encoding!)
2006-03-28 17:13:09 +00:00
nfreear 957aa5b93b Fix bug 5014, 'nameweekscss' language string. 2006-03-28 15:46:48 +00:00
gustav_delius 8cc274defc Changed the get_actual_responses() method to truncate at 40 characters, contributed by Jean-Michel. 2006-03-28 08:27:56 +00:00
gustav_delius 223ad0b94b Better fix for bug 3225 that is reading the precision setting from php.ini, contributed by Paulo 2006-03-28 07:39:36 +00:00
stronk7 187db9ddfe Adding "ca" to the array of encodings... 2006-03-28 07:37:58 +00:00
gustav_delius 66125eda14 Fixed incorrect use of quiz_get_renderoptions. This quiz-specific function should in future be removed from this question code 2006-03-28 07:37:51 +00:00
moodler 29d218ce2f Added GUI for $CFG->sessioncookiepath 2006-03-28 05:31:21 +00:00
moodler 1ae655b17c Support for $CFG->sessioncookiepath 2006-03-28 05:26:18 +00:00
moodler 98691349b1 Regenerate course caches after UTF upgrade (bug 5002) 2006-03-28 02:14:12 +00:00
michaelpenne a7ae1ad3fd [BugFix] Multiple essays were not showing for grading: http://moodle.org/mod/forum/discuss.php?d=41999#195580 2006-03-28 00:30:24 +00:00
gustav_delius bc2feba364 Some preparation for manual grading 2006-03-27 17:38:30 +00:00
nfreear ad525445c0 Accessibility: tidied commented code. 2006-03-27 16:54:34 +00:00
gustav_delius 5eae68aa2a Fixed tolerance problem, see bug 3225 2006-03-27 16:38:44 +00:00
nfreear c6a553710d Accessibility: Bug tracker 4997, replaced table with list - low risk! 2006-03-27 16:21:56 +00:00
nfreear 149097cee3 Accessibility: Bug tracker 4997, "Unnecessary table for course sections/activities". 2006-03-27 16:08:26 +00:00
stronk7 44eee4e2b3 FPDF class credits added. 2006-03-27 15:42:38 +00:00
nfreear 05c5dc6a53 Accessibility: Bug tracker 4994, "Need skip navigation link..." 2006-03-27 15:05:35 +00:00
moodler 5989d186ed Hiding TinyMCE settings for now, deferring this to 1.7 2006-03-27 14:09:03 +00:00
moodler 9955754227 Remove the tinymce option until 1.7 2006-03-27 14:05:40 +00:00
stronk7 039d4d5c2b At installation time we *always* are going to show release notes
from en_utf8. It's the only lang pack that includes such info
with the upgrade, independently of everything else (unicodedb...).
2006-03-27 12:46:27 +00:00
stronk7 de12ca6a42 Now $CFG->unicodedb is sent to DB everytime we arrive to the
admin/index.php script (installation, upgrade...). This will
stop the encoding introspection code present in setup.php
2006-03-27 12:32:51 +00:00
ethem f0e2d8b3d4 Merged from MOODLE_15_STABLE. 2006-03-27 12:21:13 +00:00
stronk7 7104d80dbc Now setup.php detects is CFG->unicode is not set and examines
DB to detect such value dinamically. Useful for installations
not using the standard installer but manually edited config.php
files.
Little TODO: modify a bit the initial config tables insets to
insert this value, avoiding to call it for each request. Coming
soon (although not mandatory for 1.6beta). Tested against both
MySQL and PostgreSQL with unicode and non-unicode DBs.
2006-03-27 11:24:14 +00:00
moodler 4431d2e036 Fixed no- display when not logged in (bug 4990) 2006-03-27 09:50:23 +00:00
ikawhero 763e8d61f4 Tidying up 2006-03-27 09:08:09 +00:00
ikawhero 7592c7467d Added new string for default sort 2006-03-27 09:07:57 +00:00
ethem d414c46183 Some descriptions was added 2006-03-27 08:49:43 +00:00
gustav_delius 3a58ad11bc The "Reports" tab is now a "Results" tab so that the grading fits in better. 2006-03-27 08:45:02 +00:00
ikawhero e0279f63d7 Added default sort 2006-03-27 08:42:25 +00:00
moodler 95d6f2e47d Added fpdf for use by modules 2006-03-27 08:42:07 +00:00
gustav_delius 31e95855b8 Improved quiz report plugin mechanism and converted the manual grading script into a report plugin 2006-03-27 08:41:20 +00:00
gustav_delius ffa1f07890 Removed notices caused by empty responses 2006-03-27 08:38:55 +00:00
ikawhero 616ae6d5fe Added default sort. 2006-03-27 08:37:17 +00:00
ethem c7dac7f5a9 index.php & lib.php
Payment management functions moved to lib.php
2006-03-27 08:31:16 +00:00
moodler 5f0b05fbbb Er more fixes 2006-03-27 08:03:18 +00:00
moodler 80d810be76 Added a missing fileld for direction 2006-03-27 07:54:42 +00:00
ethem 6972506e99 Tabs are out 2006-03-27 07:53:27 +00:00
ikawhero 70fe1b0534 Oops, getting my SQL right. 2006-03-27 07:44:12 +00:00
ikawhero f1d49973ac Making the defaultsort field signed to indicate sort direction 2006-03-27 07:42:33 +00:00
moodler 8179046dd5 Sort the sort menu 2006-03-27 07:24:26 +00:00
ikawhero 649a83ffb6 Version bump - added 2 new fields to data table 2006-03-27 06:52:50 +00:00
moodler 505d3123d9 Misc fixes 2006-03-27 06:52:50 +00:00
ikawhero bc1ab28226 Added 2 new fields:
1. editany - flag to allow any user to edit any entry
2. defaultsort - set the default sort field for list view
2006-03-27 06:52:11 +00:00
vyshane b395a1e44a Fix for Bug #4978 - Every time I add one field in one DB activity...
Added AS df in SQL query in data_fieldname_exists(). Reformatted the strings
to use single quotes when quoting in SQL. These changes might solve PostgreSQL
problems.
2006-03-27 06:19:34 +00:00
vyshane cb3689b917 We now mark records as approved if the data activity is set to not require
approval of new records.
2006-03-27 05:36:47 +00:00
moodler ec21b13ebb New string 2006-03-27 05:30:48 +00:00
moodler b023ec4dda Fixed index page 2006-03-27 05:28:26 +00:00
vyshane 58e167c3f4 Added 2 columns for number of records and number of records not approved yet. 2006-03-27 05:20:50 +00:00
gbateson 887df2db79 modified newlines for Windows (perhaps?) 2006-03-27 05:18:50 +00:00
gbateson d80aef713a modified README.txt to download zip, lang and question/format files from CVS 2006-03-27 05:16:15 +00:00
moodler 1a161a7041 Removed silly date string 2006-03-27 05:14:51 +00:00
moodler e8184755f3 New strings for Date field 2006-03-27 04:38:55 +00:00
moodler 7054c0e4d6 New field plugin for dates 2006-03-27 04:37:05 +00:00
vyshane 7ddda9dbcf Fixed Bug #4985 - Guest rights to the database module. 2006-03-27 04:13:32 +00:00
mjollnir_ 34f4ff351d WHERE 1 is NOT valid postgres syntax. Just pass empty string instead! 2006-03-27 04:04:40 +00:00
mjollnir_ fa10cafe61 Fixing blocks upgrade in postgres (my fault) 2006-03-27 04:03:19 +00:00
vyshane 9e5537eb3f Replaced <br /> with <hr /> for default list template. 2006-03-27 04:02:48 +00:00
vyshane 4d423a0b00 Removed the unneeded ORDER BY clauses for the queries that are COUNTing.
Fix for Bug #4979 - Errror in Browse Page.
2006-03-27 03:43:27 +00:00
moodler a05653a0b2 Improvements to print_date_selector, print_time_selector etc to allow them
to be returned as strings
2006-03-27 03:42:44 +00:00
vyshane 1ef46cbeaa Fixed javascript for cases where htmleditor is not available. 2006-03-27 03:02:26 +00:00
mjollnir_ 173fc40f56 Added missing language string for statsoff 2006-03-27 02:22:34 +00:00
mjollnir_ 742104c531 Merged from MOODLE_15_STABLE: Since there was no pg support for enrol/authorize until later, the versioning was screwey in postgres, so check the table exists first before trying to add columns to it, create it if it is not there 2006-03-26 22:59:23 +00:00
patrickslee 8cf1d8949e Stripped out an unnecessary line in pg_dump output which causes error.
Also deletes the last temp file while duplicating database to save space
2006-03-26 21:47:49 +00:00
patrickslee 40b4a063d4 Fixed false course category move when searching courses in editing mode 2006-03-26 20:58:54 +00:00
moodler dbdfc3dbab Little tidyings, I should be in bed watching Scrubs! 2006-03-26 16:19:57 +00:00
moodler 0cdb296458 Old test code 2006-03-26 16:16:06 +00:00
moodler fe350f8564 Include course in RSS feed name 2006-03-26 15:57:37 +00:00
moodler c8505cacd5 Better looking form for preferences and more accessible 2006-03-26 15:54:41 +00:00
moodler 6be88c6af0 Shortanswers can now be '0' 2006-03-26 15:03:08 +00:00
gustav_delius 5f9ef821df Moved detailed responses report into contrib 2006-03-26 12:02:46 +00:00
gustav_delius a239d1d92c Renamed the question style class from question to que, see bug 4904 2006-03-26 11:11:29 +00:00
gustav_delius d077b8793e Took out the restriction of the question styles to the quiz module only. 2006-03-26 10:48:47 +00:00
mits 9ab8f17df1 fixed "tablink text" visibility. 2006-03-26 10:06:27 +00:00
gustav_delius d23e3e11dd Moved the code for basing new attempts on previous attempts from questions to quiz and fixed the bug reported at http://moodle.org/mod/forum/discuss.php?d=42029#194212 in the process 2006-03-26 07:59:43 +00:00
mits d4156b1bd1 improved "tablink text" visibility. 2006-03-26 07:40:30 +00:00
moodler 886583bf6d FIlter wasn't using site databases globally 2006-03-26 06:28:50 +00:00
moodler 4ef4cff973 Added string for the filter 2006-03-26 06:06:00 +00:00
moodler 10aba62740 Tidy messages and display 2006-03-26 06:00:28 +00:00
moodler 5600b50118 New strings 2006-03-26 05:59:52 +00:00
moodler 33819735aa More tidying up 2006-03-26 05:36:34 +00:00
moodler 75c42c876f Properly fixed page flow for approvals and deletions 2006-03-26 05:22:16 +00:00
moodler 473dd2888b Various little fixes. 2006-03-26 05:03:10 +00:00
stronk7 3620b8dccf New generaltable styles added... 2006-03-26 01:31:46 +00:00
mark-nielsen 07de03b06a [Added] two new lang entries for import.php 2006-03-26 00:13:37 +00:00
mark-nielsen 90455bb3ab [Fixed] Import. Updated code to work with /question instead of /mod/quiz. Lead to a few interal bug fixes. Also moved two hard coded strings to the lang file. 2006-03-26 00:10:39 +00:00
stronk7 6385df35bc Fixed typo. 2006-03-25 23:43:14 +00:00
mark-nielsen 69baf10f74 [Removed] Tree view setting has been removed. Its functionality has been replaced with the tabs. 2006-03-25 21:43:10 +00:00
mark-nielsen 97d2756c65 [New Feature] Tabbed navigation added to lesson (similar to quiz)
[Added] Graceful fails added to view.php, essay grading, and reports
[Changed] got rid of a lot of references to $_POST/GET/REQUEST
[Fixed] In reports, it required teacheredit, should only be teacher
[Changed] High scores - teachers can actually see them!  Also, improved output by using print_table and print_heading
[Changed] Grade essays now uses fullname() to print user names
2006-03-25 21:38:57 +00:00
gustav_delius f1b50ee94c Use existing language string for correct answer 2006-03-25 21:36:00 +00:00
mark-nielsen b59c1d77e9 [New] lang entries for tabs
[Changed] old lang entries to help bring consistancy and unity to the different lesson pages
2006-03-25 21:29:20 +00:00
gustav_delius 0705c069c0 Shortened and simplified a string, so that it fits better onto the quiz editing form. 2006-03-25 21:28:41 +00:00
gustav_delius 5cb9076a58 Removed warning when deleting questions with no states 2006-03-25 21:07:11 +00:00
gustav_delius d7bc70247c Fixed typo 2006-03-25 21:04:44 +00:00
moodler 9803d9740f Fixed some mistakes 2006-03-25 17:19:42 +00:00
moodler 7da6274c35 Return to the record you edited after editing 2006-03-25 16:29:35 +00:00
moodler dbcf5bdcbf Fixed some bung security logic 2006-03-25 16:19:06 +00:00
moodler 2740351ee9 Improvements to RSS . it could be better 2006-03-25 16:12:42 +00:00
moodler d74a6d5e67 Removced the "generate all" button and just made it a default action for
new databases
2006-03-25 14:58:14 +00:00
moodler a44e70811a Update the passed-in data object when generating new templates 2006-03-25 14:57:36 +00:00
moodler 4d75b9eb0d Smarter links for the templates tab 2006-03-25 14:56:27 +00:00
moodler 32cba33f8e iChanged strings 2006-03-25 14:20:00 +00:00
moodler ec865e2d74 Fixes for fields display 2006-03-25 14:00:54 +00:00
stronk7 11f7b25d18 Bump! Now we support Win32 locales. B-)
Anyway some "holes" remain. See:

http://docs.moodle.org/en/Table_of_locales
2006-03-25 12:26:33 +00:00
stronk7 9533fbd5a6 English_Australia is our root Windows locale! :-P
See: http://docs.moodle.org/en/Table_of_locales
2006-03-25 12:21:35 +00:00
moodler be51e3d504 Rename a string 2006-03-25 08:49:20 +00:00
moodler 66cb6f29d7 Better-looking add fields 2006-03-25 08:46:35 +00:00
moodler a7ee8d45cc Don't prefix add filed with label 2006-03-25 08:46:02 +00:00
mjollnir_ effbd108a3 Fixing call to upgrade_plugins since questiontypes moved to question/type 2006-03-25 07:55:56 +00:00
moodler a33c4e5a84 Added support for Yahoo and MSN Search 2006-03-25 07:09:40 +00:00
gustav_delius 4eda4eecbd Added question type that is used if a question of unknown type is encountered.
Also removed some of the unnecessary calls to name()
2006-03-24 21:21:59 +00:00
gustav_delius 5c2447494d These are no longer needed because the backup functions are part of the questiontype classes now. 2006-03-24 20:44:13 +00:00
mjollnir_ 9ec656750e More time fixes for stats - under certain dst situations there could have been an infinite loop. Please someone who is clever about timezones & dst review this 2006-03-24 20:43:38 +00:00
gustav_delius ca252edb1d Setting title attribute on questiontype icons so that tooltips show the question type name 2006-03-24 20:02:42 +00:00
gustav_delius aaae75b04f Renaming question/questiontypes/ to question/types/ as requested by Martin 2006-03-24 19:54:13 +00:00
gustav_delius 643ec47d32 Renaming question/questiontypes/ to question/types/ as requested by Martin 2006-03-24 19:31:46 +00:00
nfreear 3d9237d685 Accessibility: resizable icons moved to pix/a/ and renamed. 2006-03-24 17:08:47 +00:00
moodler 204ff4a127 Always allow regeneration of templates 2006-03-24 14:49:21 +00:00
thepurpleblob 994890ef3a Added missing string 2006-03-24 14:49:13 +00:00
moodler 36a9cc4caf Cleaned up approval script (more security ;-)) 2006-03-24 14:48:54 +00:00
moodler 0eda0a46b2 Fixed a typo 2006-03-24 14:44:55 +00:00
vyshane 251616fd67 Update for URL field changes. 2006-03-24 14:35:21 +00:00
vyshane faf5ec4fa5 Bug fixes and changes to URL field. 2006-03-24 14:34:00 +00:00
moodler 5bac6d10e3 Renamed fields.php to field.php 2006-03-24 02:44:05 +00:00
moodler a2cd47971d Renaming some stuff, it's the fashion this week 2006-03-24 02:35:36 +00:00
moodler 7cd3acc45e Just working out the preset file format 2006-03-24 02:21:48 +00:00
vyshane f41cadeba7 Fix for Bug #4969. Renamed variable $mode to $template. 2006-03-24 02:09:15 +00:00
stronk7 311c697a86 Added two strings to display dates properly. For English we leave them
empty as ASCII = UTF-8
2006-03-23 23:45:28 +00:00
patrickslee c4dd557978 Proper fix for the module toolbar actions 2006-03-23 23:36:20 +00:00
patrickslee 9932144e89 Fixed group switch icon cannot set a module to use no groups 2006-03-23 22:56:11 +00:00
gustav_delius 363773ef87 Removing questiontype settings from quiz settings page 2006-03-23 19:56:42 +00:00
gustav_delius 1fc29d8a1e Taking out help button from the grade option, there is really no help required. 2006-03-23 19:51:58 +00:00
gustav_delius cd9ca85409 Timer now uses the client's clock. Patch contributed by Phillip Franks, see bug 4967 2006-03-23 19:32:24 +00:00
stronk7 b8770bc0a5 Two new $CFG runtime variables created $CFG->ostype (WINDOWS, UNIX) and
$CFG->os (= PHP_OS) to handle it centrally. Also, although not critical,
it should be recommended to replace all the current uses of PHP_OS to the
new variables. See bug 4968.
(http://moodle.org/bugs/bug.php?op=show&bugid=4968)
2006-03-23 17:54:33 +00:00
stronk7 f422ee81c3 Automatic installer.php by installer_builder (20060323) 2006-03-23 16:52:20 +00:00
stronk7 fc4a9c3261 Automatic installer.php by installer_builder (20060323) 2006-03-23 16:35:18 +00:00
ethem 2eaa289883 Table type fix. ENGINE changed to TYPE. Old mysql version issue. 2006-03-23 14:26:18 +00:00
gustav_delius 5bf3aee8bb Do the module upgrades before the qtype upgrades 2006-03-23 13:05:40 +00:00
thepurpleblob 51bcdf28b3 Added support for matching questions. Bug #3901 2006-03-23 11:13:50 +00:00
thepurpleblob 2d52056f79 Not all questions have grades/fractions. Added check. 2006-03-23 11:12:54 +00:00
moodler d118d06afc Various tidy-ups 2006-03-23 10:01:21 +00:00
ikawhero b51434e751 Block now configurable. 2006-03-23 09:55:20 +00:00
ikawhero 4852ab889f Added some new strings for blog tags block 2006-03-23 09:53:52 +00:00
vyshane fd96d5e2ec Fixed bug data_print_template() from /mod/data/lib.php. Extra function
argument removed.
2006-03-23 08:34:22 +00:00
ikawhero e8964639ce Tidied up the class size assignments 2006-03-23 07:48:49 +00:00
vyshane a18f8e458f Renamed $rid to $recordid in function call $field->update_content($rid,
$value, $name); This fixes a bug that was causing the data_content to be
stored wrongly.
2006-03-23 07:20:16 +00:00
vyshane 3a5a7928ea Fixed extra function argument in call for display_add_field() from add.php. 2006-03-23 06:20:48 +00:00
moodler 59d28e0550 removed $content->content = $this->format_data_field_multimenu_content($value); bad cut and paste 2006-03-23 05:41:48 +00:00
moodler 2b1d7c8e82 Fixed some typos 2006-03-23 05:38:53 +00:00
vyshane 8921fdb762 Fixed typo in function define_field() 2006-03-23 03:48:58 +00:00
moodler 2ef2b3f19d Fixed Fatal error: Call to undefined function get_course() in /data/www/html/server/dev/mod/data/field/file/field.class.php on line 133 2006-03-23 02:50:21 +00:00
vyshane e64ef4f9b7 Fixed php notice for undeclared variable. 2006-03-23 02:34:37 +00:00
moodler 6d727d75cf Added missing text 2006-03-23 01:32:34 +00:00
mjollnir_ 60f4cbc13a Fixing missing , in prefix_blog_instance postgres creation 2006-03-23 00:37:53 +00:00
gustav_delius 76de2cdf1a Putting the "Save as new question" button back. 2006-03-22 22:37:27 +00:00
gustav_delius 6dfc23760f The obsolete table quiz_attemptonlast_datasets should no longer get created 2006-03-22 22:04:31 +00:00
gustav_delius 7518b645b9 Removed some more references to quiz from the questiontype code. 2006-03-22 21:51:33 +00:00
gustav_delius fe9b5cfd0b Fixed the links to the question review script. 2006-03-22 21:30:00 +00:00
thepurpleblob a22802e051 Fixed link to example file. 2006-03-22 19:14:36 +00:00
thepurpleblob 2bcbc88d0a Changed comment about encoding (must be utf-8) 2006-03-22 18:58:36 +00:00
thepurpleblob 8a6f231b50 added rest of instructions for this option 2006-03-22 18:43:44 +00:00
gustav_delius 0429cd86c3 Deleting attempts properly now 2006-03-22 18:27:28 +00:00
michaelpenne 8a18280393 Added a new entry to this file for Essay question type. I followed the format of the other question types listed in this file. 2006-03-22 18:06:00 +00:00
michaelpenne 1b704069c4 Help file for the Essay question type. 2006-03-22 18:03:42 +00:00
nfreear 6575bfd4d1 Accessibility: fix bug 4963 in function, print_header. Added 'lang' attribute to $direction, used by standard and other themes. 2006-03-22 17:48:53 +00:00
gustav_delius 4dca7e51ca Some minor improvements in the handling of review options, the setting of timestamp, and improvements to the documentation 2006-03-22 17:22:36 +00:00
nfreear 48943f403c Accessibility: fixed bug 4012 x9, added Alt, filled empty Alt-link text. 2006-03-22 17:19:46 +00:00
gustav_delius 609c7d517d Fixed bug 4953 2006-03-22 17:18:55 +00:00
ikawhero 7d61cf6596 Added sorting - needs generalising. 2006-03-22 16:48:35 +00:00
thepurpleblob 4b920216ac New help popup for import option 'match grades'.
Needs some more info.
2006-03-22 16:44:47 +00:00
thepurpleblob 76f0a33403 Grades in imported questions must match grades option list.
Added option to either generate error or match to nearest valid value if they don't
2006-03-22 16:30:14 +00:00
thepurpleblob 8511669cb9 Added function for matching/checking question grades on quiz import. 2006-03-22 16:27:46 +00:00
thepurpleblob e86ce920fa Added new strings for question grade matching 2006-03-22 16:27:04 +00:00
moodler 1472fc4b36 Fingers were on auto-pilot obviously! Thanks Mits! 2006-03-22 15:54:54 +00:00
moodler a835f1c343 Removed some debugging 2006-03-22 14:55:49 +00:00
thepurpleblob b4db945e40 Grade option list generation now out to library 2006-03-22 14:44:33 +00:00
thepurpleblob e9de436630 Split out grade option list generation, so it can be used in import/export too. 2006-03-22 14:43:55 +00:00
moodler f0497d6ff0 Various cleanups 2006-03-22 14:31:32 +00:00
moodler 6c74c1da70 Some language modifications 2006-03-22 14:31:06 +00:00
gustav_delius dfa47f965c Cleanup: don't use questiontype constants within questiontypes 2006-03-22 13:51:25 +00:00
moodler 26d93549f5 Fixed up some styles and pagepath for field-editing pages 2006-03-22 13:38:29 +00:00
gustav_delius 76a1cf366e Don't name script files after the plugin, makes it more difficult to base a new plugin on an old one. 2006-03-22 12:19:40 +00:00
gustav_delius e08eba6a66 These are no longer needed because the restore functions are part of the questiontype classes now. 2006-03-22 11:56:04 +00:00
gustav_delius 18cbc9683d rqp questions set the type to rqp_nn where nn is the rqp_type id 2006-03-22 11:19:26 +00:00
gustav_delius ead293420d Questiontypes are doing their own database upgrade now.
I modified the enrollment plugin mechanism to work for any type of plugin
2006-03-22 10:44:54 +00:00
gustav_delius ea889e7744 Recode qtypes during restore of old backups. 2006-03-22 10:32:29 +00:00
gustav_delius 9b908126b9 Bumped the backup version because I need this version in the question restore code. 2006-03-22 10:28:42 +00:00
ikawhero f918fce272 Some styles for block blog tags 2006-03-22 10:14:52 +00:00
ikawhero eaa319b355 Added colours (correct Aust English spelling) for block blog tags 2006-03-22 10:14:08 +00:00
moodler b6ffdddaa5 Tweaky tweaky tweak 2006-03-22 09:53:13 +00:00
moodler bf4de5b583 Cleanups 2006-03-22 09:49:29 +00:00
moodler aa34425f43 Fixed up hardcoded tables with notice_yesno 2006-03-22 09:43:10 +00:00
moodler 9a169d1dc7 Cleaned up table of fields 2006-03-22 09:33:29 +00:00
ikawhero 976982d3e2 Corrected variable reference - was causing problems with SQL inserts/updates. 2006-03-22 09:16:08 +00:00
moodler c9095ae670 The menu to add fields is now more accessible 2006-03-22 09:14:44 +00:00
moodler 1b0d9dca18 Fixing more typos 2006-03-22 08:56:47 +00:00
moodler 423bd918b5 Fixing silly stuff 2006-03-22 08:44:26 +00:00
gustav_delius 3be86ca6b3 In preparation of the qtype plugin-mechanism give set version information for all questiontypes that already have database tables. 2006-03-22 08:41:56 +00:00
ikawhero 78d932b793 Initialise variable usedtags. 2006-03-22 08:38:47 +00:00
moodler ed69c72326 Fixes 2006-03-22 08:32:54 +00:00
moodler 0997e51afe Lots and lots and lots of cleanup for the data module code, mostly
to do with how the field classes worked.  Now it should be even easier
for developers.

No changes for users.  :-P

The changes are not well tested yet!
2006-03-22 08:07:26 +00:00
vyshane 53c988a403 Fix for Bug #4954
Patch submitted by jun at catalyst dot net dot nz
2006-03-22 07:07:57 +00:00
vyshane 1e9f3edb56 Added $CFG->pagepath for Moodle Doc link. 2006-03-22 04:15:00 +00:00
vyshane c05181937a Added $forcelang optional parameter. This is useful if we want to get help.php
to display the help content in a language irrespective of the site language
settings. This is needed for /admin/helpdoc.php script. This view requires
previews for:

1) en_utf8
2) the current language the site is set to

Without the change to /help.php, 1) is not possible.
2006-03-22 03:16:27 +00:00
vyshane 3b26532171 Fixed preview link bug (Bug #4942). Made the preview popup use /help.php for a
real preview of what the help content will look like.
2006-03-22 03:13:31 +00:00
gustav_delius 6040798269 Abolished the qtype integers. The question types are now indexed by their name as specified by their directory name. This will avoid a lot of confusion in future when we have plugable question types. 2006-03-21 23:08:36 +00:00
danstowell 069b6daf76 Minor changes to RSSlib - main change is augnmented PHPdoc for the issues in RSS enclosures 2006-03-21 22:35:23 +00:00
gustav_delius ba8f7ff02a Restore works again, except for random questions. 2006-03-21 22:35:03 +00:00
gustav_delius 315559d354 Moving question restore code into questiontype classes. The restore is now temporarily broken but I will fix it as soon as I get home. 2006-03-21 20:59:32 +00:00
gustav_delius 6af1e0b2c2 Fix bug 4952 2006-03-21 20:55:23 +00:00
dhawes 6b263129c0 fix listed in bug 3834 applied 2006-03-21 20:54:50 +00:00
stronk7 b51551e794 Some excess of security was causing Bug 4713.
(http://moodle.org/bugs/bug.php?op=show&bugid=4713)

Merged from MOODLE_15_STABLE
2006-03-21 20:08:51 +00:00
gustav_delius c5d94c4150 Moved questiontype specific backup functions into questiontype classes 2006-03-21 18:15:09 +00:00
moodler 42431d7a30 Fixed bug in make_mod_upload_directory() vecause of new lang packs 2006-03-21 16:57:32 +00:00
gustav_delius fe1106f0d1 Now the question backup code has been separated from the quiz backup code. 2006-03-21 16:50:42 +00:00
nfreear 8ceb3e67d5 Part fix, bug 4943: print_simple_box behaviour changed. Now aligns box, and shrinks to fit for left/right-alignment. 2006-03-21 16:29:50 +00:00
gustav_delius 924ff16a07 Moving question backup from mod/quiz/ to question/. In a first step I am making a duplicate copy of the whole backuplib.php. Next I will go in and delete the question backupcode from mod/quiz/backuplib.php and the quiz backup code from question/backuplib.php 2006-03-21 15:38:35 +00:00
gustav_delius cf60a28a0b Fixed small problem in delete_question() 2006-03-21 15:33:30 +00:00
tjhunt f76648809e Clarify doc comment. 2006-03-21 14:09:55 +00:00
thepurpleblob bc12bfea4f Removed unused global (see bug #4948) 2006-03-21 13:38:36 +00:00
anthonyforth 88629fc419 Rename backup_ids_uk constraint to include prefix to allow easy installation of multiple instances from one database. 2006-03-21 10:31:28 +00:00
moodler 581d27ff58 FIxes for some question styles that were getting confused by the new /question
directory
2006-03-21 09:39:15 +00:00
moodler 92b6d775b2 No reports or grading when there are no questions 2006-03-21 09:28:08 +00:00
moodler c88369b8e3 Christian's code to support time delays 2006-03-21 09:24:47 +00:00
moodler 07679347f4 Removing language files we don't need 2006-03-21 09:23:20 +00:00
moodler 133081306d Just another warning 2006-03-21 09:21:00 +00:00
moodler cc9708572b Removed errant help file 2006-03-21 09:16:22 +00:00
moodler 26c829d7ed Improve the English 2006-03-21 09:12:38 +00:00
moodler da077b9a7a Change of function name, no actual change 2006-03-21 09:08:57 +00:00
moodler ba6602f8da Old change, just removing a comment 2006-03-21 09:08:16 +00:00
moodler d27a5b2581 Christian's changes to update Resources when files are moved
I've not checked this closely but it seems to work
2006-03-21 09:07:19 +00:00
gustav_delius f67172b64b Moved code to delete questions and question categories to lib/questionlib.php
Also fixed bug 4949
2006-03-21 09:06:34 +00:00
moodler 9d8d30e03a Aha, the link to the new reset feature 2006-03-21 09:04:22 +00:00
moodler d799fa2d6c Checking in an old change 2006-03-21 09:03:30 +00:00
moodler dba2764db7 Show tag name in the RSS feed 2006-03-21 08:56:20 +00:00
moodler 0ad2f60285 Small patches while I contemplate rewriting all those patches from scratch 2006-03-21 08:04:15 +00:00
moodler 6479f65751 Filled in string for blog tags block 2006-03-21 07:37:12 +00:00
moodler ffd0fbb7ac New feature: you can now reset a course simply and easily using the new
"Reset" item on the course admin menu.

This allows you to delete user data from the course without touching the
course itself.
2006-03-21 07:34:33 +00:00
vyshane 6305db8858 Bug #4887 2006-03-21 07:03:37 +00:00
vyshane 5a1736e382 Added $CFG->pagepath for Moodle Docs. 2006-03-21 04:59:55 +00:00
vyshane c27ae154d6 Added language strings for CVS imports. 2006-03-21 04:38:05 +00:00
vyshane e1791b72e8 Added CSV import facility for the data module. Fixed notice for checkbox and
multimenu field types.
2006-03-21 04:36:36 +00:00
vyshane 2c42a9e71c Fixed Bug #4945 2006-03-21 03:11:38 +00:00
moodler d7dfcee179 Tweaking output and layout 2006-03-21 01:35:42 +00:00
gustav_delius 4b87fbe7ad Improved language strings used during deletion of courses 2006-03-20 23:05:35 +00:00
gustav_delius 90c3f31066 Some improvements to delete_question() 2006-03-20 23:04:22 +00:00
gustav_delius 75cd257be8 Moved the quiz constants into lib.php to keep things simple. 2006-03-20 20:59:46 +00:00
gustav_delius af3830ee49 Rename quiz_default_questiontype to default_questiontype 2006-03-20 20:52:18 +00:00
gustav_delius 6b11a0e863 Renaming constants QUIZ_ADAPTIVE and QUIZ_IGNORE_DUPRESP to QUESTION_..... and moved them to lib/questionlib.php because they are used for question-level options. 2006-03-20 20:45:55 +00:00
gustav_delius 077588e2a4 Removed references to quiz 2006-03-20 20:19:29 +00:00
stronk7 2d597adac7 Automatic installer.php by installer_builder (20060320) 2006-03-20 16:25:00 +00:00
moodler 2c0be8da59 Rename a link 2006-03-20 15:56:19 +00:00
moodler 356d76d5f3 Tidy form a tiny bit 2006-03-20 15:55:08 +00:00
moodler e037ed244a Some new default styles for generaltables 2006-03-20 15:44:07 +00:00
moodler 5889c1bb64 Small fix for admin menu layout and also print_table 2006-03-20 15:33:18 +00:00
moodler 8e62501630 Slight, temporary fix for one thing caused by new print_simple_box (see bug 4943) 2006-03-20 15:27:35 +00:00
thepurpleblob 9ecf1c7727 Removed comments for global filter settings.
These now have a GUI option on the admin=>filters page
2006-03-20 15:06:10 +00:00
thepurpleblob 2a8dfb5caa Added explanatory note about encodings in imported files. 2006-03-20 13:48:33 +00:00
moodler 6887074b40 New string 2006-03-20 13:12:21 +00:00
moodler ee64892aae Some new strings 2006-03-20 12:50:22 +00:00
moodler ebb73f49b8 RSS should be fully working now
but phew, we need to clean up that old simpblog stuff with all the wierd
variable names.  ;-)
2006-03-20 12:45:36 +00:00
moodler 952d8dc87c Speedup! get_timezone_record wasn't caching! :-) 2006-03-20 09:36:47 +00:00
ikawhero f3ea6dfaaa Block for listing blog tags 2006-03-20 08:28:25 +00:00
moodler 9a8091a9ab Put some default times in for people who were tracking dev 2006-03-20 07:47:41 +00:00
moodler 2d642a137c Add timemodified to blog_tag_instance records and some clean up 2006-03-20 07:45:55 +00:00
moodler 6a30c073d4 Added timemodified to blog_tag_instance table and some indexes 2006-03-20 07:40:55 +00:00
moodler 112d0ebf82 Added a new field "module" to the post table to indicate what type of module
each entry is
2006-03-20 07:13:21 +00:00
moodler 490201c75c tag support in rss 2006-03-20 05:48:40 +00:00
moodler a9743837bf SLightly more efficiency to help keep the cached_text table smaller see bug 4677 2006-03-20 02:33:41 +00:00
stronk7 c47a030a0b Email encoding only can be specified if $CFG->unicodedb=true 2006-03-19 20:42:34 +00:00
gustav_delius 7347c60b52 Teacher-provided text is now printed without cleaning. 2006-03-19 19:49:37 +00:00
gustav_delius 3abfa3a013 Show All link below question list. 2006-03-19 19:23:07 +00:00
gustav_delius d38bd8c1be Removed a notice 2006-03-19 18:33:35 +00:00
gustav_delius afabbb3374 Almost forgot to take out diagnostic echo 2006-03-19 18:31:48 +00:00
gustav_delius f30bbcaf5b Improved handling of event types so that now graded states can always be distinguished from ungraded ones. 2006-03-19 18:28:29 +00:00
gustav_delius 43a602a7a6 Small correction to comment 2006-03-19 12:19:49 +00:00
stronk7 8abebd1e5b Notice killing... ;-) 2006-03-19 11:13:16 +00:00
stronk7 a848411a3b Notice killing... ;-) 2006-03-19 11:10:25 +00:00
gustav_delius 570c30aaa0 slightly more informative error message 2006-03-19 11:05:04 +00:00
gustav_delius b2315a929d Don't try to recode empty answers. 2006-03-19 11:03:12 +00:00
gustav_delius 96e5e2e251 I hadn't known that ! has higher precedence than == 2006-03-19 11:02:36 +00:00
gustav_delius 18bd0d680c miniscule change: subquestion code only has to be unique within question 2006-03-19 10:43:12 +00:00
gustav_delius 549880a59d temporary fix to essay print_question... This really should be converted to using templates. 2006-03-19 10:21:23 +00:00
stronk7 afe7f09506 Automatic installer.php by installer_builder (20060319) 2006-03-19 10:04:24 +00:00
gustav_delius c0749a1605 Fixed backup and restore for match questions 2006-03-19 09:50:43 +00:00
gustav_delius 28b904c8c2 Fixed multichoice restore
Print message when recoding fails
2006-03-19 09:20:42 +00:00
stronk7 39aed89b8b Now the user emailcharset setting can fallback to the site emailcharset setting. 2006-03-19 02:46:56 +00:00
stronk7 c539d6224b Now encode_mimeheader() only encodes the header if it isn't 100% ASCII. 2006-03-19 02:38:21 +00:00
stronk7 56a2b987e6 Starting NOW we are using our own encode_mimeheader() function to
generate all Moodle emails. Only applied if we are running under
$CFG->unicodedb. Tested with postfix and sendmail servers and
Thunderbird, Mail and Entourage mail clients...

Test, test, test....!
2006-03-19 02:35:50 +00:00
mark-nielsen 8bd7bacd14 [Fixed] this page was shooting of warnings for unset variable score. Now checks to make sure score is set before using it. 2006-03-19 02:16:00 +00:00
mark-nielsen aeade7e227 cleaned up the left menu feature output by removing an unused form and several unnecessary string concatenations 2006-03-19 02:08:37 +00:00
stronk7 fbf7e289a9 Updating phpmailer to 1.73. Some bugs solved. 2006-03-19 02:07:51 +00:00
stronk7 b4750d4d7f Updating phpmailer to 1.73. DOS linefeeds are now out. 2006-03-19 02:06:06 +00:00
stronk7 376508306e Updating phpmailer to 1.73. Language files. 2006-03-19 02:03:02 +00:00
mark-nielsen 289218844a [Changed] The print_simple_box_start/stop changes conflicted greatly with the display of branch table buttons (the box printed above the buttons some how :( ) To fix this, the tables were taken out and divs were used instead to display and arrange the buttons. This turns out to be a good thing because now the user has more control over the buttons via style sheet. Also did some extra clean up in the section of code printing the branch table.
[Added] new styles to styles.php to help display the buttons correctly.
2006-03-19 01:53:50 +00:00
stronk7 3ec5ec15bc Function encode_mimeheader() added. Finally, it seems that we have to
use our own function because phpmailer one doesn't handle multi-byte
characters, breaking them.
2006-03-19 01:09:15 +00:00
gbateson d95bcfff8d increase gap size for long answers in JCloze 2006-03-18 23:47:56 +00:00
koenr 250091b6ca these files have two titles 2006-03-18 20:52:50 +00:00
koenr 56dda82175 changed titles to Moodle standard helpfile titles 2006-03-18 20:41:24 +00:00
stronk7 b212c114ce First cut of email working with any encoding. Works practically ok but
I've to check something that seems to be a bug in the build of the
subject. Sendind it to CVS to check the code under Win32 and Linux.
2006-03-18 17:48:52 +00:00
gustav_delius ccccf04f70 Multianswer restore now works.
Timelimit is rounded to integer before saving in the database
Some more diagnostic error messages
Towards more plugable question types: $QUIZ_MENU is now populated by the question types themselves.
2006-03-18 14:14:55 +00:00
skodak a4b3fc9220 fixed warning 2006-03-18 10:07:35 +00:00
moodler 884dc7861a Fixed case for multiple grops 2006-03-17 17:17:51 +00:00
stronk7 36bd0b29a4 Automatic installer.php by installer_builder (20060317) 2006-03-17 16:27:55 +00:00
moodler 6b09974ba2 Added the missing support for typex fields! 2006-03-17 16:19:31 +00:00
nfreear 11154cb8fe Accessibility: updated the "help prefix" - spoken 'colon' to silent ',' 2006-03-17 13:01:55 +00:00
nfreear 5288e4a5ff Accessibility: tidied, removed commented code functions, print_simple_box_start, _end (followup to OU-Bugz: 737) 2006-03-17 12:27:18 +00:00
nfreear b7fb26437d Accessibility: tidied, scripted the validator links, added 'skip block' explanation, removed MIME type, 'no new window' notes. Updated javascript, image sections. 2006-03-17 11:53:13 +00:00
nfreear 334cefd2e3 Accessibility: TODO: link to; synchronise with accessibility status. Help page sections - accessibility statement, access keys, links, images, standards compliance. 2006-03-17 11:39:31 +00:00
nfreear 3e0bacff76 Accessibility: function calendar_top_controls, tidy up commented code. 2006-03-17 10:53:15 +00:00
moodler 6619a7f4a3 iImproved RSS 2006-03-17 09:48:24 +00:00
moodler a848c48cf3 Just pushing the RSS a bit further, it's not tested properly yet 2006-03-17 09:11:06 +00:00
moodler 66c52fdfb4 Just tweaking 2006-03-17 08:20:28 +00:00
toyomoyo 0deaa99354 blog not blogs 2006-03-17 08:13:48 +00:00
toyomoyo ab7d76bb5a naming consistency 2006-03-17 08:13:27 +00:00
danstowell 95a86f752b Fixes to rsslib to ensure the output is valid RSS 2.0 2006-03-17 07:44:22 +00:00
toyomoyo 516194d0e8 made some changes to allow rss feeds 2006-03-17 07:38:08 +00:00
toyomoyo 7fe0ce4e6a had to change this a bit because blogs use different location to store rss, as it is not a module, please warn if this is a security issue 2006-03-17 07:37:27 +00:00
toyomoyo 29e2dd37ea took out rss stuff 2006-03-17 05:54:46 +00:00
toyomoyo 1e1ba8c295 change in publish states 2006-03-17 05:53:52 +00:00
vyshane 663b45a86d Fixed php notice 2006-03-17 04:51:14 +00:00
mark-nielsen 0646963948 [Changed] function execute_teacherwarning to function lesson_display_teacher_warning because it was violating the function naming policy 2006-03-17 03:37:31 +00:00
mark-nielsen 4b55d2aff2 [Added] added phpdoc comments to locallib.php 2006-03-17 03:31:19 +00:00
mjollnir_ aa898e41c1 Stickyblocks: fool pagelib into thinking it is course-view when it needs to be, rather than admin-stickyblocks 2006-03-17 03:17:44 +00:00
gustav_delius c6abbe5e39 Some incomplete work on the restore code (committing only because I am moving to a different machine) 2006-03-16 21:17:31 +00:00
jgraham909 53f6a21e5e Fixed grade_category table definitions to handle change in MySQL versions 5.0.3 and greater
see http://moodle.org/mod/forum/discuss.php?d=41501 for more details.
2006-03-16 19:50:28 +00:00
patrickslee 17eef684ae Fixed a typo in the last authorize.net patch from Ethem 2006-03-16 19:32:17 +00:00
nfreear 2e94cf0c09 Accessibility: incidental image - should be empty Alt text; removed unnecessary height/width (OU-Bugz: 696, 697) 2006-03-16 11:51:19 +00:00
nfreear c14d100161 Accessibility: strict, removed unnecessary alt="search" from <input type="text">. 2006-03-16 11:47:38 +00:00
nfreear eab1f9aebd Accessibility: do NOT change, fixed call to trim in function, helpbutton (OU-Bugz: 752) 2006-03-16 11:13:21 +00:00
nfreear 97f76a1aa3 weblib.php: replaced <table> in print_simple_box_start _end with <div>s (OU-Bugz: 737) 2006-03-16 11:03:02 +00:00
danstowell bce7a133b9 Re bug 4640 - enabled filtering for attachment link HTML - enables MP3 uploads to use mediafilter, for example 2006-03-16 10:36:54 +00:00
skodak e520147b60 fixed Bug #4855, too much info saved in db. 2006-03-16 10:22:40 +00:00
skodak 6381d41aba fixed problem when saving module settings 2006-03-16 10:11:06 +00:00
vyshane 4379c8e9bb W3C validation and misc code cleanup. 2006-03-16 08:49:20 +00:00
toyomoyo d87c9c6ea0 if not logged in, can not edit page. tags + 2 spaces 2006-03-16 08:45:39 +00:00
toyomoyo a093387b92 if htmleditor is on, only show html format 2006-03-16 08:32:29 +00:00
toyomoyo 3d624b9831 formattign issues 2006-03-16 08:22:53 +00:00
toyomoyo ae8a5ff023 added blog link to print_user 2006-03-16 08:16:08 +00:00
toyomoyo e97e16dfe2 min pagesize = 1 2006-03-16 07:55:22 +00:00
toyomoyo 12e01c0ce3 can not see links if not logged in 2006-03-16 07:51:12 +00:00
toyomoyo 4fc479666f rmoved batchpublish in lib, add new entry link on top 2006-03-16 07:47:37 +00:00
toyomoyo debaed9f71 case insensitive tag search 2006-03-16 07:41:26 +00:00
moodler aad6de9208 Simplified 2006-03-16 07:22:58 +00:00
toyomoyo 3daaa61811 more cleaning 2006-03-16 06:16:54 +00:00
vyshane a2c28054b8 Added $CFG->pagepath to the blocks_execute_action() function for the config
action. This is used to generate the Moodle Docs URL for configuration of an
instance of a block.
2006-03-16 04:55:43 +00:00
toyomoyo 60534cfc9c more cleaning for filter class 2006-03-16 04:33:47 +00:00
toyomoyo 91366ca7dd more cleaning 2006-03-16 04:21:13 +00:00
vyshane a0fd7c1df8 Updated print_textarea() 2006-03-16 03:56:19 +00:00
toyomoyo c0778901fd more cleaning 2006-03-16 03:42:56 +00:00
michaelpenne 2ea3451018 SQL error occured when viewing this page and no questions have been added to the quiz. This has been fixed. 2006-03-16 03:26:49 +00:00
toyomoyo 40b6323cd0 fixed a bug where using tag to search blogs, nav menu is not working 2006-03-16 02:01:55 +00:00
skodak 09eb1e9e28 fixed live link 2006-03-15 21:05:19 +00:00
skodak 838231ff95 fixed broken log links in admin menu; I noticed it some time ago, the merge seems to be finished - I decided to fix it now 2006-03-15 21:03:45 +00:00
skodak f89f924e03 fixed debug warning 2006-03-15 20:50:05 +00:00
gustav_delius 5872b4cca3 Fixed typo giving sesskey error 2006-03-15 20:25:49 +00:00
skodak 9bc78f8456 fixed typo PARAM_CLEAR 2006-03-15 18:08:24 +00:00
nfreear 3fb99e7352 Accessibility: fix removed .navbar { height }, admin view in Opera 8 (OU-Bugz: 750) 2006-03-15 15:33:19 +00:00
nfreear ee692a4210 Accessibility: fix - darker, 'weeks' course format - date text too pale (OU-Bugz: 751) 2006-03-15 15:26:15 +00:00
nfreear 1b3a4c8f1c Accessibility: 'weekscss' course format - layout table of weeks, now a list. 2006-03-15 15:20:53 +00:00
koenr ba54314b58 typo 2006-03-15 14:25:58 +00:00
nfreear 2f8a4d8548 Accessibility: improved class-name semantics, matches 'weeks' course format. 2006-03-15 11:02:42 +00:00
nfreear 2bf0e5e2a9 Accessibility: added title to envelope link, replaced img width/height (OU-Bugz: 697,736) 2006-03-15 10:42:50 +00:00
nfreear ce148ff57e Accessibility: critical fix (editing on), filled empty Alt-link text, times 6 (OU-Bugz: 744) 2006-03-15 10:26:56 +00:00
nfreear d57be0a8b4 Accessibility: strict, replaced image border, width... with classes (OU-Bugz: 697, 745) 2006-03-15 10:23:09 +00:00
moodler e7fea10028 Don't use isteacher() 2006-03-15 10:05:19 +00:00
moodler fe5a1e23b3 Remove hardcoded box size for My Moodle 2006-03-15 09:59:28 +00:00
moodler 9cba7a8c80 Added some more efficiencies to the code, but something seems to be wrong
with this function as the SQL is not finding any new posts at all for me.

Needs checking!
2006-03-15 09:56:57 +00:00
nfreear a328113f13 Accessibility: validation, missing 'alt' attribute, near $strshowallweeks (OU-Bugz: 741) 2006-03-15 09:56:40 +00:00
moodler e23800b7b5 Fixed classes for styles in forum overview in My Moodle 2006-03-15 09:50:42 +00:00
nfreear 99499e69a4 Accessibility: validation, erroneous & replaced with &amp; call to popup_form (OU-Bugz: 735) 2006-03-15 09:42:37 +00:00
toyomoyo aebb940968 ";" 2006-03-15 09:14:38 +00:00
toyomoyo fd40fbb2bd added cancel button for preference 2006-03-15 09:13:34 +00:00
toyomoyo 20fc0f2655 took out courseid and groupid 2006-03-15 08:49:33 +00:00
vyshane 540f964d92 Fixed undefined var notice 2006-03-15 08:40:56 +00:00
vyshane 80743e2a5b Fixed bug in use_html_editor() that prevented HTMLArea display if $name is not
provided.
2006-03-15 08:30:03 +00:00
moodler 6d74edf770 Link to logs now available through reports (SE) 2006-03-15 08:08:20 +00:00
moodler ff6f951197 Log reporting. (SE) 2006-03-15 08:07:14 +00:00
moodler 4d70ff5c51 Changed to full urls as we will be linking to here from the admin reports (SE) 2006-03-15 08:05:34 +00:00
vyshane d87f8b6f33 Made gen_textarea() use print_textarea() function from /lib/weblib.php 2006-03-15 07:42:01 +00:00
toyomoyo 32a2647e02 took out a form tag 2006-03-15 07:14:39 +00:00
ikawhero 7c4b2fb3c2 Removed redundant if statement 2006-03-15 06:38:28 +00:00
vyshane 035d465cb6 Made added $return argument to print_textarea() function. 2006-03-15 05:38:02 +00:00
toyomoyo 924f20e221 many functions removed, might have broken a few things 2006-03-15 04:15:09 +00:00
moodler a2a3733666 iFIx up some styles for the MyMoodle overview 2006-03-15 04:01:10 +00:00
moodler 5d45c04fce More styles for My Moodle 2006-03-15 03:47:08 +00:00
moodler a7a74d7706 Added some styles 2006-03-15 03:42:51 +00:00
moodler 76a60031d0 All the assignment classes no longer need to be loaded, and removed some notices 2006-03-15 03:36:33 +00:00
vyshane 5f9b13b860 Updated use_html_editor() and print_editor_config() 2006-03-15 03:12:28 +00:00
vyshane 6b9dbb377f Textarea field now uses functions use_html_editor() and print_editor_config()
form /lib/weblib.php. It's been decided that the minimum requirements for the
database module will be 1.5.3+ stable. Will commit updates to the above two
functions to 1.5.3+ stable once they have been tested on stable.
2006-03-15 03:11:25 +00:00
toyomoyo b2cda3d13a taking out extendedbody 2006-03-15 02:32:46 +00:00
toyomoyo e17426ca5f more cleaning 2006-03-15 02:17:35 +00:00
toyomoyo f99fee6c71 more cleaning, filter do not process dates 2006-03-15 02:02:25 +00:00
patrickslee 9ca0187e16 Chat module support for my moodle page 2006-03-14 22:28:28 +00:00
patrickslee 101e9cad48 Dim link if not visible in my course view for assignment module 2006-03-14 22:05:16 +00:00
patrickslee 84fa8f5fdd Assignment module support for my moodle page 2006-03-14 21:26:37 +00:00
stronk7 33b58d3a21 Automatic installer.php by installer_builder (20060314) 2006-03-14 17:43:30 +00:00
nfreear bde7173de0 Accessibility: fixed bug 4921, Editing on: block delete, 'move down'... icons too big... CSS selector (OU-Bugz: 747) 2006-03-14 17:35:31 +00:00
nfreear b3d26d8d57 Accessibility: critical fix (editing on), filled empty Alt-link text, times 6 (OU-Bugz: 744) 2006-03-14 16:45:34 +00:00
nfreear dfdcd09b2d Accessibility: strict, replaced image border, width... with classes (OU-Bugz: 697, 745) 2006-03-14 16:17:21 +00:00
thepurpleblob ced7916cee More coding style improvements. 2006-03-14 16:01:40 +00:00
nfreear 81d33f6355 Accessibility: validation, missing 'alt' attribute, near $strshowallweeks (OU-Bugz: 741) 2006-03-14 15:36:48 +00:00
nfreear be37f335fc Accessibility: validation, erroneous & replaced with &amp; popup_form (OU-Bugz: 697) 2006-03-14 15:17:03 +00:00
nfreear 4025f33ac1 Accessibility: added class="weekscss", removed commented code. 2006-03-14 15:11:30 +00:00
nfreear 3182eb7832 Accessibility: (strict HTML) remove unnecessary width/height attributes on <img> (OU-Bugz: 697) 2006-03-14 14:05:51 +00:00
nfreear ea78c234f9 Accessibility: fixed ambiguous asterisk next to 'edit profile', with title and hidden text (OU-Bugz: 733). 2006-03-14 12:55:06 +00:00
thepurpleblob fd14913ed6 fixed yet another missing courseid parameter :-) 2006-03-14 09:57:54 +00:00
nfreear 11a0b96a4b Accessibility: fix, removed string 'today', which duplicates the calendar string. 2006-03-14 09:54:49 +00:00
toyomoyo 61ca5f8dd3 quoting tag string 2006-03-14 09:08:58 +00:00
vyshane c969c28772 Made textarea field use use_html_editor() and print_editor_config() from
/lib/weblib.php. Removed these functions from
/lib/mod/field/textarea/field.class.php. Will commit updates to these
functions to Moodle 1.5 Stable. Database module will only be compatible with
the latest Moodle 1.5 Stable and onwards.
2006-03-14 08:32:14 +00:00
toyomoyo b7dc1805f3 fixed a bug where userid is overwritten 2006-03-14 08:07:57 +00:00
toyomoyo 772c526064 deletion confirmation 2006-03-14 07:02:50 +00:00
toyomoyo 1a3f39f1c6 added sesskey and confirmation for deletion of blog entries 2006-03-14 06:56:58 +00:00
toyomoyo 7ffb7e9cc7 more cleaning 2006-03-14 06:36:51 +00:00
vyshane 1b426aefb6 Fixed javascript bug. Clicking on a template tag now inserts the tag into the
textarea in both wysiwyg and non-wysiwyg modes.
2006-03-14 05:56:14 +00:00
vyshane d02d138070 Clicking on a template tag e.g. [[field_name]] now adds the template tag to
the HTMLArea editor in the template views. This is not currently working in
source code mode of the editor.

Added equivalent of use_html_editor() and print_editor_config() from
/lib/weblib.php to textarea field class. We use a copy in that class instead of
calling the functions in /lib/weblib.php because we want the data module to be
compatible with Moodle 1.5. This is not ideal, but it is a necessary evil.

Updated the textarea field class to use the correct path to
/lib/editor/htmlarea/htmlarea.php.
2006-03-14 05:32:41 +00:00
vyshane d13c59383a Added javascript function insertAtCursor() 2006-03-14 05:26:40 +00:00
vyshane 3afc728f5c Changed use_html_editor and print_editor_config functions so that we have an
editor javascript object that we can use when we create the HTMLArea editor.
This object allows us to call e.g. editor.insertHtml().
2006-03-14 05:26:03 +00:00
toyomoyo 3a90f3896a housekeeping 2006-03-14 04:23:00 +00:00
moodler 54bf5de8d2 Merged fix for bug 4639 from stable 2006-03-14 04:12:52 +00:00
patrickslee cd9afe2ff6 Set default enrolment plugin to manual if the previous default is not an interactive enrolment plugin 2006-03-14 03:02:12 +00:00
patrickslee f182aaf1b5 Serious typo in postgres7 upgrade script 2006-03-14 02:52:34 +00:00
toyomoyo 954cfa1bfa httpclient only used in trackbacks, which is not supported in this version, removed 2006-03-14 02:46:46 +00:00
toyomoyo 752c0c4d29 some cleaning, removed config.html for admin 2006-03-14 02:26:44 +00:00
skodak 4f01826a27 removed $SESSION->encoding now replaced by current_charset() and $CFG->unicodedb; 3rd party contribs must be fixed to be utf-8 and 1.6dev compatible anyway;
going to add a notice to wiki at http://docs.moodle.org/en/UTF-8_scripts
2006-03-13 22:26:06 +00:00
skodak a3182bd7e7 updated language detection 2006-03-13 22:11:56 +00:00
patrickslee 96a7973eb9 Updated Authorize.net for Ethem 2006-03-13 21:19:04 +00:00
patrickslee eca0392a2e Seperate postgres command line process for better error caching 2006-03-13 20:45:27 +00:00
thepurpleblob 02fecf447c Additional strings for new import feature (bug #3896) 2006-03-13 19:41:13 +00:00
thepurpleblob cbc87100f7 Added ability to import files already in the course files area. (Bug #3896)
Also started tidying up the code, more to do.
2006-03-13 19:32:42 +00:00
stronk7 38b34fb74d Automatic installer.php by installer_builder (20060313) 2006-03-13 18:57:36 +00:00
gustav_delius 7befd0188d If a student has not attempted a question then the grade column for that question will show -- instead of 0. 2006-03-13 18:36:36 +00:00
gustav_delius 3e2c988f0c Somehow missed this table reference during renaming. 2006-03-13 18:30:35 +00:00
ethem ef62312dbe You can't do this action: $a->action 2006-03-13 18:26:55 +00:00
ethem 7c824f1f63 You can't do this action: $a->action 2006-03-13 18:20:08 +00:00
stronk7 d685d03e31 Automatic installer.php by installer_builder (20060313) 2006-03-13 18:03:43 +00:00
ethem a6c656065c Students can view their payments. 2006-03-13 17:57:12 +00:00
nfreear 222caf2793 Accessibility: replace navbar table with <div> for standard theme, shouldn't break other themes (OU-Bugz: 729) 2006-03-13 17:54:52 +00:00
stronk7 ec4e56f518 Automatic installer.php by installer_builder (20060313) 2006-03-13 17:54:27 +00:00
stronk7 c2faf8ab3b Automatic installer.php by installer_builder (20060313) 2006-03-13 17:46:09 +00:00
nfreear 90b7674ac4 Accessibility: fix, forum search button, breadcrumb image (Email: Eloy stronk7, 9 March, OU-Bugz: 720) 2006-03-13 17:37:15 +00:00
nfreear 51250e7573 Accessibility: fix, doubled size of Resizable icons, now 2em or 21 by 23 pixels (OU-Bugz: 728) 2006-03-13 17:33:14 +00:00
stronk7 caa96952c1 Automatic installer.php by installer_builder (20060313) 2006-03-13 17:28:34 +00:00
stronk7 63bfa464b4 Automatic installer.php by installer_builder (20060313) 2006-03-13 17:26:14 +00:00
stronk7 b6ffab3f81 Automatic installer.php by installer_builder (20060313) 2006-03-13 17:20:52 +00:00
tjhunt d2176fb2f1 For some arguments, get_record_sql could fail only with debug off, then no error message is shown and it is hard to debug. Now the code is more similar between debug on/off, which should make debugging easier. 2006-03-13 17:07:38 +00:00
ethem e57facac59 Teachers can manage the payments of the course. 2006-03-13 16:54:09 +00:00
ethem 843d9bdc42 Now, teachers can manage the payments in their courses if admin set up this. 2006-03-13 16:47:44 +00:00
sam_marshall f95310d224 Corrected line that would cause restore_create_modules to return True if the first module fails to restore, but the second succeeds. (Whereas it would already be False if the first succeeds, but second fails.) 2006-03-13 16:32:22 +00:00
nfreear 3a8ad5764f Accessibility: calendar <abbr> and link styles. 2006-03-13 16:16:23 +00:00
nfreear 40d34f9e3c Accessibility: fix, weblib.php: print_navigation, class="resize" (Martin D post 10/3, OU-Bugz: 726) 2006-03-13 14:46:05 +00:00
nfreear 531a574aff Accessibility: fix, use $CFG->pixpath, clearer image-names (Martin D post 10/3, OU-Bugz: 718) 2006-03-13 13:32:19 +00:00
moodler fd6590a987 Fix for bug 4875 which was only happening on MySQL 5 2006-03-13 12:43:01 +00:00
ethem 3a36b0b6f3 Users can view their orders... 2006-03-13 11:15:09 +00:00
nfreear e996ef5d94 Accessibility: fix, use $CFG->pixpath, clearer image-names (Martin D post 10/3, OU-Bugz: 718) 2006-03-13 10:49:41 +00:00
tjhunt e8395a09f4 Added a comment to explain that add_to_log is the way it is for performance reasons. 2006-03-13 10:37:21 +00:00
ikawhero df44f29a89 Changed a string 2006-03-13 09:29:44 +00:00
toyomoyo 86b67cc21c fixing 1 wrong string 2006-03-13 08:55:33 +00:00
toyomoyo 5c625033c0 _params and other cleaning, blogs might be broken 2006-03-13 08:46:13 +00:00
moodler 25a784066a Moved some strings! 2006-03-13 07:54:44 +00:00
ikawhero 03d843b2dc Added another extension for Real Media. This should cover all the file
types for which you would want to embed a player or give you a way to do
it eg writing an ram or rpm file.
2006-03-13 07:21:50 +00:00
ikawhero 6fe1db7e74 Added another string for Real Media 2006-03-13 07:19:06 +00:00
ikawhero d539ccf3e8 Added support for .ram files and added config settings. 2006-03-13 06:16:23 +00:00
ikawhero a68dc79623 Added strings for realmedia filter 2006-03-13 06:14:39 +00:00
toyomoyo b37a5f51fc adding some strings 2006-03-13 06:10:45 +00:00
toyomoyo 7b07bc5553 changed a string 2006-03-13 06:09:44 +00:00
toyomoyo 9154b44000 some cleaning, not very clean yet 2006-03-13 06:05:44 +00:00
mjollnir_ d355395199 Fixing my moodle bug in forum track posts display 2006-03-13 00:42:01 +00:00
gustav_delius b9618e80bd Truncated long action name in log, see http://moodle.org/mod/forum/discuss.php?d=41446#190858 2006-03-13 00:21:35 +00:00
gustav_delius 31d21f22a5 Better display of response history 2006-03-13 00:20:34 +00:00
gustav_delius 12fcd27da6 Some work on question restore code, not complete 2006-03-13 00:18:38 +00:00
mjollnir_ d348b6f2b0 Adding new mdl_log indexes to the .sql files as well as just the pg ones (bug #4112), plus a few postgres fixes for blog 2006-03-12 23:20:47 +00:00
mjollnir_ 65070e3c03 Adding new mdl_log indexes to the .sql files as well as just the pg ones (bug #4112) 2006-03-12 23:19:17 +00:00
patrickslee ef03a260e5 PostgreSQL 7.x pg_dump command line options fix 2006-03-12 21:40:24 +00:00
gustav_delius b2b97d6834 Every questiontype should have its own backup and restore code. This is a first step in that direction. I have created the individual restore libraries for all question types but they are not yet used. 2006-03-12 21:27:14 +00:00
gustav_delius 32a189d636 More renamings to separate questions from quiz. Some other small fixes. 2006-03-12 21:17:42 +00:00
skodak 4352f048f5 workaround for some more uninitialized offset warnings 2006-03-12 20:06:12 +00:00
patrickslee 6a3a3f079f Added payment icon for authorize.net plugin 2006-03-12 19:53:20 +00:00
gustav_delius b0fb1e836b Default values for quiz_delay1 and quiz_delay2 2006-03-12 19:23:55 +00:00
gustav_delius 1bfdafd475 The box for the warning was too narrow. In future this should probably be controlled by CSS. 2006-03-12 19:14:56 +00:00
urs_hunkler 26b820a501 splitted CSS for questions in layout, fonts and color specific properties. 2006-03-12 13:36:18 +00:00
moodler ce39b5f7b1 Questions have moved 2006-03-12 08:11:08 +00:00
moodler 6ac7e7c51a Tidy cron warning 2006-03-12 08:08:51 +00:00
moodler d150048049 Updated README 2006-03-12 08:04:29 +00:00
moodler e0c6a2c643 Removed bad link from admincronsetup (bug 4759) 2006-03-12 07:55:50 +00:00
moodler af6c3dc345 Updated the cronwarning string to remove old link 2006-03-12 07:52:28 +00:00
moodler 0301965a28 Fix the cron help to point to the new help page in lang packs 2006-03-12 07:51:53 +00:00
moodler 44e029bb4c New cronwarning2 string (see bug 4759) 2006-03-12 07:33:42 +00:00
moodler 15bb726f62 Moved basic install info from doc to help 2006-03-12 07:31:36 +00:00
stronk7 8b7d1cfc7e Automatic installer.php by installer_builder (20060311) 2006-03-11 19:49:37 +00:00
mits d01d5040b3 added tabs background color on quiz module. 2006-03-11 19:00:47 +00:00
skodak df1931578a password handling refactoring and added conversion of passwords to unicode 2006-03-11 11:26:36 +00:00
michaelpenne c5b71097bc [BugFix] Bug #4852 - HTML editor problems 2006-03-11 00:23:21 +00:00
stronk7 cdef6d4211 New-improved installer. Now it allows to download the langpack
from download.moodle.org and some other minor tweaks solved.
2006-03-11 00:03:51 +00:00
stronk7 f662060c93 Updated a bunch of installation strings. Thanks to WildGirl
(my online English dictionary and grammar checker)
2006-03-10 23:51:15 +00:00
stronk7 6eb6ca89a3 Automatic installer.php by installer_builder (20060311) 2006-03-10 23:43:23 +00:00
stronk7 a86b38051d Automatic installer.php by installer_builder (20060311) 2006-03-10 23:22:18 +00:00
stronk7 30f0de391e Automatic installer.php by installer_builder (20060311) 2006-03-10 23:17:14 +00:00
stronk7 d35b53595b Automatic installer.php by installer_builder (20060310) 2006-03-10 22:55:40 +00:00
ethem 235a90f9b6 Course filter is added to payment management page.
Show the enrolment method of course is 'authorize.
2006-03-10 20:05:24 +00:00
stronk7 9e5588572b Automatic installer.php by installer_builder (20060310) 2006-03-10 18:56:57 +00:00
stronk7 b065b7e149 Automatic installer.php by installer_builder (20060310) 2006-03-10 18:52:11 +00:00
stronk7 6df9bd8ebc Automatic installer.php by installer_builder (20060310) 2006-03-10 18:19:55 +00:00
stronk7 15448980ce Automatic installer.php by installer_builder (20060310) 2006-03-10 17:52:19 +00:00
stronk7 ad09e2edc8 Automatic installer.php by installer_builder (20060310) 2006-03-10 17:37:45 +00:00
stronk7 21fa4b99d2 Automatic installer.php by installer_builder (20060310) 2006-03-10 17:28:30 +00:00
stronk7 8f0bde00e3 Automatic installer.php by installer_builder (20060310) 2006-03-10 17:08:22 +00:00
nfreear 892f55b6df Accessibility: fix, use $CFG->pixpath, clearer image-names (Martin D post 10/3, OU-Bugz: 718) 2006-03-10 17:02:22 +00:00
nfreear 3034bd23ef Accessibility: fix, replace <i> with <span> (Martin D post 10/3, OU-Bugz: 717) 2006-03-10 16:46:19 +00:00
stronk7 ff6f5a59c1 Automatic installer.php by installer_builder (20060310) 2006-03-10 16:07:11 +00:00
danstowell 87c429a650 Updating a ref to the moved enrolment helpfile 2006-03-10 15:51:45 +00:00
danstowell 57bcbe80c2 Moving help refs from enrol-imsenterprise to enrol/imsenterprise 2006-03-10 15:50:30 +00:00
danstowell 89f8a234d5 Moving enrol-imsenterprise to enrol/imsenterprise 2006-03-10 15:48:41 +00:00
danstowell 395ec1ed68 Some small changes to IMS Enterprise enrol - improved some logic and logging 2006-03-10 13:07:48 +00:00
koenr 4369f73ea7 file dms.php was initially added on branch MOODLE_15_STABLE. 2006-03-10 12:55:03 +00:00
koenr d3a26b97a1 file message.php was initially added on branch MOODLE_15_STABLE. 2006-03-10 12:55:03 +00:00
thepurpleblob 7277ee54ca Removed bad bad bad isset_param() function. 2006-03-10 11:11:32 +00:00
thepurpleblob bc5e4b1cbe Whoops... missed one. 2006-03-10 11:08:50 +00:00
thepurpleblob 63d2ed1aa3 Getting rid of those isset_param() calls. 2006-03-10 11:07:10 +00:00
ikawhero 685cf3d6c4 More tidying up 2006-03-10 09:16:11 +00:00
moodler 3515ae35e2 Just spacings 2006-03-10 09:08:59 +00:00
moodler 7261578f34 Fixing typos 2006-03-10 09:08:04 +00:00
moodler d0c231688c Cleaning 2006-03-10 09:06:16 +00:00
ikawhero 9f69862640 Tidying up some accessibility changes 2006-03-10 08:57:22 +00:00
moodler 9191e2b581 Updated the new "help prefix" which just looked plain wierd 2006-03-10 08:52:11 +00:00
ikawhero fa80db235c Minor change to language string 2006-03-10 08:42:08 +00:00
ikawhero 417195c1c1 SQL fix 2006-03-10 08:36:04 +00:00
moodler c4d044b5e3 Updated copyright notice 2006-03-10 08:28:59 +00:00
ikawhero 20b4bd4358 A few minor changes 2006-03-10 08:25:03 +00:00
ikawhero 9dd5dabb61 Fixed typo 2006-03-10 08:21:59 +00:00
ikawhero 9a381dcc00 Added new string 2006-03-10 08:14:43 +00:00
ikawhero d33a06d554 Old admin reports is now a pluggable report type 2006-03-10 08:07:08 +00:00
ikawhero 27b5a24ad7 Moving files to new pluggable directory 2006-03-10 07:50:30 +00:00
ikawhero eaad0cb614 Adding new pluggable reports 2006-03-10 07:46:24 +00:00
moodler 73a60fc04d file enrol_internal.php was initially added on branch MOODLE_15_STABLE. 2006-03-10 07:27:54 +00:00
moodler f403f224dc file lesson.php was initially added on branch MOODLE_15_STABLE. 2006-03-10 07:27:54 +00:00
moodler c00dc833a3 file enrol_flatfile.php was initially added on branch MOODLE_15_STABLE. 2006-03-10 07:27:54 +00:00
moodler cd59c11044 file enrol_database.php was initially added on branch MOODLE_15_STABLE. 2006-03-10 07:27:54 +00:00
moodler c7e5f61438 file scorm.php was initially added on branch MOODLE_15_STABLE. 2006-03-10 07:27:54 +00:00
moodler 0819ed2a64 file appointment.php was initially added on branch MOODLE_15_STABLE. 2006-03-10 07:27:54 +00:00
moodler 687d9cd595 file install.php was initially added on branch MOODLE_15_STABLE. 2006-03-10 07:27:54 +00:00
moodler 1df010d740 file hotpot.php was initially added on branch MOODLE_15_STABLE. 2006-03-10 07:27:54 +00:00
moodler 568971aefb file enrol_paypal.php was initially added on branch MOODLE_15_STABLE. 2006-03-10 07:27:54 +00:00
moodler 0260f47831 file questionnaire.php was initially added on branch MOODLE_15_STABLE. 2006-03-10 07:27:54 +00:00
moodler a8461bfc35 file quiz_analysis.php was initially added on branch MOODLE_15_STABLE. 2006-03-10 07:27:54 +00:00
moodler 45dc8c0b66 file attendance.php was initially added on branch MOODLE_15_STABLE. 2006-03-10 07:27:54 +00:00
moodler b43580a0f7 file countries.php was initially added on branch MOODLE_15_STABLE. 2006-03-10 07:27:54 +00:00
moodler 8792d522f5 file quiz_responses.php was initially added on branch MOODLE_15_STABLE. 2006-03-10 07:27:54 +00:00
moodler 9222652a0b file exercise.php was initially added on branch MOODLE_15_STABLE. 2006-03-10 07:27:54 +00:00
moodler 4213fb6b3a file responsesdownload.html was initially added on branch MOODLE_15_STABLE. 2006-03-10 07:27:54 +00:00
moodler 5174a1cdc7 file responsesoptions.html was initially added on branch MOODLE_15_STABLE. 2006-03-10 07:27:54 +00:00
moodler dcd0d1437b took out a warning msg 2006-03-10 06:59:26 +00:00
toyomoyo 4a173181f4 blog (development code) 2006-03-10 06:53:01 +00:00
toyomoyo 89d38fdddc adding blog support (development code) 2006-03-10 06:50:37 +00:00
toyomoyo 6cafc73db1 blog menu block (code is in development) 2006-03-10 06:49:39 +00:00
toyomoyo ac60dc4c80 fixing missing global 2006-03-10 04:28:21 +00:00
patrickslee cb8229d0a8 UTF8 migration - now supporting PostgreSQL 2006-03-10 03:43:33 +00:00
patrickslee 6442124426 Add update_record() postgres bytea support
To get ready for the postgres utf8 migration script
2006-03-10 03:32:48 +00:00
martinlanghoff d70fd5612d block_admin: add special cases for enrol/authorize -- might need more work for multienrol 2006-03-10 02:20:56 +00:00
martinlanghoff 8c25f6f227 enrol/imsenrolment: Introducing IMS Enterprise enrolment module by Dan Stowell
IMS Enterprise 1.1 file enrolment module for Moodle
    (also reported to work with v1.01 and v1.0 data)

  (c) 2005-2006 Dan Stowell
  Released under the Gnu Public Licence (GPL)

This module was originally in contrib/enrol_imsenterprise, and a 1.5-compatible
version of the module can still be found there.
2006-03-10 02:01:06 +00:00
patrickslee 83fb39c913 rename enrol_internal.php to enrol_manual.php 2006-03-10 01:26:13 +00:00
stronk7 68a3f81d4d Now the installer will try to download the selected lang pack
from download.moodle.org to be able to continue with the
installation using such lang.
2006-03-10 01:07:41 +00:00
martinlanghoff 10741fb26e mod/resource: dos2unix on the Hive code
Some Windows newlines got in there somehow. Cleanup.
2006-03-10 01:05:52 +00:00
stronk7 844474a21b Automatic installer.php by installer_builder (20060310) 2006-03-10 00:56:14 +00:00
stronk7 77c42ea458 Added some strings to the be able to download lang packs from
the installer.

Please, check them!!!
2006-03-10 00:55:49 +00:00
stronk7 8198e4fed3 Automatic installer.php by installer_builder (20060310) 2006-03-10 00:15:13 +00:00
stronk7 87d1558be7 Automatic installer.php by installer_builder (20060310) 2006-03-09 23:59:18 +00:00
stronk7 2489a6f6fe Non-admins can use the component-install class 2006-03-09 23:55:46 +00:00
stronk7 f099f4dc12 Automatic installer.php by installer_builder (20060310) 2006-03-09 23:39:29 +00:00
stronk7 c6ebacf671 Automatic installer.php by installer_builder (20060310) 2006-03-09 23:04:23 +00:00
stronk7 d8ec84c053 Automatic installer.php by installer_builder (20060309) 2006-03-09 22:57:41 +00:00
stronk7 b9b4e32ab9 Now it's possible to use any language in the installer.
Next step: Add the possibility to download and install
the selected language from the installer.
2006-03-09 20:24:14 +00:00
stronk7 8288895c19 Automatic installer.php by installer_builder (20060309) 2006-03-09 20:11:46 +00:00
stronk7 770753855f Automatic installer.php by installer_builder (20060309) 2006-03-09 19:48:21 +00:00
stronk7 56efad85ea Initial revision 2006-03-09 19:48:21 +00:00
stronk7 6e7ed6c5ff Automatic installer.php by installer_builder (20060903) 2006-03-09 19:36:08 +00:00
stronk7 fb25dd2a86 Initial revision 2006-03-09 19:36:08 +00:00
mits fa0a43a8a5 added styles for reports. 2006-03-09 18:27:37 +00:00
stronk7 c1f6779fac If $CFG->running_installer is set, we force to retrieve
all the strings from installer.php to allow multi-lang
installations.
2006-03-09 17:43:14 +00:00
stronk7 e05fc498ea Avoid some minor notices and warnings (reported as bug 2814 to Typo3 team)
(http://bugs.typo3.org/view.php?id=2814)
2006-03-09 17:29:58 +00:00
stronk7 7dc2cdd405 Reverted latest changes. We are going to continue faithful to
Typo3 versions. We can solve this ourselves in textlib.php
2006-03-09 17:18:15 +00:00
moodler 8a8333860e Checking in some old changes 2006-03-09 16:45:25 +00:00
moodler 9b2831eb77 Fix icons 2006-03-09 16:44:57 +00:00
moodler 72d1301aa4 Some styles for reports etc 2006-03-09 16:41:37 +00:00
moodler 375013d2f1 Take away the box, so we can use CSS instead 2006-03-09 16:35:25 +00:00
moodler 17f829a765 Added security and consistent CSS 2006-03-09 16:34:24 +00:00
moodler be92c3c1a6 It's been moved 2006-03-09 16:33:56 +00:00
thepurpleblob 0399e15d90 Mostly error messages for import and export, previously hard coded. 2006-03-09 16:18:28 +00:00
thepurpleblob 1e3d6fd804 Fixed up some more links.
Fixed up a bunch of hardcoded text.
Added test for exporting category with no questions.
2006-03-09 16:17:45 +00:00
moodler 9216720058 Fixed some more paths 2006-03-09 15:24:41 +00:00
moodler e3ca6280c6 More cleanups 2006-03-09 15:21:49 +00:00
moodler 6b2f1037b3 Some cleanups 2006-03-09 15:13:02 +00:00
moodler 0cb9ec10ca FIxed bug 4903 and enrol notices 2006-03-09 14:51:28 +00:00
sam_marshall c0381e22da Added way to get a textual description of a file (e.g. 'Word document') based on its MIME type. 2006-03-09 13:14:33 +00:00
sam_marshall 3ce73b147f filelib - Added support for looking up icons via MIME type as well as via extension 2006-03-09 12:07:11 +00:00
ethem d5e50c25d5 help with $a 2006-03-09 11:35:54 +00:00
moodler 6a25f4d957 Moved a big fat log function out to course/report/log/lib.php 2006-03-09 09:50:24 +00:00
moodler bad35380c7 FIxed icon display 2006-03-09 09:49:34 +00:00
moodler 256ed9e4cd Moved these to course/report/log 2006-03-09 09:49:19 +00:00
moodler 52af9a3544 Logs have moved 2006-03-09 09:47:53 +00:00
moodler 0a935fb3c0 Added real rough new report for logs - needs work. Shane? 2006-03-09 09:45:57 +00:00
toyomoyo 1242eb8f38 Checking in some blog-related user changes for testing on
another machine
2006-03-09 09:09:20 +00:00
toyomoyo 1917efb2b2 added default for blogs 2006-03-09 09:01:40 +00:00
moodler e0dd378807 Aha 2006-03-09 08:55:41 +00:00
moodler 883fdc5241 Added newline 2006-03-09 08:45:45 +00:00
moodler 8c5ea8d5ce Look for languages in report directories too 2006-03-09 08:27:53 +00:00
moodler bcadf372af Quickly cleaning up reports
This one was the old participation report (still needs work!)
2006-03-09 08:24:10 +00:00
moodler e3f97fc284 Slight tidy-up, needs work still 2006-03-09 08:09:28 +00:00
moodler 5585348a6a Quickly moving old reports into new structure
This one is Outline Report
2006-03-09 08:06:19 +00:00
vyshane 05da418753 Added $CFG->pagepath so that the Moodle Doc URLs are generated properly for
this section.
2006-03-09 07:53:14 +00:00
moodler 2622ceb494 Renamed mod.html to mod.php 2006-03-09 07:41:59 +00:00
moodler 36245854f2 No direct inclusion 2006-03-09 07:41:18 +00:00
moodler 222aa60d3f Adding reports link. 2006-03-09 07:40:41 +00:00
moodler 3bf7fc74a4 New report plugin structure for all course reports.
More to be added soon.
2006-03-09 07:37:40 +00:00
moodler 7064007f5b Fixing the logic for the enrol upgrade 2006-03-09 06:54:31 +00:00
vyshane 53008a8d4b Added data module to list of allowed modules for the report. 2006-03-09 06:27:29 +00:00
vyshane 4c03f9209d Added functions data_get_view_actions() and data_get_post_actions() for
participation reports.
2006-03-09 06:26:42 +00:00
martinlanghoff 46a811142e [multienrol]Don't die if there's an empty directory in enrol and better strings for admin ui
The admin UI still needs a bit of wordsmithing to make it easy to understand what the model we have is.
2006-03-09 05:06:18 +00:00
martinlanghoff c6a40e74b9 [multienrol]enrol/authorize: Back put last commit - "manual" is the right name 2006-03-09 05:03:41 +00:00
martinlanghoff 7ce85a1969 [multienrol]enrol/authorize: fix references to 'internal' method 2006-03-09 04:26:37 +00:00
martinlanghoff a60952d73d [multienrol] 2006-03-09 04:22:03 +00:00
martinlanghoff aa190ccd1e [multienrol]Merged Ethem Evlice's changes to authorize.net
Minimal changes -- with this, the tip of MOODLE_16_MULTIENROL is fully merged.
2006-03-09 04:14:12 +00:00
martinlanghoff ed8365d9c2 [multienrol]Set default enrol_plugins_enabled if the variable is not set 2006-03-09 03:58:08 +00:00
martinlanghoff 9feef2bfb7 [multienrol]Rename enrolment language files according to the rename of internal plugin to manual
(and cleanup the mess I made merging files into lang/en -- sorry!)
2006-03-09 03:55:31 +00:00
martinlanghoff 4af1efecf7 [multienrol]Fixed a typo in database upgrade script. Bug #4528 2006-03-09 03:47:54 +00:00
martinlanghoff 29f8533223 [multienrol]More changes to the internal->manual transition 2006-03-09 03:46:53 +00:00
martinlanghoff 908c1ae7ac [multienrol]DB upgrade script to clean up enrol field for user_students and user_teachers 2006-03-09 03:23:07 +00:00
martinlanghoff e90737c7fe [multienrol]More changes to the internal->manual transition 2006-03-09 03:22:20 +00:00
martinlanghoff 6a2c524ca9 [multienrol]DB upgrade script to clean up enrol field for user_students and user_teachers 2006-03-09 03:20:30 +00:00
martinlanghoff a51e2a7f3b [multienrol]Renamed "internal" enrolment plugin to "manual" 2006-03-09 03:19:10 +00:00
martinlanghoff c02fdda12d [multienrol]Made upgrade script more intelligent about setting enrol_plugins_enabled 2006-03-09 03:16:17 +00:00
martinlanghoff 74da3c2c89 [multienrol]Improved get_student/teacher_courses() functions to cache enrolment type that saves lots of recursive database query 2006-03-09 03:15:42 +00:00
martinlanghoff 1919f9926e [multienrol]Replaced configuration variable override with class property 2006-03-09 03:15:01 +00:00
martinlanghoff c9e0b90be1 [multienrol]Make sure internal plugin is saved on the top so it will be called at the first place 2006-03-09 03:14:32 +00:00
martinlanghoff 54e9516e59 [multienrol]Some database upgrade to preserve the default enrolment plugin 2006-03-09 03:02:37 +00:00
martinlanghoff 4d3f4df562 [multienrol]Wrote some breif notices for the new enrolment configuration panel 2006-03-09 03:00:48 +00:00
martinlanghoff cd1d0ef61a [multienrol]Hide disabled plugins and show the name of the site default in selection list 2006-03-09 02:57:41 +00:00
martinlanghoff f5befec4e8 [multienrol]Fixed some wired characters caused by my editor 2006-03-09 02:56:44 +00:00
martinlanghoff b31c216293 [multi-enrol]Fixed a wrong URL 2006-03-09 02:54:40 +00:00
martinlanghoff f9667a5aea [multienrol]Initial commit for multi enrolment plugin feature 2006-03-09 02:48:29 +00:00
michaelpenne 379bf73893 [Added] Added lang entry for lesson_delete_course() feedback 2006-03-09 02:27:23 +00:00
michaelpenne eee850986f [Added] Added function lesson_delete_course() to clean up the lesson_default table 2006-03-09 02:26:20 +00:00
moodler 1ec13950d1 Checking in some unchecked-in code 2006-03-09 01:51:22 +00:00
patrickslee 613c1fcf49 Corrected calls to user table migration functions back to course table ones 2006-03-09 01:39:51 +00:00
skodak acc26080d6 fixed notices, the last one is quite hacky :-( 2006-03-08 21:53:53 +00:00
gbateson 330388c3ac JCloze improvements: allow gap at start of cloze and allow "0" for a gap value 2006-03-08 17:54:11 +00:00
nfreear 00e648c100 Accessibility: .calendar-controls now div and span, not <table> 2006-03-08 17:36:52 +00:00
nfreear d9a976cc39 Accessibility: lang/xx/calendar.php: add 'eventnone', lang/xx/access.php: rem 'today'. 2006-03-08 17:31:37 +00:00
nfreear 2a06efcc69 Accessibility: calendar_get_mini, table summary now multilingual; replaced table in calendar_top_controls. 2006-03-08 17:27:56 +00:00
nfreear f20c4d02b8 Accessibility: table summary and <abbr> for day abbreviations. 2006-03-08 17:03:02 +00:00
nfreear b5c42e700b Accessibility: code taken from function calendar_get_mini, for new function calendar_get_popup. 2006-03-08 16:52:23 +00:00
tjhunt 09481160db Refactor course deletion code to eliminate about 70 lines of duplication. 2006-03-08 16:10:24 +00:00
thepurpleblob 5651e89765 Added instructions for blackboard 6+ 2006-03-08 14:43:23 +00:00
thepurpleblob c6333d4de5 Added string for blackboard_6 2006-03-08 14:35:58 +00:00
thepurpleblob d1c9748130 Adding support for BlackBoard V6 (and 7). Modified from contrib version.
Needs more testing and some fixes, but more-or-less works.
2006-03-08 14:32:54 +00:00
thepurpleblob a0e512feac Fixed missing courseid param in paging bar 2006-03-08 14:27:26 +00:00
nfreear f4077420c2 Accessibility: additional styles, img.resize and .searchform button 2006-03-08 14:22:36 +00:00
nfreear 2eff1f87ef Accesibility: added 'breadcrumb' strings. 2006-03-08 14:12:04 +00:00
thepurpleblob 07663430ac Fixed some urls (mod/quiz to question). 2006-03-08 13:58:55 +00:00
thepurpleblob 5a4bcbc37c changed filename cleaning from PARAM_CLEANFILE to PARAM_FILE 2006-03-08 13:12:46 +00:00
nfreear 5496f50cae Accessibility: fixes .clearer, .skip-block, img.resize now in styles_fonts, .breadcrumb now a list. 2006-03-08 12:50:43 +00:00
nfreear 9b22400f20 Accessibility: /pix/a for accessibility and usability related images - 1em resizable. 2006-03-08 12:38:43 +00:00
nfreear 9a477f9024 Accessibility: function print_navigation now uses <ul> list, replaced &raquo; with image, fixed print_side_block using $block_id. 2006-03-08 12:33:21 +00:00
nfreear 123238d042 Accessibility: /pix/a for accessibility and usability related images - fixed path. 2006-03-08 12:24:57 +00:00
nfreear 430ac17bec Accessibility: /pix/a for accessibility and usability related images. 2006-03-08 12:20:04 +00:00
nfreear 9252cbb703 Accessibility: replaced <input type="submit"> with button-embedded image. 2006-03-08 12:11:30 +00:00
skodak 9f79b50f05 fixed missing global $CFG - anyway it worked even without it :-D 2006-03-08 11:20:38 +00:00
toyomoyo 5790c8998a took out some debug code for koen 2006-03-08 06:57:53 +00:00
toyomoyo ffa5b35f6d counting is not sensible is not sorting by id asc 2006-03-08 05:08:44 +00:00
vyshane f1b6ce824d Made some of the tabs linked even if selected in the different views. 2006-03-08 04:54:57 +00:00
vyshane 748e0925c2 Added attribute $linkedwhenselected to tabobject class. Basically defines
whether the tab should be linked even if it is selected.
2006-03-08 04:53:48 +00:00
vyshane a392a8b22d Added course module in call to navmenu() so that we have the < (prev) and >
<next> buttons in all the views for the data module. To keep things
consistent.
2006-03-08 03:53:54 +00:00
vyshane bfb7fe86bb When updating a resource, $CFG->pagepath should be /mod/resource/type instead
of /mod/resource/mod.
2006-03-08 03:23:22 +00:00
toyomoyo 2c46dd5b4e wrong type for remove, should be an int, it is an id 2006-03-08 03:17:31 +00:00
skodak 0c0849cf5f lots of incorrect required_param()'s - there MUST be only two parameters not three!! 2006-03-08 00:08:51 +00:00
skodak e92d8ccf4d fixed category switching bug 2006-03-07 23:59:33 +00:00
skodak b1f00c8985 incorrect use of required_param() 2006-03-07 23:51:21 +00:00
skodak bbba475967 fixed includes in included files - see bug #4891 2006-03-07 23:41:22 +00:00
skodak e1427cdec5 fixed incorrect use of required_param() 2006-03-07 23:30:27 +00:00
mjollnir_ fb3ea05cc3 Adding more indexes to the log table - bug 4112 + version bump 2006-03-07 22:14:40 +00:00
skodak 107e7612b5 short php tags once more 2006-03-07 21:46:34 +00:00
skodak 38b7336ed1 short php tags 2006-03-07 21:35:13 +00:00
skodak 2c87013a55 missing p() in value 2006-03-07 21:06:46 +00:00
skodak 1b56f11102 fixed warning 2006-03-07 20:40:21 +00:00
skodak 2780eb570c missing db prefix 2006-03-07 20:32:49 +00:00
skodak 8f0fba5ce0 nasty empty line at the end of file .... 2006-03-07 20:26:27 +00:00
skodak 25580a01bc finally now the restore should work and with correct unicode related coding style, sorry 2006-03-07 19:53:56 +00:00
skodak de9924ae0a parameter cleaup - round 8; short php tag in group-edit.html 2006-03-07 19:36:13 +00:00
skodak 038ba6aa30 change value of PARAM_RAW from 0 to 666, becasue we need to detect incorrect param types (such as PARAM_IND) and incorrect order - optional_param('xx', PARAM_INT, 0)
This might break faulty code...
2006-03-07 19:20:23 +00:00
nfreear fd6abcc87a Accessibility: fixed bug, duplicate call to blocks_print_group. 2006-03-07 17:38:02 +00:00
skodak 7710da22bd parameter cleaup - round 7; corrected search in user.php, semicolon in case fixed in utfdbmigrate (I wonder if it caused any problems) 2006-03-07 16:42:30 +00:00
thepurpleblob 1771fcb04f Added note that blackboard import is not compatible with BB v6 2006-03-07 16:04:44 +00:00
skodak 4abbb75c80 parameter cleaup - round 6; major cleanup and fixing in uploaduser.php 2006-03-07 11:13:57 +00:00
bobopinna 3ec5d7a62b Fixed a word error (bug 4895) Many thanks to Ray 2006-03-07 10:51:21 +00:00
thepurpleblob d9ca6d5550 Put $CFG->pagepath in a more logical position 2006-03-07 10:34:08 +00:00
bobopinna 9314dcdf6e Updated with attempts management 2006-03-07 10:03:36 +00:00
skodak 63d86fad67 parameter cleaup - round 5; timezone.php fixed 2006-03-07 09:01:49 +00:00
vyshane 459e90230f Fixed bug: wrong parameter for input field (max size of uploaded file) 2006-03-07 08:53:40 +00:00
vyshane fb38540df5 Renamed data "templates defaults" action to "templates def" because the db
column has a limit of 20 characters.
2006-03-07 08:47:26 +00:00
toyomoyo 5f9de695a4 this code is for koen to test, it will output a lot of debug info in debug mode, thanks 2006-03-07 08:24:32 +00:00
vyshane 6977f32079 Updated logging support. Added version upgrade. 2006-03-07 08:11:19 +00:00
vyshane 0a09100ff7 Update logging support. Bumped module version up. 2006-03-07 08:10:40 +00:00
moodler f90e9ff653 Cleaned up display of groups and group links in user profile 2006-03-07 06:22:59 +00:00
toyomoyo 653c0596de added some code to give some feedback once in a while (per 5000 records, for now) 2006-03-07 04:36:55 +00:00
patrickslee 6c1a3ce7db Added missing alias in SQL statements 2006-03-07 02:20:30 +00:00
toyomoyo f07da5dde0 fixing 4883, sorry 2006-03-07 01:33:52 +00:00
skodak 1ccc4867c5 comment improvement 2006-03-06 21:17:10 +00:00
skodak c07549b6e2 fixed coding style of unicode db detection 2006-03-06 20:30:00 +00:00
skodak a2eaae6102 parameter cleaup - round 4 2006-03-06 19:27:25 +00:00
nfreear de533d2612 Accessibility: 'weekscss' course format, replaced <table>, <td> with DIVs, inline style. 2006-03-06 16:14:10 +00:00
skodak 636c2c08d9 parameter cleaup - round 3 2006-03-06 14:25:26 +00:00
nfreear 0666fc3270 Accessibility: Evaluation weekly format for course display - NO layout tables, for accessibility, etc. Initial straight copy of weeks/format.php; $string['formatweekscss'] 2006-03-06 14:08:52 +00:00
nfreear f8d0d6336b Accessibility: Evaluation weekly format for course display - NO layout tables, for accessibility, etc. Initial straight copy of weeks/format.php 2006-03-06 14:08:01 +00:00
skodak 045e9e2484 parameter cleaup - round 2 2006-03-06 13:22:37 +00:00
skodak 12afe27987 cleanup and bugfixing in filters.php 2006-03-06 13:20:38 +00:00
nfreear 68ac3b35e0 Accessibility: moved H2 from weblib.php: print_side_block_start, to moodleblock.class.php: _title_html (validate, <span>s revert to <div>); skip block link - replaced pixel image with 'accesshide' text; use get_string. 2006-03-06 12:50:43 +00:00
nfreear 9aa4592e79 Accessibility: moved H2 from weblib.php: print_side_block_start, to moodleblock.class.php: _title_html (validate, <span>s revert to <div>); skip block link - replaced pixel image with 'accesshide' text. 2006-03-06 12:49:07 +00:00
julmis 57e0348ae0 Statusbar was missing from default configuration. 2006-03-06 12:38:14 +00:00
nfreear f6c9cf917e Accessibility: the general accessibility, usability and navigation language file. 2006-03-06 12:28:06 +00:00
tjhunt c0b5b31a48 Addition to locallib.php to notify local code when a course is deleted. 2006-03-06 12:19:58 +00:00
skodak 1c47adc540 parameter cleaup - round 1 2006-03-06 10:02:59 +00:00
julmis 1452f9e11b And more readme updates. 2006-03-06 09:44:57 +00:00
julmis 127907098c Removing old editor scripts. These are found at /lib/editor/htmlarea from now on. 2006-03-06 07:57:41 +00:00
julmis 515e6eccbe Adding support for new GetHtml plugin 2006-03-06 07:44:35 +00:00
julmis 4773034906 Adding new GetHtml plugin. 2006-03-06 07:15:13 +00:00
julmis f2214522d8 Fixing comma problem. 2006-03-06 07:12:04 +00:00
julmis 5d816150cd Writing more readme... 2006-03-06 07:11:35 +00:00
skodak 8f59002a9f fixed wrong parameter type 2006-03-06 06:26:32 +00:00
skodak 96e98ea67f Fixed error in my previous commit, unknown parametery type 0. 2006-03-06 06:25:33 +00:00
ikawhero 70070c1f88 Changes to custom script code. Credit to Gordon Bateson. Bug 4827. 2006-03-06 01:45:11 +00:00
mjollnir_ 2e05b22ab6 Fixing the parse error in moodlelib! Do I get a prize for being first after sf.net came back up? ;) 2006-03-06 00:39:51 +00:00
mjollnir_ 74ffb569c6 Added a useful function in moodlelib to resolve filename collisions when moving files around. Perhaps useful for backup or importing or files/index.php 2006-03-06 00:36:06 +00:00
julmis 988f9ddff0 Changing tiny to use gzip compressed version. 2006-03-05 10:36:24 +00:00
julmis 07f37ebca2 Removing advanced theme docs... 2006-03-05 10:28:01 +00:00
julmis 80153c354c Removing plugins... 2006-03-05 10:08:30 +00:00
julmis def7254987 Removing examples. 2006-03-05 09:46:28 +00:00
julmis 140e306f4e Removing docs... 2006-03-05 08:58:55 +00:00
julmis 8d529638a6 Writing more readme... 2006-03-05 08:46:49 +00:00
urs_hunkler eb9ca068c5 added check for function page_doc_link() to avoid the not found error in Moodle 1.5 2006-03-05 08:28:39 +00:00
julmis 9cc07c7393 Adding new editor readme. 2006-03-05 07:48:15 +00:00
skodak a083b93cec First stange of parameter handling refactoring, no new features + minor bugfixes. More changes coming soon.
New code should be easier to understand, just simple switch-case. Expect some detailed documentation for module authors before UK MoodleMoot :-)
2006-03-04 18:05:41 +00:00
julmis 906f98bd0c Adding tinymce editor choice. 2006-03-04 16:55:24 +00:00
julmis e1ecf0a019 Adding wrapper function loadeditor. 2006-03-04 16:53:02 +00:00
julmis c06c849221 Modifying print_textarea for new editorObject compatible. 2006-03-04 16:04:48 +00:00
julmis c10364100d Adding editorlib. 2006-03-04 16:01:41 +00:00
julmis ffcdfb974b Adding TinyMCE support 2006-03-04 15:59:11 +00:00
julmis 876110eb1d Adding TinyMCE editor 2006-03-04 15:57:34 +00:00
julmis 6c1e8ba8d2 Moving old editor to htmlarea folder. 2006-03-04 15:24:17 +00:00
julmis c2db12af42 Adding tinymce needed defaults and new $CFG property 'editorsrc' 2006-03-04 14:52:50 +00:00
skodak 1b1d34225b incorrect usage of clean_filename() replaced with clean_param($text, PARAM_SAFEDIR) 2006-03-04 12:37:29 +00:00
skodak 46b8113012 optional unicode characters and better conversion to ascii in function clean_file(); fixed textlib setup code; unicode related cleanup in config-dist.php
I am going to review the usage of clean_filename() now
2006-03-04 11:35:08 +00:00
skodak b9fd28eade loginas language typos a fixes (thanks rob for fixing it!) and more consistent loginas password dialog layout. 2006-03-04 09:01:56 +00:00
skodak d8eb52a2d0 fixed bug #2596 - filterlib is now adding popup javascript into html files 2006-03-03 23:25:27 +00:00
skodak 0beabf4898 fixed NULL in foreach warning 2006-03-03 22:26:22 +00:00
skodak fd5ca378e6 fixed UTF-8 restore problems caused by utf8_restore 2006-03-03 22:22:07 +00:00
skodak af5be70cf2 Optional "Login as" password protection - please test, usage explained in config-dist.php 2006-03-03 20:33:38 +00:00
skodak 904d60d4d3 table tag typo 2006-03-03 20:12:31 +00:00
skodak 01eb4f5f21 loginas.php parameter typo 2006-03-03 19:50:33 +00:00
skodak 212039c0d8 utf8 related cleanup in glossary import and export code - please test 2006-03-03 19:49:08 +00:00
thepurpleblob dcd51df25e Another bunch of missing courseid parameters.
Deleting questions was not working.
2006-03-03 15:20:48 +00:00
moodler 7cbc59192f VERY preliminary import script, needs a lot of work 2006-03-03 14:44:54 +00:00
thepurpleblob 4967818418 Quiz directory path incorect in download link fixed (bug #4424) 2006-03-03 14:19:15 +00:00
nfreear bef6cd5d81 Accessibility: weblib.php: function print_side_block, completed 'Skip block' link. 2006-03-03 11:48:02 +00:00
thepurpleblob 5d77ace20b Added missing courseid link to final continue button. 2006-03-03 11:17:23 +00:00
thepurpleblob 5cda54cf25 space missing in html output 2006-03-03 11:07:26 +00:00
thepurpleblob c4c06b6713 Fixed continue button. Link now requires courseid parameter. 2006-03-03 10:37:55 +00:00
urs_hunkler be2d062ea4 Added a "." at the end of a comment sentence 2006-03-03 10:10:55 +00:00
vyshane 1cfc979a73 Added argument $meta to pagelib::print_header (data module) 2006-03-03 08:30:36 +00:00
vyshane c853304e52 Added support for printing <link rel="alternate" type="application/rss+xml"...
/> tag in header. Only happens if appropriate. E.g. RSS turned on etc.
2006-03-03 08:06:50 +00:00
vyshane d4706960e4 Refactored function rss_get_link() so that it uses a new function
rss_get_url() which generates the URL to the RSS XML file. Because in some
cases we need the URL only, and not the whole <a href...><img ...></a> string.

Added function rss_get_url()
2006-03-03 08:03:45 +00:00
vyshane a443e10f6f Made field names as links that go to the edit view for the respective fields. 2006-03-03 06:13:27 +00:00
vyshane d2555cedfa Updated $CFG->pagepath generation for add and delete cases. 2006-03-03 03:33:11 +00:00
vyshane cc1d322807 Added $CFG->pagepath so that the body class and id attributes are set properly
and so that the Moodle Docs link is generated correctly.
2006-03-03 03:32:15 +00:00
skodak 29939bea87 improved kses cleaning of html SC#204; merged from MOODLE_15_STABLE 2006-03-02 21:38:20 +00:00
urs_hunkler e56e5ed720 Added CSS for calculated and numerical questions 2006-03-02 17:11:31 +00:00
dhawes fec312fdf5 removed secondary cache to close bug 4625 2006-03-02 17:05:12 +00:00
urs_hunkler 89fe8086c5 I had commented out the quiz section to be sure that no other CSS is active. Now the #mod-quiz-report styles are active again. 2006-03-02 14:53:13 +00:00
thepurpleblob 2dd6d66b31 Rewrite of add_indented_names() function.
Bit longer, but *much* faster for large numbers of categories.
2006-03-02 14:13:42 +00:00
gustav_delius 5433ee83ee When the question name is taken from the question text it is now cut off at 15 characters. 2006-03-02 14:08:48 +00:00
gustav_delius f4b72cdb74 Made to work with the new templating system. 2006-03-02 14:02:49 +00:00
urs_hunkler 48447225e2 Moved the question styles to layout.css. I'll move the CSS for colors and fonts into the right files when the work on questions is finished. 2006-03-02 13:04:23 +00:00
tjhunt b97c41647c Refactor the code for deleting a course from course/delete.php to a function in moodlelib.php. 2006-03-02 11:58:43 +00:00
exe-cutor be58b18f15 Corrected some typos and added Shibboleth setup hints for IIS 2006-03-02 10:40:36 +00:00
exe-cutor 8f39553e36 Changed and added some Shibboleth language strings 2006-03-02 07:50:53 +00:00
patrickslee 7130abaf90 Missed undoing the changes to one line for the last revert 2006-03-02 03:02:35 +00:00
patrickslee 13c6d7e6bc Backup last commit regarding to the "quiz_" prefixes. There must been something wrong with the upgrade code that not renaming those tables. 2006-03-02 03:00:31 +00:00
toyomoyo 2df6965c30 fixed a bug where group image is not displayed 2006-03-02 02:31:20 +00:00
vyshane 1761da15fc Added moodledocslink string to moodle.php language file. 2006-03-02 02:29:23 +00:00
vyshane 850435e777 Made footer.html use get_string when displaying the moodle docs link. 2006-03-02 02:25:55 +00:00
patrickslee 38393aad2d Added missing "quiz_" prefixes to table names 2006-03-02 02:25:22 +00:00
toyomoyo 4c64486f0c NO_CONV for backup_log_info 2006-03-02 01:33:00 +00:00
mjollnir_ ed2482dfae Fixing up some RENAME tables in postgres for quiz 2006-03-02 01:30:04 +00:00
moodler 16bac723c0 Removed the shibboleth code (there is a new way now)
http://moodle.org/mod/forum/discuss.php?d=39918#187611
2006-03-02 01:09:56 +00:00
mits b67580acfa removed styles_fonts.css and styles_layout.css from $THEME->sheets. 2006-03-01 23:01:39 +00:00
mits a076daf274 removed styles_fonts.css and styles_layout.css to use files of Standard theme. 2006-03-01 22:51:55 +00:00
gustav_delius 2662cf46fc Some improvements to how the tabs and links behave. 2006-03-01 21:16:28 +00:00
stronk7 00f6fb1b71 Adding the new h2.header 2006-03-01 18:29:39 +00:00
gustav_delius 37a12367c5 Templates and css hooks for more questiontypes. Essay and RQP will be done at a later date. 2006-03-01 16:15:30 +00:00
moodler f413e3fbee Fixed some typos 2006-03-01 14:03:56 +00:00
tjhunt 1f8ede91cd Remove references to unused globals in remove_course_contents() and remove_course_userdata(), and fix comments. 2006-03-01 12:15:57 +00:00
tjhunt 34763a795a Change fulldelete(), so it does not give an error if the thing you try to delete does not exist. 2006-03-01 12:13:09 +00:00
nfreear 73bb9da7e5 Accessibility: added Alt text for envelope/message link (existing lang string); converted <div> to <ul>, inherit existing classes & styles. 2006-03-01 11:18:33 +00:00
nfreear b34a009985 Accessibility: fixed $string['helpprefix'] for multi-languages; weblib.php, removed <img> width height - move to stylesheet, standard theme. 2006-03-01 11:01:16 +00:00
nfreear 1527acab30 Accessibility: fixed $string['helpprefix'] for multi-languages. 2006-03-01 10:53:05 +00:00
gustav_delius dc2ff7c341 Fixed incorrect function name, spotted by Penny 2006-03-01 10:42:15 +00:00
gustav_delius 70c01adb91 Improvement to tabbed interface 2006-03-01 09:30:21 +00:00
moodler 6b25f553cc Fixed some typos 2006-03-01 09:12:13 +00:00
moodler 880a6f6b7a Added a new config variable that will mail db connection errors to someone (eg admin) 2006-03-01 09:06:57 +00:00
gustav_delius 567709c4e0 Tabs on question bank editing pages 2006-03-01 08:43:41 +00:00
vyshane 63339fc88c Added moodle docs link to footer of the themes. The link is generated by the
page_doc_link function.
2006-03-01 07:49:53 +00:00
vyshane 8fde6caa25 Added language string for the new config var "docroot". 2006-03-01 07:48:17 +00:00
vyshane 3963147913 Added function page_doc_link in weblib.php. This function is used to print a
link to the moodle docs for the current page.

Added the default value (http://docs.moodle.org) for docroot config variable
in defaults.php.
2006-03-01 07:47:14 +00:00
vyshane 14b7ebd3cb Added config variable for docroot: the moodle documentations root. This is
used to display a link for the docs that are relevant for the current page.
2006-03-01 07:45:29 +00:00
gustav_delius f5565b6969 Removing some more references to quiz from import/export code 2006-03-01 07:36:09 +00:00
toyomoyo 28dad8b90a added proxy handling for lang import 2006-03-01 07:15:19 +00:00
gustav_delius dc1f00de19 Some little fixes and more renaming to cleanly separate question code from quiz code
Renaming tables:
quiz_answers -> question_answers
quiz_categories -> question_categories

Renaming functions:
quiz_get_category_menu -> question_category_menu
quiz_get_category_coursename -> question_category_coursename
quiz_categorylist -> question_categorylist
2006-03-01 07:03:57 +00:00
toyomoyo 3c1acb61bb printing user picture for comments 2006-03-01 06:51:06 +00:00
vyshane 47f01c2f57 Icon for the page documentation links 2006-03-01 04:01:02 +00:00
mjollnir_ ecb5d875af Updated the comments around the horrible sql construction in the quiz reports for overview & response 2006-03-01 03:00:33 +00:00
mjollnir_ eeaf5ebce1 Ported the rework of the reports to the responses report. PLEASE try not to load all users into memory and then implode it into a string for the sql - just JOIN, it is what the database is good at :( 2006-03-01 02:46:15 +00:00
mjollnir_ 3d45832721 Tidyup of whitespace and commented out stuff from last commit 2006-03-01 02:44:38 +00:00
moodler 4cd29f6c5a Take $CFG->pagepath into account for page_id_and_class so "weird" pages
can end up wth nice page classes and ids
2006-03-01 02:38:03 +00:00
moodler 1933c40771 Setting new variable $CFG->pagepath to give hints later on to the
function page_id_and_class and also page_doc_link so that they can set
things more correctly for each different module being used.
2006-03-01 02:34:34 +00:00
mjollnir_ 03c8c27ee0 By popular request - quiz report now shows students with attempts only, students with no attempts only, students with attempts AND no attempts. This fixes bugs #4406 and #4353 2006-03-01 02:20:32 +00:00
mjollnir_ 6ae92cf9b0 Fixing up a badly named quiz table in postgres. PLEASE remember that you cannot just do RENAME - it breaks the sequences 2006-03-01 02:17:47 +00:00
mjollnir_ cfe3f66f47 Added comments in the horribly complicated sql around the quiz report (fixes bug # 4406) 2006-03-01 00:49:49 +00:00
mjollnir_ 7343f3c40a Fixing a warning in import course data - bug #4773 2006-03-01 00:33:50 +00:00
gustav_delius c902637954 Committed fix for bug 4829 2006-02-28 20:43:06 +00:00
skodak 5c25b6af93 prevent unwanted password change here SC#225; merged from MOODLE_15_STABLE 2006-02-28 20:27:19 +00:00
nfreear ece65914f9 Accessibility: lib/weblib.php: function helpbutton - added $string['helpprefix']. 2006-02-28 15:29:11 +00:00
nfreear d455cd04e9 Accessibility: function _title_html, replaced <div> with H2, enclosed <div> to <span> - now validates! weblib.php: function side_block_start. 2006-02-28 13:13:52 +00:00
nfreear 02db7f7a02 Accessibility: function _title_html, replaced <div> with H2, enclosed <div> to <span> - now validates! 2006-02-28 13:12:13 +00:00
nfreear b6f30b1818 Accessibility: functions changed, print_heading_block, print_side_block, print_side_block_start -- course .headingblock is now H2; .sideblock .header is now H2; .sideblock <table> is now <ul> (+ commented code for 'skip block link'). 2006-02-28 12:29:51 +00:00
nfreear 72d7872a23 Accessibility: course .headingblock is now H2; .sideblock .header is now H2; .sideblock <table> is now <ul> (+ commented code for 'skip block link'). 2006-02-28 12:02:32 +00:00
gustav_delius 062f1125cc *** empty log message *** 2006-02-28 09:36:31 +00:00
gustav_delius 4f48fb42af Towards removing reference to quiz module from the question code
Renaming tables:
quiz_questions -> question
quiz_states -> question_states

Renaming functions:
quiz_delete_question -> delete_question
quiz_get_question_options -> get_question_options
quiz_get_states -> get_question_states
quiz_restore_state -> restore_question_state
quiz_save_question_session -> save_question_session
quiz_state_is_graded -> question_state_is_graded
quiz_extract_responses -> question_extract_responses
quiz_regrade_question_in_attempt -> regrade_question_in_attempt
quiz_process_responses -> question_process_responses
quiz_isgradingevent -> question_isgradingevent($event)
quiz_search_for_duplicate_responses -> question_search_for_duplicate_responses
quiz_apply_penalty_and_timelimit -> question_apply_penalty_and_timelimit
quiz_print_question_icon -> print_question_icon
quiz_get_image -> get_question_image
quiz_make_name_prefix -> question_make_name_prefix
quiz_get_id_from_name_prefix -> question_get_id_from_name_prefix
quiz_new_attempt_uniqueid -> question_new_attempt_uniqueid
quiz_get_renderoptions -> question_get_renderoptions
quiz_print_quiz_question -> print_question
quiz_get_question_responses -> get_question_responses
quiz_get_question_actual_response -> get_question_actual_response
quiz_get_question_fraction_grade -> get_question_fraction_grade
quiz_get_default_category -> get_default_question_category


Renaming constants:
QUIZ_EVENT.... -> QUESTION_EVENT....
QUIZ_MAX_NUMBER_ANSWERS -> QUESTION_NUMANS
2006-02-28 09:26:00 +00:00
vyshane 77230a8b5a Fix for Bug #4850.
Wrapped offending block in an isset() check to get rid of php notices in debug mode.
2006-02-28 07:01:23 +00:00
vyshane 96ed436f37 Bug #4849 2006-02-28 04:41:44 +00:00
vyshane 4745a69050 Fixing Bug #4849 2006-02-28 04:33:39 +00:00
vyshane 0b3cfe8812 Fixed Bug #4552 2006-02-28 02:51:31 +00:00
toyomoyo e95dddd7a9 added a line to prevent warning 2006-02-28 01:52:38 +00:00
ikawhero f73eb30b02 Added realmedia support. 2006-02-27 23:48:25 +00:00
mits db2007cbc0 modified for Accessibility based on Standard theme. 2006-02-27 22:58:31 +00:00
nfreear 9fdbbcf768 Accessibility: 'headermain' is now H1, see theme/standard/styles_layout.css: .headermain
TODO (other moodlers): propagate change through header.html in other themes.
2006-02-27 14:17:08 +00:00
vyshane 91247b891f Changed the managingEditor and webMaster XML tags to show the fullname of the admin instead of the email address. This prevents spam resulting from bots crawling the RSS feeds. 2006-02-27 05:11:02 +00:00
moodler 735a795229 A few small changes for Vy to continue working on (logs, mostly) 2006-02-27 04:13:03 +00:00
vyshane e045d2042c Removing the /mod/data/lang/ directory since the language strings will now be stored under /lang/ 2006-02-27 04:04:30 +00:00
toyomoyo e1701b3ccd bynameondate for comments 2006-02-27 02:16:50 +00:00
toyomoyo 7c0af760aa comments, not comment, typo 2006-02-27 02:16:19 +00:00
toyomoyo 2232755c93 added time created and modified for comments 2006-02-27 02:13:48 +00:00
toyomoyo 8e24bfe7e8 adding date created and date modified for comments 2006-02-27 02:06:35 +00:00
urs_hunkler e03f2fec99 some template structure corrections and enhancements 2006-02-25 17:29:02 +00:00
urs_hunkler 259af02332 CSS enhancements and corrections 2006-02-25 17:27:49 +00:00
thepurpleblob 65c9673497 Latest version of Markdown Extra - Note that Extra has some new features
See: http://www.michelf.com/projects/php-markdown/extra/
2006-02-25 16:48:46 +00:00
michaelpenne 6094f43dd5 [Fix] Removed htmlentities on student answer. 2006-02-24 21:31:23 +00:00
michaelpenne 44492c2a18 [Fix] $navigation and $grade_value were undefined when lesson was added to site main page 2006-02-24 21:26:15 +00:00
michaelpenne 0d2df6a049 Removed correct and incorrect colors. 2006-02-24 20:17:41 +00:00
michaelpenne 1ae43a52f9 [BugFix] Bug #4174 - Lesson Essay Question Can't be Graded when attempt not finished 2006-02-24 20:17:08 +00:00
michaelpenne 0ac9372517 [BugFix] Bug #4828 - \ stripping problem 2006-02-24 19:42:13 +00:00
michaelpenne ee27cca526 [BugFix] Bug #4216 - cancel button 2006-02-24 19:09:14 +00:00
thepurpleblob 4c5d208a3e missing course parameter in header 2006-02-24 18:54:54 +00:00
thepurpleblob feb60a0755 Added function (from locallib.php) to create default quiz filename 2006-02-24 18:49:50 +00:00
thepurpleblob 7ac1e095b8 Moving export default filename function. 2006-02-24 18:49:01 +00:00
thepurpleblob f55b3d10bf Corrected require path for new location 2006-02-24 16:05:51 +00:00
thepurpleblob d8c2c55bf9 Removed import/export files. Moved to new (question) location 2006-02-24 16:01:44 +00:00
thepurpleblob 7b4ac82a37 Removed from old location 2006-02-24 15:50:39 +00:00
thepurpleblob 71d0be31d6 Removed import export functions 2006-02-24 15:46:59 +00:00
thepurpleblob 72c8c699be Removed links to locallib.php 2006-02-24 15:46:26 +00:00
thepurpleblob ff4b6492a0 Moved import/export functions. 2006-02-24 15:44:53 +00:00
thepurpleblob 5ab6af1238 Changed links to import and export screens. 2006-02-24 15:39:59 +00:00
thepurpleblob aca318e17e Moving import/export to new question area.
This will need some more work/testing though!
2006-02-24 15:17:40 +00:00
thepurpleblob 84769fd8a8 Moving quiz import/export files to new question area. 2006-02-24 15:14:09 +00:00
urs_hunkler 5bc572112c class added to the submit button to be able to position it
I optimized display.html and CSS
same class name for different objects is problematic
_ quiz table and question table must not be named with same class
_ surrounding tabel: class="multichoice|etc"
_ answer table: class="answer"
I changed the classname of the "answer" div to class="ablock" (short from "answer-block") that it does not conflict with "answer"
multichoice:
_ changed first row to class="r0"
_ added descriptive classes to the cells
2006-02-24 15:00:27 +00:00
gustav_delius f02c6f017e Renamed QUIZ_QTYPES to QTYPES 2006-02-24 13:48:43 +00:00
gustav_delius b2db6c5a41 Removing the developer docs because they are now held in MoodleDocs 2006-02-24 13:38:46 +00:00
gustav_delius 4b32fd66ab Moved function quiz_question_used from mod/quiz/locallib.php to question_used in lib/questionlib. Fixed some more links. 2006-02-24 12:53:47 +00:00
gustav_delius 219e92f2eb Preview now works also if no quiz is specified 2006-02-24 12:38:21 +00:00
gustav_delius 05054049a5 Fixed the redirection url to edit.php 2006-02-24 12:11:30 +00:00
gustav_delius d242adcf8f Updated rqp scripts to work with the separate question scripts in moodle/question 2006-02-24 12:01:47 +00:00
gustav_delius 2466f4dafb Added icon for the question bank link 2006-02-24 11:50:29 +00:00
gustav_delius b3ce2c2673 Updated date on copyright notice 2006-02-24 11:38:17 +00:00
gustav_delius d7c4c1b653 Admin Question link now points to the new question bank editing interface in moodle/question/ 2006-02-24 10:58:04 +00:00
gustav_delius 8a274d4d37 Bumped version number (hadn't been done in a long time) in order to be able to require latest Moodle version in the quiz module. 2006-02-24 10:51:26 +00:00
gustav_delius 8a9ba05a8a Removing questiontypes from their old location, they are now in moodle/question/questiontypes/ 2006-02-24 10:43:59 +00:00
gustav_delius 80a5e194ff Updated quiz scripts to work with the separate question scripts in moodle/question 2006-02-24 10:43:06 +00:00
gustav_delius e586cfb4b0 Updated question scripts to work in their new location 2006-02-24 10:35:28 +00:00
gustav_delius e56a08dc15 Updated questionlib to work with the new location of the question scripts 2006-02-24 10:25:16 +00:00
gustav_delius 516cf3eb59 Moving quiz-independent question scripts to their new location. In a following commit these files will be updated to actually work in their new location. 2006-02-24 10:21:40 +00:00
gbateson e7801d39dc improved handling of relative URLs for media files in jqz files 2006-02-24 09:57:25 +00:00
toyomoyo f841494c62 see changes for admin/utfdbmigrate.php 2006-02-24 08:20:13 +00:00
toyomoyo e98ae339ef see changes to admin/utfdbmigrate.php 2006-02-24 07:33:31 +00:00
toyomoyo 42295d1c67 added some new functionality
1. allows moodler to input a global language. If set, all convertion will be from that encoding to utf8. Thus saving time.
2. Allows user to specify the number of records to process. This will resume after x number of recoreds are processed.
3. DIsplay the approximate total number of records that needs process. Note some records might get processed multiple times
4. Takes the moodler right back to lang import after migration
2006-02-24 07:24:59 +00:00
vyshane 4e53996865 Made script work with 1.5 2006-02-24 06:14:39 +00:00
toyomoyo 59a488e1aa prints the whole comment when displaying confirmation 2006-02-24 04:30:29 +00:00
toyomoyo b754b2115c fixing bugs 2006-02-24 04:26:27 +00:00
martinlanghoff 20b36bed42 mod/quiz/backuplib: tiny syntax fix - thanks Nigel 2006-02-24 01:10:08 +00:00
mjollnir_ 0a0bcdd259 Merged from MOODLE_15_STABLE: Fixing a problem reported about self enrolment in child courses and not being able to access the parent without logging in and out again at http://moodle.org/mod/forum/post.php?reply=185699 2006-02-23 22:15:30 +00:00
gbateson 4a2360ac71 improved conversion of relative URLs for some Flash players 2006-02-23 21:24:25 +00:00
danmarsden 90ca2ce87d fixed bug with limits not limiting for only enrolled students - limit was counting non-enrolled students as well. - also removed checkboxes to delete response from not-answered column. 2006-02-23 21:20:44 +00:00
gustav_delius c6293e00db Backing up the 'originalquestion' field 2006-02-23 19:16:39 +00:00
gustav_delius 3eb9904f61 Restoring the 'originalquestion' field 2006-02-23 19:14:51 +00:00
gustav_delius 602d778b1f Experimenting with a new event type to accommodate teacher-marked questions. This is work in progress. 2006-02-23 19:12:46 +00:00
thepurpleblob cb06a092dc Whoops - ranges for categories on each page were incorrect. Plus added
sesskey to page numbers.
2006-02-23 16:55:13 +00:00
thepurpleblob 4a987dfa67 Improvements to pagination. Linked to all actions now. 2006-02-23 16:05:05 +00:00
thepurpleblob fb3fe7aa07 Added some basic pagination to categories screen. Probably needs a bit
more refinement.
2006-02-23 15:26:38 +00:00
ikawhero 9677eb79c5 Making custom scripts path generic so it is not forced to be in the
dataroot directory which is writable by the web server.
Path cleaned to avoid relative directory links.
2006-02-23 07:04:13 +00:00
toyomoyo 7b5aa1b725 case sensitive IP 2006-02-23 03:16:28 +00:00
toyomoyo 2786ff706d fix for 4825 2006-02-23 02:56:07 +00:00
toyomoyo f055d14bed fix for string type sort error, bug 4823 2006-02-23 02:34:46 +00:00
danmarsden 348630d87e moving duplicated code into Lib.php as functions & clean up the code a bit. - also now include users group info in text/excel downloads. - preparation for new choice block! 2006-02-23 01:20:24 +00:00
mits d8c33a44a9 polished. 2006-02-23 01:06:20 +00:00
mits b5cbc10eca to show "Turn editing on" and "Turn student view on" button in-line,
added styles_layout.css which includes  ".navbutton" attribute.
2006-02-23 01:04:36 +00:00
michaelpenne 150cdce033 [Update] Updated the help files to support regular expressions in short answer 2006-02-23 01:01:16 +00:00
michaelpenne e2d89fc3a7 [Changed/Added] langs for regular expression code in short answer 2006-02-23 00:42:46 +00:00
michaelpenne d643cbfb73 [Added] Added Regular Expression support for short answers by Joseph Rézeau. Discussion: http://moodle.org/mod/forum/discuss.php?d=38544
[Changed] Some display information has been changed, now prints page contents, user answer, and response
2006-02-23 00:41:28 +00:00
gustav_delius 4546212ce3 Keep the action icons in the category questions list from wrapping. Eventually this editing page needs to be styled properly with css. 2006-02-22 19:19:42 +00:00
gustav_delius f7cf31f594 Some mysql versions appear not to be willing to convert an empty string into a float. So setting all empty fields to 0 first. 2006-02-22 19:12:29 +00:00
thepurpleblob ce5a4f3284 Split out category class, and moved display part of code to it's own
section. About to make some changes related to large numbers of
categories (pagination etc).
2006-02-22 10:47:20 +00:00
gustav_delius f9cd8ce632 To determine whether a question has been graded we can now no longer look at wether the grade is the empty string because the grade is now always a number. Instead we use the $state->last_graded->event field. 2006-02-22 00:17:17 +00:00
urs_hunkler c02131ec37 started to build the CSS for the new quizzes. While working on it I will write all into styles.php. When finished I will put the CSS into the standard themes. The quiz part in the standard theme is deactivated. 2006-02-21 23:53:52 +00:00
gustav_delius 7fddf77ea5 display template for truefalse questions. Also simplified the code. 2006-02-21 23:08:11 +00:00
gustav_delius dcfa8b2aa9 No submit button in readonly mode 2006-02-21 23:06:47 +00:00
gustav_delius 3fc63cbe96 display template for shortanswer questions 2006-02-21 13:23:02 +00:00
thepurpleblob b9709b76d9 Corrected oversight with uploaded file filters change
See http://moodle.org/mod/forum/discuss.php?d=40177
2006-02-21 12:54:24 +00:00
thepurpleblob e11108a580 $CFG->filteruploadedfiles off by default.
See http://moodle.org/mod/forum/discuss.php?d=40177
2006-02-21 12:39:16 +00:00
thepurpleblob 2f9bd37cc3 Added proper check for $CFG->filteruploadedfiles, so that text/plain files
are not converted to text/html if this is 'off'
See discussion: http://moodle.org/mod/forum/discuss.php?d=40177
2006-02-21 10:43:23 +00:00
thepurpleblob 88118bb173 Range of settings improved for $CFG->filteruploadedfiles
See discussion: http://moodle.org/mod/forum/discuss.php?d=40177
2006-02-21 10:39:33 +00:00
thepurpleblob 741f827adc Added text strings for more versatile $CFG->filteruploadedfiles setting
and changed help string to suit.
2006-02-21 10:37:44 +00:00
urs_hunkler 55a997d08a some missing icons added 2006-02-21 07:44:53 +00:00
urs_hunkler 5452c7255c Comments from Andy:
config.php contains a new option,  $THEME->chameleonteachereditenabled  by default this is false, preventing teachers from editing chameleon course themes.  css.php has been changed a little to make use of this new property, it now also checks $CFG->allowcoursethemes before letting a teacher edit anything.

There have been some bug fixes in the handling of border shorthands.

Some workarounds to avoid a pretty big IE bug - the addRule method in IE's version of DOM 2 CSS  (which I use to create the live preview of changes), can crash the browser if the selector being added contains certain characters. Now as chameleon generates the preview it checks the selectors against a list of allowed characters - if the selector contains any character not on the list it will be ignored.

I don't think I'm quite there yet, but I made a bit of a change in some of the event handling code which means support for IE 5.5 seems to be getting closer :-)
2006-02-21 07:29:34 +00:00
toyomoyo c19c05c400 security issues with dangerous template 2006-02-21 07:17:02 +00:00
toyomoyo 5af0b52558 changed data_submitted for secureform; added sesskey 2006-02-21 02:02:24 +00:00
gbateson bb54c1c756 do not show JCloze clue button, if there is no clue 2006-02-21 00:19:15 +00:00
gustav_delius fbf0e2a204 Fix for bug 4810 2006-02-20 21:10:13 +00:00
gustav_delius 1d0f9df57e Added CVS hooks to templates 2006-02-20 20:47:48 +00:00
thepurpleblob 35d0543a1a added forcedownload=1 to exported file download.
Partly fixes problem with <pre> tags getting added by file.php
2006-02-20 16:42:01 +00:00
toyomoyo 03b80ff60d real fix for secureforms 2006-02-20 09:34:13 +00:00
toyomoyo ea6f999dc3 fix for secure forms 2006-02-20 09:31:29 +00:00
gustav_delius 38992f7e23 Changed grade fields to type real, added missing essay question tables. 2006-02-20 09:04:09 +00:00
toyomoyo 850d05ce38 . 2006-02-20 06:07:09 +00:00
toyomoyo 310639ff8c keep comments to the left for IE 2006-02-20 05:50:45 +00:00
gbateson 8faa855d37 encapsulate all functions within class;
rename "get_hotpotatoes_xxx" functions to "hotpot_get_xxx";
rename "seed_hotpotatoes_RNG" function to "hotpot_seed_RNG";
initialize all $question objects using $this->defaultquestion (if possible);
fix decoding of ampersands in HP quiz readings
2006-02-20 05:49:53 +00:00
toyomoyo b22bd6bc54 took out an extra echo 2006-02-20 05:40:26 +00:00
toyomoyo bbf0379ca1 fixed navigation after deleting or editting data comment 2006-02-20 05:37:15 +00:00
vyshane 006e4687cd Added array check when counting number of groups. 2006-02-20 05:09:43 +00:00
vyshane 4c906f7388 List of people in course now shows the number of groups each user is in. Resolves Bug #4799. 2006-02-20 04:59:30 +00:00
toyomoyo 8b034b6ddb string fix and empty lines 2006-02-20 03:15:38 +00:00
vyshane e5689267df Fixed bug in RSS xml file generation.
Fixed bug in file and picture links.
2006-02-20 03:02:32 +00:00
vyshane af25f45e1a Cleaning up xhtml markup. Code now validates for xhtml 1.0 transitional. 2006-02-20 02:15:45 +00:00
toyomoyo 7541b03f28 changed some grade fields into float type, see #4806 2006-02-20 01:41:00 +00:00
toyomoyo f344731398 fix for 4758 2006-02-20 01:30:30 +00:00
mjollnir_ ebe2c5057b Fixed up a few tiny syntax errors in quiz upgrade 2006-02-19 23:15:55 +00:00
gustav_delius 0f03f3a0c2 This way around will work better. Sorry, I am tired. 2006-02-19 23:08:52 +00:00
gustav_delius e3d36faadf Tables for essay questions. Penny will check I didn't mess this up. 2006-02-19 23:06:25 +00:00
gustav_delius c1e24bcd8e Changing grade fields to float for postgre 2006-02-19 22:49:30 +00:00
gustav_delius 3dd1a5c432 Changing grade fields to float for mysql. Asking Penny to do the same for postgreSQL 2006-02-19 22:19:00 +00:00
gustav_delius c4c7a2a67b Revert the fix to $status because it turns out that for example backup_putid() returns false when called with an id that has already been added. 2006-02-19 21:46:36 +00:00
koenr 917dd201c9 Ignored by accident some good advise 2006-02-19 21:39:22 +00:00
gustav_delius e1eed5ccfc Fix for bug 4217 2006-02-19 17:41:27 +00:00
moodler b8d1372a7b Make Database RSS feed work on Moodle 1.5 as well ;-) 2006-02-19 17:39:59 +00:00
gustav_delius d211bc1db1 Added string used to avoid confusion due to hidden questions, see bug 4217 2006-02-19 17:37:29 +00:00
gustav_delius 2e42186cbb Part of the future question type plug-in mechanism. This is not yet active, I am committing this only so as not to loose it. 2006-02-19 17:30:45 +00:00
gustav_delius 14afbbf034 Added the much-requested question reordering tool 2006-02-19 16:34:06 +00:00
gustav_delius 1c34035a40 Language string for the question reordering tool
Fixed grammar
2006-02-19 16:32:59 +00:00
koenr 64ac757850 Extra help and relieving lecture for during installation. 2006-02-19 16:32:57 +00:00
gustav_delius cd4f6b27a2 Help file for the question reordering tool 2006-02-19 16:27:02 +00:00
gustav_delius 7af1e88286 Added comments to the code (when will moodle HQ start commenting their own code? ;-) 2006-02-19 13:26:58 +00:00
stronk7 8630fd4be7 Done, changing some files with DOS linefeeds to Unix linefeeds. Bug 4763.
(http://moodle.org/bugs/bug.php?op=show&bugid=4763)
2006-02-19 10:31:21 +00:00
koenr a8126fc554 XHTML compliance typo 2006-02-18 21:35:30 +00:00
gustav_delius 1ef048aed3 Fixing a misprint that was preventing multiple files from showing. 2006-02-18 21:19:04 +00:00
gustav_delius 238bf03473 get_image now only returns the link, leaving the formating of the img tag up to the template 2006-02-18 21:08:34 +00:00
gustav_delius 997a2d5be3 New defaults, strings and help files for shuffle options 2006-02-18 21:07:39 +00:00
gustav_delius 162f62daaf New strings for shuffle options 2006-02-18 21:06:08 +00:00
gustav_delius 5e397ce7b0 New help files for shuffle options 2006-02-18 21:05:23 +00:00
gustav_delius a3b8af3805 Clear all floats before printing the next component. 2006-02-18 20:41:08 +00:00
mits bcb1789331 changed README.txt to README.html. 2006-02-18 20:38:51 +00:00
gustav_delius 0f9f31c81c Using html template for multichoice question 2006-02-18 20:01:36 +00:00
gustav_delius bffa0685da Added periods at the ends of the answer prompt sentences 2006-02-18 19:58:17 +00:00
gustav_delius ee49be211b updated required Moodle version in an attempt to stop people installing the unstable quiz module code (I use unstable in the sense of rapidly changing, not in the sense of buggy of course :-)) 2006-02-18 19:03:06 +00:00
gustav_delius 7f65c565be First steps towards separating logic and layout in the printing of questions: the print_question() method in the default question type now uses the template question.html 2006-02-18 17:32:56 +00:00
gustav_delius 7aa42eb0c8 The import tab has to provide the course id. 2006-02-18 15:11:03 +00:00
gustav_delius c54da50b29 An additional sorting order for category question list 2006-02-18 15:09:08 +00:00
gustav_delius a258d4fea8 Make sure teachers can only import into categories for which they have editing rights. 2006-02-18 13:09:59 +00:00
gustav_delius 39230689ef shuffleanswers is always turned on in cloze questions
Feedback popups are now sticky, see http://moodle.org/mod/forum/discuss.php?d=39983#183780
2006-02-17 18:31:15 +00:00
gustav_delius 7f30d941bc Corrected the page comment 2006-02-17 17:28:47 +00:00
gustav_delius 344be2522c Added link to questions bank 2006-02-17 17:15:56 +00:00
gustav_delius 6551bb8969 Changing headers to decoupling the question editing page from the quiz module. 2006-02-17 17:15:17 +00:00
gustav_delius fe5a3eb249 Better prompts for multiple choice questions, see bug 2791 2006-02-17 14:14:18 +00:00
toyomoyo 80329e02da forgot timelimit 2006-02-17 02:47:01 +00:00
toyomoyo b73b9d81ec better fix for 4360 2006-02-17 01:31:28 +00:00
gustav_delius f00da052c0 Bug in "Prevent late submissions" setting fixed, thanks to Samuli, see bug 4780 2006-02-16 22:01:57 +00:00
gustav_delius 5c6b657acb Bug in "Prevent late submissions" setting fixed, thanks to Samuli, see bug 4780 2006-02-16 21:56:57 +00:00
gustav_delius 997bcf0eb8 As Eloy pointed out, my recent addition for including child categories used by random questions did not restrict to the course or the instances currently being backed up. 2006-02-16 18:15:15 +00:00
gustav_delius 95ea52d41b Changed language string "Move category to" to "Parent", see bug 4727 2006-02-16 10:26:44 +00:00
gustav_delius 92c781cab3 Update the stamp each time a question is edited. This is the outcome of a long Skype discussion with Eloy on 15/02/06. A planned improvement for the future is to set the stamp to a md5 hash of the questiondata to ensure that identical questions will have identical stamps. Currently it is possible to obtain some duplication during question restore if between backup and restore the teacher clicks on the Save button on the editing page without acutally making any changes. Admittedly not a very likely scenario and hence the current system is good enough for now. 2006-02-16 10:20:27 +00:00
gbateson 84f037e086 micro increment version to 2.1.13 2006-02-16 10:18:54 +00:00
gbateson e5be91b770 correctly handle HTML entities in readings 2006-02-16 10:17:48 +00:00
exe-cutor 33d8eacfe4 Changed sequence of error messages. This makes more sense and should be better
understandable from a user's point of view.
2006-02-16 09:05:11 +00:00
exe-cutor a70d959a71 this file now does the authentication and doesnt use Shibboleth lazy sessions anymore for
various reasons, including security
2006-02-16 08:59:59 +00:00
exe-cutor b0e1220af4 Changed shib auth instructions to reflect new procedure for shib auth 2006-02-16 08:53:36 +00:00
exe-cutor 100f9e0d43 We dont use lazy sessions anymore for serveral reasons, including security 2006-02-16 08:52:29 +00:00
exe-cutor 0762da9ce2 not needed anymore with new shib auth procedure. 2006-02-16 08:50:50 +00:00
exe-cutor e2a420d6b2 Changed instructions to reflect new shib auth procedure 2006-02-16 08:50:15 +00:00
vyshane a684d28b29 Fixed notice in picture field edit view.
Made the field type icons clickable to edit the field.
2006-02-16 08:15:00 +00:00
vyshane cbde4dc94d Added back some strings that got lost. 2006-02-16 06:17:33 +00:00
vyshane a508f208ce RSS support 2006-02-16 03:35:10 +00:00
toyomoyo 7ac8a18b6e fixed a string 2006-02-16 01:50:09 +00:00
michaelpenne e51b142a78 Removed changes made earlier for ungraded essay questions. Will try to find an alternate method. 2006-02-16 00:30:50 +00:00
gustav_delius 6a687a0e98 Now contains code to also backup those categories needed by random questions that recurse into child categories.
Fixed the way the $status flag is handled.
2006-02-15 22:30:54 +00:00
gustav_delius 2b9221b9ff Fixed bug leading to warnings 2006-02-15 22:18:49 +00:00
gustav_delius 3181dafd62 added language strings, in particular for the tabs and decimal digits 2006-02-15 12:17:25 +00:00
gustav_delius 1bc28beba0 Improved the comment for set_field() 2006-02-15 12:13:20 +00:00
ethem 46bbbb4c85 DB new upgrade system. 2006-02-15 10:15:27 +00:00
gustav_delius f0b2c1cc2b Applied fixes from bug 4319. Thanks to Jaroslav 2006-02-15 08:59:32 +00:00
gustav_delius 03d1753c1c Renamed table quiz_newest_states to question_sessions 2006-02-15 08:38:41 +00:00
gustav_delius 832d40420c Renamed table quiz_newest_states to question_sessions 2006-02-15 08:34:36 +00:00
gustav_delius 786187cdfd Removed unnecessary code: questions are only deleted if they have no attempts. 2006-02-15 08:13:14 +00:00
toyomoyo ee14d73682 no update for en_utf8 2006-02-15 06:43:46 +00:00
toyomoyo e51d9eb4bf changed some strings 2006-02-15 06:38:32 +00:00
toyomoyo e5952c5a78 removed ability to update/delete en_utf8 2006-02-15 06:02:14 +00:00
patrickslee 94f9f07d3b Re-formatted the imporved flat file enorlment description 2006-02-15 03:27:56 +00:00
toyomoyo 9214c22430 fix for 4758 2006-02-15 01:55:04 +00:00
gustav_delius b2a90f76b2 Don't apply lateness check when teacher previews. 2006-02-15 00:16:57 +00:00
gustav_delius adaa8c8650 Grammar fix, bug 4526 2006-02-15 00:06:28 +00:00
gustav_delius 193b283985 removed a warning, see bug 4406 2006-02-14 23:24:10 +00:00
gustav_delius 85b9b86f51 Round also the raw score. 2006-02-14 23:08:06 +00:00
mjollnir_ 35cfff0e66 added to magpie the ability to do POSTs as well as GETs.. submitted this patch upstream but upstream doesn't seem to look at patches on sf.net 2006-02-14 20:33:40 +00:00
gustav_delius 8c85be6698 Rounding errors could lead to "Partially correct" for correct answers, see http://moodle.org/mod/forum/discuss.php?d=39548 2006-02-14 18:37:03 +00:00
gustav_delius 24edc235c6 Fixed submit buttons 2006-02-14 18:21:06 +00:00
thepurpleblob bfb5216f5d Format now uses defaultquestion() method. Bug #4752 2006-02-14 09:53:37 +00:00
thepurpleblob 4db0b132cb Bring formatting into line with Moodle standard (at last!) 2006-02-14 09:45:29 +00:00
moodler 40470d9349 Added new feature: time delay between quiz attempts 2006-02-14 05:12:24 +00:00
vyshane de9b123967 Fixed typo for get_string call for 'rsshowmany' 2006-02-14 04:10:47 +00:00
vyshane 235ef1e56e Added string for RSS explanation 2006-02-14 04:09:51 +00:00
toyomoyo 5ae56899ba backup and restore for comments and ratings 2006-02-14 04:02:19 +00:00
mjollnir_ f9648e77cf Added cron support for blocks - it was already there in the tables, now we just need to use it 2006-02-14 03:24:08 +00:00
toyomoyo d02cb0d006 new ratings functionality 2006-02-14 03:21:56 +00:00
toyomoyo 1f45ca1428 taking out the print_object 2006-02-14 03:19:19 +00:00
toyomoyo 4d3d87f0a4 adding ratings and comments functionality 2006-02-14 03:17:21 +00:00
toyomoyo 81ef8c1f48 fixing a weird index in scorm_scoes_track (see bug report 4742) 2006-02-14 02:44:03 +00:00
toyomoyo a9149e77e4 bug fix for 4742 2006-02-14 02:35:11 +00:00
toyomoyo 1c8510355f adding index pagetype to block_pinned to make it consistent 2006-02-14 02:34:37 +00:00
mjollnir_ 3a11c548b2 Fixing a warning in debug mode 2006-02-14 02:01:31 +00:00
mjollnir_ 347723bda2 fixing bug # 4751 - adding unique key in postgres for mod/quiz for gustav 2006-02-14 02:01:06 +00:00
gustav_delius 12318329fa Edit link in preview mode now also for descriptions, see bug 4518 2006-02-13 23:48:12 +00:00
gustav_delius b04523d1c4 convert sequence field to text to accomodate very long sequences, see bug 4257 2006-02-13 23:34:30 +00:00
gustav_delius a42f000635 Matching questions now no longer give away the answer in the page source, see bug 694 (that is an old bug!) 2006-02-13 23:15:40 +00:00
koenr d8891d4a23 typo 2006-02-13 22:52:45 +00:00
michaelpenne b9376ebef0 The following changes were made to help reduce confusion for students when essay questions are being used in a quiz.
- When a essay question has been submitted or being reviewed and has not been graded by the instructor, then the Marks are not shown and displays a message to the student instead of saying Incorrect. (changes to questiontypes/questiontype.php in functions print_question and print_question_grading_details).

    - For students, in view.php, a notice is printed to inform him/her that s/he has ungraded essay question(s).
    - For teachers, in view.php, a notice is printed to inform him/her that s/he has X number of ungraded essays for X number of studnets

    - In review.php, next to the grade output, informs the viewer if X number of ungraded essays in this attempt.

    - In questiontypes/essay/questiontype.php created a utility function to generate the numbers used in the above changes.

    - In lang/en/quiz.php added new lang entries.

So, hopefully the student will now understand that their grade does not include the ungraded essay questions.  Modification of lang entries might be needed to further drive this point.
2006-02-13 20:27:34 +00:00
michaelpenne d8ed413b92 Converted tabs to spaces 2006-02-13 17:44:50 +00:00
michaelpenne 2f6f0b8ce2 [Fixed] In function save_session_and_responses, now checks to makes sure $state->options->graded is set. 2006-02-13 17:41:19 +00:00
thepurpleblob 5744931aa2 Format now uses defaultquestion() method. Bug #4752 2006-02-13 16:24:05 +00:00
thepurpleblob d3ca8695cb Now used defaultquestion() method. Bug #4752 2006-02-13 16:17:22 +00:00
thepurpleblob 2ad273d70b Format now uses defaultquestion(). Bug #4752 2006-02-13 16:11:17 +00:00
thepurpleblob cb04e0d664 Now picks up default $question object. Bug #4752 2006-02-13 15:48:48 +00:00
bobopinna baef508d2c Removed the last short tag 2006-02-13 15:14:57 +00:00
thepurpleblob 42e5993199 Added initialisation method for question object. Permits setting of default
values for required (but not imported) database fields.
Bug #4752
2006-02-13 14:46:26 +00:00
gustav_delius acb0c2d93e fixing hardcoded string, see bug 4432 2006-02-13 13:28:40 +00:00
gustav_delius 353138dc11 Added a unique index for attempt->uniqueid 2006-02-13 13:20:57 +00:00
gustav_delius 6d08ff4f01 Fixing javascript, see bug 4418 2006-02-13 11:23:47 +00:00
vyshane a593aeee92 Added RSS support for data module. 2006-02-13 07:57:54 +00:00
patrickslee 9896df48fd Change password button should be displayed according to the setting of the user who is been viewed, not the user who is viewing(currently logged in) 2006-02-13 03:08:56 +00:00
toyomoyo 48dbefcd7d fix for 4735 2006-02-13 02:44:37 +00:00
toyomoyo 583dfd073d individual record error only gets reported when debug is on 2006-02-13 02:38:40 +00:00
toyomoyo 89ac329bd0 taking out adodb_logsql table 2006-02-13 01:58:42 +00:00
toyomoyo 4dc78ff1c1 taking out pma tables as they are not mandatory 2006-02-13 01:57:04 +00:00
toyomoyo 3b34520151 fixed a bug to stop changing dummy field 2006-02-13 01:55:42 +00:00
moodler fd198b8776 Adding new feature: Time delay between quiz attempts 2006-02-13 01:49:52 +00:00
moodler e61eab5a83 Adding new feature: delay between quiz attempts 2006-02-13 01:45:29 +00:00
patrickslee 808856c6f6 Imporved the documentation for flatfile enrolment plugin on the configuration page
Backported from MOODLE_15_STABLE
2006-02-13 00:36:56 +00:00
gustav_delius f0295d5aba Remove empty line, see bug 4747 2006-02-12 23:30:37 +00:00
gustav_delius 41323dff31 Added missing percentages to the grade selector, closing bug 4250 2006-02-12 22:38:13 +00:00
gustav_delius aa960f6b04 Edit link in preview window now says 'Edit'. 2006-02-12 22:26:53 +00:00
gustav_delius 0b72ce2051 Made page compatible with new tabbed interface and removed continue button as requested in bug 2919 2006-02-12 21:50:38 +00:00
gustav_delius 721b5b28c9 Stopped using the language strings for the assignment module because that was requested in bug 4558. 2006-02-12 21:23:54 +00:00
gustav_delius 8779eab55d Avoid error messages in case $quiz->sumgrades is zero, closing bug 4454. Merged from STABLE 2006-02-12 21:08:43 +00:00
skodak 0ae88327f2 fixed whitespace only 2006-02-12 19:46:30 +00:00
skodak 9b9ae915d7 scales.php fixed page parameters and removed isset_param(); scale parameter now named scaleid when listing only 2006-02-12 19:43:17 +00:00
skodak 295e4bdd18 fixed page parameters and removed isset_param() 2006-02-12 19:07:20 +00:00
gustav_delius 162cbee229 Added field to versioning table needed by new versioning table (to be committed later) 2006-02-12 15:28:17 +00:00
gustav_delius d40d8ef7b1 quiz_delete_question() now recursively also deletes data associated with newer versions of the question. 2006-02-12 15:24:45 +00:00
skodak fac01360b3 removed isset_param() 2006-02-12 11:27:22 +00:00
skodak 23ca8954be removed isset_param() and fixed warning 2006-02-12 11:24:24 +00:00
gustav_delius 5a981c9480 shuffleanswers option can now also be set at the question level, see http://moodle.org/mod/forum/discuss.php?d=39371 2006-02-12 09:46:34 +00:00
gustav_delius 906935f3b0 Put the default grade option onto question edit forms, see http://moodle.org/mod/forum/discuss.php?d=39371#181767 2006-02-11 22:37:30 +00:00
gustav_delius 7c4127efad Put the default grade option onto question edit forms, see http://moodle.org/mod/forum/discuss.php?d=39371#181767 2006-02-11 21:07:08 +00:00
gustav_delius 90ec0c2fc7 removed two method definitions that are used for the editing form 2006-02-11 16:40:09 +00:00
stronk7 feba81cc49 Avoid one notice. Bug 4690. Credits go to fad. B-)
(http://moodle.org/bugs/bug.php?op=show&bugid=4690)
2006-02-11 16:17:06 +00:00
gustav_delius 6f51aa2e5b get_actual_response() method for cloze question type contributed by Jean-Michel, see http://moodle.org/mod/forum/discuss.php?d=27730#181773 2006-02-11 16:13:21 +00:00
gustav_delius eaa5a1c0c8 Added missing icon (used by quiz editing page) 2006-02-11 14:07:54 +00:00
ikawhero ef0cfc1dbe Fixed some typos. Credit to Darlene Morris. 2006-02-11 03:55:52 +00:00
ethem 9a5a7c3814 Function: getsettletime minute fix. 2006-02-10 12:41:56 +00:00
moodler 3c73df8e5d Added missing require_once('locallib.php'); 2006-02-10 03:59:30 +00:00
vyshane 74142cc5a7 Reverted back rss_get_link() function. We've decided that the data module will
store it's XML RSS stuff in another path.
2006-02-10 03:16:59 +00:00
vyshane d1dbc96fea Modified function rss_get_link() so that we ignore $userid if it is empty when
we build the path to the XML file.

We need this for RSS feeds for the data module, where it does not make sense
to generate an XML file for each user when they will all be seeing the same
feed.
2006-02-10 03:03:29 +00:00
toyomoyo 55e87e5386 added code to remove possible warnings 2006-02-10 01:26:16 +00:00
toyomoyo 2cdd87a70f fix for 4720, added code to make sure en_utf8 is searchable in dirroot as well 2006-02-10 01:21:52 +00:00
toyomoyo 7919264b84 bug fixing for 4720 2006-02-10 01:16:54 +00:00
danmarsden d921818dc1 tidy up download of files when groups are turned on. + fix for Bug 4601 Bug 4476 2006-02-09 22:45:31 +00:00
danmarsden df5fb55cbc Bug #4452 link names to profiles 2006-02-09 21:50:21 +00:00
danmarsden 313441331e add ability to delete responses, add pragma to text download and removed hardcoded localised string. 2006-02-09 21:09:10 +00:00
danmarsden a56ca75fda backticks around release to allow upgrade to work correctly when using mysql 5 2006-02-09 18:12:51 +00:00
gustav_delius c4adc2c493 Added a second row of tabs to the Edit tab: Questions, Categories, Import, Export, Settings
Added phpdoc header to some files
Improved language string and help file for decimal digits on grades
2006-02-09 13:57:22 +00:00
gustav_delius 4eedc50cbc Excluded the description questiontypes from random questions
Fixed a warning message when there are no questions

Removed the category id number from the message shown to users when there are not enough random questions because this id number does not mean anything to the user.
2006-02-09 13:46:05 +00:00
gustav_delius e7cb8f3e7a Now one can set the title attribute for a tab separately from its text 2006-02-09 13:38:04 +00:00
gustav_delius 27998b9e2f Added a NOT NULL to a text field just because others have it and now it agrees with my recent commit to STABLE. 2006-02-09 12:23:49 +00:00
thepurpleblob 716a508520 parameters all go through required_param() and optional_param() 2006-02-09 11:50:25 +00:00
toyomoyo 743500132c bug fix for 4724 2006-02-09 07:52:48 +00:00
toyomoyo 527ec51af5 fix for 4726 2006-02-09 06:41:18 +00:00
vyshane bbe39b6ca9 Updated lang/en/data.php.
Removed hard coded message strings from scripts and moved them to the language file.
Fixed a display bug in multimenu field.
Removed rounded help buttons from fields, made the fields use html title to
display the descriptions instead.
2006-02-09 04:44:56 +00:00
toyomoyo 4a6716ceab bug fix for 4670 2006-02-09 02:18:13 +00:00
danmarsden c100a341a6 Bug 3768 - Release is now a reserved word in MySql 5 2006-02-08 23:46:21 +00:00
toyomoyo 7988d9e75a prevent the attempt of editting packs located in $CFG->dirroot/lang (from get_list_of_languages() used in 1.6 sites that are not uncodedb) 2006-02-08 07:44:36 +00:00
toyomoyo bcfe401e39 fix for 4715 2006-02-08 07:23:02 +00:00
ikawhero ef3d770bfa Initial help files for data module. Need tidying up. 2006-02-08 06:10:16 +00:00
fyang1024 b827a98e10 remove the testing code 2006-02-08 06:01:13 +00:00
ikawhero a3425b2ada Strings for the data module 2006-02-08 06:00:42 +00:00
fyang1024 407ed8c619 change class name soapclient to soap_client according to the nusoap.php in the lib/soap folder 2006-02-08 06:00:24 +00:00
toyomoyo d6af3cfab9 add_instance change too 2006-02-08 04:58:21 +00:00
toyomoyo 17e5f3fc9d adding 3 more fields to mod.html, and modified data_update_instance 2006-02-08 04:56:44 +00:00
moodler d49490104a Added new help: time enforced delay on attempting quizzes 2006-02-08 04:49:23 +00:00
moodler fb03508866 Added new lang: time enforced delay on attempting quizzes 2006-02-08 04:47:03 +00:00
moodler 72ef06cfe5 Added new feature, the time enforced delay on attempting quizzes 2006-02-08 04:44:57 +00:00
moodler cab300a85f Add two new fields for time enforced delay between two quizzes 2006-02-08 04:41:31 +00:00
moodler 401c3496ae Adding two new fields for time enforced delay between quiz 2006-02-08 04:37:22 +00:00
toyomoyo 256054828a adding 3 more fields 2006-02-08 04:35:43 +00:00
toyomoyo 0e64ba2852 adding 3 new fields 2006-02-08 04:35:23 +00:00
patrickslee 765d3c7dde Show category list rather than the whole list of courses if there is only one category and with more than 200 courses in it
Otherwise we will have a HUGE list of courses flooding our browser.

Backported from MOODLE_15_STABLE
2006-02-08 04:21:22 +00:00
patrickslee 48643b4918 Do not show the category list with courses if there are more than 200 courses in the system
Otherwise the front page/course list will be flooded with courses.
2006-02-08 03:34:20 +00:00
toyomoyo 70eed352e6 fixing a problem with enum 2006-02-08 03:30:26 +00:00
gbateson cfbaea0056 small change to get CSS background images displayed on site where PHP's server API is "CGI". Micro increment version number to 2.1.12 2006-02-08 02:47:22 +00:00
toyomoyo 1a395c082d added a missing prefix 2006-02-08 02:42:12 +00:00
toyomoyo 5698c19d7a prints all SQLs if debug is set to true 2006-02-08 02:20:43 +00:00
toyomoyo f8cf297a7a bug fix for 4709 2006-02-08 02:02:28 +00:00
toyomoyo d9e61eacfd setting time to 0 2006-02-07 07:05:01 +00:00
toyomoyo 656411a550 adding pma tables 2006-02-07 05:57:54 +00:00
toyomoyo 0a43c46b3b hardcode all encodings, so we don't need to rely on old lang files 2006-02-07 02:57:35 +00:00
toyomoyo 24d8b724da bug 4504 2006-02-07 01:39:22 +00:00
patrickslee 8e227aa767 Added a parameter to print_courses() to hide site course
This parameter is used in index.php because if the moodle site have more than one category the site course will be displayed in the course list in the front page.

This problem appeared after the "front page format" feature is introduced. As the old front page will show a category tree with courses if there are more than one category in the system when "list of courses" is chosen as the front page.
2006-02-07 01:13:27 +00:00
gustav_delius bfb55c1870 now loading central soap library 2006-02-07 01:13:20 +00:00
gustav_delius cd00e988bb Introduced function quiz_delete_question() and questiontype methods delete_question() 2006-02-07 00:44:27 +00:00
stronk7 de4217730a Deleted soap libraries from quiz. Now they are part of the central libraries
(lib/soaplib.php and lib/soap). Bug 4646.
(http://moodle.org/bugs/bug.php?op=show&bugid=4646)
2006-02-07 00:26:54 +00:00
stronk7 882e59b93b Main Moodle SOAP library. It uses nusoap or phpsoap
as needed. Copied from rqp question type.
2006-02-07 00:20:50 +00:00
stronk7 157278118e wrapper library to use internal PHP5 SOAP library. Copied from
rqp quiz questions.
2006-02-07 00:19:38 +00:00
stronk7 b6b970705e Initially the get_string() function, if any string wasn't found under
one lang (or its parent), was searched from "en" or "en_utf8"
(depending of the status of the DB migration).

But "en" isn't one full lang anymore under 1.6 but one "child" of "en_utf8" and
it's completely empty so we must look for the string into his new parent too.

This should solve problems with upgraded sites using non-english languages
that were showing brackets everywhere. Now they will show the english strings
until they manually install lang packages (1.5 packs) or automatically (1.6 packs).
2006-02-07 00:08:47 +00:00
patrickslee bfb2ed3bdd Fixed nusoap include problem in lams module caused by the rename of nusoap lib directory 2006-02-06 23:45:43 +00:00
gustav_delius c9dfed37c2 Silenced notices produced by flush() and ob_flush() in regrading code. 2006-02-06 23:28:30 +00:00
gustav_delius 3bf0212c24 Another improvement on regrading. The code thought that grading for a question changed if the grade was like 1/3. The precision in the database is different than the newly calculated grade, so now we round both values to 5 decimal places, which should fix this problem. This was committed to STABLE by Julian a long time ago 2006-02-06 23:25:15 +00:00
gustav_delius 27aa2243ea I was adding the slashes twice 2006-02-06 23:15:59 +00:00
mjollnir_ f5f270a188 Adding missing default perfdebug 2006-02-06 23:02:05 +00:00
gustav_delius 46fbd65ab7 Show grading details only if $options->scores is true 2006-02-06 22:52:05 +00:00
gustav_delius adce1ab5c1 Fixing problem from earlier merge 2006-02-06 21:22:07 +00:00
mjollnir_ f90672bf85 Added back a field I missed when reworking the sql for quiz reports - qa.uniqueid as attemptuniqueid - after skype discussion with gustav 2006-02-06 20:58:27 +00:00
michaelpenne 8e7cf8d4c9 [Fixed] Activity linking was not useing the course module id correctly. 2006-02-06 20:49:03 +00:00
gustav_delius 668bc1f3a6 reverting change made by Martin D when going to version 1.230 2006-02-06 20:44:43 +00:00
stronk7 a25a4a7356 Nusoap lib is now uder the soap dir. Bug 4646.
(http://moodle.org/bugs/bug.php?op=show&bugid=4646)
2006-02-06 19:39:18 +00:00
stronk7 2797078a69 Moving the nusoap library from nusoap to the new soap dir. 2006-02-06 19:37:17 +00:00
stronk7 f1144867da nusoap lib updated to latest revision.
Point 1 of bug 4646
(http://moodle.org/bugs/bug.php?op=show&bugid=4646)
2006-02-06 19:20:22 +00:00
thepurpleblob f6dc60844f Added provision for resetting values to default. Bug #4123 2006-02-06 16:48:32 +00:00
thepurpleblob e9512cdda9 Added ability to reset to default. Bug #4123 2006-02-06 16:36:28 +00:00
thepurpleblob cda8673c5f Added ability to reset page to defaults. bug #4123 2006-02-06 16:32:44 +00:00
thepurpleblob 56a031c9ac Added string for resettodefaults for filters pages. bug #4123 2006-02-06 16:31:36 +00:00
thepurpleblob 7be6fd6684 Added new reset button. bug #4123 2006-02-06 16:30:30 +00:00
thepurpleblob 0ae6a2cad5 Added test for cache directory. Suppresses errors if it does not exist. 2006-02-06 15:35:31 +00:00
andreabix dbda947cf0 Fixed uneven spacing in minicalendar table. Thanks to Daniele Cordella for the hint. 2006-02-06 14:46:47 +00:00
stronk7 8859e0b6ca Now "en" lang has "en_utf8" as parent so we must allow
it to look for parent strings... Only "en_utf8" remains
as root language to save us from some checks (because
it cannot have parentlaguage defined).
2006-02-06 13:45:00 +00:00
stronk7 e973824c94 parentlanguage is the correct name 2006-02-06 13:24:49 +00:00
moodler a956203b48 Added a missing string 2006-02-06 13:02:23 +00:00
moodler bdad561a9e DOS format 2006-02-06 12:59:57 +00:00
moodler ff2fccc971 Updated README 2006-02-06 12:59:20 +00:00
moodler 919ece0f88 Slightly more documentation 2006-02-06 12:52:12 +00:00
moodler 0b85bf5430 New stub file for "en" language 2006-02-06 12:51:05 +00:00
moodler c1a1e8e465 New base version of English in UTF8 2006-02-06 09:30:09 +00:00
moodler 49aafb90bd New base version of English in Unicode format 2006-02-06 09:28:59 +00:00
moodler cfa40737cf Removing all the language packs from HEAD!! 8-D 2006-02-06 09:22:14 +00:00
vyshane f9eab7b0c9 Fixed bug in /mod/data/filter.php - content list for autolinking was not being
generated properly.

Updated /mod/data/fields.php - deletion of a field now also deletes
data_contents and any files associated as well.

Add/update/delete fields - template now gets updates in the following cases:
1) Deletion: remove template tags for the field from all templates
2) Edit: search and replace template tags for the field in all templates
3) Add: append template tag for field into the signe and rss templates, but
only if these templates are not empty. Otherwise we'd rather the user uses the
automatic template generation facility, which produces better display.
2006-02-06 09:13:37 +00:00
moodler 20f601d324 editting of langs take place in $CFG->dataroot/lang now, Editting of en_utf8 is disabled 2006-02-06 08:41:21 +00:00
toyomoyo 5d9a7c352e group 0 records are visible to all now 2006-02-06 06:30:18 +00:00
toyomoyo 27b00cd39b no page in groups, thanks 2006-02-06 06:19:00 +00:00
toyomoyo f4e101bd08 adding group support 2006-02-06 06:13:34 +00:00
ikawhero a0397e90da return to previous view after editing a record 2006-02-06 05:37:20 +00:00
ikawhero d6f0e247b4 I'm really having issues getting this one line right! 2006-02-06 05:36:34 +00:00
ikawhero 12fe91c401 Oops, missing semicolon 2006-02-06 05:33:26 +00:00
ikawhero 5782be6b0a Recommiting lost changes. 2006-02-06 05:31:52 +00:00
toyomoyo 42e118badc templates and fields do not require group support 2006-02-06 05:31:49 +00:00
moodler 6e0119dd30 Various small XHTML fixes, language fixes 2006-02-06 05:24:02 +00:00
ikawhero 6f4e039994 Tidying up. 2006-02-06 05:18:37 +00:00
moodler bbccd611cb fixing for 4695 2006-02-06 05:02:38 +00:00
moodler 56135f6b4c Show the intro at the top of the page 2006-02-06 04:17:30 +00:00
moodler 089e8937f7 Removing delDirContents because we already have remove_dir 2006-02-06 04:03:30 +00:00
moodler 201b8b3681 adding a check to make sure student can't participant in teacher participation level 2006-02-06 03:51:51 +00:00
moodler ecb454fe6a fixing a type update->updated 2006-02-06 03:13:59 +00:00
moodler 653bcc596c Added a link to the listtemplate images to the full record 2006-02-06 03:06:16 +00:00
moodler cd2f695055 Added a parameter to display_browse_field() to pass the template name
to the fields, so they can return different output for different templates.

Picture now has two heights/widths for different templates
2006-02-06 02:49:46 +00:00
moodler 83b4f772d9 fixing 4681 2006-02-06 02:41:59 +00:00
moodler a6d122f7a7 fix for 4615 2006-02-06 02:31:32 +00:00
moodler cc0a632f1e fixing ' problems 4679 2006-02-06 02:15:44 +00:00
moodler dd0b8fe1d4 fixing typos 2006-02-06 01:51:03 +00:00
gustav_delius 0e2057cb17 Added essay question to list of excluded types for random questions
Also fixed type on previous commit
2006-02-05 22:55:09 +00:00
gustav_delius 5e468d30e1 Fixed a potential bug that would have hit if one quiz would have had two random questions for the same category, one of which was set to recurse into subcategories and the other not.
At the same time this improves performance because no longer all the potential questions are loaded from the database but only their ids.
2006-02-05 22:51:32 +00:00
scop22 1a914bccda Fixing 'firstdayofweek' string to include number only 2006-02-05 20:30:34 +00:00
scop22 f68e6f2ace Committing in ko language pack to keep up with latest translated strings in ko_utf8 unicode pack; last commit before the move to unicode only translation 2006-02-05 20:21:45 +00:00
scop22 78e58fb918 Committing in ko_utf8 many new additions and corrections; last commit before the new unicode system kicks in 2006-02-05 19:00:44 +00:00
gustav_delius d28ca2be6f Fixing image link, closing bug 4489 2006-02-05 18:58:49 +00:00
gustav_delius 205e0e2dd6 Some comments added and fixed small potential bug in get_correct_responses() 2006-02-05 18:45:31 +00:00
gustav_delius fb06b99b78 Reverting a change which Martin made in an attempt to encrypt information in the matching questiontype which unfortunately broke a lot of other question types. 2006-02-05 18:31:23 +00:00
stronk7 74506a51a3 Perform one aditional check to avoid one, in my opinion,
bad behaviour of PHP5.
2006-02-05 10:11:12 +00:00
stronk7 b4dd571d8e Now the installer looks for UTF-8 enabled DB (both for MySQL and
Postgress) warning if DB it isn't found. This test can be skipped,
but showing a message about it.
If everything is OK the CFG->unicodedb variable is written to the
config.php file.
With this, 1.6 installer should be 100% ready.
2006-02-05 00:57:44 +00:00
gustav_delius 2b0906805b Fix for bug 4678 contributed by rwmoore 2006-02-05 00:35:51 +00:00
stronk7 96c9f7379c Now the utfdbmigrate process trusts about enviromental decission. 2006-02-04 19:03:51 +00:00
mits 98cd3ab70c changed iconv and mbstring recommended messages based on /lang/en.
translated new strings.
2006-02-04 18:57:59 +00:00
stronk7 76bb0d20a3 We only allow to bypass "required" checks. 2006-02-04 18:57:22 +00:00
stronk7 696d30784b DOS linefeeds are dead now! 2006-02-04 18:51:25 +00:00
stronk7 be828dcdcb New record!! 2 lines, 3 typos!! :-P
Also, I've noticed that the file has DOS linefeeds!
Please avoid them!
2006-02-04 18:49:19 +00:00
stronk7 8dc725d939 Solving typo! 2006-02-04 18:31:09 +00:00
stronk7 b0e2a189ce Now every test in the enviromental check can by bypassed by one
function execution. Currently it's used to check for MySQL 4.1.12
and if present, result will be ok, showing a notice about
possible problems with non latin languages.
2006-02-04 18:30:22 +00:00
stronk7 de36987bcf changing one wrong string. 2006-02-04 18:26:27 +00:00
stronk7 cae45bfe82 Sending some new environment strings.
Verified by EOS  ;-)
2006-02-04 18:20:14 +00:00
stronk7 b9993e9568 Bypass function redefined a bit. 2006-02-04 17:22:59 +00:00
martignoni 8c42b481bb adding strings 2006-02-04 15:38:19 +00:00
martignoni 32ca09bca8 Added to enviroment feedback messages. More soon... 2006-02-04 15:36:37 +00:00
martignoni 1f22eb2f3f Show only one message for actions (Capture/Void/Credit) in test mode. 2006-02-04 15:23:09 +00:00
mits 4f358c9ec9 polished. 2006-02-03 18:57:20 +00:00
martignoni f0018992ea Minor change. Delete one slash. 2006-02-03 14:44:39 +00:00
martignoni 1030f57b67 Error strings for component_installer class added. 2006-02-03 14:42:16 +00:00
moodler 1291b2d54f Fixed some SQL errors on searching and sorting 2006-02-03 10:53:00 +00:00
ikawhero 1f697b99aa Remove para tags 2006-02-03 10:42:14 +00:00
mits 512cc057aa translated new strings for maintenance.. 2006-02-03 10:33:19 +00:00
ikawhero d20578cc4d New help file. Needs cleaning up. 2006-02-03 10:12:18 +00:00
ikawhero 26aae788ba Initial help files for data module. Will need cleaning up. 2006-02-03 09:27:37 +00:00
vyshane 173b1b1261 Input field size cleanups. 2006-02-03 09:22:23 +00:00
moodler 27f7cf9039 adding strings 2006-02-03 09:19:51 +00:00
moodler 27afe69260 get_string not stripslashes 2006-02-03 09:17:25 +00:00
moodler e9e6e7b85f fix for 4676 2006-02-03 09:16:15 +00:00
ikawhero d0dfb3ba87 More strings added 2006-02-03 09:00:49 +00:00
ikawhero f3b5b8b668 Added new string 2006-02-03 08:58:08 +00:00
ikawhero d7ca860b9d Added helpbutton for approvals. 2006-02-03 08:56:30 +00:00
moodler 20fda38ba9 adding functionality to allow teacher approval of record 2006-02-03 08:12:41 +00:00
moodler cf3e199bce changes in search, sort etc 2006-02-03 08:11:36 +00:00
ikawhero 31c1f1c93e Added help buttons, removed ambiguous participants entry. 2006-02-03 08:10:06 +00:00
bobopinna 0f995ab206 Fixed some bugs and typos 2006-02-03 08:04:57 +00:00
vyshane 0bbc6f5700 Added autolinking. 2006-02-03 08:04:40 +00:00
moodler 60b8d2234a Added a space 2006-02-03 07:38:27 +00:00
moodler dae9e55b06 Added Skype web-status 2006-02-03 07:27:46 +00:00
mits 9aeb3a8a5f translated new strings for environment. 2006-02-03 02:04:17 +00:00
stronk7 9e2d15e559 Now environment.xml file can define for all the tests (database,
php and php_extension) some feedback notes to be showed on error,
on check and on ok.

Tomorrow, I'll include de bypass mechanism that will allow us to
change results of any text based in function call results.
2006-02-03 00:40:49 +00:00
stronk7 205b551eeb Added to enviroment feedback messages. More soon... 2006-02-03 00:24:46 +00:00
stronk7 10a1ac179e Change one style to apply it in some more places... 2006-02-03 00:23:03 +00:00
mjollnir_ 510b75ae64 Merged from MOODLE_15_STABLE: Moved check_dir_exists function from backup/lib.php to moodlelib 2006-02-02 20:30:34 +00:00
stronk7 d24e8b250e Now enviroment.xml will support:
- Feedback messages to be defined on error and on check.
- Bypass function calls to change original checks performed.
2006-02-02 18:29:41 +00:00
mits 6c2cde36d7 polished.
The great change for lang files is coming soon :-)
http://moodle.org/mod/forum/discuss.php?d=38892
2006-02-02 10:33:09 +00:00
vyshane bad7f9e00a Removed debugging output from /mod/data/lib.php
New icons for field types
2006-02-02 10:12:30 +00:00
martignoni dcbf710fc6 2 components strings... 2006-02-02 10:11:46 +00:00
martignoni 356725e9b6 Adding some strings for db migration 2006-02-02 10:10:22 +00:00
martignoni d0488aa831 New language strings to express ordering choices 2006-02-02 10:00:28 +00:00
martignoni 17b976fb97 One forgotten string (dbwrongencoding) 2006-02-02 09:52:43 +00:00
martignoni 7ad51db5e0 One forgotten string... ('skipdbencodingtest') 2006-02-02 09:37:42 +00:00
carlesbellver 52b4548021 Moodle 1.6 2006-02-02 08:10:11 +00:00
vyshane c87fbb27e1 Removed autolink support from radio button field (not needed).
Fixed bug for empty muti menu and multi checkbox fields.
Added "Choose..." as first item in single selection menu. Added relevant
string in en language.
Updated /mod/data/lib.php, function store_data_content() so that we store
empty content for fields too.
2006-02-02 06:28:17 +00:00
mits 05a42a140b polished. 2006-02-02 04:52:37 +00:00
mjollnir_ 3abd1a5552 Merged from MOODLE_15_STABLE: Fixing bug#4659 - don't make upload directories unless there's something to save 2006-02-01 20:01:50 +00:00
stronk7 4128597a44 Solved one bug when decoding encoded links for
resource->reference
(http://moodle.org/mod/forum/discuss.php?d=38801)

Merged from MOODLE_15_STABLE
2006-02-01 19:10:30 +00:00
koenr 19b7a4a2ca New strings from Vichika for khmer 2006-02-01 16:25:01 +00:00
koenr 64c17a0710 New files and new strings from a new translator: Tormod for the no language pack
Checking it in while I'm still sure I'm doing it right :-D
2006-02-01 15:36:22 +00:00
ethem 33bbb39b4f Show warning message if cron doesn't work. Review order depends on cron & an_capture_day. 2006-02-01 13:30:45 +00:00
gbateson abbd2c40ba if old "v6" folder cannot be deleted, update will WARN but will not fail 2006-02-01 13:25:06 +00:00
ethem 7fec4cb2f9 Rename an_cutoff_hour and an_cutoff_min to an_cutoff. 2006-02-01 13:03:13 +00:00
vyshane 88f47f81bc Removed autolink form radio button field (not needed). 2006-02-01 06:59:57 +00:00
moodler 1c6f450c41 changed to use componentlib 2006-02-01 05:59:21 +00:00
mits 2655b93fe2 Delete one slash from "remotedownloadnotallowed" on error.php
translated new strings for language migration.
translated a new string for Authorize.net.

to make expression soften changed translation "We" from [Kanji] character to Japanese syllabary characters.
meaning is same.
2006-02-01 05:43:07 +00:00
vyshane 2806b95ca2 Modification to make field use content1 column in data_content table 2006-02-01 05:13:01 +00:00
vyshane 22e192c9f0 Added language strings for multi-selection menu and checkbox fields. 2006-02-01 05:11:23 +00:00
vyshane 2c5c1418bb Added multi-selection menu field support. 2006-02-01 05:09:59 +00:00
vyshane 4728968fc7 Checkbox field support 2006-02-01 05:08:51 +00:00
ethem 181c06ea6b Show only one message for actions (Capture/Void/Credit) in test mode. 2006-01-31 16:41:46 +00:00
stronk7 4d1014d5c8 ziip files doesn't exist! 2006-01-31 15:03:52 +00:00
stronk7 24e4cd5375 Now environmental data can be installed automatically from
download.moodle.org using the component_installer class.

Seems to work at the fist try, so something is wrong, sure! :-P
2006-01-31 14:53:05 +00:00
stronk7 65e9c20363 2 components strings... 2006-01-31 14:48:49 +00:00
stronk7 71de0d55f8 Bug solved. make_upload_directory() is relative to
dataroot by definition.
2006-01-31 14:32:20 +00:00
stronk7 ae8c20d737 Minor change. Delete one slash. 2006-01-31 14:31:02 +00:00
martignoni c77f9c311f Better wording 2006-01-31 13:40:52 +00:00
martignoni 58780da99b Some typos corrected 2006-01-31 13:36:52 +00:00
martignoni 0dae324b93 Typo corrected 2006-01-31 13:22:40 +00:00
moodler 9b470754b3 deleting lang cahce after done 2006-01-31 09:08:22 +00:00
moodler 860e5affcb adding some strings for db migration 2006-01-31 08:43:07 +00:00
moodler 001fc706ef fixing bugs in event table 2006-01-31 08:37:00 +00:00
moodler 799ce77d79 mechanism for unicode db migration is in. Please only use for testing at this stage. This is not for production site! (yet) 2006-01-31 08:21:04 +00:00
moodler b1cdbbf9c6 New Chameleon theme from
Urs Hunkler - http://www.unodo.de
    Andrew Walker - http://www.altoncollege.ac.uk
2006-01-31 06:05:33 +00:00
vyshane f1ad19bcae Fixed update display bug in the menu field.
Updated following fields so that they do not pack data into
data_content.content, but use data_content.content, data_content.content1,
etc:

- URL field
- File field
- Picture field

Note that above changes to the way data is stored means that the new
implementation is not compatible with previous version.

Updated textarea field. Added relevant help messages. Added richtext editor
support. Removed ability to restrict allowed formats for the textarea field.

Misc bug fixes and display tweaks.
2006-01-31 04:25:46 +00:00
vyshane 5f5bcda8b4 Added richtext support for textarea, plus relevant help buttons. Made fields
use column content1, content 2, etc. instead of packing everything into
content.
2006-01-31 03:58:42 +00:00
patrickslee 79724b8ebb file enrol_manual.php was initially added on branch MOODLE_16_MULTIENROL. 2006-01-31 02:53:56 +00:00
moodler 136b6ab33f changed to use utfconvert function 2006-01-31 02:15:21 +00:00
mits 9ae17efc1c translated new strings for component_installer class. 2006-01-31 01:22:41 +00:00
stronk7 cdeb260153 Error strings for component_installer class added. 2006-01-31 00:15:26 +00:00
stronk7 c6fd7d80f3 Minor modifications. 2006-01-31 00:14:48 +00:00
stronk7 d70c9bda55 Finished the install_component class. It allows do do all the work
just with 2 calls. See embebed documentation about usage.

Next step, add some error strings and implement it both in pear and
environmental actions.
2006-01-30 23:19:13 +00:00
gustav_delius a445d5e8b2 shortened language string name as requested in bug 4568 2006-01-30 23:17:47 +00:00
patrickslee e0140f2425 Revised front page logic so list of courses and list of categories show correct things regardless of any special situation
And a small HTML fix for print_category_info()
2006-01-30 22:54:12 +00:00
patrickslee 6298f98c0a Some HTML fixes for configurable frontpage settings page 2006-01-30 21:20:45 +00:00
gustav_delius 6e218d24ce Fixed alignment of form elements in IE 2006-01-30 21:09:48 +00:00
gustav_delius 56b5d16a4d Fixed alignment of module icon so it looks correct also in Firefox. 2006-01-30 20:45:54 +00:00
mits c551c0604a polished. 2006-01-30 15:31:21 +00:00
stronk7 d359b5ac14 first cut of the component download and install
library. Will be used for 1.6 langs, pear and
enviromental stuff install from moodle.org.

Not working yet!
2006-01-30 15:02:20 +00:00
mits 21d47f1f37 polished. 2006-01-30 12:05:46 +00:00
thepurpleblob 610a889296 Fixed typo. 2006-01-30 10:51:40 +00:00
mits 176ef4cdde polished. 2006-01-30 02:19:06 +00:00
mits 3328924542 polished.
translated new string new for "express ordering choices".
2006-01-30 01:02:01 +00:00
gustav_delius 9f55987836 Now use language strings instead of 1,2,3 to express ordering choices 2006-01-30 00:40:57 +00:00
gustav_delius 9af43ab537 new language strings to express ordering choices 2006-01-30 00:40:36 +00:00
mits d0977a1a58 polished. 2006-01-30 00:29:06 +00:00
mits c5aaa15c9c polished. 2006-01-30 00:17:07 +00:00
mits eaa315d771 polished. 2006-01-29 12:55:58 +00:00
koenr 66e28bf870 clarified the use of this language pack in English 2006-01-29 11:05:07 +00:00
koenr cc7561762d Changing language notation Norsk to Norsk - Norsk - Bokm&#229;l after discussion with Tormod 2006-01-29 10:42:42 +00:00
koenr 7f059d2375 Changing display of Nynorsk to Norsk - Nynorsk after discussion with Tormod 2006-01-29 10:40:04 +00:00
mits c699199a51 polished and translated new strings. 2006-01-29 05:55:15 +00:00
mits aecb0db468 polished and added one new string for install. 2006-01-28 20:49:13 +00:00
koenr 14cf08fdba new strings translated 2006-01-28 20:04:17 +00:00
stronk7 5c95e839f7 One forgotten string... 2006-01-28 19:52:26 +00:00
defacer e68cf1b3e9 Merging from STABLE:
Fix for bug 4627:

Hide "change password" link in admin block if the user is restricted.
Not a security issue, as the script doesn't allow you to change your
password even if you go there by typing in the URL.

Credits for report & patch go to Joseph Rezeau.
2006-01-28 19:49:16 +00:00
stronk7 6844571580 Added one new string and polished another one. Thanks EOS! ;-) 2006-01-28 19:21:22 +00:00
mits d0ec7d0ced modified based on fixed "typo Bug #4638" lang/en. 2006-01-28 16:12:40 +00:00
koenr 1667957eb0 typo Bug #4638 2006-01-28 15:40:35 +00:00
moodler fe9f19ef1e Added a fix to help user profile pictures under safe mode (from Mahmoud H. Hasan)
PHP manual mentions it too.
2006-01-28 14:15:56 +00:00
mits 0600f5be99 making expression more soften, changed translation of "as" from Kanji character to Japanese syllabary characters.
meaning is same.
2006-01-28 12:35:41 +00:00
mits 95f26a9a3e upgraded AdoDB and added Typo3 charset libs based on /lang/en
committed again ......
2006-01-28 11:45:12 +00:00
mits 4250125a3d Upgraded AdoDB and added Typo3 charset libs based on /lang/en. 2006-01-28 11:39:24 +00:00
stronk7 875571cae9 Upgraded AdoDB and added Typo3 charset libs (Spanish) 2006-01-28 11:16:23 +00:00
stronk7 a8f23ba288 Upgraded AdoDB and added Typo3 charset libs. 2006-01-28 11:08:56 +00:00
mits ce97200025 polished. 2006-01-28 10:38:19 +00:00
mits 1cf0e57716 polished. 2006-01-28 10:30:49 +00:00
mits 4a3b5c15e4 polished. 2006-01-28 09:19:51 +00:00
mits 1046dabbe2 polished. 2006-01-28 07:38:55 +00:00
moodler 7d94fa91d5 Upgraded ADOdb to 4.71
http://sourceforge.net/project/shownotes.php?release_id=387862&group_id=42718
2006-01-28 06:04:42 +00:00
stronk7 13ca56cf52 Solving double addslashes to DB when the site is running with
magic_quotes_gpc() disabled (because Moodle addslashes to
everything). Not a pretty hack, but it seems to work.
(http://moodle.org/mod/forum/discuss.php?d=38127)

Merged from MOODLE_15_STABLE
2006-01-27 23:01:34 +00:00
ethem 00a354a2da Which form is submitted? Internal or authorize?
This eliminates undefined form->property notices when user submitted internal form.
2006-01-27 14:16:41 +00:00
ethem d90534da0d Move $this->validate_enrol_form() to check_entry(). 2006-01-27 13:44:11 +00:00
ethem c5c56ae00d Move card validation to validate_enrol_form function. 2006-01-27 13:34:42 +00:00
martignoni cc56643a8b Forgotten string 'adminemailexpired' 2006-01-27 13:25:11 +00:00
martignoni ca3e567a20 Reverted wrong string deletion 2006-01-27 13:17:23 +00:00
mits eca7556d55 polished. 2006-01-27 11:25:50 +00:00
mits cc3de1f126 polished. 2006-01-27 10:46:29 +00:00
ethem b1fa2cf269 Card Validation and Postal Code field validation fix. (is_int & is_numeric) 2006-01-27 09:16:01 +00:00
moodler bdc003eb05 bug fixings 2006-01-27 04:39:53 +00:00
moodler 677169b9dc fixing typo 2006-01-27 04:31:46 +00:00
moodler f36c4b9601 took out an echo 2006-01-27 04:29:11 +00:00
moodler 112d84a3f9 fixing typo =( 2006-01-27 04:27:08 +00:00
toyomoyo a597f8a86a adding function print_progress from upgradeforumread 2006-01-27 02:54:51 +00:00
toyomoyo 943cc10d5b took out print_progress funciton and put it in adminlib 2006-01-27 02:54:03 +00:00
mits 71f7eeff64 polished. 2006-01-26 14:18:55 +00:00
mits 15797ed775 polished.
making expression more soften, changed translation of "ask" from Kanji character to Japanese syllabary characters.
meaning is same.
2006-01-26 13:57:30 +00:00
martignoni c3eebe72c6 Extra text in 'guestnosubmit' 2006-01-26 13:36:34 +00:00
martignoni da72808b23 Latest install-related strings added. 2006-01-26 13:33:51 +00:00
martignoni ed16012468 Minor change... 2006-01-26 13:20:12 +00:00
martignoni d4841ba032 Split some strings for better formatting. Old ones are maintained
for 1.5 compatibility.
2006-01-26 13:19:02 +00:00
martignoni 913b3ca7ae Environment strings added. 2006-01-26 12:58:34 +00:00
martignoni dc33c57d0d Manage orders with status filter. All/Authorized/Captured/Refunded/Cancelled/Expired. 2006-01-26 12:46:41 +00:00
martignoni 7fd2b284d9 AVS & Reason messages. 2006-01-26 12:43:53 +00:00
ethem a47f3a1ab2 New strings from Ethem Evlice (ethem AT evlice DOT com) <XHTML /> compliant. 2006-01-26 12:29:59 +00:00
mits 04058928e6 polished. 2006-01-26 12:22:20 +00:00
gbateson fee4328c6b Further improvement to generation alternative matches in JMatch 2006-01-26 12:11:36 +00:00
martignoni 3422bbf524 Merged Patrick's mailnow patch. This allows admin users the ability to override maxediting time and have forum posts mailed out immediately. 2006-01-26 10:23:22 +00:00
martignoni daca15fb32 Environment strings added. 2006-01-26 10:14:10 +00:00
barias 73d3ad7fe9 Latest help files 2006-01-26 01:12:38 +00:00
julmis 1ab4713da2 Merging from MOODLE_15_STABLE
- adding fix for Bug 4562. Fix posted by sgarcia.
2006-01-25 23:47:16 +00:00
stronk7 e4a70465de Raising MySQL minimum version to 4.1.16
Merged from MOODLE_15_STABLE
2006-01-25 15:52:48 +00:00
koenr 9d6cdb7141 NCR notation required - sorry 2006-01-25 14:56:22 +00:00
koenr 95e45af5f8 new strings from Maryia 2006-01-25 14:42:29 +00:00
vyshane 113782126c Modifications to use new columns in data_content table
Modifications to support different text formats
2006-01-25 09:21:17 +00:00
vyshane eefe4f9720 Modifications to use new columns in data_content table 2006-01-25 09:18:29 +00:00
vyshane c91c24d7e3 Modifications to bring in line with the changes to database structure.
Vy-Shane
2006-01-25 09:10:14 +00:00
carlesbellver 9629b1d285 Correccions 2006-01-25 07:59:43 +00:00
gbateson 27e4e81f1b micro increment version to 2.1.11 2006-01-25 07:31:37 +00:00
gbateson ea2cf99599 added backup/restore compatibility for Moodle 1.5 (and earlier) 2006-01-25 07:20:13 +00:00
moodler 3e42156be5 removed an extra echo statement 2006-01-25 06:23:33 +00:00
moodler 4979f73c9e fixing typos 2006-01-25 06:11:26 +00:00
moodler 37d7e71a0b bug fixning 2006-01-25 06:11:00 +00:00
moodler 052dec9a2c adding more cases for serialized blocks 2006-01-25 06:10:18 +00:00
moodler b250d8b32b bug fixing indexing problem 2006-01-25 06:07:52 +00:00
moodler 25d0380b6e bug fixing 2006-01-25 05:20:33 +00:00
mits 423e3cdd14 polished. 2006-01-25 03:47:28 +00:00
mits 72b5c43142 polished.
making expression more soften, changed translation of "immediately", "As soon as"  from Kanji character to Japanese syllabary characters.
checked frequency of usage in Google.
meaning is same.
2006-01-24 11:33:15 +00:00
mits 05366c0084 polished. 2006-01-24 08:34:04 +00:00
moodler 3b1cddb932 adding a require_logout() function 2006-01-24 06:01:30 +00:00
moodler 0302c52fd2 adding a require_logout() function =) 2006-01-24 06:00:32 +00:00
moodler 3b32165cc7 bug fixing 2006-01-24 02:37:18 +00:00
moodler a03d69a5ea added code to support dummy fields (to enable dropping and adding arbitray number of indexes) 2006-01-24 02:36:32 +00:00
moodler e70813cf37 Cleaned up text field params (textarea does this now) 2006-01-24 02:20:51 +00:00
moodler 54cf0d092f Fixed a parameter check 2006-01-24 02:07:13 +00:00
vyshane 65342c76a3 Fixed syntax error on line 804. 2006-01-24 01:51:13 +00:00
moodler a789577bf4 Fix Bug #4626 - weblib.php: $course object conversion error in &quot;print_footer &quot; function 2006-01-24 01:40:06 +00:00
mits 0b58de9ae1 polished again. 2006-01-24 01:29:46 +00:00
mits f7393b5297 polished. 2006-01-24 01:27:10 +00:00
michaelpenne de1547bf6c [Fixed] A problem with storing the answerid for numerical questions. Discussion here: http://moodle.org/mod/forum/discuss.php?d=37537 2006-01-24 00:47:11 +00:00
mjollnir_ 5e33ce6da3 bugfix for hook for filters to have their own save config function 2006-01-23 22:38:01 +00:00
mjollnir_ e5b66e2cd4 added hook for filters to have their own save config function if they want to 2006-01-23 20:37:44 +00:00
stronk7 4d69a487e4 Cleaning of unnecessary 4th fields in the insert_record() function.
See http://moodle.org/bugs/bug.php?op=show&bugid=4583 for more
information.
2006-01-23 16:36:46 +00:00
andreabix 8794f8bff0 Typo corrected thanks to Luca Mazzola 2006-01-23 14:24:52 +00:00
dlnsk 979435ffa5 New string added 2006-01-23 07:52:52 +00:00
moodler 0e15269a94 bug fixing 2006-01-23 05:41:51 +00:00
mits 7a5f1757fc translated extra text in 'guestnosubmit'. 2006-01-23 03:48:29 +00:00
moodler 0c25b4534e bug fixes 2006-01-23 03:15:45 +00:00
moodler 43b48b89f6 Extra text in 'guestnosubmit' 2006-01-23 02:41:01 +00:00
moodler 15921df130 Extra fix for bug #4604. Guests see different message, instead of "You have not submitted anything" 2006-01-23 02:38:26 +00:00
mits 19ab119426 making expression more soften, changed translation of some words from Kanji character to Japanese syllabary characters.
checked frequency of usage in Google.
meaning is same.
2006-01-23 02:03:47 +00:00
stronk7 5e0b242bfc Avoid one wrong primarykey parameter that, after latest
changes to insert_record() was breaking the wiki module
completely!
2006-01-22 23:54:09 +00:00
stronk7 e734dbb66b There! :-P :-D
(just looking for one BIG problem in wiki - pagename is lost, so page
is never detected, so the edit page is showed once and again and again,
and again.......)
2006-01-22 20:27:11 +00:00
mits a1017a70c4 making expression more soften, changed translation of "whether or not" from Kanji character to Japanese syllabary characters.
meaning is same.
2006-01-22 05:15:20 +00:00
gbateson db5170674c removed some extraneous white space 2006-01-22 04:40:27 +00:00
gbateson fb1b789fd6 standardized line endings, so that README.TXT is readable on Windows machines 2006-01-22 04:39:37 +00:00
mits c681a96f9e polished. 2006-01-22 04:17:55 +00:00
mits 0941f850b8 making expression more soften, changed some translation of "and" from Kanji character to Japanese syllabary characters.
meaning is same.
2006-01-22 03:43:23 +00:00
mits 4e88dab6f4 making expression more soften, changed translation of "whether or not" from Kanji character to Japanese syllabary characters.
meaning is same.
2006-01-22 03:26:13 +00:00
mits 6d41efb830 translated latest install-related strings. 2006-01-21 21:04:46 +00:00
stronk7 b3f06605c3 Latest install-related strings added. 2006-01-21 18:14:29 +00:00
stronk7 3b3b80293c Now the installation process perform then environment check. 2006-01-21 17:30:01 +00:00
koenr 0e101fea8e few new strings 2006-01-21 15:10:23 +00:00
koenr bad5bd243f trying to make things more understandable 2006-01-21 15:09:49 +00:00
gbateson 2266fc893e fix typo: "get_user_preference" => "set_user_preference" 2006-01-21 06:48:23 +00:00
gbateson b74d340762 only display "Excel" option, if an Excel library is available 2006-01-21 06:46:48 +00:00
mits ca61cb465c polished. 2006-01-21 00:23:06 +00:00
stronk7 d83f837385 Changed harcoded 'admin' to $CFG->admin
Merged from MOODLE_15_STABLE
2006-01-21 00:19:02 +00:00
mits 60e8150a83 polished. 2006-01-21 00:16:21 +00:00
mits 04e5e9678e changed export file name to standard one. 2006-01-20 23:17:54 +00:00
mits 9816635451 translated new strings for install and Autorized.net.
making expression more soften, changed translation of "already" from Kanji character to Japanese syllabary characters.
meaning is same.
2006-01-20 23:09:59 +00:00
stronk7 878d309c2b Now results of check_moodle_environment() are
cached, saving us of some work when the script
is called more than once per request (install)

Merged from MOODLE_15_STABLE
2006-01-20 18:52:48 +00:00
stronk7 182dca14e5 Added one new style for better formatting. 2006-01-20 16:18:52 +00:00
stronk7 6f0879b6bf Minor change... 2006-01-20 16:17:51 +00:00
stronk7 e6f930f340 Split some strings for better formatting. 2006-01-20 16:11:32 +00:00
stronk7 2317aa003a Split some strings for better formatting. Old ones are maintained
for 1.5 compatibility.
2006-01-20 16:09:29 +00:00
ethem 752d465f4d Manage orders with status filter. All/Authorized/Captured/Refunded/Cancelled/Expired. 2006-01-20 16:04:52 +00:00
stronk7 b3bcee2457 First field must be unique in every select. Bug 4619.
(http://moodle.org/bugs/bug.php?op=show&bugid=4619)

Merged from MOODLE_15_STABLE
2006-01-20 15:09:54 +00:00
ethem 347923bf24 New strings from Ethem Evlice (ethem AT evlice DOT com) <XHTML /> compliant. 2006-01-20 12:08:01 +00:00
carlesbellver 1a2524ca4d Ajudes 2006-01-20 11:35:43 +00:00
gbateson 05b88e80df addslashes to "name" and "summary" when they are set from the HP quiz file;
increment version to v2.1.10
2006-01-20 11:27:52 +00:00
stronk7 09f972719b Solved small bug introduced in lat revision. My fault. :-( 2006-01-20 10:43:44 +00:00
moodler 698184d779 more bug fixing 2006-01-20 06:21:42 +00:00
mjollnir_ e31e89c3ac fixing a strange bug in stats graph display 2006-01-20 04:19:08 +00:00
moodler ede17ee59f fixing bugs 2006-01-20 04:06:49 +00:00
moodler 0046e5a0d9 adding code to migrate serialized html blocks 2006-01-20 03:43:38 +00:00
moodler 5739b8ad34 bug fixes 2006-01-20 02:50:06 +00:00
moodler 35bcb325f6 Added textarea field type.
Committed by Vy-Shane <vyshane@moodle.com>
2006-01-20 02:38:11 +00:00
toyomoyo 9a1a27b8fa removing \ 2006-01-20 02:26:37 +00:00
moodler 8e71ea9540 fixing conflicts 2006-01-20 01:53:50 +00:00
mits 6d8ccbf6c9 translated new strings for install, book and Autorized.net. 2006-01-20 01:41:28 +00:00
moodler 75785350dc fixing the conflicts, sorry >_< 2006-01-20 01:37:34 +00:00
moodler d22f58a2d7 bug fix for 4615 2006-01-20 01:19:33 +00:00
gbateson 79050beed7 micro-increment version number to v2.1.9 2006-01-20 01:05:13 +00:00
gbateson 9ddda2cef3 allow duplicate segments on JMatch 2006-01-20 00:59:50 +00:00
mjollnir_ 41547057cc Merged Patrick's mailnow patch. This allows admin users the ability to override maxediting time and have forum posts mailed out immediately. 2006-01-19 23:52:08 +00:00
patrickslee 3c622ced98 Removed some mailnow related patches -- mailnow feature is not merged yet 2006-01-19 22:45:59 +00:00
stronk7 a716b6495f Added some strings (related to external installers), so translators
can work with them. Needed to implement the script to create
install/lang/xx/install.php files automatically from official lang files.
2006-01-19 18:24:50 +00:00
stronk7 3470b39f5c Modifying the installation script. Step 1: Replace all
the harcoded stages to some nicer defines.
2006-01-19 17:41:56 +00:00
stronk7 00d3a0fd95 Notices out! 2006-01-19 16:21:50 +00:00
skodak 8d8f70e5a6 remove upload form for guests 2006-01-19 15:24:25 +00:00
ethem c1a91db06e AVS and Reason messages. 2006-01-19 14:57:23 +00:00
ethem 9d025f4a3d AVS & Reason messages. 2006-01-19 13:42:40 +00:00
12348 changed files with 226794 additions and 565564 deletions
+36 -35
View File
@@ -1,35 +1,36 @@
README $Id$
------
QUICK INSTALL
=============
For the impatient, here is a basic outline of the
installation process, which normally takes me only
a few minutes:
1) Move the Moodle files into your web directory.
2) Create a single database for Moodle to store all
it's tables in (or choose an existing database).
3) Visit your Moodle site with a browser, you should
be taken to the install.php script, which will lead
you through creating a config.php file and then
setting up Moodle, creating an admin account etc.
4) Set up a cron task to call the file admin/cron.php
every five minutes or so.
For more information, see the INSTALL DOCUMENTATION:
http://moodle.org/doc
If you have real trouble, please visit the Moodle course
"Using Moodle" on moodle.org.
Good luck and have fun!
Martin Dougiamas, Lead Developer
README $Id$
------
QUICK INSTALL
=============
For the impatient, here is a basic outline of the
installation process, which normally takes me only
a few minutes:
1) Move the Moodle files into your web directory.
2) Create a single database for Moodle to store all
it's tables in (or choose an existing database).
3) Visit your Moodle site with a browser, you should
be taken to the install.php script, which will lead
you through creating a config.php file and then
setting up Moodle, creating an admin account etc.
4) Set up a cron task to call the file admin/cron.php
every five minutes or so.
For more information, see the INSTALL DOCUMENTATION:
http://docs.moodle.org/en/Installing_Moodle
A local copy can also be found in
lang/en_utf8/help/install.html (or your language)
Good luck and have fun!
Martin Dougiamas, Lead Developer
+12 -6
View File
@@ -62,17 +62,23 @@
echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
}
echo "</optgroup>\n";
}
if (!empty($users)) {
foreach ($users as $user) {
$fullname = fullname($user, true);
echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
} else {
if ($usercount > MAX_USERS_PER_PAGE) {
echo '<optgroup label="'.get_string('toomanytoshow').'"><option></option></optgroup>'."\n"
.'<optgroup label="'.get_string('trysearching').'"><option></option></optgroup>'."\n";
} else {
if (!empty($users)) {
foreach ($users as $user) {
$fullname = fullname($user, true);
echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
}
}
}
}
?>
</select>
<br />
<input type="text" name="searchtext" size="30" value="<?php echo $searchtext ?>"
<input type="text" name="searchtext" size="30" value="<?php p($searchtext, true) ?>"
onFocus ="document.adminform.add.disabled=true;
document.adminform.remove.disabled=true;
document.adminform.removeselect.selectedIndex=-1;
+13 -10
View File
@@ -1,14 +1,10 @@
<?PHP // $Id$
// Admin-only script to assign administrative rights to users
require_once("../config.php");
require_once('../config.php');
define("MAX_USERS_PER_PAGE", 50);
optional_variable($add, "");
optional_variable($remove, "");
optional_variable($search, "");
if (! $site = get_site()) {
redirect("$CFG->wwwroot/$CFG->admin/index.php");
}
@@ -81,7 +77,7 @@
}
/// Is there a current search?
$previoussearch = (!empty($frm->search) or ($frm->previoussearch == 1)) ;
$previoussearch = (!empty($frm->search) or (isset($frm->previoussearch) and $frm->previoussearch == 1)) ;
/// Get all existing admins
$admins = get_admins();
@@ -105,11 +101,18 @@
/// If no search results then get potential users excluding current admins
if (empty($searchusers)) {
if (!$users = get_users(true, '', true, $adminlist, 'firstname ASC, lastname ASC', '', '',
0, 99999, 'id, firstname, lastname, email') ) {
$users = array();
$usercount = get_users(false, '', true, $adminlist, 'firstname ASC, lastname ASC', '', '',
0, 99999, 'id, firstname, lastname, email');
$users = array();
if ($usercount <= MAX_USERS_PER_PAGE) {
if (!$users = get_users(true, '', true, $adminlist, 'firstname ASC, lastname ASC', '', '',
0, 99999, 'id, firstname, lastname, email') ) {
$users = array();
}
}
$usercount = count($users);
}
$searchtext = (isset($frm->searchtext)) ? $frm->searchtext : "";
+65 -23
View File
@@ -1,7 +1,10 @@
<?PHP // $Id$
// config.php - allows admin to edit all configuration variables
include("../config.php");
require_once('../config.php');
$auth = optional_param('auth', '', PARAM_SAFEDIR);
require_login();
if (!$site = get_site()) {
@@ -16,12 +19,13 @@
error(get_string('confirmsesskeybad', 'error'));
}
$focus = '';
/// If data submitted, then process and store.
if ($config = data_submitted()) {
$config = (array)$config;
validate_form($config, $err);
// extract and sanitize the auth key explicitly
$modules = get_list_of_plugins("auth");
@@ -31,6 +35,14 @@
notify("Error defining the authentication method");
}
// load the auth plugin library
require_once("{$CFG->dirroot}/auth/$auth/lib.php");
$err = array();
if (function_exists('auth_validate_form')) {
auth_validate_form($config, $err);
}
if (count($err) == 0) {
foreach ($config as $name => $value) {
if (preg_match('/^pluginconfig_(.+?)$/', $name, $matches)) {
@@ -62,16 +74,25 @@
}
$modules = get_list_of_plugins("auth");
$options = array();
foreach ($modules as $module) {
$options[$module] = get_string("auth_$module"."title", "auth");
}
asort($options);
if (isset($_GET['auth']) && in_array($_GET['auth'], $modules)) {
$auth = $_GET['auth'];
if (!empty($auth) && in_array($auth, $modules)) {
} else {
$auth = $config->auth;
}
$auth = clean_filename($auth);
// changepassword link replaced by individual auth setting
if (!empty($config->changepassword)) {
if (empty($config->{'auth_'.$auth.'_changepasswordurl'})) {
$config->{'auth_'.$auth.'_changepasswordurl'} = $config->changepassword;
}
set_config('changepassword','');
}
$auth = clean_param($auth,PARAM_SAFEDIR);
require_once("$CFG->dirroot/auth/$auth/lib.php"); //just to make sure that current authentication functions are loaded
if (! isset($config->guestloginbutton)) {
$config->guestloginbutton = 1;
@@ -85,11 +106,13 @@
if (! isset($config->changepassword)) {
$config->changepassword = "";
}
$user_fields = array("firstname", "lastname", "email", "phone1", "phone2", "department", "address", "city", "country", "description", "idnumber", "lang");
if (empty($focus)) {
$focus = "";
if (! isset($config->{'auth_'.$auth.'_changepasswordurl'})) {
$config->{'auth_'.$auth.'_changepasswordurl'} = '';
}
if (! isset($config->{'auth_'.$auth.'_changepasswordhelp'})) {
$config->{'auth_'.$auth.'_changepasswordhelp'} = '';
}
$user_fields = array("firstname", "lastname", "email", "phone1", "phone2", "department", "address", "city", "country", "description", "idnumber", "lang");
$guestoptions[0] = get_string("hide");
$guestoptions[1] = get_string("show");
@@ -129,20 +152,39 @@
echo "<table border=\"0\" width=\"100%\" cellpadding=\"4\">";
require_once("$CFG->dirroot/auth/$auth/config.html");
$CFG->pagepath = 'auth/' . $auth;
echo '<tr><td colspan="3">';
print_heading(get_string('auth_common_settings', 'auth'));
echo '<td/></tr>';
if ($auth != "email" and $auth != "none" and $auth != "manual") {
// display box for URL to change password. NB now on a per-method basis (multiple auth)
echo "<tr valign=\"top\">";
echo "<td align=\"right\" nowrap=\"nowrap\">";
print_string("changepassword", "auth");
echo ":</td>";
echo "<td>";
echo "<input type=\"text\" name=\"changepassword\" size=\"40\" value=\"$config->changepassword\" />";
$passurl = $config->{'auth_'.$auth.'_changepasswordurl'};
echo "<input type=\"text\" name=\"auth_{$auth}_changepasswordurl\" size=\"40\" value=\"$passurl\" />";
echo "</td>";
echo "<td>";
print_string("changepasswordhelp","auth");
print_string("auth_changepasswordurl_expl","auth",$auth);
echo "</td></tr>";
// display textbox for lost password help. NB now on a per-method basis (multiple auth)
echo "<tr valign=\"top\">";
echo "<td align=\"right\" nowrap=\"nowrap\">";
print_string("auth_changepasswordhelp", "auth");
echo ":</td>";
echo "<td>";
$passhelp = $config->{'auth_'.$auth.'_changepasswordhelp'};
echo "<textarea name=\"auth_{$auth}_changepasswordhelp\" cols=\"30\" rows=\"10\" wrap=\"virtual\">";
echo $passhelp;
echo "</textarea>\n";
echo "</td>";
echo "<td>";
print_string("auth_changepasswordhelp_expl","auth",$auth);
echo "</td></tr>";
}
@@ -198,14 +240,6 @@
/// Functions /////////////////////////////////////////////////////////////////
function validate_form(&$form, &$err) {
// if (empty($form->fullname))
// $err["fullname"] = get_string("missingsitename");
return;
}
//
// Good enough for most auth plugins
// but some may want a custom one if they are offering
@@ -239,10 +273,18 @@ function print_auth_lock_options ($auth, $user_fields, $helptext, $retrieveopts,
foreach ($user_fields as $field) {
// Define some vars we'll work with
optional_variable($pluginconfig->{"field_map_$field"}, '');
optional_variable($pluginconfig->{"field_updatelocal_$field"}, '');
optional_variable($pluginconfig->{"field_updateremote_$field"}, '');
optional_variable($pluginconfig->{"field_lock_$field"}, '');
if(empty($pluginconfig->{"field_map_$field"})) {
$pluginconfig->{"field_map_$field"} = '';
}
if(empty($pluginconfig->{"field_updatelocal_$field"})) {
$pluginconfig->{"field_updatelocal_$field"} = '';
}
if (empty($pluginconfig->{"field_updateremote_$field"})) {
$pluginconfig->{"field_updateremote_$field"} = '';
}
if (empty($pluginconfig->{"field_lock_$field"})) {
$pluginconfig->{"field_lock_$field"} = '';
}
// define the fieldname we display to the user
$fieldname = $field;
+6 -2
View File
@@ -14,7 +14,7 @@
error("Site isn't defined!");
}
$blockid = required_param( 'block',PARAM_INT );
$blockid = required_param('block', PARAM_INT);
if(($blockrecord = blocks_get_record($blockid)) === false) {
error('This block does not exist');
@@ -57,7 +57,11 @@
$strconfiguration = get_string('configuration');
$strmanageblocks = get_string('manageblocks');
$strblockname = $block->get_title();
// $CFG->pagepath is used to generate the body and id attributes for the body tag
// of the page. It is also used to generate the link to the Moodle Docs for this view.
$CFG->pagepath = 'block/' . $block->name() . '/config';
print_header($site->shortname.': '.$strblockname.": $strconfiguration", $site->fullname,
"<a href=\"index.php\">$stradmin</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> -> ".
+3 -3
View File
@@ -6,7 +6,7 @@
require_once($CFG->libdir.'/blocklib.php');
require_once($CFG->libdir.'/tablelib.php');
$confirm = optional_param('confirm', 0, PARAM_INT);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$hide = optional_param('hide', 0, PARAM_INT);
$show = optional_param('show', 0, PARAM_INT);
$delete = optional_param('delete', 0, PARAM_INT);
@@ -156,7 +156,7 @@
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'multiple', 'delete', 'settings'));
$table->define_headers(array($strname, $strcourses, $strversion, $strhide.'/'.$strshow, $strmultiple, $strdelete, $strsettings));
$table->define_baseurl($CFG->wwwroot.'/admin/blocks.php');
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'blocks');
@@ -218,7 +218,7 @@
$table->define_columns(array('block', 'delete'));
$table->define_headers(array($strname, $strdelete));
$table->define_baseurl($CFG->wwwroot.'/admin/blocks.php');
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'incompatible');
+1 -1
View File
@@ -1,6 +1,6 @@
<form method="post" action="calendar.php">
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>">
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
<table class="formtable">
<tr>
<th>adminseesall:</th>
+1 -2
View File
@@ -35,8 +35,7 @@
}
if(isset($form->forcetimezone)) {
// To protect from SQL injections ...
$form->forcetimezone = str_replace(';', '', $form->forcetimezone);
$form->forcetimezone = str_replace('\'', '', $form->forcetimezone);
$form->timezone = clean_param($form->timezone, PARAM_PATH); //not a path, but it looks like it anyway
set_config('forcetimezone', $form->forcetimezone);
}
if(isset($form->startwday)) {
+31 -13
View File
@@ -3,6 +3,10 @@
require_once('../config.php');
$installing = optional_param('installing', 0, PARAM_BOOL);
$focus = '';
if ($site = get_site()) { // If false then this is a new installation
require_login();
if (!isadmin()) {
@@ -32,9 +36,22 @@
if (count($err) == 0) {
foreach ($config as $name => $value) {
if ($name == "sessioncookie") {
$value = eregi_replace("[^a-zA-Z]", "", $value);
$value = eregi_replace("[^a-zA-Z0-9_]", "", $value);
}
unset($conf);
if ($name == "defaultallowedmodules") {
$value = implode(',',$value);
}
if ($name == 'hiddenuserfields') {
if (in_array('none', $value)) {
$value = '';
} else {
$value = implode(',',$value);
}
}
if ($name == "locale") {
$value = trim($value);
}
$conf = new object();
$conf->name = $name;
$conf->value = $value;
if ($current = get_record('config', 'name', $name)) {
@@ -48,8 +65,16 @@
}
}
}
redirect('index.php', get_string('changessaved'), 1);
exit;
if ($installing) {
print_header();
notify(get_string('changessaved'), 'notifysuccess');
print_continue('index.php');
exit;
} else {
// the following redirect was randomly breaking upgrades because it did double redirects,
// we must not use it during install/upgrade
redirect('index.php', get_string('changessaved'), 1);
}
} else {
foreach ($err as $key => $value) {
@@ -62,12 +87,6 @@
if (empty($config)) {
$config = $CFG;
if (!$config->locale = get_field('config', 'value', 'name', 'locale')) {
$config->locale = $CFG->lang;
}
}
if (empty($focus)) {
$focus = '';
}
$sesskey = !empty($USER->id) ? $USER->sesskey : '';
@@ -92,7 +111,7 @@
/// Get all the configuration fields and helptext
include('configvars.php');
require('configvars.php');
/// Cycle through the sections to get the sectionnames
$linktext = '';
@@ -105,7 +124,6 @@
echo "<center>$linktext</center>\n";
print_simple_box_start('center');
echo '<form method="post" action="config.php" name="form">';
echo '<center><input type="submit" value="'.get_string('savechanges').'" /></center>';
@@ -135,13 +153,13 @@
}
echo '<center>';
echo '<input type="hidden" name="installing" value="'.$installing.'" />';
echo '<input type="hidden" name="sesskey" value="'.$sesskey.'" />';
echo '<input type="submit" value="'.get_string('savechanges').'" />';
echo '</center>';
echo '</form>';
print_simple_box_end();
+175 -5
View File
@@ -1,5 +1,6 @@
<?php // $Id$
// Shane Elliott
defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.');
/// Add new sitewide configuration variables to this file.
@@ -68,7 +69,7 @@ class configvar {
/// debug
unset($options);
$options[7] = $strno;
$options[5] = $strno;
$options[15] = $stryes;
$misc['debug'] = new configvar (get_string('configdebug', 'admin'),
@@ -88,8 +89,19 @@ class configvarrss extends configvar {
choose_from_menu ($noyesoptions, 'enablerssfeeds', $config->enablerssfeeds, '', '', '', true),
'<font color="red"> You need to add XML support to your PHP installation.</font>' );
$misc['mymoodleredirect'] = new configvar (get_string('configmymoodleredirect','admin'),
choose_from_menu($noyesoptions,'mymoodleredirect',$config->mymoodleredirect,'','','',true));
unset($options);
$options[5] = get_string('worldblogs','blog');
$options[4] = get_string('siteblogs','blog');
$options[3] = get_string('courseblogs','blog');
$options[2] = get_string('groupblogs','blog');
$options[1] = get_string('personalblogs','blog');
$options[0] = get_string('disableblogs','blog');
$misc['bloglevel'] = new configvar (get_string('configbloglevel', 'admin'),
choose_from_menu ($options, 'bloglevel', $config->bloglevel,'','','',true));
////////////////////////////////////////////////////////////////////
/// OPERATING SYSTEM config variables
@@ -129,6 +141,8 @@ class configvarrss extends configvar {
/// sessioncookie
$operatingsystem['sessioncookie'] = new configvar (get_string('configsessioncookie', 'admin'),
'<input name="sessioncookie" type="text" size="10" value="'.s($config->sessioncookie).'" alt="sessioncookie" />' );
$operatingsystem['sessioncookiepath'] = new configvar (get_string('configsessioncookiepath', 'admin'),
'<input name="sessioncookiepath" type="text" size="10" value="'.s($config->sessioncookiepath).'" alt="sessioncookiepath" />' );
/// zip
$operatingsystem['zip'] = new configvar (get_string('configzip', 'admin'),
@@ -143,8 +157,8 @@ class configvarrss extends configvar {
/// slasharguments
unset($options);
$options[0] = "file.php?file=/pic.jpg";
$options[1] = "file.php/pic.jpg";
$options[0] = "file.php?file=/1/pic.jpg";
$options[1] = "file.php/1/pic.jpg";
$operatingsystem['slasharguments'] = new configvar (get_string('configslasharguments', 'admin'),
choose_from_menu ($options, 'slasharguments', $config->slasharguments, '', '', '', true) );
@@ -212,6 +226,71 @@ class configvarrss extends configvar {
choose_from_menu ($noyesoptions, 'allowobjectembed', $config->allowobjectembed, '', '', '', true) );
unset($options);
$options['none'] = 'No courses';
$options['all'] = 'All courses';
$options['requested'] = 'Requested courses';
$permissions['restrictmodulesfor'] = new configvar (get_string('configrestrictmodulesfor','admin'),
' <script language="JavaScript">
function togglemodules(index) {
if (index == 0) {
document.getElementById(\'allowedmodules\').disabled=true;
}
else {
document.getElementById(\'allowedmodules\').disabled=false;
}
}
</script>'.
choose_from_menu($options,'restrictmodulesfor',$config->restrictmodulesfor,'','togglemodules(this.selectedIndex);','',true) );
$permissions['restrictbydefault'] = new configvar (get_string('configrestrictbydefault','admin'),
choose_from_menu($noyesoptions, 'restrictbydefault',$config->restrictbydefault,'','','',true) );
$allowstr = '<select name="defaultallowedmodules[]" id="allowedmodules" multiple="multiple" size="10"'.((empty($config->restrictmodulesfor)) ? "disabled=\"disabled\"" : "").'>';
$allowedmodules = array();
if (!empty($config->defaultallowedmodules)) {
$allowedmodules = explode(',',$config->defaultallowedmodules);
}
// On a fresh install of Moodle, this could be empty; prevent a warning on the following loop.
if (!$mods = get_records("modules")) {
$mods = array();
}
$s = "selected=\"selected\"";
$allowstr .= '<option value="0" '.((empty($allowedmodules)) ? $s : '').'>'.get_string('allownone').'</option>'."\n";
foreach ($mods as $mod) {
$selected = "";
if (in_array($mod->id,$allowedmodules))
$selected = $s;
$allowstr .= '<option '.$selected.' value="'.$mod->id.'">'.$mod->name.'</option>'."\n";
}
$allowstr .= '</select>';
$permissions['defaultallowedmodules'] = new configvar (get_string('configdefaultallowedmodules','admin'),$allowstr);
/// course requests
$reqcourse['enablecourserequests'] = new configvar (get_string('configenablecourserequests', 'admin'),
choose_from_menu ($noyesoptions,'enablecourserequests',$config->enablecourserequests,'','','',true) );
/// default category for course requests
require_once($CFG->dirroot.'/course/lib.php');
$reqcourse['defaultrequestedcategory'] = new configvar (get_string('configdefaultrequestedcategory', 'admin'),
choose_from_menu (make_categories_options(), 'defaultrequestedcategory',$config->defaultrequestedcategory,'','','',true) );
$reqcourse['requestedteachername'] = new configvar (get_string('configrequestedteachername','admin'),
'<input type="text" name="requestedteachername" size="20" maxlength="100" value="'.s($config->requestedteachername).'" />');
$reqcourse['requestedteachersname'] = new configvar (get_string('configrequestedteachersname','admin'),
'<input type="text" name="requestedteachersname" size="20" maxlength="100" value="'.s($config->requestedteachersname).'" />');
$reqcourse['requestedstudentname'] = new configvar (get_string('configrequestedstudentname','admin'),
'<input type="text" name="requestedstudentname" size="20" maxlength="100" value="'.s($config->requestedstudentname).'" />');
$reqcourse['requestedstudentsname'] = new configvar (get_string('configrequestedstudentsname','admin'),
'<input type="text" name="requestedstudentsname" size="20" maxlength="100" value="'.s($config->requestedstudentsname).'" />');
////////////////////////////////////////////////////////////////////
/// INTERFACE config variables
@@ -233,12 +312,20 @@ class configvarrss extends configvar {
/// language menu
$interface['langcache'] = new configvar ( get_string('configlangcache', 'admin'),
choose_from_menu($noyesoptions, 'langcache', $config->langcache, '', '', '', true) );
/// locale
$interface['locale'] = new configvar ( get_string('configlocale', 'admin'),
'<input name="locale" type="text" size="10" value="'.s($config->locale).'" alt="locale" />' );
'<input name="locale" type="text" size="15" value="'.s($config->locale).'" alt="locale" />' );
/// docroot
$interface['docroot'] = new configvar ( get_string('configdocroot', 'admin'),
'<input name="docroot" type="text" size="60" value="'.s($config->docroot).'" alt="docroot" />' );
/// doctonewwindow
$interface['doctonewwindow'] = new configvar ( get_string('configdoctonewwindow', 'admin'),
choose_from_menu($noyesoptions, 'doctonewwindow', $config->doctonewwindow, '', '', '', true) );
/// timezone
$interface['timezone'] = new configvar ( get_string('configtimezone', 'admin'),
choose_from_menu (get_list_of_timezones(), 'timezone', $config->timezone, get_string('serverlocaltime'), '', '99', true ) );
@@ -309,6 +396,23 @@ class configvarrss extends configvar {
$user['autologinguests'] = new configvar (get_string('configautologinguests', 'admin'),
choose_from_menu ($noyesoptions, 'autologinguests', $config->autologinguests, '', '', '', true) );
/// hiddenuserfields
$fields = array('none', 'description', 'city', 'country', 'webpage', 'icqnumber', 'skypeid', 'yahooid', 'aimid', 'msnid', 'lastaccess');
if (empty($config->hiddenuserfields)) {
$config->hiddenuserfields = 'none';
}
$configfields = array_flip(explode(',', $config->hiddenuserfields));
$fieldoptions = '';
foreach ($fields as $value) {
$fieldoptions .= '<option value="'.$value.'"';
if (isset($configfields[$value])) {
$fieldoptions .= ' selected="selected"';
}
$fieldoptions .= '>'.get_string($value).'</option>';
}
$user['hiddenuserfields'] = new configvar (get_string('confighiddenuserfields', 'admin'),
'<select id="menuhiddenuserfields" name="hiddenuserfields[]" size="10" multiple="multiple">'.$fieldoptions.'</select>' );
@@ -346,6 +450,9 @@ class configvarrss extends configvar {
$security['notifyloginthreshold'] = new configvar (get_string('confignotifyloginthreshold', 'admin'),
choose_from_menu($options, 'notifyloginthreshold', $config->notifyloginthreshold, '', '', '', true) );
$security['protectusernames'] = new configvar (get_string('configprotectusernames', 'admin'),
choose_from_menu($noyesoptions, 'protectusernames', $config->protectusernames, '', '', '', true) );
/// secureforms
$security['secureforms'] = new configvar (get_string('configsecureforms', 'admin'),
choose_from_menu ($noyesoptions, 'secureforms', $config->secureforms, '', '', '', true) );
@@ -471,10 +578,69 @@ class configvarrss extends configvar {
$mail['denyemailaddresses'] = new configvar (get_string('configdenyemailaddresses', 'admin'),
'<input name="denyemailaddresses" type="text" size="60" value="'.s($config->denyemailaddresses).'" alt="denyemailaddresses" />' );
if (!empty($CFG->unicodedb)) { ///These options are only available if running under unicodedb
/// sitemailcharset
unset($options);
unset($charsets);
$charsets = get_list_of_charsets();
$options['0'] = get_string('none');
$options = array_merge($options, $charsets);
$mail['sitemailcharset'] = new configvar (get_string('configsitemailcharset', 'admin'),
choose_from_menu($options, 'sitemailcharset', $config->sitemailcharset, '', '', '', true));
/// allowusermailcharset
$mail['allowusermailcharset'] = new configvar (get_string('configallowusermailcharset', 'admin'),
choose_from_menu($noyesoptions, 'allowusermailcharset', $config->allowusermailcharset, '', '', '', true));
}
/// enable stats
if (empty($CFG->disablestatsprocessing)) {
$stats['enablestats'] = new configvar (get_string('configenablestats','admin'),
choose_from_menu($noyesoptions, 'enablestats', $config->enablestats, '', '', '', true) );
unset($options);
$options['none'] = get_string('none');
$options[60*60*24*7] = get_string('numweeks','moodle',1);
$options[60*60*24*14] = get_string('numweeks','moodle',2);
$options[60*60*24*21] = get_string('numweeks','moodle',3);
$options[60*60*24*28] = get_string('nummonths','moodle',1);
$options[60*60*24*56] = get_string('nummonths','moodle',2);
$options[60*60*24*84] = get_string('nummonths','moodle',3);
$options[60*60*24*112] = get_string('nummonths','moodle',4);
$options[60*60*24*140] = get_string('nummonths','moodle',5);
$options[60*60*24*168] = get_string('nummonths','moodle',6);
$options['all'] = get_string('all');
$stats['statsfirstrun'] = new configvar (get_string('configstatsfirstrun','admin'),
choose_from_menu($options,'statsfirstrun',$config->statsfirstrun,'','','',true) );
unset($options);
$options[0] = get_string('untilcomplete');
$options[60*60] = '1 '.get_string('hour');
$options[60*60*2] = '2 '.get_string('hours');
$options[60*60*3] = '3 '.get_string('hours');
$options[60*60*4] = '4 '.get_string('hours');
$options[60*60*5] = '5 '.get_string('hours');
$options[60*60*6] = '6 '.get_string('hours');
$options[60*60*7] = '7 '.get_string('hours');
$options[60*60*8] = '8 '.get_string('hours');
if (empty($config->statsruntimestarthour)) {
$config->statsruntimestarthour = 0;
}
if (empty($config->statsruntimestartminute)) {
$config->statsruntimestartminute = 0;
}
$stats['statsmaxruntime'] = new configvar (get_string('configstatsmaxruntime','admin'),
choose_from_menu($options,'statsmaxruntime',$config->statsmaxruntime,'','','',true) );
$stats['statsruntimestart'] = new configvar (get_string('configstatsruntimestart','admin'),
print_time_selector("statsruntimestarthour","statsruntimestartminute",make_timestamp(2000,1,1,$config->statsruntimestarthour,$config->statsruntimestartminute),5,true) );
$stats['statsuserthreshold'] = new configvar (get_string('configstatsuserthreshold','admin'),
'<input type="text" name="statsuserthreshold" size="4" value="'.$config->statsuserthreshold.'" />');
}
////////////////////////////////////////////////////////////////////
@@ -485,6 +651,10 @@ class configvarrss extends configvar {
$configvars['mail'] = $mail;
$configvars['user'] = $user;
$configvars['permissions'] = $permissions;
$configvars['requestedcourse'] = $reqcourse;
$configvars['misc'] = $misc;
if (empty($CFG->disablestatsprocessing)) {
$configvars['stats'] = $stats;
}
?>
+42
View File
@@ -0,0 +1,42 @@
<?php // $Id$
require_once('../config.php');
require_login();
if (!isadmin()) {
error("Only admins can access this page");
}
if (!$site = get_site()) {
redirect("index.php");
}
$stradministration = get_string("administration");
$strcourses = get_string("courses");
print_header("$site->shortname: $stradministration: $strcourses", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> $strcourses");
print_heading($strcourses);
$table->align = array ("right", "left");
$table->data[] = array('<b><a href="../course/index.php?edit=on&amp;sesskey='.$USER->sesskey.'">'.get_string("managecourses")."</a></b>",
get_string("adminhelpcourses"));
$table->data[] = array("<b><a href=\"enrol.php?sesskey=$USER->sesskey\">".get_string("enrolmentplugins")."</a></b>",
get_string("adminhelpenrolments"));
$table->data[] = array("<b><a href=\"../course/index.php?edit=off&amp;sesskey=$USER->sesskey\">".get_string("assignstudents")."</a></b>",
get_string("adminhelpassignstudents"));
$table->data[] = array("<b><a href=\"../course/index.php?edit=on&amp;sesskey=$USER->sesskey\">".get_string("assignteachers")."</a></b>",
get_string("adminhelpassignteachers")." <img src=\"../pix/t/user.gif\" height=\"11\" width=\"11\" alt=\"\" />");
$table->data[] = array("<b><a href=\"creators.php?sesskey=$USER->sesskey\">".get_string("assigncreators")."</a></b>",
get_string("adminhelpassigncreators"));
$table->data[] = array("<b><a href=\"admin.php?sesskey=$USER->sesskey\">".get_string("assignadmins")."</a></b>",
get_string("adminhelpassignadmins"));
print_table($table);
print_footer($site);
?>
+1 -4
View File
@@ -64,10 +64,7 @@
?>
</select>
<br />
<script type="text/javascript">
function
</script>
<input type="text" name="searchtext" size="30" value="<?php echo $searchtext ?>"
<input type="text" name="searchtext" size="30" value="<?php p($searchtext) ?>"
onFocus ="document.creatorsform.add.disabled=true;
document.creatorsform.remove.disabled=true;
document.creatorsform.removeselect.selectedIndex=-1;
+3 -6
View File
@@ -1,14 +1,10 @@
<?PHP // $Id$
// Admin only script to assign course creator rights to users
require_once("../config.php");
require_once('../config.php');
define("MAX_USERS_PER_PAGE", 50);
optional_variable($search, "");
optional_variable($add, "");
optional_variable($remove, "");
if (! $site = get_site()) {
redirect("$CFG->wwwroot/$CFG->admin/index.php");
}
@@ -50,6 +46,7 @@
if (!$frm = data_submitted()) {
print_simple_box("<center>".get_string("adminhelpassigncreators")."</center>", "center", "50%");
$frm = new object();
/// A form was submitted so process the input
@@ -73,7 +70,7 @@
}
/// Is there a current search?
$previoussearch = (!empty($frm->search) or ($frm->previoussearch == 1)) ;
$previoussearch = (!empty($frm->search) or (isset($frm->previoussearch) && $frm->previoussearch == 1)) ;
/// Get all existing creators
+151 -11
View File
@@ -26,7 +26,8 @@
chdir(dirname($_SERVER['argv'][0]));
}
require_once("../config.php");
require_once(dirname(__FILE__) . '/../config.php');
require_once($CFG->dirroot.'/lib/adminlib.php');
if (!$alreadyadmin = isadmin()) {
unset($_SESSION['USER']);
@@ -34,16 +35,30 @@
unset($_SESSION['SESSION']);
unset($SESSION);
$USER = get_admin(); /// Temporarily, to provide environment for this script
// we need to override the admin timezone to the moodle timezone!
$USER->timezone = $CFG->timezone;
}
//unset test cookie, user must login again anyway
setcookie('MoodleSessionTest'.$CFG->sessioncookie, '', time() - 3600, '/');
/// switch to site language and locale
if (!empty($CFG->courselang)) {
unset ($CFG->courselang);
}
if (!empty($SESSION->lang)) {
unset ($SESSION->lang);
}
$USER->lang = '';
moodle_setlocale();
/// send mime type and encoding
@header('Content-Type: text/plain; charset='.current_charset());
/// Start output log
$timenow = time();
mtrace("<pre>");
mtrace("Server Time: ".date('r',$timenow)."\n\n");
/// Run all cron jobs for each module
@@ -69,6 +84,31 @@
}
mtrace("Finished activity modules");
mtrace("Starting blocks");
if ($blocks = get_records_select("block", "cron > 0 AND (($timenow - lastcron) > cron)")) {
// we will need the base class.
require_once($CFG->dirroot.'/blocks/moodleblock.class.php');
foreach ($blocks as $block) {
$blockfile = $CFG->dirroot.'/blocks/'.$block->name.'/block_'.$block->name.'.php';
if (file_exists($blockfile)) {
require_once($blockfile);
$classname = 'block_'.$block->name;
$blockobj = new $classname;
if (method_exists($blockobj,'cron')) {
mtrace("Processing cron function for ".$block->name.'....','');
if ($blockobj->cron()) {
if (!set_field('block','lastcron',$timenow,'id',$block->id)) {
mtrace('Error: could not update timestamp for '.$block->name);
}
}
mtrace('done.');
}
}
}
}
mtrace("Finished blocks");
if (!empty($CFG->langcache)) {
mtrace('Updating languages cache');
get_list_of_languages();
@@ -104,12 +144,28 @@
$oneweek = $timenow - ($CFG->deleteunconfirmed * 3600);
if ($users = get_users_unconfirmed($oneweek)) {
foreach ($users as $user) {
if (delete_records("user", "id", $user->id)) {
if (delete_records('user', 'id', $user->id)) {
mtrace("Deleted unconfirmed user for ".fullname($user, true)." ($user->id)");
}
}
}
flush();
/// Delete users who haven't completed profile within required period
$oneweek = $timenow - ($CFG->deleteunconfirmed * 3600);
if ($users = get_users_not_fully_set_up($oneweek)) {
foreach ($users as $user) {
if (delete_records('user', 'id', $user->id)) {
mtrace("Deleted not fully setup user $user->username ($user->id)");
}
}
}
flush();
/// Delete old logs to save space (this might need a timer to slow it down...)
@@ -122,8 +178,8 @@
/// Delete old cached texts
if (!empty($CFG->cachetext)) { // Defined in config.php
$cachelifetime = time() - $CFG->cachetext;
delete_records_select("cache_text", "timemodified < '$cachelifetime'");
$cachelifetime = time() - $CFG->cachetext - 60; // Add an extra minute to allow for really heavy sites
delete_records_select('cache_text', "timemodified < '$cachelifetime'");
}
flush();
@@ -134,6 +190,31 @@
sync_metacourses();
//
// generate new password emails for users
//
mtrace('checking for create_password');
if (count_records('user_preferences', 'name', 'create_password', 'value', '1')) {
mtrace('creating passwords for new users');
$newusers = get_records_sql("SELECT u.id as id, u.email, u.firstname,
u.lastname, u.username,
p.id as prefid
FROM {$CFG->prefix}user u
JOIN {$CFG->prefix}user_preferences p ON u.id=p.userid
WHERE p.name='create_password' AND p.value=1 AND u.email !='' ");
foreach ($newusers as $newuserid => $newuser) {
$newuser->emailstop = 0; // send email regardless
// email user
if (setnew_password_and_mail($newuser)) {
// remove user pref
delete_records('user_preferences', 'id', $newuser->prefid);
} else {
trigger_error("Could not create and mail new user password!");
}
}
}
} // End of occasional clean-up tasks
@@ -142,6 +223,12 @@
//Perhaps a long time and memory could help in large sites
@set_time_limit(0);
@raise_memory_limit("128M");
if (function_exists('apache_child_terminate')) {
// if we are running from Apache, give httpd a hint that
// it can recycle the process after it's done. Apache's
// memory management is truly awful but we can help it.
@apache_child_terminate();
}
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") and
@@ -153,7 +240,7 @@
mtrace("Running backups if required...");
if (! schedule_backup_cron()) {
mtrace("ERORR: Something went wrong while performing backup tasks!!!");
mtrace("ERROR: Something went wrong while performing backup tasks!!!");
} else {
mtrace("Backup tasks finished.");
}
@@ -172,11 +259,64 @@
}
/// Run the enrolment cron, if any
require_once("$CFG->dirroot/enrol/$CFG->enrol/enrol.php");
$enrol = new enrolment_plugin();
$enrol->cron();
if (!empty($enrol->log)) {
mtrace($enrol->log);
if (!($plugins = explode(',', $CFG->enrol_plugins_enabled))) {
$plugins = array($CFG->enrol);
}
require_once($CFG->dirroot .'/enrol/enrol.class.php');
foreach ($plugins as $p) {
$enrol = enrolment_factory::factory($p);
if (method_exists($enrol, 'cron')) {
$enrol->cron();
}
if (!empty($enrol->log)) {
mtrace($enrol->log);
}
unset($enrol);
}
if (!empty($CFG->enablestats) and empty($CFG->disablestatsprocessing)) {
// check we're not before our runtime
$timetocheck = strtotime("$CFG->statsruntimestarthour:$CFG->statsruntimestartminute today");
if (time() > $timetocheck) {
$time = 60*60*20; // set it to 20 here for first run... (overridden by $CFG)
$clobber = true;
if (!empty($CFG->statsmaxruntime)) {
$time = $CFG->statsmaxruntime+(60*30); // add on half an hour just to make sure (it could take that long to break out of the loop)
}
if (!get_field_sql('SELECT id FROM '.$CFG->prefix.'stats_daily LIMIT 1')) {
// first run, set another lock. we'll check for this in subsequent runs to set the timeout to later for the normal lock.
set_cron_lock('statsfirstrunlock',true,$time,true);
$firsttime = true;
}
$time = 60*60*2; // this time set to 2.. (overridden by $CFG)
if (!empty($CFG->statsmaxruntime)) {
$time = $CFG->statsmaxruntime+(60*30); // add on half an hour to make sure (it could take that long to break out of the loop)
}
if ($config = get_record('config','name','statsfirstrunlock')) {
if (!empty($config->value)) {
$clobber = false; // if we're on the first run, just don't clobber it.
}
}
if (set_cron_lock('statsrunning',true,$time, $clobber)) {
require_once($CFG->dirroot.'/lib/statslib.php');
$return = stats_cron_daily();
if (stats_check_runtime() && $return == STATS_RUN_COMPLETE) {
stats_cron_weekly();
}
if (stats_check_runtime() && $return == STATS_RUN_COMPLETE) {
$return = $return && stats_cron_monthly();
}
if (stats_check_runtime() && $return == STATS_RUN_COMPLETE) {
stats_clean_old();
}
set_cron_lock('statsrunning',false);
if (!empty($firsttime)) {
set_cron_lock('statsfirstrunlock',false);
}
}
}
}
//Unset session variables and destroy it
+7 -3
View File
@@ -1,7 +1,11 @@
<?PHP // $Id$
// dbperformance.php - shows latest ADOdb stats for the current server
require_once("../config.php");
require_once('../config.php');
$topframe = optional_param('topframe', 0, PARAM_BOOL);
$bottomframe = optional_param('bottomframe', 0, PARAM_BOOL);
$do = optional_param('do', '', PARAM_ALPHA);
require_login();
@@ -13,13 +17,13 @@
$stradministration = get_string("administration");
$site = get_site();
if (isset($topframe)) {
if (!empty($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'])) {
if (!empty($bottomframe) or !empty($do)) {
$perf =&NewPerfMonitor($db);
$perf->UI($pollsecs=5);
exit;
+2 -2
View File
@@ -7,8 +7,8 @@
require_login();
$sure = optional_param('sure', '');
$reallysure = optional_param('reallysure', '');
$sure = optional_param('sure', 0, PARAM_BOOL);
$reallysure = optional_param('reallysure', 0, PARAM_BOOL);
if (!isadmin()) {
error('You must be admin to use this script!');
+103 -37
View File
@@ -1,5 +1,6 @@
<form method="post" action="editor.php">
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
<input type="hidden" name="tab" value="<?php p($currentpage) ?>" />
<table border="0" cellpadding="4" cellspacing="2">
<tr>
<td align="right" valign="top">htmleditor:</td>
@@ -15,6 +16,7 @@
<?php print_string('confightmleditor', 'admin') ?>
</td>
</tr>
<?php if ( $currenttab == 'htmlarea' ) { ?>
<tr>
<td align="right" valign="top">editorbackgroundcolor:</td>
<td valign="top"><input type="text" name="backgroundcolor" size="10" value="<?php print($CFG->editorbackgroundcolor);?>" /></td>
@@ -112,18 +114,18 @@
<input type="checkbox" name="buttons[formatblock]"<?php print(in_array("formatblock", $buttons)) ? " checked=\"checked\"": "";?> /> <?php print_string("formatblock","editor");?></td>
</tr>
<tr>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_format_bold.gif" width="18" height="18" alt="<?php print_string("bold","editor");?>" title="<?php print_string("bold","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_format_italic.gif" width="18" height="18" alt="<?php print_string("italic","editor");?>" title="<?php print_string("italic","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_format_underline.gif" width="18" height="18" alt="<?php print_string("underline","editor");?>" title="<?php print_string("underline","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_format_strike.gif" width="18" height="18" alt="<?php print_string("strikethrough","editor");?>" title="<?php print_string("strikethrough","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_format_sub.gif" width="18" height="18" alt="<?php print_string("subscript","editor");?>" title="<?php print_string("subscript","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_format_sup.gif" width="18" height="18" alt="<?php print_string("superscript","editor");?>" title="<?php print_string("superscript","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_copy.gif" width="18" height="18" alt="<?php print_string("copy","editor");?>" title="<?php print_string("copy","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_cut.gif" width="18" height="18" alt="<?php print_string("cut","editor");?>" title="<?php print_string("cut","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_paste.gif" width="18" height="18" alt="<?php print_string("paste","editor");?>" title="<?php print_string("paste","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_wordclean.gif" width="18" height="18" alt="<?php print_string("wordclean","editor");?>" title="<?php print_string("wordclean","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_undo.gif" width="18" height="18" alt="<?php print_string("undo","editor");?>" title="<?php print_string("undo","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_redo.gif" width="18" height="18" alt="<?php print_string("redo","editor");?>" title="<?php print_string("redo","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_format_bold.gif" width="18" height="18" alt="<?php print_string("bold","editor");?>" title="<?php print_string("bold","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_format_italic.gif" width="18" height="18" alt="<?php print_string("italic","editor");?>" title="<?php print_string("italic","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_format_underline.gif" width="18" height="18" alt="<?php print_string("underline","editor");?>" title="<?php print_string("underline","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_format_strike.gif" width="18" height="18" alt="<?php print_string("strikethrough","editor");?>" title="<?php print_string("strikethrough","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_format_sub.gif" width="18" height="18" alt="<?php print_string("subscript","editor");?>" title="<?php print_string("subscript","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_format_sup.gif" width="18" height="18" alt="<?php print_string("superscript","editor");?>" title="<?php print_string("superscript","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_copy.gif" width="18" height="18" alt="<?php print_string("copy","editor");?>" title="<?php print_string("copy","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_cut.gif" width="18" height="18" alt="<?php print_string("cut","editor");?>" title="<?php print_string("cut","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_paste.gif" width="18" height="18" alt="<?php print_string("paste","editor");?>" title="<?php print_string("paste","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_wordclean.gif" width="18" height="18" alt="<?php print_string("wordclean","editor");?>" title="<?php print_string("wordclean","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_undo.gif" width="18" height="18" alt="<?php print_string("undo","editor");?>" title="<?php print_string("undo","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_redo.gif" width="18" height="18" alt="<?php print_string("redo","editor");?>" title="<?php print_string("redo","editor");?>" /></td>
</tr>
<tr>
<td><input type="checkbox" name="buttons[bold]"<?php print(in_array("bold", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
@@ -140,18 +142,18 @@
<td><input type="checkbox" name="buttons[redo]"<?php print(in_array("redo", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
</tr>
<tr>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_align_left.gif" width="18" height="18" alt="<?php print_string("justifyleft","editor");?>" title="<?php print_string("justifyleft","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_align_center.gif" width="18" height="18" alt="<?php print_string("justifycenter","editor");?>" title="<?php print_string("justifycenter","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_align_right.gif" width="18" height="18" alt="<?php print_string("justifyright","editor");?>" title="<?php print_string("justifyright","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_align_justify.gif" width="18" height="18" alt="<?php print_string("justifyfull","editor");?>" title="<?php print_string("justifyfull","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_left_to_right.gif" width="18" height="18" alt="<?php print_string("lefttoright","editor");?>" title="<?php print_string("lefttoright","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_right_to_left.gif" width="18" height="18" alt="<?php print_string("righttoleft","editor");?>" title="<?php print_string("righttoleft","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_list_num.gif" width="18" height="18" alt="<?php print_string("orderedlist","editor");?>" title="<?php print_string("orderedlist","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_list_bullet.gif" width="18" height="18" alt="<?php print_string("unorderedlist","editor");?>" title="<?php print_string("unorderedlist","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_indent_less.gif" width="18" height="18" alt="<?php print_string("outdent","editor");?>" title="<?php print_string("outdent","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_indent_more.gif" width="18" height="18" alt="<?php print_string("indent","editor");?>" title="<?php print_string("indent","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_color_fg.gif" width="18" height="18" alt="<?php print_string("forecolor","editor");?>" title="<?php print_string("forecolor","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_color_bg.gif" width="18" height="18" alt="<?php print_string("hilitecolor","editor");?>" title="<?php print_string("hilitecolor","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_align_left.gif" width="18" height="18" alt="<?php print_string("justifyleft","editor");?>" title="<?php print_string("justifyleft","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_align_center.gif" width="18" height="18" alt="<?php print_string("justifycenter","editor");?>" title="<?php print_string("justifycenter","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_align_right.gif" width="18" height="18" alt="<?php print_string("justifyright","editor");?>" title="<?php print_string("justifyright","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_align_justify.gif" width="18" height="18" alt="<?php print_string("justifyfull","editor");?>" title="<?php print_string("justifyfull","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_left_to_right.gif" width="18" height="18" alt="<?php print_string("lefttoright","editor");?>" title="<?php print_string("lefttoright","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_right_to_left.gif" width="18" height="18" alt="<?php print_string("righttoleft","editor");?>" title="<?php print_string("righttoleft","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_list_num.gif" width="18" height="18" alt="<?php print_string("orderedlist","editor");?>" title="<?php print_string("orderedlist","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_list_bullet.gif" width="18" height="18" alt="<?php print_string("unorderedlist","editor");?>" title="<?php print_string("unorderedlist","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_indent_less.gif" width="18" height="18" alt="<?php print_string("outdent","editor");?>" title="<?php print_string("outdent","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_indent_more.gif" width="18" height="18" alt="<?php print_string("indent","editor");?>" title="<?php print_string("indent","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_color_fg.gif" width="18" height="18" alt="<?php print_string("forecolor","editor");?>" title="<?php print_string("forecolor","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_color_bg.gif" width="18" height="18" alt="<?php print_string("hilitecolor","editor");?>" title="<?php print_string("hilitecolor","editor");?>" /></td>
</tr>
<tr>
<td><input type="checkbox" name="buttons[justifyleft]"<?php print(in_array("justifyleft", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
@@ -168,18 +170,18 @@
<td><input type="checkbox" name="buttons[hilitecolor]"<?php print(in_array("hilitecolor", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
</tr>
<tr>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_hr.gif" width="18" height="18" alt="<?php print_string("horizontalrule","editor");?>" title="<?php print_string("horizontalrule","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_anchor.gif" width="18" height="18" alt="<?php print_string("createanchor","editor");?>" title="<?php print_string("createanchor","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_link.gif" width="18" height="18" alt="<?php print_string("insertlink","editor");?>" title="<?php print_string("insertlink","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_unlink.gif" width="18" height="18" alt="<?php print_string("removelink","editor");?>" title="<?php print_string("removelink","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_image.gif" width="18" height="18" alt="<?php print_string("insertimage","editor");?>" title="<?php print_string("insertimage","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/insert_table.gif" width="18" height="18" alt="<?php print_string("inserttable","editor");?>" title="<?php print_string("inserttable","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/em.icon.smile.gif" width="18" height="18" alt="<?php print_string("insertsmile","editor");?>" title="<?php print_string("insertsmile","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/icon_ins_char.gif" width="18" height="18" alt="<?php print_string("insertchar","editor");?>" title="<?php print_string("insertchar","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/spell-check.gif" width="18" height="18" alt="<?php print_string("spellcheck","editor");?>" title="<?php print_string("spellcheck","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_html.gif" width="18" height="18" alt="<?php print_string("htmlmode","editor");?>" title="<?php print_string("htmlmode","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/fullscreen_maximize.gif" width="18" height="18" alt="<?php print_string("popupeditor","editor");?>" title="<?php print_string("popupeditor","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_replace.gif" width="18" height="18" alt="<?php print_string("popupeditor","editor");?>" title="<?php print_string("searchandreplace","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_hr.gif" width="18" height="18" alt="<?php print_string("horizontalrule","editor");?>" title="<?php print_string("horizontalrule","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_anchor.gif" width="18" height="18" alt="<?php print_string("createanchor","editor");?>" title="<?php print_string("createanchor","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_link.gif" width="18" height="18" alt="<?php print_string("insertlink","editor");?>" title="<?php print_string("insertlink","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_unlink.gif" width="18" height="18" alt="<?php print_string("removelink","editor");?>" title="<?php print_string("removelink","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_image.gif" width="18" height="18" alt="<?php print_string("insertimage","editor");?>" title="<?php print_string("insertimage","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/insert_table.gif" width="18" height="18" alt="<?php print_string("inserttable","editor");?>" title="<?php print_string("inserttable","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/em.icon.smile.gif" width="18" height="18" alt="<?php print_string("insertsmile","editor");?>" title="<?php print_string("insertsmile","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/icon_ins_char.gif" width="18" height="18" alt="<?php print_string("insertchar","editor");?>" title="<?php print_string("insertchar","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/spell-check.gif" width="18" height="18" alt="<?php print_string("spellcheck","editor");?>" title="<?php print_string("spellcheck","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_html.gif" width="18" height="18" alt="<?php print_string("htmlmode","editor");?>" title="<?php print_string("htmlmode","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/fullscreen_maximize.gif" width="18" height="18" alt="<?php print_string("popupeditor","editor");?>" title="<?php print_string("popupeditor","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_replace.gif" width="18" height="18" alt="<?php print_string("popupeditor","editor");?>" title="<?php print_string("searchandreplace","editor");?>" /></td>
</tr>
<tr>
<td><input type="checkbox" name="buttons[inserthorizontalrule]"<?php print(in_array("inserthorizontalrule", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
@@ -196,7 +198,7 @@
<td><input type="checkbox" name="buttons[search_replace]"<?php print(in_array("search_replace", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
</tr>
<tr>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_nolink.gif" width="18" height="18" alt="<?php print_string("horizontalrule","editor");?>" title="<?php print_string("nolink","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/htmlarea/images/ed_nolink.gif" width="18" height="18" alt="<?php print_string("horizontalrule","editor");?>" title="<?php print_string("nolink","editor");?>" /></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
@@ -226,6 +228,69 @@
</table>
</td>
</tr>
<?php
}
else if ( $currenttab == 'tinymce' ) {
?>
<tr>
<td>tinymcetheme:</td>
<td><?php
$options = array('advanced' => 'Advanced','simple' => 'Simple');
choose_from_menu ($options, "tinymcetheme", $CFG->tinymcetheme, "", "", "");
?></td>
<td>&nbsp;</td>
</tr>
<tr>
<td valign="top">tinymceplugins:</td>
<td nowrap="nowrap"><?php
$pluginsdir = $CFG->libdir .'/editor/tinymce/jscripts/tiny_mce/plugins';
$plugins = editor_get_tiny_plugins();
$pluginsinuse = explode(",", $CFG->tinymceplugins);
sort($plugins);
$cnt = 0;
echo '<table border="0" cellpadding="2">';
foreach ( $plugins as $plugin ) {
$num = ($cnt % 2);
if ( $num < 1 ) {
echo '<tr>';
}
echo '<td><input type="checkbox" name="tinymceplugins[]" value="'. s($plugin) .'"';
if ( in_array($plugin, $pluginsinuse) ) {
echo ' checked="checked"';
}
echo ' /> '. $plugin .'</td>'."\n";
if ( $num > 0 ) {
echo '</tr>';
}
$cnt++;
}
echo '</table>';
?></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>tinymcecontentcss:</td>
<td><input type="text" name="tinymcecontentcss" value="<?php
!empty($CFG->tinymcecontentcss) ? p($CFG->tinymcecontentcss) : ''; ?>" size="40" /></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>tinymcepopupcss:</td>
<td><input type="text" name="tinymcepopupcss" value="<?php
!empty($CFG->tinymcepopupcss) ? p($CFG->tinymcepopupcss) : ''; ?>" size="40" /></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>tinymceeditorcss:</td>
<td><input type="text" name="tinymceeditorcss" value="<?php
!empty($CFG->tinymceeditorcss) ? p($CFG->tinymceeditorcss) : ''; ?>" size="40" /></td>
<td>&nbsp;</td>
</tr>
<?php
}
?>
<tr>
<td colspan="3" align="center"><input type="submit" value="<?php print_string("savechanges");?>" /></td>
</tr>
@@ -234,6 +299,7 @@
<form method="post" action="<?php print($GLOBALS['ME']);?>">
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
<input type="hidden" name="tab" value="<?php p($currentpage) ?>" />
<center>
<input type="submit" name="resettodefaults" value="<?php print_string('editorresettodefaults') ?>" />
</center>
+98 -6
View File
@@ -1,7 +1,10 @@
<?php // $Id$
/// configuration routines for HTMLArea editor
require_once("../config.php");
require_once('../config.php');
$currentpage = optional_param('tab', 1, PARAM_INT);
require_login();
if (!isadmin()) {
@@ -12,20 +15,38 @@
// do we want default values?
if (isset($data->resettodefaults)) {
if (!(reset_to_defaults())) {
if (!(reset_to_defaults($currentpage))) {
error("Editor settings could not be restored!");
}
} else {
if (!(editor_update_config($data))) {
if (!(editor_update_config($data, $currentpage))) {
error("Editor settings could not be updated!");
}
}
redirect("$CFG->wwwroot/$CFG->admin/editor.php", get_string("changessaved"), 1);
redirect("$CFG->wwwroot/$CFG->admin/editor.php?tab=$currentpage", get_string("changessaved"), 1);
} else {
// Generate edit form
$inactive = array();
switch ( $currentpage ) {
case 1:
$currenttab = 'htmlarea';
break;
case 2:
$currenttab = 'tinymce';
break;
default:
error("Unknown currentpage: $currentpage");
}
//$url = 'editor.php?tab=';
//$tabrow = array();
//$tabrow[] = new tabobject('htmlarea',$url . '1', 'HTMLArea');
//$tabrow[] = new tabobject('tinymce',$url . '2', 'TinyMCE');
//$tabs = array($tabrow);
$fontlist = editor_convert_to_array($CFG->editorfontlist);
$dicts = editor_get_dictionaries();
@@ -37,8 +58,11 @@
"<a href=\"index.php\">$stradmin</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> -> $streditorsettings");
print_heading($streditorsettings);
print_simple_box("<center>$streditorsettingshelp</center>","center","50%");
print("<br />\n");
//print_tabs($tabs, $currenttab, $inactive);
print_simple_box_start("center");
include("editor.html");
print_simple_box_end();
@@ -67,7 +91,7 @@ function editor_convert_to_array ($string) {
return $fonts;
}
function editor_update_config ($data) {
function editor_update_config ($data, $editor) {
/// Updates the editor config values.
@@ -75,6 +99,8 @@ function editor_update_config ($data) {
return false;
}
switch($editor) {
case 1: // HTMLArea.
// Make array for unwanted characters.
$nochars = array(chr(33),chr(34),chr(35),chr(36),chr(37),
chr(38),chr(39),chr(40),chr(41),chr(42),
@@ -115,6 +141,30 @@ function editor_update_config ($data) {
}
}
$updatedata['editorhidebuttons'] = trim($hidebuttons);
break;
case 2: // TinyMCE.
$updatedata = array();
$updatedata['htmleditor'] = !empty($data->htmleditor) ? $data->htmleditor : 0;
// Process plugins
if ( !empty($data->tinymceplugins) ) {
foreach ( $data->tinymceplugins as $key => $value ) {
$value = stripslashes(clean_param($value, PARAM_ALPHA));
$data->tinymceplugins[$key] = addslashes($value);
}
}
$updatedata['tinymceplugins'] = !empty($data->tinymceplugins) ? implode(",", $data->tinymceplugins) : '';
$updatedata['tinymcetheme'] = !empty($data->tinymcetheme) ?
clean_param($data->tinymcetheme, PARAM_ALPHA) : '';
$updatedata['tinymcecontentcss'] = !empty($data->tinymcecontentcss) ?
clean_param($data->tinymcecontentcss, PARAM_URL) : '';
$updatedata['tinymcepopupcss'] = !empty($data->tinymcepopupcss) ?
clean_param($data->tinymcepopupcss, PARAM_URL) : '';
$updatedata['tinymceeditorcss'] = !empty($data->tinymceeditorcss) ?
clean_param($data->tinymceeditorcss, PARAM_URL) : '';
break;
}
foreach ($updatedata as $name => $value) {
if (!(set_config($name, $value))) {
@@ -125,7 +175,7 @@ function editor_update_config ($data) {
return true;
}
function reset_to_defaults () {
function reset_to_defaults ($editor) {
/// Reset the values to default
global $CFG;
@@ -133,6 +183,8 @@ function reset_to_defaults () {
$updatedata = array();
switch ( $editor ) {
case 1: // HTMLArea.
$updatedata['editorbackgroundcolor'] = $defaults['editorbackgroundcolor'];
$updatedata['editorfontfamily'] = $defaults['editorfontfamily'];
$updatedata['editorfontsize'] = $defaults['editorfontsize'];
@@ -141,6 +193,16 @@ function reset_to_defaults () {
$updatedata['editorfontlist'] = $defaults['editorfontlist'];
$updatedata['editorhidebuttons'] = $defaults['editorhidebuttons'];
$updatedata['editordictionary'] = '';
break;
case 2: // TinyMCE.
$updatedata['tinymceplugins'] = $defaults['tinymceplugins'];
$updatedata['tinymcetheme'] = $defaults['tinymcetheme'];
$updatedata['tinymcecontentcss'] = $defaults['tinymcecontentcss'];
$updatedata['tinymcepopupcss'] = $defaults['tinymcepopupcss'];
$updatedata['tinymceeditorcss'] = $defaults['tinymceeditorcss'];
break;
}
foreach ($updatedata as $name => $value) {
if (!(set_config($name, $value))) {
@@ -211,4 +273,34 @@ function editor_get_dictionaries () {
}
function editor_get_tiny_plugins() {
global $CFG;
$plugins = array();
$plugindir = $CFG->libdir .'/editor/tinymce/jscripts/tiny_mce/plugins';
if ( !$fp = opendir($plugindir) ) {
return $plugins;
exit;
}
while ( ($file = readdir($fp)) !== false ) {
if ( preg_match("/^\.+/", $file) ) {
continue;
}
if ( is_dir($plugindir .'/'. $file) ) {
array_push($plugins, $file);
}
}
if ( $fp ) {
closedir($fp);
}
return $plugins;
}
?>
+64 -41
View File
@@ -2,10 +2,11 @@
// enrol.php - allows admin to edit all enrollment variables
// Yes, enrol is correct English spelling.
include("../config.php");
$enrol = optional_param('enrol', $CFG->enrol, PARAM_ALPHA);
require_once('../config.php');
$enrol = optional_param('enrol', $CFG->enrol, PARAM_SAFEDIR);
$CFG->pagepath = 'enrol';
require_login();
if (!$site = get_site()) {
@@ -20,69 +21,91 @@
error(get_string('confirmsesskeybad', 'error'));
}
require_once("$CFG->dirroot/enrol/$enrol/enrol.php"); /// Open the class
require_once("$CFG->dirroot/enrol/enrol.class.php"); /// Open the factory class
$enrolment = new enrolment_plugin();
/// If data submitted, then process and store.
/// Save settings
if ($frm = data_submitted()) {
if ($enrolment->process_config($frm)) {
set_config('enrol', $frm->enrol);
redirect("enrol.php?sesskey=$USER->sesskey", get_string("changessaved"), 1);
if (empty($frm->enable)) {
$frm->enable = array();
}
} else {
$frm = $CFG;
if (empty($frm->default)) {
$frm->default = '';
}
if ($frm->default && $frm->default != 'manual' && !in_array($frm->default, $frm->enable)) {
$frm->enable[] = $frm->default;
}
asort($frm->enable);
$frm->enable = array_merge(array('manual'), $frm->enable); // make sure manual plugin is called first
set_config('enrol_plugins_enabled', implode(',', $frm->enable));
set_config('enrol', $frm->default);
redirect("enrol.php?sesskey=$USER->sesskey", get_string("changessaved"), 1);
}
/// Otherwise fill and print the form.
/// Print the form
/// get language strings
$str = get_strings(array('enrolments', 'users', 'administration', 'settings'));
$str = get_strings(array('enrolmentplugins', 'users', 'administration', 'settings', 'edit'));
print_header("$site->shortname: $str->enrolmentplugins", "$site->fullname",
"<a href=\"index.php\">$str->administration</a> ->
<a href=\"users.php\">$str->users</a> -> $str->enrolmentplugins");
$modules = get_list_of_plugins("enrol");
$options = array();
foreach ($modules as $module) {
$options[$module] = get_string("enrolname", "enrol_$module");
}
asort($options);
print_header("$site->shortname: $str->enrolments", "$site->fullname",
"<a href=\"index.php\">$str->administration</a> ->
<a href=\"users.php\">$str->users</a> -> $str->enrolments");
print_simple_box(get_string('configenrolmentplugins', 'admin'), 'center', '700');
echo "<form target=\"{$CFG->framename}\" name=\"enrolmenu\" method=\"post\" action=\"enrol.php\">";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".$USER->sesskey."\">";
echo "<div align=\"center\"><p><b>";
$table = new stdClass();
$table->head = array(get_string('name'), get_string('enable'), get_string('default'), $str->settings);
$table->align = array('left', 'center', 'center', 'center');
$table->size = array('60%', '', '', '15%');
$table->width = '700';
$table->data = array();
/// Choose an enrolment method
echo get_string('chooseenrolmethod').': ';
choose_from_menu ($options, "enrol", $enrol, "",
"document.location='enrol.php?sesskey=$USER->sesskey&enrol='+document.enrolmenu.enrol.options[document.enrolmenu.enrol.selectedIndex].value", "");
$modules = get_list_of_plugins("enrol");
foreach ($modules as $module) {
echo "</b></p></div>";
/// Print current enrolment type description
print_simple_box_start("center", "80%");
print_heading($options[$enrol]);
// skip if directory is empty
if (!file_exists("$CFG->dirroot/enrol/$module/enrol.php")) {
continue;
}
print_simple_box_start("center", "60%", '', 5, 'informationbox');
print_string("description", "enrol_$enrol");
print_simple_box_end();
$name = get_string("enrolname", "enrol_$module");
$plugin = enrolment_factory::factory($module);
$enable = '<input type="checkbox" name="enable[]" value="'.$module.'"';
if (stristr($CFG->enrol_plugins_enabled, $module) !== false) {
$enable .= ' checked="checked"';
}
if ($module == 'manual') {
$enable .= ' disabled="disabled"';
}
$enable .= ' />';
if (method_exists($plugin, 'print_entry')) {
$default = '<input type="radio" name="default" value="'.$module.'"';
if ($CFG->enrol == $module) {
$default .= ' checked="checked"';
}
$default .= ' />';
} else {
$default = '';
}
$table->data[$name] = array($name, $enable, $default,
'<a href="enrol_config.php?sesskey='.$USER->sesskey.'&amp;enrol='.$module.'">'.$str->edit.'</a>');
}
asort($table->data);
echo "<hr />";
// print_heading($str->settings);
$enrolment->config_form($frm);
print_table($table);
echo "<center><p><input type=\"submit\" value=\"".get_string("savechanges")."\"></p></center>\n";
echo "<center><input type=\"submit\" value=\"".get_string("savechanges")."\"></center>\n";
echo "</form>";
print_simple_box_end();
print_footer();
exit;
?>
?>
+88
View File
@@ -0,0 +1,88 @@
<?PHP // $Id$
// enrol_config.php - allows admin to edit all enrollment variables
// Yes, enrol is correct English spelling.
require_once("../config.php");
$enrol = required_param('enrol', PARAM_ALPHA);
$CFG->pagepath = 'enrol/' . $enrol;
require_login();
if (!$site = get_site()) {
redirect("index.php");
}
if (!isadmin()) {
error("Only the admin can use this page");
}
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
}
require_once("$CFG->dirroot/enrol/enrol.class.php"); /// Open the factory class
$enrolment = enrolment_factory::factory($enrol);
/// If data submitted, then process and store.
if ($frm = data_submitted()) {
if ($enrolment->process_config($frm)) {
redirect("enrol.php?sesskey=$USER->sesskey", get_string("changessaved"), 1);
}
} else {
$frm = $CFG;
}
/// Otherwise fill and print the form.
/// get language strings
$str = get_strings(array('enrolmentplugins', 'configuration', 'users', 'administration'));
$modules = get_list_of_plugins("enrol");
foreach ($modules as $module) {
$options[$module] = get_string("enrolname", "enrol_$module");
}
asort($options);
print_header("$site->shortname: $str->enrolmentplugins", "$site->fullname",
"<a href=\"index.php\">$str->administration</a> ->
<a href=\"users.php\">$str->users</a> ->
<a href=\"enrol.php?sesskey=$USER->sesskey\">$str->enrolmentplugins</a> ->
$str->configuration");
echo "<form target=\"{$CFG->framename}\" name=\"enrolmenu\" method=\"post\" action=\"enrol_config.php\">";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".$USER->sesskey."\">";
echo "<div align=\"center\"><p><b>";
/// Choose an enrolment method
echo get_string('chooseenrolmethod').': ';
choose_from_menu ($options, "enrol", $enrol, "",
"document.location='enrol_config.php?sesskey=$USER->sesskey&enrol='+document.enrolmenu.enrol.options[document.enrolmenu.enrol.selectedIndex].value", "");
echo "</b></p></div>";
/// Print current enrolment type description
print_simple_box_start("center", "80%");
print_heading($options[$enrol]);
print_simple_box_start("center", "60%", '', 5, 'informationbox');
print_string("description", "enrol_$enrol");
print_simple_box_end();
echo "<hr />";
$enrolment->config_form($frm);
echo "<center><p><input type=\"submit\" value=\"".get_string("savechanges")."\"></p></center>\n";
echo "</form>";
print_simple_box_end();
print_footer();
exit;
?>
+43 -4
View File
@@ -31,12 +31,12 @@
require_once('../config.php');
require_once($CFG->libdir.'/environmentlib.php');
require_once($CFG->libdir.'/componentlib.class.php');
/// Parameters
$action = optional_param('action', '', PARAM_ALPHA);
$sesskey = optional_param('sesskey');
$version = optional_param('version');
$action = optional_param('action', '', PARAM_ACTION);
$version = optional_param('version', '', PARAM_FILE); //
/// Security checks
require_login();
@@ -55,14 +55,48 @@
$strenvironment = get_string('environment', 'admin');
$strerror = get_string('error');
$strmoodleversion = get_string('moodleversion');
$strupdate = get_string('updatecomponent', 'admin');
$strupwards = get_string('upwards', 'admin');
$strmisc = get_string('miscellaneous');
/// Print the header stuff
print_header("$SITE->shortname: $strenvironment", $SITE->fullname,
"<a href=\"index.php\">$stradmin</a> -> ".$strenvironment);
"<a href=\"index.php\">$stradmin</a> -> <a href=\"misc.php\">$strmisc</a> -> "
.$strenvironment);
/// Print the component download link
echo '<div class="reportlink"><a href="environment.php?action=updatecomponent&amp;sesskey='.$USER->sesskey.'">'.$strupdate.'</a></div>';
print_heading($strenvironment);
/// Handle the 'updatecomponent' action
if ($action == 'updatecomponent' && confirm_sesskey()) {
/// Create component installer and execute it
if ($cd = new component_installer('http://download.moodle.org',
'environment',
'environment.zip')) {
$status = $cd->install(); //returns ERROR | UPTODATE | INSTALLED
switch ($status) {
case ERROR:
if ($cd->get_error() == 'remotedownloadnotallowed') {
$a = new stdClass();
$a->url = 'http://download.moodle.org/environment/environment.zip';
$a->dest= $CFG->dataroot.'/';
print_simple_box(get_string($cd->get_error(), 'error', $a), 'center', '', '', 5, 'errorbox');
} else {
print_simple_box(get_string($cd->get_error(), 'error'), 'center', '', '', 5, 'errorbox');
}
break;
case UPTODATE:
print_simple_box(get_string($cd->get_error(), 'error'), 'center');
break;
case INSTALLED:
print_simple_box(get_string('componentinstalled', 'admin'), 'center');
break;
}
}
}
/// Start of main box
print_simple_box_start('center');
@@ -107,6 +141,11 @@
/// Gather and show results
$status = check_moodle_environment($version, $environment_results);
/// Other links
echo '<div align="center">';
print_single_button('phpinfo.php', NULL, get_string('phpinfo'));
echo '</div>';
/// Print footer
print_footer();
?>
+26
View File
@@ -34,4 +34,30 @@
</PHP_EXTENSION>
</PHP_EXTENSIONS>
</MOODLE>
<MOODLE version="1.7">
<DATABASE level="required">
<VENDOR name="mysql" version="4.1.16">
<FEEDBACK>
<ON_ERROR message="mysql416required" />
</FEEDBACK>
<BYPASS function="bypass_mysql416_reqs" message="mysql416bypassed" />
</VENDOR>
<VENDOR name="postgres" version="7.4" />
<VENDOR name="mssql" version="8.0" />
<VENDOR name="oracle" version="9.0" />
</DATABASE>
<PHP version="4.3.0" level="required" />
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="optional">
<FEEDBACK>
<ON_CHECK message="iconvrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
</PHP_EXTENSIONS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+108
View File
@@ -0,0 +1,108 @@
<?php // $Id$
// filter.php
// Edit text filter settings
require_once('../config.php');
require_once($CFG->libdir.'/tablelib.php');
// check for allowed access
require_login();
if (!isadmin()) {
error( 'Only administrators can use the filters administration page' );
}
if (!$site = get_site()) {
error( 'Site is not defined in filters administration page' );
}
// get parameters
$param = new Object;
$param->filter = required_param('filter', PARAM_PATH);
$param->submit = optional_param('submit', 0, PARAM_BOOL);
$param->reset = optional_param('reset', 0, PARAM_BOOL);
$filtername = substr($param->filter, strpos( $param->filter, '/' )+1 ) ;
// $CFG->pagepath is used to generate the body and id attributes for the body tag
// of the page. It is also used to generate the link to the Moodle Docs for this view.
$CFG->pagepath = 'filter/' . $filtername . '/config';
// get translated strings for use on page
$txt = new Object;
$txt->managefilters = get_string( 'managefilters' );
$txt->administration = get_string( 'administration' );
$txt->configuration = get_string( 'configuration' );
//======================
// Process Actions
//======================
// if reset pressed let filter config page handle it
$forcereset = false;
if (!empty($param->reset)) {
$forcereset = true;
}
else
if ($config = data_submitted()) {
// check session key
if (!confirm_sesskey()) {
error( get_string('confirmsesskeybad', 'error' ) );
}
$configpath = $CFG->dirroot.'/filter/'.$filtername.'/filterconfig.php';
if (file_exists($configpath)) {
require_once($configpath);
$functionname = $filtername.'_process_config';
if (function_exists($functionname)) {
$functionname($config);
$saved = true;
}
}
if (empty($saved)) {
// run through submitted data
// reject if does not start with filter_
foreach ($config as $name => $value) {
set_config( $name,$value );
}
}
redirect( "$CFG->wwwroot/$CFG->admin/filters.php", get_string('changessaved'), 1);
exit;
}
//==============================
// Display logic
//==============================
$filtername = ucfirst($filtername);
print_header( "$site->shortname: $txt->managefilters", "$site->fullname",
"<a href=\"index.php\">$txt->administration</a> -> <a href=\"configure.php\">$txt->configuration</a> " .
"-> <a href=\"filters.php\">$txt->managefilters</a> -> $filtername" );
print_heading( $txt->managefilters );
print_simple_box("<center>".get_string("configwarning", "admin")."</center>", "center", "50%");
echo "<br />";
print_simple_box_start("center",'');
?>
<form action="filter.php?filter=<?php echo urlencode($param->filter); ?>" method="post">
<input type="hidden" name="sesskey" value="<?php echo sesskey(); ?>" />
<?php include "$CFG->dirroot/$param->filter/filterconfig.html"; ?>
<center>
<input type="submit" name="submit" value="<?php print_string('savechanges'); ?>" />
<input type="submit" name="reset" value="<?php echo print_string('resettodefaults'); ?>" />
</center>
</form>
<?php
print_simple_box_end();
print_simple_box_end();
print_footer();
?>
-159
View File
@@ -1,159 +0,0 @@
<?php print_simple_box_start("center"); ?>
<form name="filters" id="filters" method="post" action="filters.php">
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>">
<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"); ?>
<form name="options" id="options" method="post" action="filters.php">
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>">
<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[604800] = get_string('numdays', '', 7);
$options[86400] = get_string('numdays', '', 1);
$options[43200] = get_string('numhours', '', 12);
$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 nowrap="nowrap" align="right"><?php p($strfilterall) ?>:</td>
<td>
<?php
unset($options);
$options[0] = get_string('no');
$options[1] = get_string('yes');
choose_from_menu ($options, "filterall", $CFG->filterall, "", "", "");
?>
</td>
<td>
<?php p($strconfigfilterall) ?>
</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(); ?>
+285 -124
View File
@@ -1,172 +1,333 @@
<?PHP // $Id$
// Allows the admin to create, delete and rename course categories
<?php // $Id$
// filters.php
// Edit list of available text filters
require_once("../config.php");
require_once('../config.php');
require_once($CFG->libdir.'/tablelib.php');
optional_variable($iselect);
optional_variable($uselect);
optional_variable($add);
optional_variable($remove);
optional_variable($up);
optional_variable($down);
// defines
define('FILTER_TABLE','filter_administration_table');
// check for allowed access
require_login();
if (!isadmin()) {
error("Only administrators can use this page!");
error('Only administrators can use the filters administration page');
}
if (!$site = get_site()) {
error("Site isn't defined!");
error('Site is not defined in filters administration page');
}
/// Print headings
// get values from page
$params = new object();
$params->action = optional_param('action', '', PARAM_ACTION);
$params->filterpath = optional_param('filterpath', '', PARAM_PATH);
$params->cachetext = optional_param('cachetext', 0, PARAM_INT);
$params->filterall = optional_param('filterall', 0, PARAM_BOOL);
$params->filteruploadedfiles = optional_param('filteruploadedfiles', 0, PARAM_INT);
$params->filtermatchoneperpage = optional_param('filtermatchoneperpage', 0, PARAM_BOOL);
$params->filtermatchonepertext = optional_param('filtermatchonepertext', 0, PARAM_BOOL);
$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", 'admin');
$strfilteruploadedfiles = get_string("filteruploadedfiles", "admin");
$strfilterall = get_string("filterall", "admin");
$strconfigfilteruploadedfiles = get_string("configfilteruploadedfiles", 'admin');
$strconfigfilterall = get_string("configfilterall", "admin");
// some basic information
$url = 'filters.php';
$myurl = "$url?sesskey=" . sesskey();
$img = "$CFG->pixpath/t";
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");
// get translated strings for use on page
$txt = new object();
$txt->managefilters = get_string('managefilters');
$txt->administration = get_string('administration');
$txt->configuration = get_string('configuration');
$txt->name = get_string('name');
$txt->hide = get_string('hide');
$txt->show = get_string('show');
$txt->hideshow = "$txt->hide/$txt->show";
$txt->settings = get_string('settings');
$txt->up = get_string('up');
$txt->down = get_string('down');
$txt->updown = "$txt->up/$txt->down";
$txt->cachetext = get_string('cachetext', 'admin');
$txt->configcachetext = get_string('configcachetext', 'admin');
$txt->filteruploadedfiles = get_string('filteruploadedfiles','admin');
$txt->configfilteruploadedfiles = get_string('configfilteruploadedfiles','admin');
$txt->filterall = get_string('filterall','admin');
$txt->filtermatchoneperpage = get_string('filtermatchoneperpage','admin');
$txt->filtermatchonepertext = get_string('filtermatchonepertext','admin');
$txt->configfilterall = get_string('configfilterall','admin');
$txt->configfiltermatchoneperpage = get_string('configfiltermatchoneperpage','admin');
$txt->configfiltermatchonepertext = get_string('configfiltermatchonepertext','admin');
$txt->cachecontrols = get_string('cachecontrols');
$txt->yes = get_string('yes');
$txt->no = get_string('no');
$txt->none = get_string('none');
$txt->allfiles = get_string('allfiles');
$txt->htmlfilesonly = get_string('htmlfilesonly');
// get a list of possible filters (and translate name if possible)
// note filters can be in the dedicated filters area OR in their
// associated modules
$installedfilters = array();
$filtersettings = 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")) {
foreach ($plugins as $plugin) {
$pluginpath = "$CFG->dirroot/$filterlocation/$plugin/filter.php";
$settingspath = "$CFG->dirroot/$filterlocation/$plugin/filterconfig.html";
if (is_readable($pluginpath)) {
$name = trim(get_string("filtername", $plugin));
if (empty($name) or $name == "[[filtername]]") {
$name = $plugin;
if (empty($name) or ($name == '[[filtername]]')) {
$name = ucfirst($plugin);
}
$installedfilters["$filterlocation/$plugin"] = $name;
if (is_readable($settingspath)) {
$filtersettings[] = "$filterlocation/$plugin";
}
$allfilters["$filterlocation/$plugin"] = $name;
}
}
}
/// Make an array of all the currently installed filters
$installedfilters = array();
// get all the currently selected filters
if (!empty($CFG->textfilters)) {
$installedfilters = explode(',',$CFG->textfilters);
$oldactivefilters = explode(',', $CFG->textfilters);
$oldactivefilters = array_unique($oldactivefilters);
} else {
$oldactivefilters = array();
}
// Do a little cleanup for robustness
foreach ($installedfilters as $key => $installedfilter) {
if (empty($installedfilter)) {
unset($installedfilters[$key]);
set_config("textfilters", implode(',', $installedfilters));
}
// take this opportunity to clean up filters
$activefilters = array();
foreach ($oldactivefilters as $oldactivefilter) {
if (!empty($oldactivefilter) and array_key_exists($oldactivefilter, $installedfilters)) {
$activefilters[] = $oldactivefilter;
}
}
$selectedfilter = "none";
//======================
// Process Actions
//======================
/// If data submitted, then process and store.
if ($params->action=="") {
// store cleaned active filers in db
set_config('textfilters', implode(',', $activefilters));
} elseif (($params->action=="hide") and confirm_sesskey()) {
$key=array_search($params->filterpath, $activefilters);
// check filterpath is valid
if ($key===false) {
// ignore it - doubleclick??
} else {
// just delete it
unset($activefilters[$key]);
set_config('textfilters', implode(',', $activefilters));
}
} elseif (($params->action=="show") and confirm_sesskey()) {
// check filterpath is valid
if (!array_key_exists($params->filterpath, $installedfilters)) {
error("Filter $params->filterpath is not currently installed", $url);
} elseif (array_search($params->filterpath,$activefilters)) {
// filterpath is already active - doubleclick??
} else {
// add it to installed filters
$activefilters[] = $params->filterpath;
$activefilters = array_unique($activefilters);
set_config('textfilters', implode(',', $activefilters));
}
} elseif (($params->action=="down") and confirm_sesskey()) {
$key=array_search($params->filterpath, $activefilters);
// check filterpath is valid
if ($key===false) {
error("Filter $params->filterpath is not currently active", $url);
} elseif ($key>=(count($activefilters)-1)) {
// cannot be moved any further down - doubleclick??
} else {
// swap with $key+1
$fsave = $activefilters[$key];
$activefilters[$key] = $activefilters[$key+1];
$activefilters[$key+1] = $fsave;
set_config('textfilters', implode(',', $activefilters));
}
} elseif (($params->action=="up") and confirm_sesskey()) {
$key=array_search($params->filterpath, $activefilters);
// check filterpath is valid
if ($key===false) {
error("Filter $params->filterpath is not currently active", $url);
} elseif ($key<1) {
//cannot be moved any further up - doubleclick??
} else {
// swap with $key-1
$fsave = $activefilters[$key];
$activefilters[$key] = $activefilters[$key-1];
$activefilters[$key-1] = $fsave;
set_config('textfilters', implode(',', $activefilters));
}
} elseif (($params->action=="config") and confirm_sesskey()) {
set_config('cachetext', $params->cachetext);
set_config('filteruploadedfiles', $params->filteruploadedfiles);
set_config('filterall', $params->filterall);
set_config('filtermatchoneperpage', $params->filtermatchoneperpage);
set_config('filtermatchonepertext', $params->filtermatchonepertext);
}
if (!empty($options)) {
if (($config = data_submitted()) && confirm_sesskey()) {
unset($config->options);
unset($config->sesskey);
foreach ($config as $name => $value) {
set_config($name, $value);
}
//======================
// Build Display Objects
//======================
// construct the display array with installed filters
// at the top in the right order
$displayfilters = array();
foreach ($activefilters as $activefilter) {
$name = $installedfilters[$activefilter];
$displayfilters[$activefilter] = $name;
}
foreach ($installedfilters as $key => $filter) {
if (!array_key_exists($key, $displayfilters)) {
$displayfilters[$key] = $filter;
}
}
if (!empty($add) and !empty($uselect) and confirm_sesskey()) {
$selectedfilter = $uselect;
if (!in_array($selectedfilter, $installedfilters)) {
$installedfilters[] = $selectedfilter;
set_config("textfilters", implode(',', $installedfilters));
// construct the flexible table ready to display
$table = new flexible_table(FILTER_TABLE);
$table->define_columns(array('name', 'hideshow', 'order', 'settings'));
$table->column_style('hideshow', 'text-align', 'center');
$table->column_style('order', 'text-align', 'center');
$table->column_style('settings', 'text-align', 'center');
$table->define_headers(array($txt->name, $txt->hideshow, $txt->updown, $txt->settings));
$table->define_baseurl("$CFG->wwwroot/$CFG->admin/filters.php");
$table->set_attribute('id', 'blocks');
$table->set_attribute('class', 'flexible generaltable generalbox');
$table->set_attribute('style', 'margin:auto;');
$table->set_attribute('cellpadding', '5');
$table->setup();
// iterate through filters adding to display table
$updowncount = 1;
$activefilterscount = count($activefilters);
foreach ($displayfilters as $path => $name) {
$upath = urlencode($path);
// get hide/show link
if (in_array($path, $activefilters)) {
$hideshow = "<a href=\"$myurl&amp;action=hide&amp;filterpath=$upath\">";
$hideshow .= "<img src=\"{$CFG->pixpath}/i/hide.gif\" height=\"16\" width=\"16\" alt=\"hide\" /></a>";
$hidden = false;
$displayname = "<span>$name</span>";
}
else {
$hideshow = "<a href=\"$myurl&amp;action=show&amp;filterpath=$upath\">";
$hideshow .= "<img src=\"{$CFG->pixpath}/i/show.gif\" height=\"16\" width=\"16\" alt=\"show\" /></a>";
$hidden = true;
$displayname = "<span class=\"dimmed_text\">$name</span>";
}
} else if (!empty($remove) and !empty($iselect) and confirm_sesskey()) {
$selectedfilter = $iselect;
foreach ($installedfilters as $key => $installedfilter) {
if ($installedfilter == $selectedfilter) {
unset($installedfilters[$key]);
// get up/down link (only if not hidden)
$updown = '';
if (!$hidden) {
if ($updowncount>1) {
$updown .= "<a href=\"$myurl&amp;action=up&amp;filterpath=$upath\">";
$updown .= "<img src=\"$img/up.gif\" alt=\"up\" /></a>&nbsp;";
}
else {
$updown .= "<img src=\"$CFG->pixpath/spacer.gif\" height=\"16\" width=\"16\" alt=\"\" />&nbsp;";
}
if ($updowncount<$activefilterscount) {
$updown .= "<a href=\"$myurl&amp;action=down&amp;filterpath=$upath\">";
$updown .= "<img src=\"$img/down.gif\" alt=\"down\" /></a>";
}
else {
$updown .= "<img src=\"$CFG->pixpath/spacer.gif\" height=\"16\" width=\"16\" alt=\"\" />";
}
++$updowncount;
}
set_config("textfilters", implode(',', $installedfilters));
} else if ((!empty($up) or !empty($down)) and !empty($iselect) and confirm_sesskey()) {
// settings link (if defined)
$settings = '';
if (in_array($path, $filtersettings)) {
$settings = "<a href=\"filter.php?filter=" . urlencode($path) . "\">";
$settings .= "{$txt->settings}</a>";
}
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;
// write data into the table object
$table->add_data(array($displayname, $hideshow, $updown, $settings));
}
/// 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;
}
// build options list for cache lifetime
$seconds = array(604800,86400,43200,10800,7200,3600,2700,1800,900,600,540,480,420,360,300,240,180,120,60,30,0);
unset($lifetimeoptions);
foreach ($seconds as $second) {
if ($second>=86400) {
$options[$second] = get_string('numdays','',$second/86400);
}
if (!$installed) {
$uninstalledfilters[] = $filter;
elseif ($second>=3600) {
$options[$second] = get_string('numhours','',$second/3600);
}
elseif ($second>=60) {
$options[$second] = get_string('numminutes','',$second/60);
}
elseif ($second>=1) {
$options[$second] = get_string('numseconds','',$second);
}
else {
$options[$second] = get_string('no');
}
}
/// Print the current form
//==============================
// Display logic
//==============================
include("filters.html");
print_header("$site->shortname: $txt->managefilters", "$site->fullname",
"<a href=\"index.php\">$txt->administration</a> -> <a href=\"configure.php\">$txt->configuration</a> " .
"-> $txt->managefilters");
print_heading_with_help($txt->managefilters, 'filters');
// print the table of all the filters
$table->print_html();
// print the table for the cache controls
print_heading($txt->cachecontrols);
print_simple_box_start('center');
?>
<form name="options" id="options" method="post" action="<?php echo $url; ?>" >
<input type="hidden" name="sesskey" value="<?php echo sesskey(); ?>" />
<input type="hidden" name="action" value="config" />
<table cellpadding="20">
<tr valign="top">
<td nowrap="nowrap" align="right"><?php echo $txt->cachetext; ?></td>
<td><?php choose_from_menu($options, "cachetext", $CFG->cachetext, "", "", ""); ?></td>
<td><?php echo $txt->configcachetext; ?></td>
</tr>
<tr valign="top">
<td nowrap="nowrap" align="right"><?php echo $txt->filteruploadedfiles; ?></td>
<td><?php choose_from_menu(array($txt->none,$txt->allfiles,$txt->htmlfilesonly),
"filteruploadedfiles", $CFG->filteruploadedfiles,"","",""); ?></td>
<td><?php echo $txt->configfilteruploadedfiles; ?></td>
</tr>
<tr valign="top">
<td nowrap="nowrap" align="right"><?php echo $txt->filtermatchoneperpage; ?></td>
<td><?php choose_from_menu(array($txt->no,$txt->yes), "filtermatchoneperpage", $CFG->filtermatchoneperpage,"","",""); ?></td>
<td><?php echo $txt->configfiltermatchoneperpage; ?></td>
<tr valign="top">
<td nowrap="nowrap" align="right"><?php echo $txt->filtermatchonepertext; ?></td>
<td><?php choose_from_menu(array($txt->no,$txt->yes), "filtermatchonepertext", $CFG->filtermatchonepertext,"","",""); ?></td>
<td><?php echo $txt->configfiltermatchonepertext; ?></td>
</tr>
</tr>
<tr valign="top">
<td nowrap="nowrap" align="right"><?php echo $txt->filterall; ?></td>
<td><?php choose_from_menu(array($txt->no,$txt->yes), "filterall", $CFG->filterall,"","",""); ?></td>
<td><?php echo $txt->configfilterall; ?></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();
print_footer();
+55 -30
View File
@@ -1,12 +1,24 @@
<?php // $Id$
ob_start(); //for whitespace test
require_once('../config.php');
// extra whitespace test - intentionally breaks cookieless mode
$extraws = '';
while (true) {
$extraws .= ob_get_contents();
if (!@ob_end_clean()) { //
break;
}
}
define('SEVERITY_NOTICE', 'notice');
define('SEVERITY_ANNOYANCE', 'annoyance');
define('SEVERITY_SIGNIFICANT', 'significant');
define('SEVERITY_CRITICAL', 'critical');
$solution = optional_param('solution', 0, PARAM_SAFEDIR); //in fact it is class name alhanumeric and _
require_login();
if (!isadmin()) {
error('Only the admin can use this page');
@@ -15,9 +27,11 @@
$site = get_site();
$stradmin = get_string('administration');
$strhealthcenter = get_string('healthcenter');
$strmisc = get_string('miscellaneous');
print_header($site->shortname.': '.$strhealthcenter, $site->fullname,
'<a href="index.php">'.$stradmin.'</a> -> '.$strhealthcenter);
'<a href="index.php">'.$stradmin.'</a> -> <a href="misc.php">'.$strmisc.'</a> ->'.
$strhealthcenter);
echo <<<STYLES
<style type="text/css">
@@ -81,9 +95,7 @@ dd.solution li {
</style>
STYLES;
$solution = optional_param('solution', NULL);
if(!empty($solution) && class_exists($solution)) {
if(strpos($solution, 'problem_') === 0 && class_exists($solution)) {
health_print_solution($solution);
}
else {
@@ -215,18 +227,13 @@ class problem_000001 extends problem_base {
class problem_000002 extends problem_base {
function title() {
return 'Extra characters at the end of config.php';
return 'Extra characters at the end of config.php or other library function';
}
function exists() {
// [pj] When the requirements are raised to PHP 4.3.0 this will be file_get_contents()
if($fp = @fopen('../config.php', 'r')) {
$contents = fread($fp, 16384); // 16K should be enough
$ending = substr($contents, -2);
unset($contents);
if($ending == '?>') {
return false;
}
fclose($fp);
global $extraws;
if($extraws === '') {
return false;
}
return true;
}
@@ -234,11 +241,11 @@ class problem_000002 extends problem_base {
return SEVERITY_SIGNIFICANT;
}
function description() {
return 'Your Moodle configuration file, config.php, contains some characters after the closing PHP tag (?>). This could cause Moodle to exhibit several kinds of problems and should be fixed.';
return 'Your Moodle configuration file config.php or another library file, contains some characters after the closing PHP tag (?>). This causes Moodle to exhibit several kinds of problems (such as broken downloaded files) and must be fixed.';
}
function solution() {
global $CFG;
return 'You need to edit <strong>'.$CFG->dirroot.'/config.php</strong> and remove all characters (including spaces and returns) after the ending ?> tag. These two characters should be the very last in that file.';
return 'You need to edit <strong>'.$CFG->dirroot.'/config.php</strong> and remove all characters (including spaces and returns) after the ending ?> tag. These two characters should be the very last in that file. The extra trailing whitespace may be also present in other PHP files that are included from lib/setup.php.';
}
}
@@ -349,24 +356,41 @@ class problem_000008 extends problem_base {
return 'PHP: memory_limit cannot be controlled by Moodle';
}
function exists() {
$memlimit = @ini_get('memory_limit');
if(empty($memlimit)) {
$oldmemlimit = @ini_get('memory_limit');
if(empty($oldmemlimit)) {
// PHP not compiled with memory limits, this means that it's
// probably limited to 8M so we have a problem...
return true;
// probably limited to 8M or in case of Windows not at all.
// We can ignore it for now - there is not much to test anyway
// TODO: add manual test that fills memory??
return false;
}
// Otherwise, raise_memory_limit in setup.php will do the trick
$oldmemlimit = get_real_size($oldmemlimit);
//now lets change the memory limit to something unique below 128M==134217728
@ini_set('memory_limit', 134217720);
$testmemlimit = get_real_size(@ini_get('memory_limit'));
//verify the change had any effect at all
if ($oldmemlimit == $testmemlimit) {
//memory limit can not be changed - is it big enough then?
if ($oldmemlimit < get_real_size('128M')) {
return true;
} else {
return false;
}
}
@ini_set('memory_limit', $oldmemlimit);
return false;
}
function severity() {
return SEVERITY_ANNOYANCE;
return SEVERITY_NOTICE;
}
function description() {
return 'The settings for PHP on your server do not allow a script to request more memory during its execution. This means that most likely there is a hard limit of 8MB for each script. It is possible that certain operations within Moodle will require more than this amount in order to complete successfully, especially if there are lots of data to be processed. Therefore, it is recommended that you contact your server administrator to address this issue.';
return 'The settings for PHP on your server do not allow a script to request more memory during its execution. '.
'This means that there is a hard limit of '.@ini_get('memory_limit').' for each script. '.
'It is possible that certain operations within Moodle will require more than this amount in order '.
'to complete successfully, especially if there are lots of data to be processed.';
}
function solution() {
global $CFG;
return 'We need a good solution here. Enabling memory limit control means recompiling PHP... maybe this should be SEVERITY_NOTICE instead of SEVERITY_ANNOYANCE?';
return 'It is recommended that you contact your web server administrator to address this issue.';
}
}
@@ -420,7 +444,7 @@ class problem_000010 extends problem_base {
$desc .= '<li>slasharguments are enabled in Moodle configuration</li>';
}
if ($this->status() == -1) {
$desc .= '<li>can not run automatic test, you can verify it <a href="'.$CFG->wwwroot.'/file.php/testslasharguments" target="_blank">here</a></li>';
$desc .= '<li>can not run automatic test, you can verify it <a href="'.$CFG->wwwroot.'/file.php/testslasharguments" target="_blank">here</a> manually</li>';
} else if ($this->status() == 0) {
$desc .= '<li>slashargument test <strong>failed</strong>, please check server configuration</li>';
} else {
@@ -461,13 +485,13 @@ class problem_000010 extends problem_base {
function status() {
global $CFG;
$handle = @fopen($CFG->wwwroot.'/file.php?file=/testslasharguments', "r");
$contents = trim(@fread($handle, 7));
$contents = @trim(fread($handle, 10));
@fclose($handle);
if ($contents != 'test -1') {
return -1;
}
$handle = @fopen($CFG->wwwroot.'/file.php/testslasharguments', "r");
$contents = trim(@fread($handle, 6));
$contents = trim(@fread($handle, 10));
@fclose($handle);
switch ($contents) {
case 'test 1': return 1;
@@ -498,7 +522,7 @@ class problem_000011 extends problem_base {
}
function solution() {
global $CFG;
if (isset($_GET['resetsesserrorcounter'])) {
if (optional_param('resetsesserrorcounter', 0, PARAM_BOOL)) {
if (get_field('config', 'name', 'name', 'session_error_counter')) {
delete_records('config', 'name', 'session_error_counter');
}
@@ -534,7 +558,8 @@ class problem_00000x extends problem_base {
TODO:
session.save_path -- it doesn't really matter because we are already IN a session, right?
detect unsupported characters in $CFG->wwwroot - see bug Bug #6091 - relative vs absolute path during backup/restore process
*/
?>
?>
+157 -125
View File
@@ -1,29 +1,32 @@
<?php // $Id$
/// Check that config.php exists, if not then call the install script
if (!file_exists("../config.php")) {
if (!file_exists('../config.php')) {
header('Location: ../install.php');
die;
}
require_once("../config.php");
include_once("$CFG->dirroot/lib/adminlib.php"); // Contains various admin-only functions
/// Check that PHP is of a sufficient version
if (!check_php_version("4.1.0")) {
$version = phpversion();
print_heading("Sorry, Moodle requires PHP 4.1.0 or later (currently using version $version)");
/// Moved here because older versions do not allow while(@ob_end_clean());
if (version_compare(phpversion(), "4.3.0") < 0) {
$phpversion = phpversion();
echo "Sorry, Moodle requires PHP 4.3.0 or later (currently using version $phpversion)";
die;
}
/// This is a Moodle 1.5 hack ONLY to fix accidental bad versions from version.php
/// Do not copy this code into HEAD
if ($CFG->version == '2005072100') {
set_config('version', 2005060221);
}
/// Turn off time limits and try to flush everything all the time, sometimes upgrades can be slow.
@set_time_limit(0);
@ob_implicit_flush(true);
while(@ob_end_clean()); // ob_end_flush prevents sending of headers
require_once('../config.php');
include_once($CFG->dirroot.'/lib/adminlib.php'); // Contains various admin-only functions
$id = optional_param('id', '', PARAM_ALPHANUM);
$confirmupgrade = optional_param('confirmupgrade', 0, PARAM_BOOL);
$agreelicence = optional_param('agreelicence',0, PARAM_BOOL);
/// Check some PHP server settings
@@ -73,13 +76,6 @@
$CFG->version = "";
}
/// Turn off time limits and try to flush everything all the time, sometimes upgrades can be slow.
@set_time_limit(0);
@ob_implicit_flush(true);
@ob_end_flush();
/// Check if the main tables have been installed yet or not.
if (! $tables = $db->Metatables() ) { // No tables yet at all.
@@ -104,12 +100,12 @@
print_header($strlicense, $strlicense, $strlicense, "", "", false, "&nbsp;", "&nbsp;");
print_heading("<a href=\"http://moodle.org\">Moodle</a> - Modular Object-Oriented Dynamic Learning Environment");
print_heading(get_string("copyrightnotice"));
print_simple_box_start("center");
print_simple_box_start('center');
echo text_to_html(get_string("gpl"));
print_simple_box_end();
echo "<br />";
notice_yesno(get_string("doyouagree"), "index.php?agreelicence=true",
"http://moodle.org/doc/?frame=licence.html");
"http://docs.moodle.org/en/License");
exit;
}
@@ -148,7 +144,7 @@
$a->newversion = "$release ($version)";
$strdatabasechecking = get_string("databasechecking", "", $a);
if (empty($_GET['confirmupgrade'])) {
if (empty($confirmupgrade)) {
print_header($strdatabasechecking, $stradministration, $strdatabasechecking,
"", "", false, "&nbsp;", "&nbsp;");
notice_yesno(get_string('upgradesure', 'admin', $a->newversion), 'index.php?confirmupgrade=yes', 'index.php');
@@ -184,11 +180,7 @@
print_header($strcurrentversion, $stradministration, $strcurrentversion,
"", "", false, "&nbsp;", "&nbsp;");
if (set_config("version", $version)) {
print_heading("Moodle $release ($version)");
print_continue("index.php");
die;
} else {
if (!set_config("version", $version)) {
$db->debug=true;
if (main_upgrade(0)) {
print_continue("index.php");
@@ -199,7 +191,6 @@
}
}
/// Updated human-readable release version if necessary
if ($release <> $CFG->release) { // Update the release version
@@ -209,16 +200,10 @@
if (!set_config("release", $release)) {
notify("ERROR: Could not update release version in database!!");
}
print_continue("index.php");
print_simple_box_start("CENTER");
include("$CFG->dirroot/lang/en/docs/release.html");
print_simple_box_end();
print_continue("index.php");
notice(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes'), 'index.php');
exit;
}
/// Insert default values for any important configuration variables
include_once("$CFG->dirroot/lib/defaults.php");
@@ -231,17 +216,22 @@
}
}
/// Send $CFG->unicodedb to DB to have it available for next requests
set_config('unicodedb', $CFG->unicodedb);
/// If any new configurations were found then send to the config page to check
if (!empty($configchange)) {
redirect("config.php");
redirect("config.php?installing=1");
}
/// Find and check all main modules and load them up or upgrade them if necessary
upgrade_activity_modules("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
/// Check all questiontype plugins and upgrade if necessary
// It is important that this is done AFTER the quiz module has been upgraded
upgrade_plugins('qtype', 'question/type', "$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
/// Upgrade backup/restore system if necessary
require_once("$CFG->dirroot/backup/lib.php");
upgrade_backup_db("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
@@ -254,8 +244,11 @@
upgrade_blocks_plugins("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
/// Check all enrolment plugins and upgrade if necessary
upgrade_enrol_plugins("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
upgrade_plugins('enrol', 'enrol', "$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
/// Check for local database customisations
require_once("$CFG->dirroot/lib/locallib.php");
upgrade_local_db("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
/// Set up the overall site name etc.
@@ -300,8 +293,8 @@
/// Check if we are returning from moodle.org registration and if so, we mark that fact to remove reminders
if (!empty($_GET['id'])) {
if ($_GET['id'] == $CFG->siteidentifier) {
if (!empty($id)) {
if ($id == $CFG->siteidentifier) {
set_config('registered', time());
}
}
@@ -313,26 +306,43 @@
print_simple_box_start('center', '100%', '', 20);
print_heading($stradministration);
/// Deprecated database! Warning!!
if (!empty($CFG->migrated_to_new_db)) {
print_simple_box_start('center','60%');
print_string('dbmigrationdeprecateddb','admin');
print_simple_box_end();
}
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");
"$CFG->wwwroot/$CFG->admin/upgrade$CFG->upgrade.php"), "center", '60%');
print_spacer(10,10);
}
if (ini_get_bool('register_globals') && !ini_get_bool('magic_quotes_gpc')) {
print_simple_box(get_string('globalsquoteswarning', 'admin'), 'center');
print_simple_box(get_string('globalsquoteswarning', 'admin'), 'center', '60%');
}
if (is_dataroot_insecure()) {
print_simple_box(get_string('datarootsecuritywarning', 'admin', $CFG->dataroot), 'center', '60%');
}
/// If no recently cron run
$lastcron = get_field_sql('SELECT max(lastcron) FROM ' . $CFG->prefix . 'modules');
if (time() - $lastcron > 3600 * 24) {
print_simple_box(get_string('cronwarning', 'admin') , 'center');
$strinstallation = get_string('installation', 'install');
$helpbutton = helpbutton('install', $strinstallation, 'moodle', true, false, '', true);
print_simple_box(get_string('cronwarning', 'admin')."&nbsp;".$helpbutton, 'center', '60%');
}
/// Alert if we are currently in maintenance mode
if (file_exists($CFG->dataroot.'/1/maintenance.html')) {
print_simple_box(get_string('sitemaintenancewarning', 'admin') , 'center');
print_simple_box(get_string('sitemaintenancewarning', 'admin') , 'center', '60%');
}
/// Alert if we are currently in maintenance mode
if (empty($CFG->unicodedb)) {
print_simple_box(get_string('unicodeupgradenotice', 'admin') , 'center', '60%');
}
/// Print slightly annoying registration button every six months ;-)
@@ -341,7 +351,7 @@
if (!isset($CFG->registered) || $CFG->registered < (time() - 3600*24*30*6)) {
$options = array();
$options['sesskey'] = $USER->sesskey;
print_simple_box_start('center');
print_simple_box_start('center','60%');
echo '<div align="center">';
print_string('pleaseregister', 'admin');
print_single_button('register.php', $options, get_string('registration'));
@@ -349,112 +359,134 @@
print_simple_box_end();
}
$table->tablealign = "right";
$table->tablealign = "center";
$table->align = array ("right", "left");
$table->wrap = array ("nowrap", "nowrap");
$table->cellpadding = 5;
$table->cellspacing = 0;
$table->width = "40%";
$table->width = '40%';
$configdata = "<font size=\"+1\">&nbsp;</font><a href=\"config.php\">".get_string("configvariables", 'admin')."</a> - <font size=\"1\">".
get_string("adminhelpconfigvariables")."</font><br />";
$configdata .= "<font size=\"+1\">&nbsp;</font><a href=\"site.php\">".get_string("sitesettings")."</a> - <font size=\"1\">".
get_string("adminhelpsitesettings")."</font><br />";
$configdata .= "<font size=\"+1\">&nbsp;</font><a href=\"../theme/index.php\">".get_string("themes")."</a> - <font size=\"1\">".
get_string("adminhelpthemes")."</font><br />";
$configdata .= "<font size=\"+1\">&nbsp;</font><a href=\"lang.php\">".get_string("language")."</a> - <font size=\"1\">".
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=\"blocks.php\">".get_string("manageblocks")."</a> - <font size=\"1\">".
get_string("adminhelpmanageblocks")."</font><br />";
$configdata .= "<font size=\"+1\">&nbsp;</font><a href=\"filters.php\">".get_string("managefilters")."</a> - <font size=\"1\">".
get_string("adminhelpmanagefilters")."</font><br />";
$configdata = '<div class="adminlink"><a href="config.php">'.get_string('configvariables', 'admin').
'</a> - <span class="explanation">'.get_string('adminhelpconfigvariables').'</span></div>';
$configdata .= '<div class="adminlink"><a href="site.php">'.get_string('sitesettings').
'</a> - <span class="explanation">'.get_string('adminhelpsitesettings').'</span></div>';
$configdata .= '<div class="adminlink"><a href="../theme/index.php">'.get_string('themes').
'</a> - <span class="explanation">'.get_string('adminhelpthemes').'</span></div>';
$configdata .= '<div class="adminlink"><a href="lang.php">'.get_string('language').
'</a> - <span class="explanation">'.get_string('adminhelplanguage').'</span></div>';
$configdata .= '<div class="adminlink"><a href="modules.php">'.get_string('managemodules').
'</a> - <span class="explanation">'.get_string('adminhelpmanagemodules').'</span></div>';
$configdata .= '<div class="adminlink"><a href="blocks.php">'.get_string('manageblocks').
'</a> - <span class="explanation">'.get_string('adminhelpmanageblocks').'</span></div>';
$configdata .= '<div class="adminlink"><a href="filters.php">'.get_string('managefilters').
'</a> - <span class="explanation">'.get_string('adminhelpmanagefilters').'</span></div>';
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 />";
$configdata .= '<div class="adminlink"><a href="backup.php">'.get_string('backup').
'</a> - <span class="explanation">'.get_string('adminhelpbackup').'</span></div>';
}
$configdata .= "<font size=\"+1\">&nbsp;</font><a href=\"editor.php\">". get_string("editorsettings") ."</a> - <font size=\"1\">".
get_string("adminhelpeditorsettings")."</font><br />";
$configdata .= "<font size=\"+1\">&nbsp;</font><a href=\"calendar.php\">". get_string('calendarsettings', 'admin') ."</a> - <font size=\"1\">".
get_string('helpcalendarsettings', 'admin')."</font><br />";
$configdata .= "<font size=\"+1\">&nbsp;</font><a href=\"maintenance.php\">". get_string('sitemaintenancemode', 'admin') ."</a> - <font size=\"1\">".
get_string('helpsitemaintenance', 'admin')."</font><br />";
$configdata .= '<div class="adminlink"><a href="editor.php">'.get_string('editorsettings').
'</a> - <span class="explanation">'.get_string('adminhelpeditorsettings').'</span></div>';
$configdata .= '<div class="adminlink"><a href="calendar.php">'.get_string('calendarsettings', 'admin').
'</a> - <span class="explanation">'.get_string('helpcalendarsettings', 'admin').'</span></div>';
$configdata .= '<div class="adminlink"><a href="maintenance.php">'.get_string('sitemaintenancemode', 'admin').
'</a> - <span class="explanation">'.get_string('helpsitemaintenance', 'admin').'</span></div>';
$table->data[] = array("<font size=\"+1\"><b><a href=\"configure.php\">".get_string("configuration")."</a></b></font>",
$configdata);
$table->data[] = array('<strong><a href="configure.php">'.get_string('configuration').'</a></strong>', $configdata);
$userdata = "<font size=\"+1\">&nbsp;</font><a href=\"auth.php?sesskey=$USER->sesskey\">".get_string("authentication")."</a> - <font size=\"1\">".
get_string("adminhelpauthentication")."</font><br />";
$userdata .= "<font size=\"+1\">&nbsp;</font><a href=\"user.php\">".get_string("edituser")."</a> - <font size=\"1\">".
get_string("adminhelpedituser")."</font><br />";
$userdata .= "<font size=\"+1\">&nbsp;</font><a href=\"$CFG->wwwroot/$CFG->admin/user.php?newuser=true&amp;sesskey=$USER->sesskey\">".
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?sesskey=$USER->sesskey\">".
get_string("uploadusers")."</a> - <font size=\"1\">".
get_string("adminhelpuploadusers")."</font><br />";
$userdata = '<div class="adminlink"><a href="auth.php?sesskey='.$USER->sesskey.'">'.get_string("authentication").
'</a> - <span class="explanation">'.get_string('adminhelpauthentication').'</span></div>';
$userdata .= '<div class="adminlink"><a href="user.php">'.get_string('edituser').
'</a> - <span class="explanation">'.get_string('adminhelpedituser').'</span></div>';
$userdata .= '<div class="adminlink"><a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/user.php?newuser=true&amp;sesskey='.$USER->sesskey.'">'.
get_string('addnewuser').'</a> - <span class="explanation">'.get_string('adminhelpaddnewuser').'</span></div>';
$userdata .= '<div class="adminlink"><a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/uploaduser.php?sesskey='.$USER->sesskey.'">'.
get_string('uploadusers').'</a> - <span class="explanation">'.get_string('adminhelpuploadusers').'</span></div>';
$userdata .= "<hr /><font size=\"+1\">&nbsp;</font><a href=\"enrol.php?sesskey=$USER->sesskey\">".get_string("enrolments")."</a> - <font size=\"1\">".
get_string("adminhelpenrolments")."</font><br />";
$userdata .= "<font size=\"+1\">&nbsp;</font><a href=\"../course/index.php?edit=off&amp;sesskey=$USER->sesskey\">".get_string("assignstudents")."</a> - <font size=\"1\">".
get_string("adminhelpassignstudents")."</font><br />";
$table->data[] = array('<strong><a href="users.php">'.get_string('users').'</a></strong>', $userdata);
$userdata .= "<font size=\"+1\">&nbsp;</font><a href=\"../course/index.php?edit=on&amp;sesskey=$USER->sesskey\">".get_string("assignteachers")."</a> - <font size=\"1\">".
get_string("adminhelpassignteachers").
" <img src=\"../pix/t/user.gif\" height=\"11\" width=\"11\" alt=\"\" /></font><br />";
$userdata .= "<font size=\"+1\">&nbsp;</font><a href=\"creators.php?sesskey=$USER->sesskey\">".get_string("assigncreators")."</a> - <font size=\"1\">".
get_string("adminhelpassigncreators")."</font><br />";
$userdata .= "<font size=\"+1\">&nbsp;</font><a href=\"admin.php?sesskey=$USER->sesskey\">".get_string("assignadmins")."</a> - <font size=\"1\">".
get_string("adminhelpassignadmins")."</font><br />";
$coursedata = '<div class="adminlink"><a href="../course/index.php?edit=on&amp;sesskey='.$USER->sesskey.'">'.get_string('managecourses').
'</a> - <span class="explanation">'.get_string('adminhelpcourses').'</span></div>';
$coursedata .= '<div class="adminlink"><a href="enrol.php?sesskey='.$USER->sesskey.'">'.get_string('enrolmentplugins').
'</a> - <span class="explanation">'.get_string('adminhelpenrolments').'</span></div>';
$coursedata .= '<div class="adminlink"><a href="../course/index.php?edit=off&amp;sesskey='.$USER->sesskey.'">'.
get_string('assignstudents').'</a> - <span class="explanation">'.get_string('adminhelpassignstudents').'</span></div>';
$coursedata .= '<div class="adminlink"><a href="../course/index.php?edit=on&amp;sesskey='.$USER->sesskey.'">'.
get_string('assignteachers').'</a> - <span class="explanation">'.get_string('adminhelpassignteachers').
' <img src="../pix/t/user.gif" height="11" width="11" alt="" /></span></div>';
$coursedata .= '<div class="adminlink"><a href="creators.php?sesskey='.$USER->sesskey.'">'.get_string('assigncreators').
'</a> - <span class="explanation">'.get_string('adminhelpassigncreators').'</span></div>';
$coursedata .= '<div class="adminlink"><a href="admin.php?sesskey='.$USER->sesskey.'">'.get_string('assignadmins').
'</a> - <span class="explanation">'.get_string('adminhelpassignadmins').'</span></div>';
$table->data[] = array("<font size=\"+1\"><b><a href=\"users.php\">".get_string("users")."</a></b></font>", $userdata);
$table->data[] = array('<strong><a href="courses.php">'.get_string('courses').'</a></strong>', $coursedata);
$table->data[] = array("<font size=\"+1\"><b><a href=\"../course/index.php?edit=on&amp;sesskey=$USER->sesskey\">".get_string("courses")."</a></b></font>",
"<font size=\"+1\">&nbsp;</font>".get_string("adminhelpcourses"));
$table->data[] = array("<font size=\"+1\"><b><a href=\"../course/log.php?id=$site->id\">".get_string("logs")."</a></b></font>",
"<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>",
"<font size=\"+1\">&nbsp;</font>".get_string("adminhelpsitefiles"));
$table->data[] = array('<font size="+1"><b><a href="environment.php">'.get_string('environment','admin').'</a></b></font>',
"<font size=\"+1\">&nbsp;</font>".get_string('adminhelpenvironment'));
$miscdata = '<div class="adminlink"><a href="../files/index.php?id='.$site->id.'">'.get_string('sitefiles').
'</a> - <span class="explanation">'.get_string('adminhelpsitefiles').'</span></div>';
$miscdata .= '<div class="adminlink"><a href="stickyblocks.php">'.get_string('stickyblocks','admin').
'</a> - <span class="explanation">'.get_string('adminhelpstickyblocks').'</span></div>';
$miscdata .= '<div class="adminlink"><a href="report.php">'.get_string('reports').
'</a> - <span class="explanation">'.get_string('adminhelpreports').'</span></div>';
//to be enabled later
/* $miscdata .= '<div class="adminlink"><a href="health.php">'.get_string('healthcenter').
'</a> - <span class="explanation">'.get_string('adminhelphealthcenter').'</span></div>';*/
$miscdata .= '<div class="adminlink"><a href="environment.php">'.get_string('environment', 'admin').
'</a> - <span class="explanation">'.get_string('adminhelpenvironment').'</span></div>';
/// Optional stuff
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>",
"<font size=\"+1\">&nbsp;</font>".get_string("adminhelpmanagedatabase"));
$miscdata .= '<div class="adminlink"><a href="'.$CFG->dbtype.'/frame.php">'.get_string('managedatabase').
'</a> - <span class="explanation">'.get_string('adminhelpmanagedatabase').'</span></div>';
}
$table->data[] = array('<strong><a href="misc.php">'.get_string('miscellaneous').'</a></strong>', $miscdata);
/// Hooks for Matt Oquists contrib code for repositories and portfolio.
/// The eventual official versions may not look like this
if (isset($CFG->portfolio) && file_exists("$CFG->dirroot/$CFG->portfolio")) {
$table->data[] = array("<strong><a href=\"../portfolio/\">".get_string('portfolio','portfolio').'</a></
trong>',
'<div class="explanation">'.get_string('adminhelpportfolio','portfolio').'</div>');
}
if (isset($CFG->repo) && file_exists("$CFG->dirroot/$CFG->repo")) {
$table->data[] = array("<strong><a href=\"../repository/?repoid=1&action=list\">".get_string('repository','
epository').'</a></strong>',
'<div class="explanation">'.get_string('adminhelprepository','repository').'</div>');
}
print_table($table);
//////////////////////////////////////////////////////////////////////////////////////////////////
//// 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; 1999 onwards by Martin Dougiamas<br />".
"<a href=\"../doc/?frame=licence.html\">GNU Public License</a>";
echo "<center><p><font size=\"1\">$copyrighttext</font></p></center>";
$copyrighttext = '<a href="http://moodle.org/">Moodle</a> '.
'<a href="http://docs.moodle.org/en/Release">'.$CFG->release.'</a> ('.$CFG->version.')<br />'.
'Copyright &copy; 1999 onwards, Martin Dougiamas<br />'.
'<a href="http://docs.moodle.org/en/License">GNU Public License</a>';
echo '<p class="copyright">'.$copyrighttext.'</p>';
//////////////////////////////////////////////////////////////////////////////////////////////////
echo '<table width="100%" cellspacing="0"><tr>';
echo '<td align="center" width="33%">';
print_single_button($CFG->wwwroot.'/doc/', NULL, get_string('documentation'));
echo '</td>';
echo '<td align="center" width="33%">';
print_single_button('phpinfo.php', NULL, get_string('phpinfo'));
echo '</td>';
echo '<td align="center" width="33%">';
echo '<div align="center">';
$options = array();
$options['sesskey'] = $USER->sesskey;
print_single_button('register.php', $options, get_string('registration'));
echo '</td></tr></table>';
echo '</div>';
print_simple_box_end();
if (optional_param('dbmigrate')) { // ??? Is this actually used?
print_simple_box_start('center','60%');
require_once($CFG->dirroot.'/admin/utfdbmigrate.php');
db_migrate2utf8();
print_simple_box_end();
}
print_footer($site);
?>
+5 -3
View File
@@ -1,6 +1,8 @@
<?php
include('../config.php');
require_once('../config.php');
$confirm = optional_param('confirm', 0, PARAM_BOOL);
require_login();
@@ -12,7 +14,7 @@
"Convert all tables from MYISAM to InnoDB");
if (!empty($confirm) and confirm_sesskey()) {
if ($confirm and confirm_sesskey()) {
print_heading("Please be patient and wait for this to complete...");
@@ -24,7 +26,7 @@
}
} else {
notice_yesno("Are you sure you want convert all your tables to the InnoDB format?",
"innodb.php?confirm=yes&sesskey=".sesskey(), "index.php");
"innodb.php?confirm=1&sesskey=".sesskey(), "index.php");
}
?>
+431 -130
View File
@@ -1,9 +1,59 @@
<?PHP // $Id$
/**
* Display the admin/language menu and process strings translation.
*
* CHANGES
*
* 2006/06/08 mudrd8mz
* 1) Fixed bug 5745 reported by Harry Smith so now can edit en_utf8_local pack
* 2) More notification messages included
*
* 2006/05/30 mudrd8mz
* Merged with version by Mitsuhiro Yoshida - display icon links instead of text links
* (I have changed the position of arrow icons to not to be so close each other)
*
* 2006/05/19 mudrd8mz
* A lot of changes to support translation of *_utf8_local langugage packs. Needs testing
*
* 2006/05/16 mudrd8mz
* 1) LANG_DEFAULT_FILE can be now set. moodle.php used to be opened automatically.
* As it was (and still is) one of the biggest files it usually took a long time to load the page
* even if you just want to choose the file to translate.
* 2) added links from "missing" to "compare" mode page
* 3) english strings are now key-sorted in "missing" mode
* 4) list of files with missing strings is now displayed at the top of "missing" page
*
* 2006/05/14 mudrd8mz Improvements of lang.php,v 1.65 2006/04/10 22:15:57 stronk7 Exp
* 1) "go to first missing string" link can be displayed (see LANG_DISPLAY_MISSING_LINKS)
* 2) "go to next missing" link can be displayed (see LANG_DISPLAY_MISSING_LINKS)
* 3) submit button may be repeated (see LANG_SUBMIT_REPEAT*)
* 4) added (empty) "summary" attribute for the <table>'s
* 5) added error_reporting(E_ALL ^ E_NOTICE); in "compare" mode (even in debug environment
* we know that missing keys are missing strings here, not bugs ;-)
*/
require_once("../config.php");
require_once('../config.php');
$mode = optional_param('mode', '', PARAM_ALPHA);
$currentfile = optional_param('currentfile', 'moodle.php', PARAM_FILE);
define('LANG_SUBMIT_REPEAT', 1); // repeat displaying submit button?
define('LANG_SUBMIT_REPEAT_EVERY', 20); // if so, after how many lines?
define('LANG_DISPLAY_MISSING_LINKS', 1); // display "go to first/next missing string" links?
define('LANG_DEFAULT_FILE', ''); // default file to translate. Empty allowed
define('LANG_LINK_MISSING_STRINGS', 1); // create links from "missing" page to "compare" page?
define('LANG_DEFAULT_USELOCAL', 0); // should *_utf8_local be used by default?
$mode = optional_param('mode', '', PARAM_ALPHA);
$currentfile = optional_param('currentfile', LANG_DEFAULT_FILE, PARAM_FILE);
$uselocal = optional_param('uselocal', -1, PARAM_INT);
if ($uselocal == -1) {
if (isset($SESSION->langtranslateintolocal)) {
$uselocal = $SESSION->langtranslateintolocal;
} else {
$uselocal = LANG_DEFAULT_USELOCAL;
}
} else {
$SESSION->langtranslateintolocal = $uselocal;
}
require_login();
@@ -23,9 +73,30 @@
$streditstrings = get_string("editstrings", 'admin');
$stredithelpdocs = get_string("edithelpdocs", 'admin');
$strthislanguage = get_string("thislanguage");
$strgotofirst = get_string('gotofirstmissing','admin');
$strfilestoredin = get_string('langstorein', 'admin');
$strfilestoredinhelp = get_string('langstoreinhelp', 'admin');
$strswitchlangdirbtn = get_string('langstoreswitch', 'admin');
$strchoosefiletoedit = get_string('langchoosefile', 'admin');
$streditennotallowed = get_string('langnoeditenglish', 'admin');
$strfilecreated = get_string('langfilecreated', 'admin');
// FIXME / TODO
// remove following lines after adding string into proper english lang pack
$strgotofirst = 'go to first missing string';
$strfilestoredin = 'Save file into folder :';
$strfilestoredinhelp = 'Where the file will be stored';
$strswitchlangdirbtn = 'switch';
$strchoosefiletoedit = 'Choose file to edit from the box above';
$streditennotallowed = 'Language en_utf8 cannot be edited with this page - switch to local';
$strfilecreated = 'New file created';
$currentlang = current_language();
switch ($mode) {
case "missing":
// Missing array keys are not bugs here but missing strings
error_reporting(E_ALL ^ E_NOTICE);
$navigation = "<a href=\"lang.php\">$strlanguage</a> -> $strmissingstrings";
$title = $strmissingstrings;
$button = '<form target="'.$CFG->framename.'" method="get" action="'.$CFG->wwwroot.'/'.$CFG->admin.'/lang.php">'.
@@ -46,7 +117,6 @@
break;
}
$currentlang = current_language();
print_header("$site->shortname: $title", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> ".
@@ -54,75 +124,129 @@
'', '', true, $button);
if (!$mode) {
print_simple_box_start('center','80%');
echo '<table summary="" align="center" width="100%"><tr><td width="50%" align="center">';
print_string('managelang','admin');
echo '</td><td align="center" width="50%">';
print_string('editlang','admin');
echo '</td></tr><tr><td>';
print_string('lang16notify','admin');
echo '<p /><a href="langimport.php">'.get_string('langimport','admin').'</a>';
echo '</td><td>';
$currlang = current_language();
$langs = get_list_of_languages();
echo "<table align=\"center\"><tr><td align=\"right\">";
echo "<table summary=\"\" align=\"center\"><tr><td align=\"right\">";
echo "<b>$strcurrentlanguage:</b>";
echo "</td><td>";
echo popup_form ("$CFG->wwwroot/$CFG->admin/lang.php?lang=", $langs, "chooselang", $currlang, "", "", "", true);
echo '</td></tr><tr><td colspan="2">';
$options["lang"] = $currentlang;
print_single_button("http://moodle.org/download/lang/", $options, get_string("latestlanguagepack"));
//print_single_button("http://moodle.org/download/lang/", $options, get_string("latestlanguagepack"));
echo "</td></tr></table>";
print_heading("<a href=\"lang.php?mode=missing\">$strmissingstrings</a>");
print_heading("<a href=\"lang.php?mode=compare\">$streditstrings</a>");
print_heading("<a href=\"langdoc.php\">$stredithelpdocs</a>");
echo '</td></tr></table>';
print_simple_box_end();
print_footer();
exit;
}
// Get a list of all the root files in the English directory
$langdir = "$CFG->dirroot/lang/$currentlang";
$enlangdir = "$CFG->dirroot/lang/en";
$enlangdir = "$CFG->dirroot/lang/en_utf8";
if ($currentlang == 'en_utf8') {
$langdir = $enlangdir;
} else {
$langdir = "$CFG->dataroot/lang/$currentlang";
}
$locallangdir = "$CFG->dataroot/lang/{$currentlang}_local";
if (! $stringfiles = get_directory_list($enlangdir, "", false)) {
error("Could not find English language pack!");
}
foreach ($stringfiles as $key => $file) {
if (substr($file, -4) != ".php") {
if (substr($file, -4) != ".php") { //Avoid non php files to be showed
unset($stringfiles[$key]);
}
if ($file == "langconfig.php") { //Avoid langconfig.php to be showed
unset($stringfiles[$key]);
}
}
if ($mode == "missing") {
if (!file_exists($langdir)) {
error ('to edit this language pack, you need to put it in '.$CFG->dataroot.'/lang');
}
// Following variables store the HTML output to be echo-ed
$m = '';
$o = '';
// For each file, check that a counterpart exists, then check all the strings
foreach ($stringfiles as $file) {
unset($string);
include("$enlangdir/$file");
$enstring = $string;
ksort($enstring);
unset($string);
if (file_exists("$langdir/$file")) {
include("$langdir/$file");
$fileismissing = 0;
} else {
notify(get_string("filemissing", "", "$langdir/$file"));
$fileismissing = 1;
// notify(get_string("filemissing", "", "$langdir/$file"));
$o .= '<div class="notifyproblem" align="center">'.get_string("filemissing", "", "$langdir/$file").'</div><br />';
$string = array();
}
$missingcounter = 0;
$first = true;
foreach ($enstring as $key => $value) {
if (empty($string[$key])) {
if (empty($string[$key]) and $string[$key] != "0") { //bug fix 4735 mits
$value = htmlspecialchars($value);
$value = str_replace("$"."a", "\\$"."a", $value);
$value = str_replace("%%","%",$value);
if ($first) {
echo "<p><b>".get_string("stringsnotset","","$langdir/$file")."</b></p><pre>";
$m .= "<a href=\"lang.php?mode=missing#$file\">$file";
$m .= $fileismissing ? '*' : '';
$m .= '</a> &nbsp; ';
$o .= "<p><a name=\"$file\"></a><b>".get_string("stringsnotset","","$langdir/$file")."</b></p><pre>";
$first = false;
$somethingfound = true;
}
echo "$"."string['$key'] = \"$value\";<br />";
$missingcounter++;
if (LANG_LINK_MISSING_STRINGS) {
$missinglinkstart = "<a href=\"lang.php?mode=compare&amp;currentfile=$file#missing$missingcounter\">";
$missinglinkend = '</a>';
} else {
$missinglinkstart = '';
$missinglinkend = '';
}
$o .= "$"."string['".$missinglinkstart.$key.$missinglinkend."'] = \"$value\";<br />";
}
}
if (!$first) {
echo '</pre><hr />';
$o .= '</pre><hr />';
}
}
if (! $files = get_directory_list("$CFG->dirroot/lang/en/help", "CVS")) {
if ($m <> '') {
echo '<br />';
print_simple_box_start("center", "80%");
echo '<center><font size="2">';
echo $m;
echo '</font></center>';
print_simple_box_end();
}
echo $o;
if (! $files = get_directory_list("$CFG->dirroot/lang/en_utf8/help", "CVS")) {
error("Could not find English language help files!");
}
@@ -134,7 +258,7 @@
}
}
if (! $files = get_directory_list("$CFG->dirroot/lang/en/docs", "CVS")) {
if (! $files = get_directory_list("$CFG->dirroot/lang/en_utf8/docs", "CVS")) {
error("Could not find English language docs files!");
}
foreach ($files as $filekey => $file) { // check all the docs files.
@@ -152,19 +276,61 @@
}
} else if ($mode == "compare") {
if (!$uselocal && !file_exists($langdir)) {
if (!lang_make_directory($langdir)) {
error('ERROR: Could not create directory '.$langdir);
} else {
echo '<div class="notifysuccess" align="center">Created directory '.
$langdir .'</div>'."<br />\n";
}
}
if ($uselocal && !file_exists($locallangdir)) {
if (!lang_make_directory($locallangdir)) {
echo '<div class="notifyproblem" align="center">ERROR: Could not create directory '.
$locallangdir .'</div>'."<br />\n";
$uselocal = 0;
} else {
echo '<div class="notifysuccess" align="center">Created directory '.
$locallangdir .'</div>'."<br />\n";
}
}
if (isset($_POST['currentfile'])){ // Save a file
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
}
$newstrings = $_POST;
unset($newstrings['currentfile']);
if (lang_save_file($langdir, $currentfile, $newstrings)) {
notify(get_string("changessaved")." ($langdir/$currentfile)", "green");
} else {
error("Could not save the file '$currentfile'!", "lang.php?mode=compare&amp;currentfile=$currentfile");
$newstrings = array();
foreach ($_POST as $postkey => $postval) {
$stringkey = lang_file_string_key($postkey);
$newstrings[$stringkey] = $postval;
}
}
unset($newstrings['currentfile']);
if ($uselocal) {
include("$langdir/$currentfile");
if (isset($string)) {
$packstring = $string;
} else {
$packstring = array();
}
unset($string);
$saveinto = $locallangdir;
} else {
$packstring = array();
$saveinto = $langdir;
}
if (lang_save_file($saveinto, $currentfile, $newstrings, $uselocal, $packstring)) {
notify(get_string("changessaved")." ($saveinto/$currentfile)", "green");
} else {
error("Could not save the file '$saveinto/$currentfile'!", "lang.php?mode=compare&amp;currentfile=$currentfile");
}
unset($packstring);
}
print_heading_with_help($streditstrings, "langedit");
@@ -180,131 +346,213 @@
echo '</font></center>';
print_simple_box_end();
print_simple_box_start("center", "80%");
echo '<center>'.$strfilestoredin.' <strong>';
echo $uselocal ? "{$currentlang}_local" : $currentlang;
echo '</strong> ';
helpbutton('langswitchstorage', $strfilestoredinhelp, 'moodle');
print_heading("$currentfile", "center", 4);
if (!file_exists("$langdir/$currentfile")) {
if (!touch("$langdir/$currentfile")) {
echo "<p><font color=\"red\">".get_string("filemissing", "", "$langdir/$currentfile")."</font></p>";
continue;
echo '<form target="'.$CFG->framename.'" method="get" action="'.$CFG->wwwroot.'/'.$CFG->admin.'/lang.php">'.
'<input type="hidden" name="mode" value="compare" />'.
'<input type="hidden" name="currentfile" value="'.$currentfile.'" />'.
'<input type="hidden" name="uselocal" value="'.(1 - $uselocal % 2).'" />'.
'<input type="submit" value="'.$strswitchlangdirbtn.'" />'.
'</form></center>';
print_simple_box_end();
if ($currentfile <> '') {
$saveto = $uselocal ? $locallangdir : $langdir;
error_reporting(0);
if (!file_exists("$saveto/$currentfile")) {
if (!@touch("$saveto/$currentfile")) {
print_heading(get_string("filemissing", "", "$saveto/$currentfile"), "center", 4, "error");
} else {
print_heading($strfilecreated, "center", 4, "notifysuccess");
}
}
if ($currentlang == "en_utf8" && !$uselocal) {
$editable = false;
print_heading($streditennotallowed, 'center', 4);
} elseif ($f = fopen("$saveto/$currentfile","r+")) {
$editable = true;
fclose($f);
} else {
$editable = false;
echo "<p><font size=\"1\">".get_string("makeeditable", "", "$saveto/$currentfile")."</font></p>";
}
error_reporting($CFG->debug);
print_heading("$currentfile", "center", 4);
if (LANG_DISPLAY_MISSING_LINKS && $editable) {
print_heading('<a href="#missing1">'.$strgotofirst.'</a>', "center", 4);
}
}
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;
if ($currentlang != 'en' and $currentfile == 'moodle.php') {
$enstring['thislanguage'] = "<< TRANSLATORS: Specify the name of your language here. If possible use Unicode Numeric Character References >>";
$enstring['thischarset'] = "<< TRANSLATORS: Specify the character set of your language here. Note that all text created while this language is active will be stored using this character set, so don't change it once you have set it. Example: iso-8859-1 >>";
$enstring['thisdirection'] = "<< TRANSLATORS: This string specifies the direction of your text, either left-to-right or right-to-left. Insert either 'ltr' or 'rtl' here. >>";
$enstring['parentlanguage'] = "<< TRANSLATORS: If your language has a Parent Language that Moodle should use when strings are missing from your language pack, then specify the code for it here. If you leave this blank then English will be used. Example: nl >>";
}
ksort($enstring);
unset($string);
unset($string);
include("$enlangdir/$currentfile");
$enstring = $string;
if ($currentlang != 'en' and $currentfile == 'moodle.php') {
$enstring['thislanguage'] = "<< TRANSLATORS: Specify the name of your language here. If possible use Unicode Numeric Character References >>";
$enstring['thischarset'] = "<< TRANSLATORS: Specify the character set of your language here. Note that all text created while this language is active will be stored using this character set, so don't change it once you have set it. Example: iso-8859-1 >>";
$enstring['thisdirection'] = "<< TRANSLATORS: This string specifies the direction of your text, either left-to-right or right-to-left. Insert either 'ltr' or 'rtl' here. >>";
$enstring['parentlanguage'] = "<< TRANSLATORS: If your language has a Parent Language that Moodle should use when strings are missing from your language pack, then specify the code for it here. If you leave this blank then English will be used. Example: nl >>";
}
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\" class=\"generalbox\">";
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 "\n\n".'<tr>';
echo '<td dir="ltr" lang="en" width="20%" nowrap="nowrap" valign="top">'.$key.'</td>'."\n";
echo '<td dir="ltr" lang="en" width="40%" valign="top">'.$envalue.'</td>'."\n";
$value = $string[$key];
$value = str_replace("\r","",$value); // Bad character caused by Windows
$value = preg_replace("/\n{3,}/", "\n\n", $value); // Collapse runs of blank lines
$value = trim($value, "\n"); // Delete leading/trailing lines
$value = str_replace("\\","",$value); // Delete all slashes
$value = str_replace("%%","%",$value);
$value = str_replace("<","&lt;",$value);
$value = str_replace(">","&gt;",$value);
$value = str_replace('"',"&quot;",$value);
$cellcolour = $value ? '': 'class="highlight"';
@include("$locallangdir/$currentfile");
$localstring = isset($string) ? $string : array();
unset($string);
@include("$langdir/$currentfile");
if ($editable) {
echo '<td width="40%" '.$cellcolour.' valign="top">'."\n";
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="stringXXX'.$key.'" cols="'.$cols.'" rows="'.$rows.'">'.$value.'</textarea>'."\n";
} else {
if ($valuelen) {
$cols = $valuelen + 2;
}
echo '<input type="text" name="stringXXX'.$key.'" value="'.$value.'" size="'.$cols.'" />';
}
echo '</td>';
} else {
echo '<td width="40%" bgcolor="'.$cellcolour.'" valign="top">'.$value.'</td>';
echo "<form name=\"$currentfile\" action=\"lang.php\" method=\"post\">";
}
}
if ($editable) {
echo '<tr><td colspan="2">&nbsp;<td><br />';
echo '<input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />';
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>';
echo "<table summary=\"\" width=\"100%\" cellpadding=\"2\" cellspacing=\"3\" border=\"0\" class=\"generalbox\">";
$linescounter = 0;
$missingcounter = 0;
foreach ($enstring as $key => $envalue) {
$linescounter++ ;
if (LANG_SUBMIT_REPEAT && $editable && $linescounter % LANG_SUBMIT_REPEAT_EVERY == 0) {
echo '<tr><td colspan="2">&nbsp;<td><br />';
echo ' <input type="submit" name="update" value="'.get_string('savechanges').': '.$currentfile.'" />';
echo '<br />&nbsp;</td></tr>';
}
$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 "\n\n".'<tr>';
echo '<td dir="ltr" lang="en" width="20%" nowrap="nowrap" valign="top">'.$key.'</td>'."\n";
echo '<td dir="ltr" lang="en" width="40%" valign="top">'.$envalue.'</td>'."\n";
// Missing array keys are not bugs here but missing strings
error_reporting(E_ALL ^ E_NOTICE);
if ($uselocal) {
$value = lang_fix_value_from_file($localstring[$key]);
$value2 = lang_fix_value_from_file($string[$key]);
if ($value == '') {
$value = $value2;
}
} else {
$value = lang_fix_value_from_file($string[$key]);
$value2 = lang_fix_value_from_file($localstring[$key]);
}
error_reporting($CFG->debug);
// Color highlighting:
// red #ef6868 - translation missing in both system and local pack
// yellow #feff7f - translation missing in system pack but is translated in local
// green #AAFFAA - translation present in both system and local but is different
if (!$value) {
if (!$value2) {
$cellcolour = 'style="background-color: #ef6868"'; // TODO: replace by CSS class
} else {
$cellcolour = 'style="background-color: #feff7f"'; // TODO: replace by CSS class
}
$missingcounter++;
if (LANG_DISPLAY_MISSING_LINKS) {
$missingtarget = '<a name="missing'.$missingcounter.'"></a>';
$missingnext = '<a href="#missing'.($missingcounter+1).'">'.
'<img src="' . $CFG->pixpath . '/t/down.gif" height="11" width="11" border="0" alt="" /></a>';
$missingprev = '<a href="#missing'.($missingcounter-1).'">'.
'<img src="' . $CFG->pixpath . '/t/up.gif" height="11" width="11" border="0" alt="" /></a>';
} else {
$missingtarget = '';
$missingnext = '';
$missingprev = '';
}
} else {
if ($value <> $value2 && $value2 <> '') {
$cellcolour = 'style="background-color: #AAFFAA"'; // TODO: replace by CSS class
} else {
$cellcolour = '';
}
$missingtarget = '';
$missingnext = '';
$missingprev = '';
}
if ($editable) {
echo '<td width="40%" '.$cellcolour.' valign="top">'. $missingprev . $missingtarget."\n";
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="stringXXX'.lang_form_string_key($key).'" cols="'.$cols.'" rows="'.$rows.'">'.$value.'</textarea>'."\n";
} else {
if ($valuelen) {
$cols = $valuelen + 5;
}
echo '<input type="text" name="stringXXX'.lang_form_string_key($key).'" value="'.$value.'" size="'.$cols.'" />';
}
if ($value2 <> '' && $value <> $value2) {
echo '<br /><span style="font-size:small">'.$value2.'</span>';
}
echo $missingnext . '</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="sesskey" value="'.$USER->sesskey.'" />';
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>';
} else {
// no $currentfile specified
print_heading($strchoosefiletoedit, "center", 4);
}
}
print_footer();
//////////////////////////////////////////////////////////////////////
function lang_save_file($path, $file, $strings) {
// Thanks to Petri Asikainen for the original version of code
// used to save language files.
//
// $path is a full pathname to the file
// $file is the file to overwrite.
// $strings is an array of strings to write
/**
* Save language translation file.
*
* Thanks to Petri Asikainen for the original version of code
* used to save language files.
*
* @uses $CFG
* @uses $USER
* @param string $path Full pathname to the directory to use
* @param string $file File to overwrite
* @param array $strings Array of strings to write
* @param bool $local Should *_local version be saved?
* @param array $packstrings Array of default langpack strings (needed if $local)
* @return bool Created successfully?
*/
function lang_save_file($path, $file, $strings, $local, $packstrings) {
global $CFG, $USER;
error_reporting(0);
if (!$f = fopen("$path/$file","w")) {
if (!$f = @fopen("$path/$file","w")) {
return false;
}
error_reporting(7);
fwrite($f, "<?PHP // \$Id\$ \n");
fwrite($f, " // $file - created with Moodle $CFG->release ($CFG->version)\n\n\n");
fwrite($f, " // $file - created with Moodle $CFG->release ($CFG->version)\n");
if ($local) {
fwrite($f, " // local modifications from $CFG->wwwroot\n");
}
fwrite($f, "\n\n");
ksort($strings);
foreach ($strings as $key => $value) {
list($id, $stringname) = explode('XXX',$key);
@list($id, $stringname) = explode('XXX',$key);
if ($CFG->lang != "zh_hk" and $CFG->lang != "zh_tw") { // Some MB languages include backslash bytes
$value = str_replace("\\","",$value); // Delete all slashes
}
@@ -312,14 +560,67 @@ function lang_save_file($path, $file, $strings) {
$value = str_replace('"', "\\\"", $value); // Add slashes for "
$value = str_replace("%","%%",$value); // Escape % characters
$value = str_replace("\r", "",$value); // Remove linefeed characters
$value = trim($value); // Delete leading/trailing white space
if ($id == "string" and $value != ""){
fwrite($f,"\$string['$stringname'] = '$value';\n");
if ((!$local) || (lang_fix_value_from_file($packstrings[$stringname]) <> lang_fix_value_from_file($value))) {
fwrite($f,"\$string['$stringname'] = '$value';\n");
}
}
}
fwrite($f,"\n?>\n");
fclose($f);
return true;
}
/**
* Fix value of string to translate.
*
* @param string $value Original string from the file
* @return string Fixed value
*/
function lang_fix_value_from_file($value='') {
$value = str_replace("\r","",$value); // Bad character caused by Windows
$value = preg_replace("/\n{3,}/", "\n\n", $value); // Collapse runs of blank lines
$value = trim($value); // Delete leading/trailing white space
$value = str_replace("\\","",$value); // Delete all slashes
$value = str_replace("%%","%",$value);
$value = str_replace("<","&lt;",$value);
$value = str_replace(">","&gt;",$value);
$value = str_replace('"',"&quot;",$value);
return $value;
}
/**
* Try and create a new language directory.
*
* @uses $CFG
* @param string $directory directory name under $CFG->dataroot/lang eg cs_utf8_local
* @return string|false Returns full path to directory if successful, false if not
*/
function lang_make_directory($dir, $shownotices=true) {
global $CFG;
umask(0000);
if (! file_exists($dir)) {
if (! @mkdir($dir, $CFG->directorypermissions)) {
return false;
}
//@chmod($dir, $CFG->directorypermissions); // Just in case mkdir didn't do it
}
return $dir;
}
/// Following functions are required because '.' in form input names
/// get replaced by '_' by PHP.
function lang_form_string_key($keyfromfile) {
return str_replace('.', '##46#', $keyfromfile); /// Derived from &#46, the ascii value for a period.
}
function lang_file_string_key($keyfromform) {
return str_replace('##46#', '.', $keyfromform);
}
?>
+35 -14
View File
@@ -9,6 +9,7 @@ Based on: lang.php in 1.4.3+ release
Thanks: Jaime Villate for important bug fixing, koen roggemans for his job and all moodlers
for intensive testing of this my first contribution
*/
require_once('../config.php');
//
// Some local configuration
@@ -21,8 +22,6 @@ Thanks: Jaime Villate for important bug fixing, koen roggemans for his job a
// or to filenames with filesize() == 0
$filetemplate = ''; // template for new files, i.e. '$Id$';
require_once("../config.php");
$currentfile = optional_param('currentfile', 'docs/README.txt', PARAM_PATH);
require_login();
@@ -49,9 +48,13 @@ Thanks: Jaime Villate for important bug fixing, koen roggemans for his job a
'choosefile.popup', '', true);
$currentlang = current_language();
$langdir = "$CFG->dirroot/lang/$currentlang";
$enlangdir = "$CFG->dirroot/lang/en";
$langdir = "$CFG->dataroot/lang/$currentlang";
$enlangdir = "$CFG->dirroot/lang/en_utf8";
if (!file_exists($langdir)) {
error ('to edit this language pack, you need to put it in '.$CFG->dataroot.'/lang');
}
// Shall I save POSTed data?
if (isset($_POST['currentfile'])) {
@@ -70,7 +73,7 @@ Thanks: Jaime Villate for important bug fixing, koen roggemans for his job a
// Get all files from /docs directory
if (! $files = get_directory_list("$CFG->dirroot/lang/en/docs", "CVS")) {
if (! $files = get_directory_list("$CFG->dirroot/lang/en_utf8/docs", "CVS")) {
error("Could not find English language docs files!");
}
@@ -82,7 +85,7 @@ Thanks: Jaime Villate for important bug fixing, koen roggemans for his job a
if (( !file_exists("$langdir/docs/$file")) || (filesize("$langdir/docs/$file") == 0)) {
$options["docs/$file"] .= "$filemissingmark";
} else {
if (filemtime("$langdir/docs/$file") < filemtime("$CFG->dirroot/lang/en/docs/$file")) {
if (filemtime("$langdir/docs/$file") < filemtime("$CFG->dirroot/lang/en_utf8/docs/$file")) {
$options["docs/$file"] .= "$fileoldmark";
}
}
@@ -90,13 +93,13 @@ Thanks: Jaime Villate for important bug fixing, koen roggemans for his job a
// Get all files from /help directory
if (! $files = get_directory_list("$CFG->dirroot/lang/en/help", "CVS")) {
if (! $files = get_directory_list("$CFG->dirroot/lang/en_utf8/help", "CVS")) {
error("Could not find English language help files!");
}
foreach ($files as $filekey => $file) { // check all the help files.
$options["help/$file"] = "help/$file";
if (( !file_exists("$langdir/help/$file")) || (filesize("$CFG->dirroot/lang/en/help/$file") == 0)) {
if (( !file_exists("$langdir/help/$file")) || (filesize("$CFG->dirroot/lang/en_utf8/help/$file") == 0)) {
$options["help/$file"] .= "$filemissingmark";
} else {
if (filemtime("$langdir/help/$file") < filemtime("$langdir/help/$file")) {
@@ -158,11 +161,17 @@ $langdir/$currentfile")."</font></p>";
."</font></p>";
}
//en_utf8 in dataroot is not editable
if ($currentlang == 'en_utf8') {
$editable = false;
}
echo "<table align=\"center\"><tr valign=\"center\"><td align=\"center\">\n";
echo "<textarea rows=\"$fileeditorrows\" cols=\"$fileeditorcols\" name=\"\">\n";
echo htmlspecialchars(file_get_contents("$enlangdir/$currentfile"));
echo "</textarea>\n";
link_to_popup_window("/lang/en/$currentfile", "popup", get_string("preview"));
//link_to_popup_window("/lang/en_utf8/$currentfile", "popup", get_string("preview"));
link_to_popup_window(help_preview_url($currentfile).'&amp;forcelang=en_utf8', 'popup', get_string('preview'));
echo "</td>\n";
if ($fileeditorinline == 1) {
echo "</tr>\n<tr valign=\"center\">\n";
@@ -176,15 +185,13 @@ $langdir/$currentfile")."</font></p>";
}
echo "<textarea rows=\"$fileeditorrows\" cols=\"$fileeditorcols\" name=\"filedata\">\n";
if (file_exists("$langdir/$currentfile")) {
echo htmlspecialchars(file_get_contents("$langdir/$currentfile"));
echo htmlspecialchars(file_get_contents("$langdir/$currentfile"));
} else {
echo ($filetemplate);
}
echo "</textarea>\n";
link_to_popup_window("/lang/$currentlang/$currentfile", "popup", get_string("preview"));
link_to_popup_window(help_preview_url($currentfile), 'popup', get_string('preview'));
echo "</td>\n</tr>\n</table>";
if ($editable) {
@@ -233,4 +240,18 @@ function langdoc_save_file($path, $file, $content) {
return true;
}
?>
function help_preview_url($currentfile) {
if (substr($currentfile, 0, 5) == 'help/') {
$currentfile = substr($currentfile, 5);
}
$currentpathexp = explode('/', $currentfile);
if (count($currentpathexp) > 1) {
$url = '/help.php?module='.$currentpathexp[0].'&amp;file='.$currentpathexp[1];
} else {
$url = '/help.php?module=moodle&amp;file='.$currentfile;
}
return $url;
}
?>
+424
View File
@@ -0,0 +1,424 @@
<?php //$Id$
///This file only manages the installation of 1.6 lang packs.
///in downloads.moodle.org, they are store in separate directory /lang16
///in local server, they are stored in $CFG->dataroot/lang
///This helps to avoid confusion.
require_once('../config.php');
$mode = optional_param('mode', 0, PARAM_INT); //phase
$pack = optional_param('pack', '', PARAM_FILE); //pack to install
$displaylang = $pack;
$uninstalllang = optional_param('uninstalllang', '', PARAM_FILE);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$sitelang = optional_param('sitelangconfig', '', PARAM_FILE);
define('INSTALLATION_OF_SELECTED_LANG', 2);
define('CHANGE_SITE_LANG', 3);
define('DELETION_OF_SELECTED_LANG', 4);
define('UPDATE_ALL_LANG', 5);
require_login();
if (!isadmin()) {
error('You must be an admin');
}
if (!$site = get_site()) {
error("Site not defined!");
}
$strlang = get_string('langimport','admin');
$stradministration = get_string("administration");
$strconfiguration = get_string("configuration");
$strlanguage = get_string("language");
$strthislanguage = get_string("thislanguage");
$title = $strlang;
print_header("$site->shortname: $title", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> -> ".
"<a href=\"lang.php\">$strlanguage</a> -> $strlang",
'', '', true, '');
print_heading('');
switch ($mode){
case INSTALLATION_OF_SELECTED_LANG: ///installation of selected language pack
if (confirm_sesskey()) {
@mkdir ($CFG->dataroot.'/temp/'); //make it in case it's a fresh install, it might not be there
@mkdir ($CFG->dataroot.'/lang/');
require_once($CFG->libdir.'/componentlib.class.php');
if ($cd = new component_installer('http://download.moodle.org', 'lang16',
$pack.'.zip', 'languages.md5', 'lang')) {
$status = $cd->install(); //returns ERROR | UPTODATE | INSTALLED
switch ($status) {
case ERROR:
if ($cd->get_error() == 'remotedownloadnotallowed') {
$a = new stdClass();
$a->url = 'http://download.moodle.org/lang16/'.$pack.'zip';
$a->dest= $CFG->dataroot.'/lang';
error(get_string($cd->get_error(), 'error', $a));
} else {
error(get_string($cd->get_error(), 'error'));
}
break;
case INSTALLED:
@unlink($CFG->dataroot.'/cache/languages');
redirect('langimport.php', get_string('langpackupdated','admin',$pack));
break;
case UPTODATE:
break;
}
} else {
notify('Had an unspecified error with the component installer, sorry.');
}
}
break;
case CHANGE_SITE_LANG: //change site language
if (confirm_sesskey()) {
$langconfig = get_record('config','name','lang');
$langconfig->value = $sitelang;
if (!empty($sitelang) && update_record('config',$langconfig)){
redirect('langimport.php', get_string('sitelangchanged','admin'));
} else {
error('Could not update the default site language!');
}
}
break;
case DELETION_OF_SELECTED_LANG: //delete a directory(ies) containing a lang pack completely
if (!$confirm && confirm_sesskey()) {
notice_yesno(get_string('uninstallconfirm', 'admin', $uninstalllang),
'langimport.php?mode=4&amp;uninstalllang='.$uninstalllang.'&amp;confirm=1&amp;sesskey='.sesskey(),
'langimport.php');
} else if (confirm_sesskey()) {
if ($uninstalllang == 'en_utf8') {
error ('en_utf8 can not be uninstalled!');
}
$dest1 = $CFG->dataroot.'/lang/'.$uninstalllang;
$dest2 = $CFG->dirroot.'/lang/'.$uninstalllang;
$rm1 = false;
$rm2 = false;
if (file_exists($dest1)){
$rm1 = remove_dir($dest1);
}
if (file_exists($dest2)){
$rm2 = remove_dir($dest2);
}
//delete the direcotries
if ($rm1 or $rm2) {
redirect('langimport.php', get_string('langpackremoved','admin'));
} else { //nothing deleted, possibly due to permission error
error('An error has occurred, language pack is not completely uninstalled, please check file permissions');
}
}
@unlink($CFG->dataroot.'/cache/languages');
break;
case UPDATE_ALL_LANG: //1 click update for all updatable language packs
//0th pull a list from download.moodle.org,
//key = langname, value = md5
$source = 'http://download.moodle.org/lang16/languages.md5';
$md5array = array();
$updated = 0; //any packs updated?
unset($CFG->langlist); // ignore admin's langlist
$alllangs = array_keys(get_list_of_languages());
$lang16 = array(); //all the Moodle 1.6 unicode lang packs (updated and not updated)
$packs = array(); //all the packs that needs updating
if (!$availablelangs = proxy_url($source)) {
error ('can not read from course');
}
//and build an associative array
foreach ($availablelangs as $alang) {
$md5array[$alang[0]] = $alang[1];
}
//filtering out non-16 packs
foreach ($alllangs as $clang) {
$dest1 = $CFG->dataroot.'/lang/'.$clang;
$dest2 = $CFG->dirroot.'/lang/'.$clang;
if (file_exists($dest1.'/langconfig.php') || file_exists($dest2.'/langconfig.php')){
$lang16[] = $clang;
}
}
//then filter out packs that have the same md5 key
foreach ($lang16 as $clang) {
if (!is_installed_lang($clang, $md5array[$clang])){
$packs[] = $clang;
}
}
@mkdir ($CFG->dataroot.'/temp/');
@mkdir ($CFG->dataroot.'/lang/');
foreach ($packs as $pack){ //for each of the remaining in the list, we
if ($pack == 'en_utf8') { // no update for en_utf8
continue;
}
//1. delete old director(ies)
$dest1 = $CFG->dataroot.'/lang/'.$pack;
$dest2 = $CFG->dirroot.'/lang/'.$pack;
$rm1 = false;
$rm2 = false;
if (file_exists($dest1)) {
$rm1 = remove_dir($dest1);
}
if (file_exists($dest2)) {
$rm2 = remove_dir($dest2);
}
if (!($rm1 || $rm2)) {
error ('could not delete old directory, update failed');
}
//2. copy & unzip into new
require_once($CFG->libdir.'/componentlib.class.php');
if ($cd = new component_installer('http://download.moodle.org', 'lang16',
$pack.'.zip', 'languages.md5', 'lang')) {
$status = $cd->install(); //returns ERROR | UPTODATE | INSTALLED
switch ($status) {
case ERROR:
if ($cd->get_error() == 'remotedownloadnotallowed') {
$a = new stdClass();
$a->url = 'http://download.moodle.org/lang16/'.$pack.'zip';
$a->dest= $CFG->dataroot.'/lang';
error(get_string($cd->get_error(), 'error', $a));
} else {
error(get_string($cd->get_error(), 'error'));
}
break;
case UPTODATE:
//Print error string or whatever you want to do
break;
case INSTALLED:
notify(get_string('langpackupdated','admin',$pack), 'notifysuccess');
$updated = true;
//Print/do whatever you want
break;
default:
}
} else {
}
}
if ($updated) {
notice(get_string('langupdatecomplete','admin'), 'langimport.php');
} else {
notice(get_string('nolangupdateneeded','admin'), 'langimport.php');
}
break;
default: //display choice mode
$source = 'http://download.moodle.org/lang16/languages.md5';
$remote = 0; //flag for reading from remote or local
if ($availablelangs = proxy_url($source)) {
$remote = 1;
} else {
$availablelangs = get_local_list_of_languages();
}
/*
if ($fp = fopen($source, 'r')){ /// attempt to get the list from Moodle.org.
while(!feof ($fp)) {
$availablelangs[] = split(',', fgets($fp,1024));
}
$remote = 1; //can read from download.moodle.org
} else { /// fopen failed, we find local copy of list.
$availablelangs = get_local_list_of_languages();
}
*/
if (!$remote) {
print_simple_box_start('center','60%');
echo '<div align="center">';
print_string('remotelangnotavailable','admin',$CFG->dataroot.'/lang/');
echo '</div>';
print_simple_box_end();
}
print_simple_box_start('center','60%');
echo '<table width="100%"><tr><td align="center">';
echo get_string('installedlangs','admin');
echo '</td><td align="center">';
echo get_string('availablelangs','admin');
echo '</td></tr>';
echo '<tr><td align="center" valign="top">';
echo '<form name="uninstallform" action="langimport.php?mode=4" method="POST">';
echo '<input name="sesskey" type="hidden" value="'.sesskey().'" />';
unset($CFG->langlist); // ignore admin's langlist
$installedlangs = get_list_of_languages();
/// display installed langs here
echo '<select name="uninstalllang" size="15">';
foreach ($installedlangs as $clang =>$ilang){
echo '<option value="'.$clang.'">'.$ilang.'</option>';
}
echo '</select>';
echo '<br /><input type="submit" value="'.get_string('uninstall','admin').'" />';
echo '</form>';
echo '<form name="updateform" action="langimport.php?mode=5" method="POST">';
echo '<br /><input type="submit" value="'.get_string('updatelangs','admin').'" />';
echo '</form>';
echo '<p />';
/// Display option to change site language
print_string('changesitelang','admin');
$sitelanguage = get_record('config','name','lang');
echo '<form name="changelangform" action="langimport.php?mode=3" method="POST">';
echo '<select name="sitelangconfig">';
foreach ($installedlangs as $clang =>$ilang) {
if ($clang == $sitelanguage->value){
echo '<option value="'.$clang.'" selected="selected">'.$ilang.'</option>';
} else {
echo '<option value="'.$clang.'">'.$ilang.'</option>';
}
}
echo '</select>';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="submit" value="'.get_string('change','admin').'" />';
echo '</form>';
/// display to be installed langs here
echo '</td><td align="center" valign="top">';
echo '<table><tr><td valign="top" align="center">'; //availabe langs table
$empty = 1; //something to pring
/// if this language pack is not already installed, then we allow installation
echo '<form name="installform" method="POST" action="langimport.php?mode=2">';
echo '<input name="sesskey" type="hidden" value="'.sesskey().'" />';
if ($remote) {
echo '<select name="pack" size="15">';
}
foreach ($availablelangs as $alang) {
if (trim($alang[0]) != "en_utf8") {
if ($remote){
if (substr($alang[0], -5) == '_utf8') { //Remove the _utf8 suffix from the lang to show
$shortlang = substr($alang[0], 0, -5);
} else {
$shortlang = $alang[0];
}
if (!is_installed_lang($alang[0], $alang[1])){ //if not already installed
echo '<option value="'.$alang[0].'">'.$alang[2].' ('.$shortlang.')</option>';
}
} else { //print list in local format, and instruction to install
echo '<tr><td>'.$alang[2].'</td><td><a href="http://download.moodle.org/lang16/'.$alang[0].'.zip">'.get_string('download','admin').'</a>';
}
$empty = 0;
}
}
if ($remote) {
echo '</select>';
echo '<br/ ><input type="submit" value="<-- '.get_string('install','admin').'">';
}
echo '</form>';
if ($empty) {
echo '<tr><td align="center">';
print_string('nolanguagetodownload','admin');
echo '</td></tr>';
}
echo '</td><tr></table>'; //close available langs table
echo '<form>';
echo '</td></tr></table>';
print_simple_box_end();
break;
} //close of main switch
print_footer();
/* returns a list of available language packs from a
* local copy shipped with standard moodle distro
* this is for site that can't perform fopen
* @return array
*/
function get_local_list_of_languages() {
global $CFG;
$source = $CFG->wwwroot.'/lib/languages.md5';
$availablelangs = array();
if ($fp = fopen($source, 'r')){
while(!feof ($fp)) {
$availablelangs[] = split(',', fgets($fp,1024));
}
}
return $availablelangs;
}
/* checks the md5 of the zip file, grabbed from download.moodle.org,
* against the md5 of the local language file from last update
* @param string $lang
* @param string $md5check
* @return bool
*/
function is_installed_lang($lang, $md5check) {
global $CFG;
$md5file = $CFG->dataroot.'/lang/'.$lang.'/'.$lang.'.md5';
if (file_exists($md5file)){
return (file_get_contents($md5file) == $md5check);
}
return false;
}
//returns an array of languages, or false if can not read from source
//uses a socket if proxy is set as a config variable
function proxy_url($url) {
global $CFG;
if ($CFG->proxyhost && $CFG->proxyport) {
$proxy_fp = fsockopen($CFG->proxyhost, $CFG->proxyport);
if (!$proxy_fp) {
return false; //failed
}
fputs($proxy_fp, "GET $url HTTP/1.0\r\nHost: $CFG->proxyhost\r\n\r\n");
$i = 0;
while(!feof($proxy_fp)) {
$string = fgets($proxy_fp, 1024);
if ($i > 11) { //12 lines of info skipped
$availablelangs[] = split(',', $string);
}
$i++;
}
fclose($proxy_fp);
} else { //proxy not in use
if ($fp = fopen($url, 'r')){ /// attempt to get the list from Moodle.org.
while(!feof ($fp)) {
$availablelangs[] = split(',', fgets($fp,1024));
}
} else { /// fopen failed, return false.
return false;
}
}
return $availablelangs;
}
?>
-1
View File
@@ -4,7 +4,6 @@
require('../config.php');
$action = optional_param('action', '', PARAM_ALPHA);
$sesskey = optional_param('sesskey');
require_login();
+47
View File
@@ -0,0 +1,47 @@
<?php // $Id$
require_once('../config.php');
require_login();
if (!isadmin()) {
error("Only admins can access this page");
}
if (!$site = get_site()) {
redirect("index.php");
}
$stradministration = get_string("administration");
$strmisc = get_string("miscellaneous");
print_header("$site->shortname: $stradministration: $strmisc", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> $strmisc");
print_heading($strmisc);
$table->align = array ("right", "left");
$table->data[] = array('<b><a href="../files/index.php?id='.$site->id.'">'.get_string('sitefiles').'</a></b>',
get_string("adminhelpsitefiles"));
$table->data[] = array('<b><a href="stickyblocks.php">'.get_string('stickyblocks','admin')."</a></b>",
get_string('adminhelpstickyblocks'));
$table->data[] = array('<b><a href="report.php">'.get_string('reports')."</a></b>",
get_string('adminhelpreports'));
// to be enabled later
/* $table->data[] = array('<b><a href="health.php">'.get_string('healthcenter')."</a></b>",
get_string('adminhelphealthcenter'));*/
$table->data[] = array('<b><a href="environment.php">'.get_string('environment', 'admin')."</a></b>",
get_string('adminhelpenvironment'));
if (file_exists("$CFG->dirroot/$CFG->admin/$CFG->dbtype")) {
$table->data[] = array('<b><a href="'.$CFG->dbtype.'/frame.php">'.get_string('managedatabase')."</a></b>",
get_string('adminhelpmanagedatabase'));
}
print_table($table);
print_footer($site);
?>
+15 -8
View File
@@ -1,7 +1,7 @@
<?PHP // $Id$
// module.php - allows admin to edit all local configuration variables for a module
require_once("../config.php");
require_once('../config.php');
require_login();
@@ -16,19 +16,20 @@
/// If data submitted, then process and store.
if ($config = data_submitted()) {
$module = optional_param('module', '', PARAM_SAFEDIR);
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
}
if ($module = optional_param('module', '', PARAM_CLEANFILE)) {
if ($module != '') {
require_once("$CFG->dirroot/mod/$module/lib.php");
// if the config.html contains a hidden form field giving
// the module name then the form does not have to prefix all
// its variable names, we will do it here.
$moduleprefix = $module.'_';
// let the module process the form data if it has to,
// $config is passed to this function by reference
require_once("$CFG->dirroot/mod/$module/lib.php");
$moduleconfig = $module.'_process_options';
if (function_exists($moduleconfig)) {
$moduleconfig($config);
@@ -37,6 +38,9 @@
$moduleprefix = '';
}
unset($config->sesskey);
unset($config->module);
foreach ($config as $name => $value) {
set_config($moduleprefix.$name, $value);
}
@@ -45,15 +49,18 @@
}
/// Otherwise print the form.
$module = required_param('module', '', PARAM_CLEANFILE);
$module = required_param('module', PARAM_SAFEDIR);
require_once("$CFG->dirroot/mod/$module/lib.php");
$stradmin = get_string("administration");
$strconfiguration = get_string("configuration");
$strmanagemodules = get_string("managemodules");
$strmodulename = get_string("modulename", $module);
// $CFG->pagepath is used to generate the body and id attributes for the body tag
// of the page. It is also used to generate the link to the Moodle Docs for this view.
$CFG->pagepath = 'mod/' . $module . '/config';
print_header("$site->shortname: $strmodulename: $strconfiguration", $site->fullname,
"<a href=\"index.php\">$stradmin</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> -> ".
@@ -61,7 +68,7 @@
print_heading($strmodulename);
print_simple_box("<center>".get_string("configwarning", 'admin')."</center>", "center", "50%");
print_simple_box("<center>".get_string("configwarning", 'admin')."</center>", "center", "60%");
echo "<br />";
print_simple_box_start("center", "");
+30 -15
View File
@@ -1,13 +1,13 @@
<?PHP // $Id$
// Allows the admin to create, delete and rename course categories
// Allows the admin to manage activity modules
require_once("../config.php");
require_once("../course/lib.php");
require_once('../config.php');
require_once('../course/lib.php');
optional_variable($disable);
optional_variable($enable);
optional_variable($delete);
optional_variable($confirm);
$show = optional_param('show', '', PARAM_SAFEDIR);
$hide = optional_param('hide', '', PARAM_SAFEDIR);
$delete = optional_param('delete', '', PARAM_SAFEDIR);
$confirm = optional_param('confirm', '', PARAM_BOOL);
require_login();
@@ -39,6 +39,8 @@
print_heading($strmanagemodules);
$coursesaffected = false;
/// If data submitted, then process and store.
@@ -46,25 +48,29 @@
if (!$module = get_record("modules", "name", $hide)) {
error("Module doesn't exist!");
}
set_field("modules", "visible", "0", "id", $module->id); // Hide main module
set_field("course_modules", "visible", "0", "module", $module->id); // Hide all related activity modules
set_field("modules", "visible", "0", "id", $module->id); // Hide main module
set_field('course_modules', 'visibleold', '1', 'visible' ,'1', 'module', $module->id); // Remember the previous visible state so we can toggle this back if the module is unhidden.
set_field('course_modules', 'visibleold', '0', 'visible' ,'0', 'module', $module->id);
set_field("course_modules", "visible", "0", "module", $module->id); // Hide all related activity modules
$coursesaffected = true;
}
if (!empty($show) and confirm_sesskey()) {
if (!$module = get_record("modules", "name", $show)) {
error("Module doesn't exist!");
}
set_field("modules", "visible", "1", "id", $module->id); // Show main module
set_field("course_modules", "visible", "1", "module", $module->id); // Show all related activity modules
set_field("modules", "visible", "1", "id", $module->id); // Show main module
set_field('course_modules', 'visible', '1', 'visibleold', '1', 'module', $module->id); // Get the previous saved visible state for the course module.
$coursesaffected = true;
}
if (!empty($delete) and confirm_sesskey()) {
$strmodulename = get_string("modulename", "$delete");
if (empty($confirm)) {
if (!$confirm) {
notice_yesno(get_string("moduledeleteconfirm", "", $strmodulename),
"modules.php?delete=$delete&amp;confirm=$delete&amp;sesskey=$USER->sesskey",
"modules.php?delete=$delete&amp;confirm=1&amp;sesskey=$USER->sesskey",
"modules.php");
print_footer();
exit;
@@ -121,14 +127,19 @@
}
}
rebuild_course_cache(); // Because things have changed
//rebuild_course_cache(); // Because things have changed
$coursesaffected = true;
$a->module = $strmodulename;
$a->directory = "$CFG->dirroot/mod/$delete";
notice(get_string("moduledeletefiles", "", $a), "modules.php");
}
}
if ($coursesaffected) {
rebuild_course_cache(); // Because things have changed
}
/// Get and sort the existing modules
@@ -138,6 +149,10 @@
foreach ($modules as $module) {
$strmodulename = get_string("modulename", "$module->name");
// Deal with modules which are lacking the language string
if ($strmodulename == '[[modulename]]') {
$strmodulename = $module->name;
}
$modulebyname[$strmodulename] = $module;
}
ksort($modulebyname);
+1 -1
View File
@@ -1,4 +1,4 @@
<?php
<?php // $Id$
if (!isset($CFG)) {
+171
View File
@@ -0,0 +1,171 @@
<?PHP // $Id$
// Allows the admin to manage questiontypes
// This page is adapted from modules.php
// This page is not yet in service, the whole plug-in architecture
// for question types is still under construction.
require_once('../config.php');
$show = optional_param('show', '', PARAM_SAFEDIR);
$hide = optional_param('hide', '', PARAM_SAFEDIR);
$delete = optional_param('delete', '', PARAM_SAFEDIR);
$confirm = optional_param('confirm', '', PARAM_BOOL);
require_login();
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");
$strdelete = get_string("delete");
$strversion = get_string("version");
$strhide = get_string("hide");
$strshow = get_string("show");
$strsettings = get_string("settings");
$strquestions = get_string("questions");
$strquestiontype = get_string("questiontype", 'quiz');
print_header("$site->shortname: $strquestions", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> -> $strquestions");
print_heading($strquestions);
/// If data submitted, then process and store.
if (!empty($hide) and confirm_sesskey()) {
if (!$qtype = get_record("question_types", "name", $hide)) {
error("Question type doesn't exist!");
}
set_field("question_types", "visible", "0", "id", $qtype->id); // Hide question type
}
if (!empty($show) and confirm_sesskey()) {
if (!$qtype = get_record("question_types", "name", $show)) {
error("Question type doesn't exist!");
}
set_field("question_types", "visible", "1", "id", $qtype->id); // Show question type
}
if (!empty($delete) and confirm_sesskey()) {
$strqtypename = get_string("qtypename", "qtype_$delete");
if (!$confirm) {
notice_yesno(get_string("qtypedeleteconfirm", "admin", $strqtypename),
"questiontypes.php?delete=$delete&amp;confirm=1&amp;sesskey=$USER->sesskey",
"questiontypes.php");
print_footer();
exit;
} else { // Delete everything!!
if ($delete == "random") {
error("You can not delete the random question type!!");
}
if (!$qtype = get_record("question_types", "name", $delete)) {
error("Question type doesn't exist!");
}
// OK, first delete all the questions
if ($questions = get_records("quiz_questions", "qtype", $qtype->id)) {
foreach ($questions as $question) {
if (! quiz_delete_question($coursemod->id, $coursemod->section)) {
notify("Could not delete the $strqtypename with id = $question->id");
}
}
}
// And the qtype entry itself
if (!delete_records("question_types", "name", $qtype->name)) {
notify("Error occurred while deleting the $strqtypename record from question_types table");
}
// Then the tables themselves
if ($tables = $db->Metatables()) {
$prefix = $CFG->prefix.$qtype->name;
foreach ($tables as $table) {
if (strpos($table, $prefix) === 0) {
if (!execute_sql("DROP TABLE $table", false)) {
notify("ERROR: while trying to drop table $table");
}
}
}
}
$a->qtype = $strqtypename;
$a->directory = "$CFG->dirroot/qtype/$delete";
notice(get_string("qtypedeletefiles", "", $a), "questiontypes.php");
}
}
/// Get and sort the existing questiontypes
if (!$qtypes = get_records("question_types")) {
error("No question types found!!"); // Should never happen
}
foreach ($qtypes as $qtype) {
$strqtypename = get_string("qtypename", "qtype_$qtype->name");
$qtypebyname[$strqtypename] = $qtype;
}
ksort($qtypebyname);
/// Print the table of all questiontypes
$table->head = array ($strquestiontype, $strquestions, $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 ($qtypebyname as $qtypename => $qtype) {
$icon = "<img src=\"$CFG->dirroot/mod/quiz/questiontypes/$qtype->name/icon.gif\" hspace=\"10\" height=\"16\" width=\"16\" border=\"0\" alt=\"\" />";
if (file_exists("$CFG->dirroot/mod/quiz/questiontypes/$qtype->name/config.html")) {
$settings = "<a href=\"questiontype.php?qtype=$qtype->name\">$strsettings</a>";
} else {
$settings = "";
}
$count = count_records('quiz_questions', 'qtype', $qtype->id);
$delete = $count ? '' : "<a href=\"questiontypes.php?delete=$qtype->name&amp;sesskey=$USER->sesskey\">$strdelete</a>";
if ($qtype->visible) {
$visible = "<a href=\"questiontypes.php?hide=$qtype->name&amp;sesskey=$USER->sesskey\" title=\"$strhide\">".
"<img src=\"$CFG->pixpath/i/hide.gif\" align=\"middle\" height=\"16\" width=\"16\" border=\"0\" alt=\"\" /></a>";
$class = "";
} else {
$visible = "<a href=\"questiontypes.php?show=$qtype->name&amp;sesskey=$USER->sesskey\" title=\"$strshow\">".
"<img src=\"$CFG->pixpath/i/show.gif\" align=\"middle\" height=\"16\" width=\"16\" border=\"0\" alt=\"\" /></a>";
$class = "class=\"dimmed_text\"";
}
if ($qtype->name == "random") {
$delete = "";
$visible = "";
$class = "";
}
$table->data[] = array ("<span $class>$icon $qtypename</span>", $count, $qtype->version, $visible, $delete, $settings);
}
print_table($table);
echo "<br /><br />";
print_footer();
?>
+2 -2
View File
@@ -1,7 +1,7 @@
<?php // $Id$
// register.php - allows admin to register their site on moodle.org
include("../config.php");
require_once('../config.php');
require_login();
@@ -139,7 +139,7 @@
echo "<input type=\"hidden\" name=\"posts\" value=\"$count\">\n";
echo '<br />';
$count = count_records('quiz_questions');
$count = count_records('question');
echo get_string("questions", 'quiz').": ".$count;
echo "<input type=\"hidden\" name=\"questions\" value=\"$count\">\n";
echo '<br />';
+4 -4
View File
@@ -1,10 +1,10 @@
<?php /// $Id$
/// Search and replace strings throughout all texts in the whole database
require('../config.php');
require_once('../config.php');
$search = optional_param('search', '');
$replace = optional_param('replace', '');
$search = optional_param('search', '', PARAM_RAW);
$replace = optional_param('replace', '', PARAM_RAW);
require_login();
@@ -45,7 +45,7 @@ foreach ($tables as $table) {
foreach ($columns as $column => $data) {
if (in_array($data->type, array('text','mediumtext','longtext','varchar'))) { // Text stuff only
$db->debug = true;
execute_sql("UPDATE {$CFG->prefix}$table SET $column = REPLACE($column, '$search', '$replace');");
execute_sql("UPDATE $table SET $column = REPLACE($column, '$search', '$replace');");
$db->debug = false;
}
}
+28
View File
@@ -0,0 +1,28 @@
<?php // $Id$
// Display all the reports available in admin/report
require_once('../config.php');
if (!isadmin()) {
error("You are not allowed to look at this page");
}
$stradmin = get_string('administration');
$strreports = get_string('reports');
$strmisc = get_string('miscellaneous');
print_header($strreports, $strreports,
'<a href="index.php">'.$stradmin.'</a> -> <a href="misc.php">'.$strmisc.'</a> ->'.
$strreports);
$directories = get_list_of_plugins('admin/report');
foreach ($directories as $directory) {
echo '<div class="plugin '.$directory.'">';
include_once($CFG->dirroot.'/admin/report/'.$directory.'/mod.php'); // Fragment for listing
echo '</div>';
}
print_footer();
?>
+111
View File
@@ -0,0 +1,111 @@
<?php
require_once('../../../config.php');
require_once($CFG->dirroot.'/lib/statslib.php');
$report = optional_param('report', STATS_REPORT_ACTIVE_COURSES, PARAM_INT);
$time = optional_param('time', 0, PARAM_INT);
$numcourses = optional_param('numcourses', 20, PARAM_INT);
if (empty($CFG->enablestats)) {
error("Stats is not enabled.");
}
require_login();
if (!isadmin()) {
error("This page is for admins only");
}
$course = get_site();
stats_check_uptodate($course->id);
$strreports = get_string('reports');
$strcourseoverview = get_string('courseoverview');
$strnav = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/index.php">'.get_string('administration').'</a> -> <a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/report.php">'.$strreports.'</a> -> '.$strcourseoverview;
$reportoptions = stats_get_report_options($course->id,STATS_MODE_RANKED);
$tableprefix = $CFG->prefix.'stats_';
$earliestday = get_field_sql('SELECT timeend FROM '.$tableprefix.'daily ORDER BY timeend LIMIT 1');
$earliestweek = get_field_sql('SELECT timeend FROM '.$tableprefix.'weekly ORDER BY timeend LIMIT 1');
$earliestmonth = get_field_sql('SELECT timeend FROM '.$tableprefix.'monthly ORDER BY timeend LIMIT 1');
if (empty($earliestday)) $earliestday = time();
if (empty($earliestweek)) $earliestweek = time();
if (empty($earliestmonth)) $earliestmonth = time();
$now = stats_get_base_daily();
$lastweekend = stats_get_base_weekly();
$lastmonthend = stats_get_base_monthly();
$timeoptions = stats_get_time_options($now,$lastweekend,$lastmonthend,$earliestday,$earliestweek,$earliestmonth);
if (empty($timeoptions)) {
error(get_string('nostatstodisplay'), $CFG->wwwroot.'/course/view.php?id='.$course->id);
}
print_header($strcourseoverview, $strcourseoverview, $strnav,'','',true,'&nbsp');
echo '<form action="index.php" method="post">'."\n";
$table->width = '*';
$table->align = array('left','left','left','left','left','left');
$table->data[] = array(get_string('statsreporttype'),choose_from_menu($reportoptions,'report',$report,'','','',true),
get_string('statstimeperiod'),choose_from_menu($timeoptions,'time',$time,'','','',true),
'<input type="text" name="numcourses" size="3" maxlength="2" value="'.$numcourses.'" />',
'<input type="submit" value="'.get_string('view').'" />') ;
print_table($table);
echo '</form>';
if (!empty($report) && !empty($time)) {
$param = stats_get_parameters($time,$report,SITEID,STATS_MODE_RANKED);
$sql = "SELECT courseid,".$param->fields." FROM ".$CFG->prefix.'stats_'.$param->table
." WHERE timeend >= ".$param->timeafter
." GROUP BY courseid "
.$param->extras
." ORDER BY ".$param->orderby
." LIMIT ".$numcourses;
$courses = get_records_sql($sql);
if (empty($courses)) {
error(get_string('statsnodata'),$CFG->wwwroot.'/'.$CFG->admin.'/report/courseoverview/index.php');
}
echo '<center><img src="'.$CFG->wwwroot.'/'.$CFG->admin.'/report/courseoverview/reportsgraph.php?time='.$time.'&report='.$report.'&numcourses='.$numcourses.'" /></center>';
$table = new object();
$table->align = array('left','center','center','center');
$table->head = array(get_string('course'),$param->line1);
if (!empty($param->line2)) {
$table->head[] = $param->line2;
}
if (!empty($param->line3)) {
$table->head[] = $param->line3;
}
foreach ($courses as $c) {
$a = array();
$a[] = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$c->courseid.'">'.get_field('course','shortname','id',$c->courseid).'</a>';
$a[] = $c->line1;
if (isset($c->line2)) {
$a[] = $c->line2;
}
if (isset($c->line3)) {
$a[] = $c->line3;
}
$table->data[] = $a;
}
print_table($table);
}
print_footer();
?>
+57
View File
@@ -0,0 +1,57 @@
<?php
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
}
if (!empty($CFG->enablestats)) {
$strreports = get_string('reports');
$strcourseoverview = get_string('courseoverview');
print_heading("$strcourseoverview:");
require_once($CFG->dirroot.'/lib/statslib.php');
$report = optional_param('report', STATS_REPORT_ACTIVE_COURSES, PARAM_INT);
$time = optional_param('time', 0, PARAM_INT);
$numcourses = optional_param('numcourses', 20, PARAM_INT);
$course = get_site();
$statsstatus = stats_check_uptodate($course->id);
$reportoptions = stats_get_report_options($course->id,STATS_MODE_RANKED);
$tableprefix = $CFG->prefix.'stats_';
$earliestday = get_field_sql('SELECT timeend FROM '.$tableprefix.'daily ORDER BY timeend LIMIT 1');
$earliestweek = get_field_sql('SELECT timeend FROM '.$tableprefix.'weekly ORDER BY timeend LIMIT 1');
$earliestmonth = get_field_sql('SELECT timeend FROM '.$tableprefix.'monthly ORDER BY timeend LIMIT 1');
if (empty($earliestday)) $earliestday = time();
if (empty($earliestweek)) $earliestweek = time();
if (empty($earliestmonth)) $earliestmonth = time();
$now = stats_get_base_daily();
$lastweekend = stats_get_base_weekly();
$lastmonthend = stats_get_base_monthly();
$timeoptions = stats_get_time_options($now,$lastweekend,$lastmonthend,$earliestday,$earliestweek,$earliestmonth);
$table->width = '*';
$table->align = array('left','left','left','left','left','left');
$table->data[] = array(get_string('statsreporttype'),choose_from_menu($reportoptions,'report',$report,'','','',true),
get_string('statstimeperiod'),choose_from_menu($timeoptions,'time',$time,'','','',true),
'<input type="text" name="numcourses" size="3" maxlength="2" value="'.$numcourses.'" />',
'<input type="submit" value="'.get_string('view').'" />') ;
echo '<form action="report/courseoverview/index.php" method="post">'."\n";
print_table($table);
echo '</form>';
if ($statsstatus !== NULL) {
notify ($statsstatus);
}
}
?>
@@ -0,0 +1,54 @@
<?php // $Id$
require_once('../../../config.php');
require_once($CFG->dirroot.'/lib/statslib.php');
require_once($CFG->dirroot.'/lib/graphlib.php');
$report = required_param('report', PARAM_INT);
$time = required_param('time', PARAM_INT);
$numcourses = required_param('numcourses', PARAM_INT);
require_login();
if (!isadmin()) {
error("You must be an admin to use this page");
}
stats_check_uptodate($course->id);
$param = stats_get_parameters($time,$report,SITEID,STATS_MODE_RANKED);
$sql = "SELECT courseid,".$param->fields." FROM ".$CFG->prefix.'stats_'.$param->table
." WHERE timeend >= ".$param->timeafter
." GROUP BY courseid "
.$param->extras
." ORDER BY ".$param->orderby
." LIMIT ".$numcourses;
$courses = get_records_sql($sql);
if (empty($courses)) {
error(get_string('statsnodata'),$CFG->wwwroot.'/'.$CFG->admin.'/report/course/index.php');
}
$graph = new graph(750,400);
$graph->parameter['legend'] = 'outside-right';
$graph->parameter['legend_size'] = 10;
$graph->parameter['x_axis_angle'] = 90;
$graph->parameter['title'] = false; // moodle will do a nicer job.
if ($report != STATS_REPORT_ACTIVE_COURSES) {
$graph->parameter['y_decimal_left'] = 2;
}
foreach ($courses as $c) {
$graph->x_data[] = get_field('course','shortname','id',$c->courseid);
$graph->y_data['bar1'][] = $c->{$param->graphline};
}
$graph->y_order = array('bar1');
$graph->y_format['bar1'] = array('colour' => 'blue','bar' => 'fill','legend' => $param->{$param->graphline});
$graph->draw_stack();
?>
+23
View File
@@ -0,0 +1,23 @@
<?php
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
}
require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->dirroot.'/course/report/log/lib.php');
$course = get_site();
print_heading(get_string('chooselogs') .':');
print_log_selector_form($course);
echo '<br />';
print_heading(get_string('chooselivelogs') .':');
echo '<center><h3>';
link_to_popup_window('/course/report/log/live.php?id='. $course->id,'livelog', get_string('livelogs'), 500, 800);
echo '</h3></center>';
?>
+63
View File
@@ -0,0 +1,63 @@
<?php // $Id$
require_once('../../../config.php');
require_once($CFG->dirroot.'/lib/statslib.php');
require_once($CFG->dirroot.'/course/report/stats/lib.php');
if (empty($CFG->enablestats)) {
error("Stats is not enabled.");
}
$courseid = required_param('course', PARAM_INT);
$report = optional_param('report', 0, PARAM_INT);
$time = optional_param('time', 0, PARAM_INT);
$mode = optional_param('mode', STATS_MODE_GENERAL, PARAM_INT);
$userid = optional_param('userid', 0, PARAM_INT);
if ($report == STATS_REPORT_USER_LOGINS) {
$courseid = SITEID; //override
}
if ($mode == STATS_MODE_RANKED) {
redirect($CFG->wwwroot.'/'.$CFG->admin.'/report.php?time='.$time);
}
if (!$course = get_record("course","id",$courseid)) {
error("That's an invalid course id");
}
if (!empty($userid)) {
if (!$user = get_record('user','id',$userid)) {
error("That's an invalid user id");
}
}
require_login();
if (!isteacher($course->id)) {
error("You need to be a teacher to use this page");
}
add_to_log($course->id, "course", "report stats", "report/stats/index.php?course=$course->id", $course->id);
stats_check_uptodate($course->id);
$strreports = get_string("reports");
$strstats = get_string('stats');
$menu = report_stats_mode_menu($course, $mode, $time);
$crumb = "<a href=\"{$CFG->wwwroot}/admin\">".get_string('administration')."</a> ->
<a href=\"{$CFG->wwwroot}/admin/report.php\">$strreports</a> ->
$strstats";
print_header("$course->shortname: $strstats", "$course->fullname",
$crumb, '', '', true, '&nbsp', $menu);
require_once($CFG->dirroot.'/course/report/stats/report.php');
print_footer();
?>
+16
View File
@@ -0,0 +1,16 @@
<?php //$Id$
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
}
if (!empty($CFG->enablestats)) {
echo '<p style="text-align:center;">';
echo '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/report/stats/index.php?course='.$course->id.'">'.get_string('stats').'</a>';
echo '</p>';
$statsstatus = stats_check_uptodate($course->id);
if ($statsstatus !== NULL) {
notify ($statsstatus);
}
}
?>
+44 -8
View File
@@ -29,19 +29,55 @@
</tr>
<tr valign="top">
<td align="right"><?php print_string("frontpageformat") ?>:</td>
<td><?php
<td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<?php
$coursecount = (count_records('course') <= FRONTPAGECOURSELIMIT);
$options = array(FRONTPAGENEWS => get_string("frontpagenews"),
FRONTPAGECOURSELIST => get_string("frontpagecourselist"),
FRONTPAGECATEGORYNAMES => get_string("frontpagecategorynames"),
FRONTPAGETOPICONLY => get_string("frontpagetopiconly"));
if (count_records("course") > 200) {
unset($options[1]);
if ($form->frontpage == 1) {
$form->frontpage = 2;
}
FRONTPAGECATEGORYCOMBO => get_string("frontpagecategorycombo"),
);
$values = array(get_string('hide'), get_string('order1', 'admin'), get_string('order2', 'admin'), get_string('order3', 'admin'), get_string('order4', 'admin'));
$seq = array_flip(explode(',',$form->frontpage));
foreach ($seq as $k => $s) {
$seq[$k]++;
}
if (!$coursecount and isset($seq[FRONTPAGECOURSELIST])) {
unset($seq[FRONTPAGECOURSELIST]); //disable course list option when too many course present
}
foreach ($options as $key => $option) {
$disabled = (!$coursecount and ($key == FRONTPAGECOURSELIST));
echo "<td>$option<br />";
choose_from_menu ($values, "frontpage[$key]", isset($seq[$key])?$seq[$key]:0, '', '', 0, false, $disabled);
echo '</td>';
}
choose_from_menu ($options, "frontpage", "$form->frontpage", "");
?>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td align="right"><?php print_string("frontpageformatloggedin") ?>:</td>
<td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<?php
$seq = array_flip(explode(',',$form->frontpageloggedin));
foreach ($seq as $k => $s) {
$seq[$k]++;
}
foreach ($options as $key => $option) {
echo "<td>$option<br />";
choose_from_menu ($values, "frontpageloggedin[$key]", isset($seq[$key])?$seq[$key]:0, '');
echo '</td>';
}
?>
</tr>
</table>
</td>
</tr>
<tr valign="top">
+22 -6
View File
@@ -1,7 +1,7 @@
<?php // $Id$
require_once("../config.php");
require_once("../course/lib.php");
require_once('../config.php');
require_once('../course/lib.php');
if ($site = get_site()) {
require_login();
@@ -11,6 +11,8 @@
$site->format = "social"; // override
}
$focus = "form.fullname";
/// If data submitted, then process and store.
if ($form = data_submitted()) {
@@ -25,11 +27,23 @@
if (count($err) == 0) {
$form->frontpage = array_flip($form->frontpage);
unset($form->frontpage[0]);
$form->frontpage = array_flip($form->frontpage);
asort($form->frontpage);
$form->frontpage = implode(',',array_flip($form->frontpage));
set_config("frontpage", $form->frontpage);
if ($form->frontpage == FRONTPAGETOPICONLY) {
if ($form->frontpage == '') {
$form->numsections = 1; // Force the topic display for this format
}
$form->frontpageloggedin = array_flip($form->frontpageloggedin);
unset($form->frontpageloggedin[0]);
$form->frontpageloggedin = array_flip($form->frontpageloggedin);
asort($form->frontpageloggedin);
$form->frontpageloggedin = implode(',',array_flip($form->frontpageloggedin));
set_config("frontpageloggedin", $form->frontpageloggedin);
$form->timemodified = time();
if ($form->id) {
@@ -91,14 +105,16 @@
if (isset($CFG->frontpage)) {
$form->frontpage = $CFG->frontpage;
} else {
$form->frontpage = FRONTPAGECOURSELIST; // Show course list by default
set_config("frontpage", $form->frontpage);
}
if (empty($focus)) {
$focus = "form.fullname";
if (isset($CFG->frontpageloggedin)) {
$form->frontpageloggedin = $CFG->frontpageloggedin;
} else {
$form->frontpageloggedin = $form->frontpage;
set_config("frontpageloggedin", $form->frontpageloggedin);
}
$stradmin = get_string("administration");
+87
View File
@@ -0,0 +1,87 @@
<?PHP // $Id$
require_once('../config.php');
require_once($CFG->dirroot.'/my/pagelib.php');
require_once($CFG->dirroot.'/lib/pagelib.php');
require_once($CFG->dirroot.'/lib/blocklib.php');
$pt = optional_param('pt', null, PARAM_SAFEDIR); //alhanumeric and -
$pagetypes = array(PAGE_MY_MOODLE => array('id' => PAGE_MY_MOODLE,
'lib' => '/my/pagelib.php',
'name' => get_string('stickyblocksmymoodle','admin')),
PAGE_COURSE_VIEW => array('id' => PAGE_COURSE_VIEW,
'lib' => '/lib/pagelib.php',
'name' => get_string('stickyblockscourseview','admin'))
// ... more?
);
// for choose_from_menu
$options = array();
foreach ($pagetypes as $p) {
$options[$p['id']] = $p['name'];
}
require_login();
if (!isadmin()) {
error("Only the admin can use this page");
}
// first thing to do is print the dropdown menu
$strtitle = get_string('stickyblocks','admin');
$strheading = get_string('adminhelpstickyblocks');
print_header($strtitle,$strtitle,'<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/index.php">'.
get_string('admin').'</a> -> <a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/misc.php">'.
get_string('miscellaneous').'</a> ->'.$strtitle);
echo '<table border="0" cellpadding="3" cellspacing="0" width="100%" id="layout-table">';
echo '<tr valign="top">';
if (!empty($pt)) {
require_once($CFG->dirroot.$pagetypes[$pt]['lib']);
define('ADMIN_STICKYBLOCKS',$pt);
$PAGE = page_create_object($pt);
$blocks = blocks_setup($PAGE,BLOCKS_PINNED_TRUE);
$blocks_preferred_width = bounded_number(180, blocks_preferred_width($blocks[BLOCK_POS_LEFT]), 210);
echo '<td style="vertical-align: top; width: '.$blocks_preferred_width.'px;" id="left-column">';
blocks_print_group($PAGE, $blocks, BLOCK_POS_LEFT);
} else {
echo '<td style="vertical-align: top;" id="left-column">';
}
echo '</td>';
echo '<td valign="top" width="*" id="middle-column">';
print_simple_box_start('center');
print_heading($strheading);
echo '<form method="post" action="'.$CFG->wwwroot.'/'.$CFG->admin.'/stickyblocks.php">'
.'<p align="center">'.get_string('stickyblockspagetype','admin').': ';
choose_from_menu($options,'pt',$pt,'choose','this.form.submit();');
echo '</p></form>';
echo get_string('stickyblocksduplicatenotice','admin');
print_simple_box_end();
echo '</td>';
if (!empty($pt)) {
echo '<td style="vertical-align: top; width: '.$blocks_preferred_width.'px;" id="left-column">';
blocks_print_group($PAGE, $blocks, BLOCK_POS_RIGHT);
}
echo '<td style="vertical-align: top;" id="left-column">';
echo '</td>';
echo '</tr></table>';
print_footer();
?>
+7 -22
View File
@@ -1,6 +1,8 @@
<?php // $Id$
include("../config.php");
require_once('../config.php');
$zone = optional_param('zone', '', PARAM_PATH); //not a path, but it looks like it anyway
require_login();
@@ -17,7 +19,7 @@
print_heading("");
if (isset($zone) and confirm_sesskey()) {
if (!empty($zone) and confirm_sesskey()) {
$db->debug = true;
echo "<center>";
execute_sql("UPDATE {$CFG->prefix}user SET timezone = '$zone'");
@@ -27,29 +29,12 @@
$USER->timezone = $zone;
}
$user = $USER;
if (abs($user->timezone) > 13) {
$user->timezone = 99;
}
$timenow = time();
$timeformat = get_string('strftimedaytime');
for ($tz = -26; $tz <= 26; $tz++) {
$zone = (float)$tz/2.0;
$usertime = $timenow + ($tz * 1800);
if ($tz == 0) {
$timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT)";
} else if ($tz < 0) {
$timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT$zone)";
} else {
$timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT+$zone)";
}
}
require_once($CFG->dirroot.'/calendar/lib.php');
$timezones = get_list_of_timezones();
echo '<center><form action="timezone.php" method="get">';
echo "$strusers ($strall): ";
choose_from_menu ($timezones, "zone", $user->timezone, get_string("serverlocaltime"), "", "99");
choose_from_menu ($timezones, "zone", 99, get_string("serverlocaltime"), "", "99");
echo "<input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\">";
echo "<input type=\"submit\" value=\"$strsavechanges\">";
echo "</form></center>";
+1 -1
View File
@@ -6,7 +6,7 @@
require_once($CFG->libdir.'/filelib.php');
require_once($CFG->libdir.'/olson.php');
$ok = optional_param('ok');
$ok = optional_param('ok', 0, PARAM_BOOL);
require_login();
-35
View File
@@ -1,35 +0,0 @@
<?php
include("../config.php");
$action = optional_param('action','LIST',PARAM_ALPHA);
$url = optional_param('url');
$info = optional_param('info');
if (!isadmin()) {
error("Only the admin can use this page");
}
print_header('Admin : Unchecked Vars' );
if ($action == 'DELETE') {
delete_records('log', 'url', $url, 'info', $info);
}
if ($errors = get_records_sql("SELECT DISTINCT url, info
FROM {$CFG->prefix}log
WHERE module = 'dev' AND
action = 'unchecked vars'")) {
echo '<table border="1" cellpadding="5">';
foreach ($errors as $error) {
echo '<tr>';
echo '<td>'.$error->url.'</td>';
echo '<td>'.$error->info.'</td>';
echo '<td><a href="unchecked_vars.php?action=DELETE&amp;url='.$error->url.'&amp;info='.$error->info.'">Delete this</a></td>';
echo '</tr>';
}
echo '</table>';
} else {
echo "No unchecked vars were detected";
}
?>
+5 -46
View File
@@ -1,9 +1,10 @@
<?PHP //$Id$
require("../config.php");
require("$CFG->dirroot/mod/forum/lib.php");
require_once('../config.php');
require_once($CFG->dirroot.'/mod/forum/lib.php');
require_once($CFG->libdir.'/adminlib.php');
optional_variable($confirm);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
require_login();
@@ -28,7 +29,7 @@
print_header("$site->shortname: $stradministration: $strupgradingdata", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> $strupgradingdata");
if (empty($_GET['confirm'])) {
if (empty($confirm)) {
notice_yesno(get_string("upgradeforumreadinfo", "admin"),
"upgradeforumread.php?confirm=true&sesskey=$USER->sesskey",
"index.php");
@@ -115,46 +116,4 @@
exit;
function print_progress($done, $total, $updatetime=5, $sleeptime=1) {
static $count;
static $starttime;
static $lasttime;
if (empty($starttime)) {
$starttime = $lasttime = time();
$lasttime = $starttime - $updatetime;
echo '<table width="500" cellpadding="0" cellspacing="0" align="center"><tr><td width="500">';
echo '<div id="bar" style="border-style:solid;border-width:1px;width:500px;height:50px;">';
echo '<div id="slider" style="border-style:solid;border-width:1px;height:48px;width:10px;background-color:green;"></div>';
echo '</div>';
echo '<div id="text" align="center" style="width:500px;"></div>';
echo '</td></tr></table>';
echo '</div>';
}
if (!isset($count)) {
$count = 0;
}
$count++;
$now = time();
if ($done && (($now - $lasttime) >= $updatetime)) {
$elapsedtime = $now - $starttime;
$projectedtime = (int)(((float)$total / (float)$done) * $elapsedtime) - $elapsedtime;
$percentage = format_float((float)$done / (float)$total, 2);
$width = (int)(500 * $percentage);
echo '<script>';
echo 'document.getElementById("text").innerHTML = "'.$count.' done. Ending: '.format_time($projectedtime).'";'."\n";
echo 'document.getElementById("slider").style.width = \''.$width.'px\';'."\n";
echo '</script>';
$lasttime = $now;
sleep($sleeptime);
}
}
?>
+3 -3
View File
@@ -1,8 +1,8 @@
<?PHP //$Id$
require("../config.php");
require_once('../config.php');
optional_variable($confirm);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
require_login();
@@ -31,7 +31,7 @@
print_header("$site->shortname: $stradministration: $strupgradinglogs", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> $strupgradinglogs");
if (empty($_GET['confirm'])) {
if (empty($confirm)) {
notice_yesno(get_string("upgradelogsinfo", "admin"),
"upgradelogs.php?confirm=true&sesskey=$USER->sesskey",
"index.php");
+373 -256
View File
@@ -3,285 +3,402 @@
/// Bulk user registration script from a comma separated file
/// Returns list of users with their user ids
require_once("../config.php");
require_once('../config.php');
require_once($CFG->libdir.'/uploadlib.php');
$numusers = optional_param('numusers', 0, PARAM_INT);
$createpassword = optional_param('createpassword', 0, PARAM_BOOL);
$updateaccounts = optional_param('updateaccounts', 0, PARAM_BOOL);
$allowrenames = optional_param('allowrenames', 0, PARAM_BOOL);
require_login();
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 (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
}
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");
$csv_encode = '/\&\#44/';
if (isset($CFG->CSV_DELIMITER)) {
$csv_delimiter = '\\' . $CFG->CSV_DELIMITER;
$csv_delimiter2 = $CFG->CSV_DELIMITER;
if (isset($CFG->CSV_ENCODE)) {
$csv_encode = '/\&\#' . $CFG->CSV_ENCODE . '/';
}
} else {
$csv_delimiter = "\,";
$csv_delimiter2 = ",";
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");
$strfile = get_string("file");
$struser = get_string("user");
$strusers = get_string("users");
$strusersnew = get_string("usersnew");
$strusersupdated = get_string("usersupdated");
$struploadusers = get_string("uploadusers");
$straddnewuser = get_string("importuser");
$csv_encode = '/\&\#44/';
if (isset($CFG->CSV_DELIMITER)) {
$csv_delimiter = '\\' . $CFG->CSV_DELIMITER;
$csv_delimiter2 = $CFG->CSV_DELIMITER;
if (isset($CFG->CSV_ENCODE)) {
$csv_encode = '/\&\#' . $CFG->CSV_ENCODE . '/';
}
} else {
$csv_delimiter = "\,";
$csv_delimiter2 = ",";
}
/// Print the header
print_header("$site->shortname: $struploadusers", $site->fullname,
"<a href=\"index.php\">$stradministration</a> ->
<a href=\"users.php\">$strusers</a> -> $struploadusers");
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
require_once($CFG->dirroot.'/lib/uploadlib.php');
$um = new upload_manager('userfile',false,false,null,false,0);
if ($um->preprocess_files()) {
$filename = $um->files['userfile']['tmp_name'];
$um = new upload_manager('userfile',false,false,null,false,0);
//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);
if ($um->preprocess_files() && confirm_sesskey()) {
$filename = $um->files['userfile']['tmp_name'];
$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,
"auth" => 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($csv_delimiter, 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?sesskey='.$USER->sesskey);
}
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?sesskey='.$USER->sesskey);
}
}
$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 (for comma separated csv files)
//Note: semicolon within a field should be encoded as &#59 (for semicolon separated csv files)
$line = split($csv_delimiter, fgets($fp,1024));
foreach ($line as $key => $value) {
//decode encoded commas
$record[$header[$key]] = preg_replace($csv_encode,$csv_delimiter2,trim($value));
}
if ($record[$header[0]]) {
// add a new user to the database
$newuser = optional_param('newuser', "", PARAM_CLEAN);
// 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) .". ".
get_string('processingstops', 'error'),
'uploaduser.php?sesskey='.$USER->sesskey);
}
// password needs to be encrypted
else if ($name == "password") {
$user->password = md5($value);
}
else if ($name == "username") {
$user->username = addslashes(moodle_strtolower($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",'c.sortorder','c.id,c.shortname,c.fullname,c.sortorder');
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 (get_record("user","username",$username) || !($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 />';
// Large files are likely to take their time and memory. Let PHP know
// that we'll take longer, and that the process should be recycled soon
// to free up memory.
@set_time_limit(0);
@raise_memory_limit("128M");
if (function_exists('apache_child_terminate')) {
@apache_child_terminate();
}
//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" => !$createpassword,
"firstname" => 1,
"lastname" => 1,
"email" => 1);
$optionalDefaults = array("institution" => 1,
"department" => 1,
"city" => 1,
"country" => 1,
"lang" => 1,
"auth" => 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,
"type1" => 1,
"type2" => 1,
"type3" => 1,
"type4" => 1,
"type5" => 1,
"password" => $createpassword,
"oldusername" => $allowrenames);
// --- get header (field names) ---
$header = split($csv_delimiter, 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?sesskey='.$USER->sesskey);
}
if ($required[$h]) {
$required[$h] = 0;
}
}
// check for required fields
foreach ($required as $key => $value) {
if ($value) { //required field missing
error(get_string('fieldrequired', 'error', $key), 'uploaduser.php?sesskey='.$USER->sesskey);
}
}
$linenum = 2; // since header is line 1
$usersnew = 0;
$usersupdated = 0;
$userserrors = 0;
$renames = 0;
$renameerrors = 0;
// Will use this course array a lot
// so fetch it early and keep it in memory
$courses = get_courses('all','c.sortorder','c.id,c.shortname,c.fullname,c.sortorder,c.teacher');
while (!feof ($fp)) {
foreach ($optionalDefaults as $key => $value) {
$user->$key = addslashes($adminuser->$key);
}
//Note: commas within a field should be encoded as &#44 (for comma separated csv files)
//Note: semicolon within a field should be encoded as &#59 (for semicolon separated csv files)
$line = split($csv_delimiter, fgets($fp,1024));
foreach ($line as $key => $value) {
//decode encoded commas
$record[$header[$key]] = preg_replace($csv_encode,$csv_delimiter2,trim($value));
}
if ($record[$header[0]]) {
// add a new user to the database
// 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) .". ".
get_string('processingstops', 'error'),
'uploaduser.php?sesskey='.$USER->sesskey);
}
// password needs to be encrypted
else if ($name == "password" && !empty($value)) {
$user->password = hash_internal_user_password($value);
}
else if ($name == "username") {
$user->username = addslashes(moodle_strtolower($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;
$addtype[0] = $user->type1;
$addtype[1] = $user->type2;
$addtype[2] = $user->type3;
$addtype[3] = $user->type4;
$addtype[4] = $user->type5;
for ($i=0; $i<5; $i++) {
$course[$i]=NULL;
}
foreach ($courses as $eachcourse) {
for ($i=0; $i<5; $i++) {
if ($eachcourse->shortname == $addcourse[$i]) {
$course[$i] = $eachcourse;
}
}
}
if ($user->username === 'changeme') {
notify(get_string('invaliduserchangeme', 'admin'));
$userserrors++;
continue;
}
// before insert/update, check whether we should be updating
// an old record instead
if ($allowrenames && !empty($user->oldusername) ) {
$user->oldusername = moodle_strtolower($user->oldusername);
if ($olduser = get_record('user','username',$user->oldusername)) {
if (set_field('user', 'username', $user->username, 'username', $user->oldusername)) {
notify(get_string('userrenamed', 'admin') . " : $user->oldusername $user->username");
$renames++;
} else {
notify(get_string('usernotrenamedexists', 'error') . " : $user->oldusername $user->username");
$renameerrors++;
continue;
}
} else {
notify(get_string('usernotrenamedmissing', 'error') . " : $user->oldusername $user->username");
$renameerrors++;
continue;
}
}
if ($olduser = get_record("user","username",$username)) {
if ($updateaccounts) {
// Record is being updated
$user->id = $olduser->id;
if (update_record('user', $user)) {
notify("$user->id , $user->username ".get_string('useraccountupdated', 'admin'));
$usersupdated++;
} else {
notify(get_string('usernotupdatederror', 'error', $username));
$userserrors++;
continue;
}
} else {
//Record not added - 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
notify("$user->id ".get_string('usernotaddedregistered', 'error', $username));
$userserrors++;
continue;
}
} else { // new user
if ($user->id = insert_record("user", $user)) {
notify("$struser: $user->id = $user->username");
$usersnew++;
if (empty($user->password) && $createpassword) {
// passwords will be created and sent out on cron
insert_record('user_preferences', array( userid => $user->id,
name => 'create_password',
value => 1));
insert_record('user_preferences', array( userid => $user->id,
name => 'auth_forcepasswordchange',
value => 1));
}
} else {
// Record not added -- possibly some other error
notify(get_string('usernotaddederror', 'error', $username));
$userserrors++;
continue;
}
}
for ($i=0; $i<5; $i++) {
if ($addcourse[$i] && !$course[$i]) {
notify(get_string('unknowncourse', 'error', $addcourse[$i]));
}
}
for ($i=0; $i<5; $i++) {
$groupid[$i] = 0;
if ($addgroup[$i]) {
if (!$course[$i]) {
notify(get_string('coursegroupunknown','error',$addgroup[$i]));
} else {
if ($group = get_record("groups","courseid",$course[$i]->id,"name",$addgroup[$i])) {
$groupid[$i] = $group->id;
} else {
notify(get_string('groupunknown','error',$addgroup[$i]));
}
}
}
}
for ($i=0; $i<5; $i++) { /// Enrol into courses if necessary
if ($course[$i]) {
if (isset($addtype[$i])) {
switch ($addtype[$i]) {
case 2: // teacher
$ret = add_teacher($user->id, $course[$i]->id, 1);
break;
case 3: // non-editing teacher
$ret = add_teacher($user->id, $course[$i]->id, 0);
break;
default: // student
$ret = enrol_student($user->id, $course[$i]->id);
break;
}
} else {
$ret = enrol_student($user->id, $course[$i]->id);
}
if ($ret) { // OK
notify('-->'. get_string('enrolledincourse', '', $addcourse[$i]));
} else {
notify('-->'.get_string('enrolledincoursenot', '', $addcourse[$i]));
}
}
}
for ($i=0; $i<5; $i++) { // Add user to groups if necessary
if ($course[$i] && $groupid[$i]) {
if (record_exists('user_students','userid',$user->id,'course',$course[$i]->id) ||
record_exists('user_teachers','userid',$user->id,'course',$course[$i]->id)) {
if (add_user_to_group($groupid[$i], $user->id)) {
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: $usersnew");
notify(get_string('usersupdated', 'admin') . ": $usersupdated");
notify(get_string('errors', 'admin') . ": $userserrors");
if ($allowrenames) {
notify(get_string('usersrenamed', 'admin') . ": $renames");
notify(get_string('renameerrors', 'admin') . ": $renameerrors");
}
echo '<hr />';
}
/// Print the form
print_heading_with_help($struploadusers, 'uploadusers');
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="hidden" name="sesskey" value="'.$USER->sesskey.'">'.
'<input type="file" name="userfile" size="30">'.
'<input type="submit" value="'.$struploadusers.'">'.
'</form></br>';
echo '</center>';
$noyesoptions = array( get_string('no'), get_string('yes') );
print_footer($course);
$maxuploadsize = get_max_upload_file_size();
echo '<center>';
echo '<form method="post" enctype="multipart/form-data" action="uploaduser.php">'.
$strfile.'&nbsp;<input type="hidden" name="MAX_FILE_SIZE" value="'.$maxuploadsize.'">'.
'<input type="hidden" name="sesskey" value="'.$USER->sesskey.'">'.
'<input type="file" name="userfile" size="30">';
print_heading(get_string('settings'));
echo '<table>';
echo '<tr><td>' . get_string('passwordhandling', 'auth') . '</td><td>';
$passwordopts = array( 0 => get_string('infilefield', 'auth'),
1 => get_string('createpasswordifneeded', 'auth'),
);
choose_from_menu($passwordopts, 'createpassword', $createpassword);
echo '</td></tr>';
echo '<tr><td>' . get_string('updateaccounts', 'admin') . '</td><td>';
choose_from_menu($noyesoptions, 'updateaccounts', $updateaccounts);
echo '</td></tr>';
echo '<tr><td>' . get_string('allowrenames', 'admin') . '</td><td>';
choose_from_menu($noyesoptions, 'allowrenames', $allowrenames);
echo '</td></tr>';
echo '</table><br />';
echo '<input type="submit" value="'.$struploadusers.'">';
echo '</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
/// Returns the file as one big long string
$data = "";
$file = @fopen($filename, "rb", $use_include_path);
+40 -43
View File
@@ -1,38 +1,35 @@
<?php // $Id$
require_once("../config.php");
require_once('../config.php');
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, "");
if (!empty($search)) {
$search=trim($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);
unset($teacher);
$newuser = optional_param('newuser', 0, PARAM_BOOL);
$delete = optional_param('delete', 0, PARAM_INT);
$confirm = optional_param('confirm', '', PARAM_ALPHANUM); //md5 confirmation hash
$confirmuser = optional_param('confirmuser', 0, PARAM_INT);
$sort = optional_param('sort', 'name', PARAM_ALPHA);
$dir = optional_param('dir', 'ASC', PARAM_ALPHA);
$page = optional_param('page', 0, PARAM_INT);
$perpage = optional_param('perpage', 30, PARAM_INT); // how many per page
$search = optional_param('search', '', PARAM_RAW);
$lastinitial = optional_param('lastinitial', '', PARAM_CLEAN); // only show students with this last initial
$firstinitial = optional_param('firstinitial', '', PARAM_CLEAN); // only show students with this first initial
$search = trim($search);
$user = new object();
$admin = new object();
$teacher = new object();
if (! record_exists("user_admins")) { // No admin user yet
$user->firstname = get_string("admin");
$user->lastname = get_string("user");
$user->username = "admin";
$user->password = md5("admin");
$user->email = "root@localhost";
$user->confirmed = 1;
$user->lang = $CFG->lang;
$user->maildisplay = 1;
$user->firstname = get_string("admin");
$user->lastname = get_string("user");
$user->username = "admin";
$user->password = hash_internal_user_password("admin");
$user->email = "root@localhost";
$user->confirmed = 1;
$user->lang = $CFG->lang;
$user->maildisplay = 1;
$user->timemodified = time();
if (! $user->id = insert_record("user", $user)) {
@@ -85,14 +82,14 @@
}
if ($newuser and confirm_sesskey()) { // Create a new user
$user->auth = "manual";
$user->firstname = "";
$user->lastname = "";
$user->username = "changeme";
$user->password = "";
$user->email = "";
$user->lang = $CFG->lang;
$user->confirmed = 1;
$user->auth = "manual";
$user->firstname = "";
$user->lastname = "";
$user->username = "changeme";
$user->password = "";
$user->email = "";
$user->lang = $CFG->lang;
$user->confirmed = 1;
$user->timemodified = time();
if (! $user->id = insert_record("user", $user)) {
@@ -130,7 +127,7 @@
error("No such user!");
}
unset($confirmeduser);
$confirmeduser = new object();
$confirmeduser->id = $confirmuser;
$confirmeduser->confirmed = 1;
$confirmeduser->timemodified = time();
@@ -158,7 +155,7 @@
exit;
} else if (!$user->deleted) {
unset($updateuser);
$updateuser = new object();
$updateuser->id = $user->id;
$updateuser->deleted = "1";
$updateuser->username = "$user->email.".time(); // Remember it just in case
@@ -199,7 +196,7 @@
$columnicon = " <img src=\"$CFG->pixpath/t/$columnicon.gif\" alt=\"\" />";
}
$$column = "<a href=\"user.php?sort=$column&amp;dir=$columndir&amp;search=$search&amp;firstinitial=$firstinitial&amp;lastinitial=$lastinitial\">".$string[$column]."</a>$columnicon";
$$column = "<a href=\"user.php?sort=$column&amp;dir=$columndir&amp;search=".urlencode(stripslashes($search))."&amp;firstinitial=$firstinitial&amp;lastinitial=$lastinitial\">".$string[$column]."</a>$columnicon";
}
if ($sort == "name") {
@@ -262,15 +259,15 @@
echo "</center>";
print_paging_bar($usercount, $page, $perpage,
"user.php?sort=$sort&amp;dir=$dir&amp;perpage=$perpage&amp;firstinitial=$firstinitial&amp;lastinitial=$lastinitial&amp;search=$search&amp;");
"user.php?sort=$sort&amp;dir=$dir&amp;perpage=$perpage&amp;firstinitial=$firstinitial&amp;lastinitial=$lastinitial&amp;search=".urlencode(stripslashes($search))."&amp;");
flush();
if (!$users) {
$match = array();
if ($search) {
$match[] = $search;
if ($search !== '') {
$match[] = s($search);
}
if ($firstinitial) {
$match[] = get_string("firstname").": $firstinitial"."___";
@@ -336,7 +333,7 @@
echo "<table class=\"searchbox\" align=\"center\" cellpadding=\"10\"><tr><td>";
echo "<form action=\"user.php\" method=\"get\">";
echo "<input type=\"text\" name=\"search\" value=\"$search\" size=\"20\" />";
echo "<input type=\"text\" name=\"search\" value=\"".s($search, true)."\" size=\"20\" />";
echo "<input type=\"submit\" value=\"$strsearch\" />";
if ($search) {
echo "<input type=\"button\" onclick=\"document.location='user.php';\" value=\"$strshowallusers\" />";
@@ -349,7 +346,7 @@
print_table($table);
print_paging_bar($usercount, $page, $perpage,
"user.php?sort=$sort&amp;dir=$dir&amp;perpage=$perpage".
"&amp;firstinitial=$firstinitial&amp;lastinitial=$lastinitial&amp;search=$search&amp;");
"&amp;firstinitial=$firstinitial&amp;lastinitial=$lastinitial&amp;search=".urlencode(stripslashes($search))."&amp;");
print_heading("<a href=\"user.php?newuser=true&amp;sesskey=$USER->sesskey\">".get_string("addnewuser")."</a>");
}
+2 -14
View File
@@ -1,6 +1,6 @@
<?php // $Id$
require_once("../config.php");
require_once('../config.php');
require_login();
@@ -24,27 +24,15 @@
$table->data[] = array("<b><a href=\"auth.php?sesskey=$USER->sesskey\">".get_string("authentication")."</a></b>",
get_string("adminhelpauthentication"));
$table->data[] = array("<b><a href=\"user.php\">".get_string("edituser")."</a></b>",
get_string("adminhelpedituser"));
$table->data[] = array("<b><a href=\"$CFG->wwwroot/$CFG->admin/user.php?newuser=true&amp;sesskey=$USER->sesskey\">".get_string("addnewuser")."</a></b>",
get_string("adminhelpaddnewuser"));
$table->data[] = array("<b><a href=\"$CFG->wwwroot/$CFG->admin/uploaduser.php?sesskey=$USER->sesskey\">".get_string("uploadusers")."</a></b>",
get_string("adminhelpuploadusers"));
$table->data[] = array('', '<hr />');
$table->data[] = array("<b><a href=\"enrol.php?sesskey=$USER->sesskey\">".get_string("enrolments")."</a></b>",
get_string("adminhelpenrolments"));
$table->data[] = array("<b><a href=\"../course/index.php?edit=off&amp;sesskey=$USER->sesskey\">".get_string("assignstudents")."</a></b>",
get_string("adminhelpassignstudents"));
$table->data[] = array("<b><a href=\"../course/index.php?edit=on&amp;sesskey=$USER->sesskey\">".get_string("assignteachers")."</a></b>",
get_string("adminhelpassignteachers")." <img src=\"../pix/t/user.gif\" height=\"11\" width=\"11\" alt=\"\" />");
$table->data[] = array("<b><a href=\"creators.php?sesskey=$USER->sesskey\">".get_string("assigncreators")."</a></b>",
get_string("adminhelpassigncreators"));
$table->data[] = array("<b><a href=\"admin.php?sesskey=$USER->sesskey\">".get_string("assignadmins")."</a></b>",
get_string("adminhelpassignadmins"));
print_table($table);
print_footer($site);
?>
+70
View File
@@ -0,0 +1,70 @@
<?php
if (!isset($form->dbhost)) {
$form->dbhost = '';
}
if (!isset($form->dbname)) {
$form->dbname = '';
}
if (!isset($form->dbuser)) {
$form->dbuser = '';
}
if (!isset($form->dbpass)) {
$form->dbpass = '';
}
if (!isset($form->dbcluster)) {
$form->dbcluster = '';
}
if (!isset($form->pathtopgdump)) {
$form->pathtopgdump = '';
}
if (!isset($form->pathtopsql)) {
$form->pathtopsql = '';
}
?>
<form name="migratefrom" action="utfdbmigrate.php" method="POST">
<input name="migrate" type="hidden" value="1" />
<input name="sesskey" type="hidden" value="<?php echo sesskey() ?>" />
<?php if (isset($err["dbconnect"])) formerr($err["dbconnect"]); ?>
<?php if (isset($err["pathtopgdump"])) formerr($err["pathtopgdump"]); ?>
<?php if (isset($err["pathtopsql"])) formerr($err["pathtopsql"]); ?>
<table cellpadding="9" cellspacing="0" width="500">
<tr valign="top">
<td align="right"><?php print_string("dbhost", "install") ?>:</td>
<td><input type="text" name="dbhost" value="<?php p($form->dbhost) ?>" />
</td>
</tr>
<tr valign="top">
<td align="right"><?php print_string("database", "install") ?>:</td>
<td><input type="text" name="dbname" value="<?php p($form->dbname) ?>" />
</td>
</tr>
<tr valign="top">
<td align="right"><?php print_string("user") ?>:</td>
<td><input type="text" name="dbuser" value="<?php p($form->dbuser) ?>" />
</td>
</tr>
<tr valign="top">
<td align="right"><?php print_string("password") ?>:</td>
<td><input type="text" name="dbpass" value="<?php p($form->dbpass) ?>" />
</td>
</tr>
<tr valign="top">
<td align="right"><?php print_string("pgcluster", "admin") ?>:</td>
<td><input type="text" name="dbcluster" value="<?php p($form->dbcluster) ?>" />
<td><?php print_string("pgclusterdescription", "admin") ?></td>
</tr>
<tr valign="top">
<td align="right" nowrap="nowrap"><?php print_string("pathtopgdump","admin") ?>:</td>
<td><input type="text" name="pathtopgdump" value="<?php p($form->pathtopgdump) ?>" />
<td><?php print_string("pathtopgdumpdesc","admin"); ?></td>
</tr>
<tr valign="top">
<td align="right" nowrap="nowrap"><?php print_string("pathtopsql","admin") ?>:</td>
<td><input type="text" name="pathtopsql" value="<?php p($form->pathtopsql) ?>" />
<td><?php print_string("pathtopsqldesc","admin"); ?></td>
</tr>
</table>
<center>
<input type="submit" value="<?php print_string('continue') ?>"/>
&nbsp;<input type="button" value="<?php print_string('cancel') ?>" onclick="javascript:history.go(-1)" />
</center>
+1112
View File
File diff suppressed because it is too large Load Diff
+8
View File
@@ -121,6 +121,14 @@ Optional:
Userinformation in array ( name => value, ....
or false in case of error
auth_validate_form(&$form, &$err)
Validate form data.
Returns:
Bool. Manipulates $form and $err arrays in place
COURSE CREATING
auth_iscreator($username)
+87 -1
View File
@@ -1 +1,87 @@
<table width="90%" border="0" cellspacing="10" cellpadding="5" align="center">
<table width="90%" border="0" cellspacing="10" cellpadding="5" align="center">
<tr>
<?php if ($show_instructions) { ?>
<td width="50%" class="headingblock">
<p align="center"><b><font size="3"><?php print_string("returningtosite") ?></font></b></p>
</td>
<td width="50%" class="headingblock">
<p align="center"><b><font size="3"><?php print_string("firsttime") ?></font></b></p>
</td>
<?php } ?>
</tr>
<tr>
<td width="50%" align="center" valign="top" class="generalbox">
<p><?php print_string("loginusing") ?>:<br />
(<?php print_string("cookiesenabled");?>)
<?php helpbutton("cookies", get_string("cookiesenabled"))?><br /><?php formerr($errormsg) ?>
</p>
<form action="index.php" method="post" name="login" id="login">
<table border="0" align="center" style="font-size: small">
<tr>
<td width="100%">
<input type="hidden" name="username" value="cas" />
<input type="hidden" name="password" value="cas" />
<input type="submit" value="<?php print_string("auth_cas_logincas", "auth") ?>" />
</td>
</tr>
</table>
</form>
<?php if ($CFG->guestloginbutton) { ?>
<hr width="80%" />
<p><?php print_string("someallowguest") ?>:</p>
<form action="index.php" method="post" name="guestlogin">
<input type="hidden" name="username" value="guest" />
<input type="hidden" name="password" value="guest" />
<input type="submit" value="<?php print_string("loginguest") ?>" />
</form>
<?php } ?>
<?php if (is_internal_auth() ) {
$changepassword = "forgot_password.php";
$changebuttonname = get_string("senddetails");
?>
<hr width="80%" />
<p><?php print_string("forgotten") ?></p>
<form action="<?php p($changepassword) ?>" method="get" name="changepassword">
<input type="submit" value="<?php p($changebuttonname) ?>" />
</form>
<?php } ?>
</td>
<?php if ($show_instructions) { ?>
<td width="50%" valign="top" class="generalbox">
<?php switch ($CFG->auth) {
case "email":
print_string("loginsteps", "", "signup.php");
?>
<div align="center">
<form action="signup.php" method="get" name="signup">
<input type="submit" value="<?php print_string("startsignup") ?>" />
</form>
</div>
<?php break;
case "none":
print_string("loginstepsnone");
break;
default:
echo format_text($CFG->auth_instructions);
if (!function_exists('auth_user_login')) {
require_once("../auth/$CFG->auth/lib.php");
}
if (!empty($CFG->auth_user_create) and function_exists('auth_user_create') ){
?>
<div align="center">
<form action="signup.php" method="get" name="signup">
<input type="submit" value="<?php print_string("startsignup") ?>" />
</form>
</div>
<?php }
}
?>
</td></tr>
<?php } ?>
</table>
+10 -9
View File
@@ -98,13 +98,11 @@ function cas_ldap_auth_user_login ($username, $password) {
function cas_authenticate_user_login ($username, $password) {
global $CFG;
// FIX ME: $cas_validate is not global
$cas_validate=true;
phpCAS::client($CFG->cas_version,$CFG->cas_hostname,(Integer)$CFG->cas_port,$CFG->cas_baseuri);
phpCAS::client($CFG->cas_version,$CFG->cas_hostname,(int)$CFG->cas_port,$CFG->cas_baseuri);
phpCAS::setLang($CFG->cas_language);
if (!phpCAS::isAuthenticated()){
phpCAS::authenticateIfNeeded();
}
phpCAS::forceAuthentication();
if ($CFG->cas_create_user=="0"){
if (record_exists('user', 'username', phpCAS::getUser())) {
$user = authenticate_user_login(phpCAS::getUser(), 'cas');
@@ -134,14 +132,16 @@ function cas_authenticate_user_login ($username, $password) {
*/
function cas_automatic_authenticate ($user="") {
global $CFG;
// FIX ME: $cas_validate is not global, but it works anyway ;-)
if (!$cas_validate){
$cas_validate=true;
phpCAS::client($CFG->cas_version,$CFG->cas_hostname,(int)$CFG->cas_port,$CFG->cas_baseuri);
phpCAS::setLang($CFG->cas_language);
if (!phpCAS::isAuthenticated() && !$CFG->guestloginbutton){
phpCAS::authenticateIfNeeded();
$cas_user_exist=phpCAS::checkAuthentication();
if (!$cas_user_exist && !$CFG->guestloginbutton){
$cas_user_exist=phpCAS::forceAuthentication();
}
if (phpCAS::isAuthenticated()){
if ($cas_user_exist){
if ($CFG->cas_create_user=="0"){
if (record_exists('user', 'username', phpCAS::getUser())) {
$user = authenticate_user_login(phpCAS::getUser(), 'cas');
@@ -167,4 +167,5 @@ function cas_automatic_authenticate ($user="") {
}
}
?>
?>
+3 -9
View File
@@ -18,7 +18,7 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.');
if (empty($CFG->loginhttps)) {
$wwwroot = $CFG->wwwroot;
} else {
$wwwroot = str_replace('http','https',$CFG->wwwroot);
$wwwroot = str_replace('http:','https:',$CFG->wwwroot);
}
$langmenu = popup_form ("$wwwroot/login/index.php?lang=", $langs, "chooselang", $currlang, "", "", "", true);
}
@@ -109,10 +109,7 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.');
//Select password change url
if (is_internal_auth() || $CFG->{'auth_'.$USER->auth.'_stdchangepassword'}){
$passwordchangeurl=$CFG->wwwroot.'/login/change_password.php';
} elseif($CFG->changepassword) {
$passwordchangeurl=$CFG->changepassword;
}
// check whether the user should be changing password
if (get_user_preferences('auth_forcepasswordchange', false)){
@@ -219,10 +216,7 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.');
//Select password change url
if (is_internal_auth() || $CFG->{'auth_'.$USER->auth.'_stdchangepassword'}){
$passwordchangeurl=$CFG->wwwroot.'/login/change_password.php';
} elseif($CFG->changepassword) {
$passwordchangeurl=$CFG->changepassword;
}
}
// check whether the user should be changing password
if (get_user_preferences('auth_forcepasswordchange', false)){
@@ -319,4 +313,4 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.');
// No footer on this page
?>
?>
+9 -5
View File
@@ -1,11 +1,15 @@
<?php
<?php
// $Id$
// logout the user from CAS server (destroy the ticket)
defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.');
include_once($CFG->dirroot.'/lib/cas/CAS.php');
phpCAS::client($CFG->cas_version,$CFG->cas_hostname,(Integer)$CFG->cas_port,$CFG->cas_baseuri);
$backurl = $CFG->wwwroot;
phpCAS::logout($backurl);
global $CFG;
if ($CFG->cas_logout){
require_once($CFG->dirroot.'/config.php');
include_once($CFG->dirroot.'/lib/cas/CAS.php');
phpCAS::client($CFG->cas_version,$CFG->cas_hostname,(int)$CFG->cas_port,$CFG->cas_baseuri);
$backurl = $CFG->wwwroot;
phpCAS::logout($backurl);
}
?>
+39
View File
@@ -0,0 +1,39 @@
<?php
/** auth_db_sync_users.php
*
* This script is meant to be called from a cronjob to sync moodle with the LDAP
* backend in those setups where the LDAP backend acts as 'master'.
*
* Recommended cron entry:
* # 5 minutes past 4am
* 5 4 * * * /usr/bin/php -c /etc/php4/cli/php.ini /var/www/moodle/auth/db/auth_db_sync_users.php
*
* Notes:
* - If you have a large number of users, you may want to raise the memory limits
* by passing -d memory_limit=256M
* - For debugging & better logging, you are encouraged to use in the command line:
* -d log_errors=1 -d error_reporting=E_ALL -d display_errors=0 -d html_errors=0
*
* Performance notes:
* + The code is simpler, but not as optimized as its LDAP counterpart.
*
*
*/
if(!empty($_SERVER['GATEWAY_INTERFACE'])){
error_log("should not be called from apache!");
exit;
}
require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); // global moodle config file.
require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->dirroot.'/lib/blocklib.php');
require_once($CFG->dirroot.'/mod/resource/lib.php');
require_once($CFG->dirroot.'/auth/db/lib.php');
require_once($CFG->dirroot.'/mod/forum/lib.php');
$CFG->debug=10;
auth_sync_users(true );
?>
+5
View File
@@ -26,7 +26,10 @@
if (!isset($config->auth_dbpasstype)) {
$config->auth_dbpasstype = "plaintext";
}
$pluginconfig = get_config('auth/db');
?>
<tr valign="top" class="required">
<td align="right">auth_dbhost:</td>
<td>
@@ -126,6 +129,8 @@
<?php
$passtype["plaintext"] = get_string("plaintext", "auth");
$passtype["md5"] = get_string("md5", "auth");
$passtype["internal"] = get_string("internal", "auth");
choose_from_menu($passtype, "auth_dbpasstype", $config->auth_dbpasstype, "");
?>
+395 -22
View File
@@ -21,31 +21,59 @@ function auth_user_login ($username, $password) {
}
// Connect to the external database
$authdb = &ADONewConnection($CFG->auth_dbtype);
$authdb = &ADONewConnection($CFG->auth_dbtype);
$authdb->PConnect($CFG->auth_dbhost,$CFG->auth_dbuser,$CFG->auth_dbpass,$CFG->auth_dbname);
switch ($CFG->auth_dbpasstype) { // Re-format password accordingly
case "md5":
$password = md5($password);
break;
}
if ($CFG->auth_dbpasstype === 'internal') {
// lookup username externally, but resolve
// password locally -- to support backend that
// don't track passwords
$rs = $authdb->Execute("SELECT * FROM $CFG->auth_dbtable
WHERE $CFG->auth_dbfielduser = '$username' ");
$authdb->Close();
$rs = $authdb->Execute("SELECT * FROM $CFG->auth_dbtable
if (!$rs) {
notify("Could not connect to the specified authentication database...");
return false;
}
if ( $rs->RecordCount() ) {
// user exists exterally
// check username/password internally
if ($user = get_record('user', 'username', $username)) {
return validate_internal_user_password($user, $password);
}
} else {
// user does not exist externally
return false;
}
} else {
// normal case: use external db for passwords
if ($CFG->auth_dbpasstype === 'md5') { // Re-format password accordingly
$password = md5($password);
}
$rs = $authdb->Execute("SELECT * FROM $CFG->auth_dbtable
WHERE $CFG->auth_dbfielduser = '$username'
AND $CFG->auth_dbfieldpass = '$password' ");
$authdb->Close();
$CFG->prefix = $prefix;
if (!$rs) {
notify("Could not connect to the specified authentication database...");
return false;
}
if ( $rs->RecordCount() ) {
return true;
} else {
return false;
$authdb->Close();
$CFG->prefix = $prefix;
if (!$rs) {
notify("Could not connect to the specified authentication database...");
return false;
}
if ( $rs->RecordCount() ) {
return true;
} else {
return false;
}
}
}
@@ -76,7 +104,11 @@ function auth_get_userinfo($username){
if ($rs = $authdb->Execute("SELECT ".$pcfg["field_map_$field"]." FROM $CFG->auth_dbtable
WHERE $CFG->auth_dbfielduser = '$username'")) {
if ( $rs->RecordCount() == 1 ) {
$result["$field"] = addslashes(stripslashes(utf8_decode($rs->fields[0])));
if (!empty($CFG->unicodedb)) {
$result["$field"] = addslashes(stripslashes($rs->fields[0]));
} else {
$result["$field"] = addslashes(stripslashes(utf8_decode($rs->fields[0])));
}
}
}
}
@@ -85,4 +117,345 @@ function auth_get_userinfo($username){
return $result;
}
?>
function auth_user_update_password($username, $newpassword) {
global $CFG;
if ($CFG->auth_dbpasstype === 'internal') {
return set_field('user', 'password', md5($newpassword), 'username', $username);
} else {
// we should have never been called!
return false;
}
}
/**
* syncronizes user fron external db to moodle user table
*
* Sync shouid be done by using idnumber attribute, not username.
* You need to pass firstsync parameter to function to fill in
* idnumbers if they dont exists in moodle user table.
*
* Syncing users removes (disables) users that dont exists anymore in external db.
* Creates new users and updates coursecreator status of users.
*
* @param bool $do_updates Optional: set to true to force an update of existing accounts
*
* This implementation is simpler but less scalable than the one found in the LDAP module.
*
*/
function auth_sync_users ($do_updates=0) {
global $CFG;
$pcfg = get_config('auth/db');
///
/// list external users
///
$userlist = auth_get_userlist();
$quoteduserlist = implode("', '", $userlist);
$quoteduserlist = "'$quoteduserlist'";
///
/// delete obsolete internal users
///
// find obsolete users
if (count($userlist)) {
$sql = 'SELECT u.id, u.username
FROM ' . $CFG->prefix .'user u
WHERE u.auth=\'db\' AND u.deleted=\'0\' AND u.username NOT IN (' . $quoteduserlist . ')';
} else {
$sql = 'SELECT u.id, u.username
FROM ' . $CFG->prefix .'user u
WHERE u.auth=\'db\' AND u.deleted=\'0\' ';
}
$remove_users = get_records_sql($sql);
if (!empty($remove_users)){
print "User entries to remove: ". count($remove_users) . "\n";
begin_sql();
foreach ($remove_users as $user) {
//following is copy pasted from admin/user.php
//maybe this should moved to function in lib/datalib.php
unset($updateuser);
$updateuser->id = $user->id;
$updateuser->deleted = "1";
$updateuser->timemodified = time();
if (update_record("user", $updateuser)) {
unenrol_student($user->id); // From all courses
remove_teacher($user->id); // From all courses
remove_admin($user->id);
notify(get_string("deletedactivity", "", fullname($user, true)) );
} else {
notify(get_string("deletednot", "", fullname($user, true)));
}
//copy pasted part ends
}
commit_sql();
}
unset($remove_users); // free mem!
if (!count($userlist)) {
// exit right here
// nothing else to do
return true;
}
///
/// update existing accounts
///
if ($do_updates) {
// narrow down what fields we need to update
$all_keys = array_keys(get_object_vars($pcfg));
$updatekeys = array();
foreach ($all_keys as $key) {
if (preg_match('/^field_updatelocal_(.+)$/',$key, $match)) {
if ($pcfg->{$match[0]}) { // if it has a true value
array_push($updatekeys, $match[1]); // the actual key name
}
}
}
// print_r($all_keys); print_r($updatekeys);
unset($all_keys); unset($key);
// only go ahead if we actually
// have fields to update locally
if (!empty($updatekeys)) {
$sql = 'SELECT u.id, u.username
FROM ' . $CFG->prefix .'user u
WHERE u.auth=\'db\' AND u.deleted=\'0\' AND u.username IN (' . $quoteduserlist . ')';
$update_users = get_records_sql($sql);
foreach ($update_users as $user) {
auth_db_update_user_record($user->username, $updatekeys);
}
unset($update_users); // free memory
}
}
///
/// create missing accounts
///
// NOTE: this is very memory intensive
// and generally inefficient
$sql = 'SELECT u.id, u.username
FROM ' . $CFG->prefix .'user u
WHERE u.auth=\'db\' AND u.deleted=\'0\'';
$users = get_records_sql($sql);
// simplify down to usernames
$usernames = array();
foreach ($users as $user) {
array_push($usernames, $user->username);
}
unset($users);
$add_users = array_diff($userlist, $usernames);
unset($usernames);
if(!empty($add_users)){
print "User entries to add: ". count($add_users). "\n";
begin_sql();
foreach($add_users as $user){
$username = $user;
$user = auth_get_userinfo_asobj($user);
// prep a few params
$user->username = $username;
$user->modified = time();
$user->confirmed = 1;
$user->auth = 'db';
// insert it
$old_debug=$CFG->debug;
$CFG->debug=10;
// maybe the user has been deleted before
if ($old_user = get_record('user', 'username', $user->username, 'deleted', 1)) {
$user->id = $old_user->id;
set_field('user', 'deleted', 0, 'username', $user->username);
echo "Revived user $user->username id $user->id\n";
} elseif ($id=insert_record ('user',$user)) { // it is truly a new user
echo "inserted user $user->username id $id\n";
$user->id = $id;
// if relevant, tag for password generation
if ($CFG->auth_dbpasstype === 'internal') {
set_user_preference('auth_forcepasswordchange', 1, $id);
set_user_preference('create_password', 1, $id);
}
} else {
echo "error inserting user $user->username \n";
}
$CFG->debug=$old_debug;
}
commit_sql();
unset($add_users); // free mem
}
return true;
}
function auth_user_exists ($username) {
global $CFG;
$authdb = &ADONewConnection($CFG->auth_dbtype);
$authdb->PConnect($CFG->auth_dbhost,$CFG->auth_dbuser,$CFG->auth_dbpass,$CFG->auth_dbname);
$rs = $authdb->Execute("SELECT * FROM $CFG->auth_dbtable
WHERE $CFG->auth_dbfielduser = '$username' ");
$authdb->Close();
if (!$rs) {
notify("Could not connect to the specified authentication database...");
return false;
}
if ( $rs->RecordCount() ) {
// user exists exterally
// check username/password internally
// ?? there is no $password variable, so why??
/*if ($user = get_record('user', 'username', $username)) {
return ($user->password == md5($password));
}*/
return $rs->RecordCount();
} else {
// user does not exist externally
return false;
}
}
function auth_get_userlist() {
global $CFG;
// Connect to the external database
$authdb = &ADONewConnection($CFG->auth_dbtype);
$authdb->PConnect($CFG->auth_dbhost,$CFG->auth_dbuser,$CFG->auth_dbpass,$CFG->auth_dbname);
// fetch userlist
$rs = $authdb->Execute("SELECT $CFG->auth_dbfielduser AS username
FROM $CFG->auth_dbtable ");
$authdb->Close();
if (!$rs) {
notify("Could not connect to the specified authentication database...");
return false;
}
if ( $rs->RecordCount() ) {
$userlist = array();
while ($rec = $rs->FetchRow()) {
array_push($userlist, $rec['username']);
}
return $userlist;
} else {
return array();
}
}
/**
* reads userinformation from DB and return it in an object
*
* @param string $username username
* @return array
*/
function auth_get_userinfo_asobj($username){
$user_array = truncate_userinfo(auth_get_userinfo($username));
$user = new object;
foreach($user_array as $key=>$value){
$user->{$key} = $value;
}
return $user;
}
function auth_db_update_user_record($username, $updatekeys=false) {
/// will update a local user record from an external source.
/// is a lighter version of the one in moodlelib -- won't do
/// expensive ops such as enrolment
///
/// If you don't pass $updatekeys, there is a performance hit and
/// values removed from DB won't be removed from moodle.
global $CFG;
$pcfg = get_config('auth/db');
//just in case check text case
$username = trim(moodle_strtolower($username));
// get the current user record
$user = get_record('user', 'username', $username);
if (empty($user)) { // trouble
error_log("Cannot update non-existent user: $username");
die;
}
if (function_exists('auth_get_userinfo')) {
if ($newinfo = auth_get_userinfo($username)) {
$newinfo = truncate_userinfo($newinfo);
if (empty($updatekeys)) { // all keys? this does not support removing values
$updatekeys = array_keys($newinfo);
}
foreach ($updatekeys as $key){
unset($value);
if (isset($newinfo[$key])) {
$value = $newinfo[$key];
$value = addslashes(stripslashes($value)); // Just in case
} else {
$value = '';
}
if (!empty($pcfg->{'field_updatelocal_' . $key})) {
if ($user->{$key} != $value) { // only update if it's changed
set_field('user', $key, $value, 'username', $username);
}
}
}
}
}
return get_record_select("user", "username = '$username' AND deleted <> '1'");
}
// A chance to validate form data, and last chance to
// do stuff before it is inserted in config_plugin
function auth_validate_form(&$form, &$err) {
// compat until we rework auth a bit
if ($form['auth_dbpasstype'] === 'internal') {
$CFG->auth_db_stdchangepassword = true;
if ($conf = get_record('config', 'name', 'auth_db_stdchangepassword')) {
$conf->value = 1;
if (! update_record('config', $conf)) {
notify("Could not update $name to $value");
}
} else {
$conf = new StdClass;
$conf->name = 'auth_db_stdchangepassword';
$conf->value = 1;
if (! insert_record('config', $conf)) {
notify("Error: could not add new variable $name !");
}
}
} else {
$CFG->auth_db_stdchangepassword = false;
if ($conf = get_record('config', 'name', 'auth_db_stdchangepassword')) {
$conf->value = 0;
if (! update_record('config', $conf)) {
notify("Could not update $name to $value");
}
} else {
$conf = new StdClass;
$conf->name = 'auth_db_stdchangepassword';
$conf->value = 0;
if (! insert_record('config', $conf)) {
notify("Error: could not add new variable $name !");
}
}
}
return true;
}
?>
+4 -4
View File
@@ -7,11 +7,11 @@ function auth_user_login ($username, $password) {
global $CFG;
if (! $user = get_record('user', 'username', $username)) {
return false;
if ($user = get_record('user', 'username', $username)) {
return validate_internal_user_password($user, $password);
}
return ($user->password == md5($password));
return false;
}
+61 -81
View File
@@ -1,71 +1,51 @@
<?php
// Initialize vars
if (!isset ($config->ldap_host_url)) {
$config->ldap_host_url = "";
}
if (!isset ($config->ldap_contexts)) {
$config->ldap_contexts = "";
}
if (!isset ($config->ldap_user_attribute)) {
$config->ldap_user_attribute = "";
}
if (!isset ($config->ldap_user_type)) {
$config->ldap_user_type = "";
}
if (!isset ($config->ldap_search_sub)) {
$config->ldap_search_sub = "";
}
if (!isset ($config->ldap_opt_deref)) {
$config->ldap_opt_deref = "";
}
if (!isset ($config->ldap_preventpassindb)) {
$config->ldap_preventpassindb = 0;
}
if (!isset ($config->ldap_bind_dn)) {
$config->ldap_bind_dn = "";
}
if (!isset ($config->ldap_bind_pw)) {
$config->ldap_bind_pw = "";
}
if (!isset ($config->ldap_version)) {
$config->ldap_version = "2";
}
if (!isset ($config->ldap_objectclass)) {
$config->ldap_objectclass = "";
}
if (!isset ($config->ldap_memberattribute)) {
$config->ldap_memberattribute = "";
}
if (!isset ($config->ldap_creators)) {
$config->ldap_creators = "";
}
if (!isset ($config->ldap_create_context)) {
$config->ldap_create_context = "";
}
if (!isset ($config->ldap_expiration)) {
$config->ldap_expiration = "";
}
if (!isset ($config->ldap_expiration_warning)) {
$config->ldap_expiration_warning = "10";
}
if (!isset ($config->ldap_expireattr)) {
$config->ldap_expireattr = "";
}
if (!isset ($config->ldap_gracelogins)) {
$config->ldap_gracelogins = "";
}
if (!isset ($config->ldap_graceattr)) {
$config->ldap_graceattr = "";
}
if (!isset ($config->auth_user_create)) {
$config->auth_user_create = "";
}
if (!isset ($config->auth_ldap_forcechangepassword)) {
$config->auth_ldap_forcechangepassword = "";
}
if (!isset ($config->auth_ldap_stdchangepassword)) {
$config->auth_ldap_stdchangepassword = false;
}
if (!isset($config->ldap_host_url))
{ $config->ldap_host_url = ''; }
if (!isset($config->ldap_contexts))
{ $config->ldap_contexts = ''; }
if (!isset($config->ldap_user_type))
{ $config->ldap_user_type = ''; }
if (!isset($config->ldap_user_attribute))
{ $config->ldap_user_attribute = ''; }
if (!isset($config->ldap_search_sub))
{ $config->ldap_search_sub = ''; }
if (!isset($config->ldap_opt_deref))
{ $config->ldap_opt_deref = ''; }
if (!isset($config->ldap_preventpassindb))
{ $config->ldap_preventpassindb = 0; }
if (!isset($config->ldap_bind_dn))
{$config->ldap_bind_dn = ''; }
if (!isset($config->ldap_bind_pw))
{$config->ldap_bind_pw = ''; }
if (!isset($config->ldap_version))
{$config->ldap_version = '2'; }
if (!isset($config->ldap_objectclass))
{$config->ldap_objectclass = ''; }
if (!isset($config->ldap_memberattribute))
{$config->ldap_memberattribute = ''; }
if (!isset($config->ldap_creators))
{$config->ldap_creators = ''; }
if (!isset($config->ldap_create_context))
{$config->ldap_create_context = ''; }
if (!isset($config->ldap_expiration))
{$config->ldap_expiration = ''; }
if (!isset($config->ldap_expiration_warning))
{$config->ldap_expiration_warning = '10'; }
if (!isset($config->ldap_expireattr))
{$config->ldap_expireattr = ''; }
if (!isset($config->ldap_gracelogins))
{$config->ldap_gracelogins = ''; }
if (!isset($config->ldap_graceattr))
{$config->ldap_graceattr = ''; }
if (!isset($config->auth_user_create))
{$config->auth_user_create = ''; }
if (!isset($config->auth_ldap_forcechangepassword))
{$config->auth_ldap_forcechangepassword = false; }
if (!isset($config->auth_ldap_stdchangepassword))
{$config->auth_ldap_stdchangepassword = false; }
$yesno = array( get_string('no'), get_string('yes') );
if (!function_exists('ldap_connect')){ // Is php4-ldap really there?
print '<tr><td><p align="center"><font color="red"><strong>Warning:
@@ -80,10 +60,10 @@ if (!function_exists('ldap_connect')){ // Is php4-ldap really there?
</td>
</tr>
<tr valign="top" class="required">
<tr valign="top" class="required">
<td align="right">ldap_host_url:</td>
<td>
<input name="ldap_host_url" type="text" size="30" value="<?php echo $config->ldap_host_url?>">
<input name="ldap_host_url" type="text" size="30" value="<?php echo $config->ldap_host_url?>" />
<?php if (isset($err["ldap_host_url"])) formerr($err["ldap_host_url"]); ?>
</td>
<td>
@@ -129,7 +109,7 @@ if (!function_exists('ldap_connect')){ // Is php4-ldap really there?
<tr valign="top" class="required">
<td align="right">ldap_bind_dn:</td>
<td>
<input name="ldap_bind_dn" type="text" size="30" value="<?php echo $config->ldap_bind_dn?>">
<input name="ldap_bind_dn" type="text" size="30" value="<?php echo $config->ldap_bind_dn?>" />
<?php if (isset($err["ldap_bind_dn"])) formerr($err["ldap_bind_dn"]); ?>
</td><td>
<?php print_string("auth_ldap_bind_dn","auth") ?>
@@ -139,7 +119,7 @@ if (!function_exists('ldap_connect')){ // Is php4-ldap really there?
<tr valign="top" class="required">
<td align="right">ldap_bind_pw:</td>
<td>
<input name="ldap_bind_pw" type="password" size="30" value="<?php echo $config->ldap_bind_pw?>">
<input name="ldap_bind_pw" type="password" size="30" value="<?php echo $config->ldap_bind_pw?>" />
<?php if (isset($err["ldap_bind_pw"])) formerr($err["ldap_bind_pw"]); ?>
</td><td>
<?php print_string("auth_ldap_bind_pw","auth") ?>
@@ -166,7 +146,7 @@ if (!function_exists('ldap_connect')){ // Is php4-ldap really there?
<tr valign="top" class="required">
<td align="right">ldap_contexts:</td>
<td>
<input name="ldap_contexts" type="text" size="30" value="<?php echo $config->ldap_contexts?>">
<input name="ldap_contexts" type="text" size="30" value="<?php echo $config->ldap_contexts?>" />
<?php if (isset($err["ldap_contexts"])) formerr($err["ldap_contexts"]); ?>
</td>
<td>
@@ -209,7 +189,7 @@ if (!function_exists('ldap_connect')){ // Is php4-ldap really there?
<tr valign="top" class="required">
<td align="right">ldap_user_attribute:</td>
<td>
<input name="ldap_user_attribute" type="text" size="30" value="<?php echo $config->ldap_user_attribute?>">
<input name="ldap_user_attribute" type="text" size="30" value="<?php echo $config->ldap_user_attribute?>" />
<?php if (isset($err["ldap_user_attribute"])) formerr($err["ldap_user_attribute"]); ?>
</td>
<td>
@@ -220,7 +200,7 @@ if (!function_exists('ldap_connect')){ // Is php4-ldap really there?
<tr valign="top" class="required">
<td align="right">ldap_memberattribute:</td>
<td>
<input name="ldap_memberattribute" type="text" size="30" value="<?php echo $config->ldap_memberattribute?>">
<input name="ldap_memberattribute" type="text" size="30" value="<?php echo $config->ldap_memberattribute?>" />
<?php if (isset($err["ldap_memberattribute"])) formerr($err["ldap_memberattribute"]); ?>
</td><td>
<?php print_string("auth_ldap_memberattribute","auth") ?>
@@ -230,7 +210,7 @@ if (!function_exists('ldap_connect')){ // Is php4-ldap really there?
<tr valign="top" class="required">
<td align="right">ldap_objectclass:</td>
<td>
<input name="ldap_objectclass" type="text" size="30" value="<?php echo $config->ldap_objectclass?>">
<input name="ldap_objectclass" type="text" size="30" value="<?php echo $config->ldap_objectclass?>" />
<?php if (isset($err["ldap_objectclass"])) formerr($err["ldap_objectclass"]); ?>
</td>
<td>
@@ -253,7 +233,7 @@ if (!function_exists('ldap_connect')){ // Is php4-ldap really there?
<?php print_string("no") ?></option>
<option value="1" <?php echo ($config->auth_ldap_forcechangepassword ? 'selected="yes"' : '') ?> >
<?php print_string("yes") ?></option>
</select><br>
</select><br />
</td>
<td align="left" valign="top">
@@ -270,7 +250,7 @@ if (!function_exists('ldap_connect')){ // Is php4-ldap really there?
<?php print_string("no") ?></option>
<option value="1" <?php echo ($config->auth_ldap_stdchangepassword ? 'selected="yes"' : '') ?> >
<?php print_string("yes") ?></option>
</select><br>
</select><br />
</td>
<td align="left" valign="top">
@@ -304,7 +284,7 @@ if (!function_exists('ldap_connect')){ // Is php4-ldap really there?
<tr valign="top" class="required">
<td align="right">ldap_expiration_warning:</td>
<td>
<input name="ldap_expiration_warning" type="text" size="2" value="<?php echo $config->ldap_expiration_warning?>">
<input name="ldap_expiration_warning" type="text" size="2" value="<?php echo $config->ldap_expiration_warning?>" />
<?php if (isset($err["ldap_expiration_warning"])) formerr($err["ldap_expiration_warning"]);
?>
</td>
@@ -316,7 +296,7 @@ if (!function_exists('ldap_connect')){ // Is php4-ldap really there?
<tr valign="top" class="required">
<td align="right">ldap_exprireattr:</td>
<td>
<input name="ldap_expireattr" type="text" size="30" value="<?php echo $config->ldap_expireattr?>">
<input name="ldap_expireattr" type="text" size="30" value="<?php echo $config->ldap_expireattr?>" />
<?php if (isset($err["ldap_expireattr"])) formerr($err["ldap_expireattr"]);
?>
</td>
@@ -343,7 +323,7 @@ if (!function_exists('ldap_connect')){ // Is php4-ldap really there?
<tr valign="top" class="required">
<td align="right">ldap_graceattr:</td>
<td>
<input name="ldap_graceattr" type="text" size="30" value="<?php echo $config->ldap_graceattr?>">
<input name="ldap_graceattr" type="text" size="30" value="<?php echo $config->ldap_graceattr?>" />
<?php if (isset($err["ldap_graceattr"])) formerr($err["ldap_graceattr"]);
?>
</td>
@@ -364,7 +344,7 @@ if (!function_exists('ldap_connect')){ // Is php4-ldap really there?
<tr valign="top" class="required">
<td align="right">ldap_create_context:</td>
<td>
<input name="ldap_create_context" type="text" size="30" value="<?php echo $config->ldap_create_context?>">
<input name="ldap_create_context" type="text" size="30" value="<?php echo $config->ldap_create_context?>" />
<?php if (isset($err["ldap_create_context"])) formerr($err["ldap_create_context"]); ?>
</td><td>
<?php print_string("auth_ldap_create_context","auth") ?>
@@ -381,7 +361,7 @@ if (!function_exists('ldap_connect')){ // Is php4-ldap really there?
<tr valign="top" class="required">
<td align="right">ldap_creators:</td>
<td>
<input name="ldap_creators" type="text" size="30" value="<?php echo $config->ldap_creators?>">
<input name="ldap_creators" type="text" size="30" value="<?php echo $config->ldap_creators?>" />
<?php if (isset($err["ldap_creators"])) formerr($err["ldap_creators"]); ?>
</td><td>
<?php print_string("auth_ldap_creators","auth") ?>
+19 -5
View File
@@ -127,16 +127,26 @@ function auth_get_userinfo($username){
$ldapval = NULL;
foreach ($values as $value) {
if(is_array($user_entry[0][strtolower($value)])) {
$newval = addslashes(stripslashes(utf8_decode($user_entry[0][strtolower($value)][0])));
if (!empty($CFG->unicodedb)) {
$newval = addslashes(stripslashes($user_entry[0][strtolower($value)][0]));
} else {
$newval = addslashes(stripslashes(utf8_decode($user_entry[0][strtolower($value)][0])));
}
}
else {
$newval = addslashes(stripslashes(utf8_decode($user_entry[0][strtolower($value)])));
if (!empty($CFG->unicodedb)) {
$newval = addslashes(stripslashes($user_entry[0][strtolower($value)]));
} else {
$newval = addslashes(stripslashes(utf8_decode($user_entry[0][strtolower($value)])));
}
}
if (!empty($newval)) { // favour ldap entries that are set
$ldapval = $newval;
}
}
$result[$key] = $ldapval;
if (!is_null($ldapval)) {
$result[$key] = $ldapval;
}
}
}
@@ -206,7 +216,11 @@ function auth_user_create ($userobject,$plainpass) {
}
foreach ($values as $value) {
if(!empty($userobject->$key) ){
$newuser[$value]=utf8_encode($userobject->$key);
if (!empty($CFG->unicodedb)) {
$newuser[$value]= $userobject->$key;
} else {
$newuser[$value]=utf8_encode($userobject->$key);
}
}
}
}
@@ -826,7 +840,7 @@ function auth_user_update($olduser, $newuser) {
if ($user_info_result){
$user_entry = auth_ldap_get_entries($ldapconnection, $user_info_result);
if (count($user_entry)) {
if (count($user_entry) > 1) {
trigger_error("ldap: Strange! More than one user record found in ldap. Only using the first one.");
}
$user_entry = $user_entry[0];
+1 -1
View File
@@ -6,7 +6,7 @@ function auth_user_login ($username, $password) {
// Returns true if the username and password work
if ($user = get_record('user', 'username', $username)) {
return ($user->password == md5($password));
return validate_internal_user_password($user, $password);
}
return false;
+1 -1
View File
@@ -6,7 +6,7 @@ function auth_user_login ($username, $password) {
// Returns true if the username and password work
if ($user = get_record('user', 'username', $username)) {
return ($user->password == md5($password));
return validate_internal_user_password($user, $password);
}
return true;
+61
View File
@@ -0,0 +1,61 @@
<?PHP // $Id: config.html
if ((!include_once('Auth/RADIUS.php')) or (!class_exists(Auth_RADIUS_PAP))) { // Is Auth/RADIUS really there?
print '<p align="center"><font color="red"><strong>Warning: The Auth_RADIUS module does not seem to be present. Please ensure it is installed and enabled.</strong></font></p>';
}
if (!isset($config->auth_radiushost)) {
$config->auth_radiushost = "127.0.0.1";
}
if (!isset($config->auth_radiusnasport)) {
$config->auth_radiusport = "0";
}
if (!isset($config->auth_radiussecret)) {
$config->auth_radiussecret = "";
}
?>
<tr valign="top" >
<td align="right"><P>auth_radiushost:</td>
<td>
<input name="auth_radiushost" type="text" size="30" value="<?php echo $config->auth_radiushost?>">
<?php if (isset($err["auth_radiushost"]))
formerr($err["auth_radiushost"]); ?>
</td>
<td>
<?php print_string("auth_radiushost","auth") ?>
</td>
</TR>
<TR valign="top" >
<td align="right"><P>auth_radiusnasport:</td>
<td>
<input name="auth_radiusport" type="text" size="6" value="<?php echo $config->auth_radiusport ?>">
<?php if (isset($err["auth_radiusnasport"])) formerr($err["auth_radiusnasport"]); ?>
</td>
<td>
<?php print_string("auth_radiusnasport","auth") ?>
</td>
</TR>
<TR valign="top" >
<td align="right"><P>auth_radiussecret:</td>
<td>
<input name="auth_radiussecret" type="text" size="6" value="<?php echo $config->auth_radiussecret ?>">
<?php if (isset($err["auth_radiussecret"])) formerr($err["auth_radiussecret"]); ?> </td>
<td>
<?php print_string("auth_radiussecret","auth") ?>
</td>
</TR>
<TR valign="top">
<td align="right"><P><?php print_string("instructions", "auth")
?>:</td>
<td>
<textarea name="auth_instructions" cols="30" rows="10" wrap="virtual"><?php
p($config->auth_instructions) ?></textarea>
</td>
<td>
<?php print_string("authinstructions","auth") ?>
<?php helpbutton("text", get_string("helptext")) ?>
</td>
</TR>
+50
View File
@@ -0,0 +1,50 @@
<?PHP // $Id$
// Authentication by looking up a RADIUS server
// Contributed by Clive Gould <clive@ce.bromley.ac.uk>
function auth_user_login ($username, $password) {
// Returns true if the username and password work
// and false if they are wrong or don't exist.
require_once 'Auth/RADIUS.php';
global $CFG;
// Added by Clive on 7th May for test purposes
// printf("Username: $username <br>");
// printf("Password: $password <br>");
// printf("auth_radiushost: $CFG->auth_radiushost <br>");
// printf("auth_radiusnasport: $CFG->auth_radiusnasport <br>");
// printf("auth_radiussecret: $CFG->auth_radiussecret <br>");
$rauth = new Auth_RADIUS_PAP($username, $password);
$rauth->addServer($CFG->auth_radiushost, $CFG->auth_radiusnasport, $CFG->auth_radiussecret);
if (!$rauth->start()) {
printf("Radius start: %s<br>\n", $rauth->getError());
exit;
}
$result = $rauth->send();
if (PEAR::isError($result)) {
printf("Radius send failed: %s<br>\n", $result->getMessage());
exit;
} else if ($result === true) {
// printf("Radius Auth succeeded<br>\n");
return true;
} else {
// printf("Radius Auth rejected<br>\n");
return false;
}
// get attributes, even if auth failed
if (!$rauth->getAttributes()) {
printf("Radius getAttributes: %s<br>\n", $rauth->getError());
} else {
$rauth->dumpAttributes();
}
$rauth->close();
}
?>
-7
View File
@@ -1,7 +0,0 @@
# Requires a Shibboleth session
# Be sure to read moodle/auth/shibboleth/README.txt for instructions
# on how to configure Moodle for Shibboleth authentication
AuthType shibboleth
ShibRequireSession Off
require shibboleth
+43 -46
View File
@@ -2,7 +2,6 @@ Shibboleth Authentication for Moodle
-------------------------------------------------------------------------------
Requirements:
- Moodle 1.5 or later
- Shibboleth target 1.1 or later. See documentation for your Shibboleth
federation on how to set up Shibboleth.
@@ -12,21 +11,20 @@ Changes:
- 05. 2005: Various extensions and fixes by Lukas Haemmerle
- 06. 2005: Adaptions to new field locks and plugin config structures by Marting
Langhoff and Lukas Haemmerle
- 10. 2005: Added better error messages and moved text to language directories
- 02. 2006: Simplified authentication so that authorization works properly
Added instructions for IIS
Moodle Configuration with Dual login
-------------------------------------------------------------------------------
1. Ensure that the .htaccess file in moodle/auth/shibboleth/ is active
It may be possible that you have to change the configuration of your web
server to allow .htaccess files to override certain settings. Alternatively,
you also could define the rules from the .htaccess file in the web server
configuration file.
2. Protect the file moodle/auth/shibboleth/shib-protected.php with Shibboleth.
This page just needs to redirect the users to moodle/auth/shibboleth/
For Apache you have to define a rule like the following:
1. Protect the directory moodle/auth/shibboleth/ with Shibboleth.
The page index.php in that directory actually logs in a Shibboleth user.
For Apache you have to define a rule like the following in the Apache config:
--
<Location ~ "/auth/shibboleth/shib-protected.php">
<Location ~ "/auth/shibboleth">
AuthType shibboleth
ShibRequireSession On
require valid-user
@@ -36,10 +34,14 @@ Moodle Configuration with Dual login
To restrict access to Moodle, replace the access rule 'require valid-user'
with something that fits your needs, e.g. 'require affiliation student'.
3. As Moodle admin, go to the 'Administrations >> Users >> Authentication
For IIS you have protect the auth/shibboleth directory directly in the
RequestMap of the Shibboleth configuration file (shibboleth.xml). See
https://authdev.it.ohio-state.edu/twiki/bin/view/Shibboleth/xmlaccesscontrol?topic=XMLAccessControl
2. As Moodle admin, go to the 'Administrations >> Users >> Authentication
Options' and select the 'Shibboleth' authentication method from the pop-up.
4. Fill in the fields of the form. The fields 'Username', 'First name',
3. Fill in the fields of the form. The fields 'Username', 'First name',
'Surname', etc should contain the name of the environment variables of the
Shibboleth attributes that you want to map onto the corresponding Moodle
variable (e.g. 'HTTP_SHIB_PERSON_SURNAME' for the person's last name, refer
@@ -58,47 +60,45 @@ Moodle Configuration with Dual login
lengths for each field in the user profile.
#############################################################################
5. The large text field 'Instructions' must contain a link to the
moodle/auth/shibboleth/shib-protected.php file which is protected by
Shibboleth (see step 2) and causes the Shibboleth login procedure to start.
You also coudl use HTML code in that field, e.g. to create your own
4. The large text field 'Instructions' must contain a link to the
moodle/auth/shibboleth/index.php file which is protected by
Shibboleth (see step 1) and causes the Shibboleth login procedure to start.
You could also use HTML code in that field, e.g. to create your own
Shibboleth login button.
6. Save the changes for the Shibboleth authentication method.
5. Save the changes for the Shibboleth authentication method.
Moodle Configuration with Shibboleth only login
-------------------------------------------------------------------------------
If you want Shibboleth as your only authentication method, configure Moodle as
described in the dual login section above and do the following steps:
5.a On the Moodle Shibboleth settings page, set the 'Alternate Login URL' to
the URL of the file 'moodle/auth/shibboleth/shib-protected.php'
4.a On the Moodle Shibboleth settings page, set the 'Alternate Login URL' to
the URL of the file 'moodle/auth/shibboleth/index.php'
This will enforce Shibboleth login.
How the Shibboleth authentication works
--------------------------------------------------------------------------------
For a user to get Shibboleth authenticated in Moodle he first must go to the
Shibboleth-protected page shib-protected.php. If Shibboleth authentication is
enabled this happens automatically when a user wants to login.
Otherwise the user has to click on the link on the login page you provided in
step 5.
To get Shibboleth authenticated in Moodle a user basically must access the
Shibboleth-protected page /auth/shibboleth/index.php. If Shibboleth is the only
authentication method (see 4.a), this happens automatically when a user wants to
login in Moodle. Otherwise, the user has to click on the link on the login page
you provided in step 4.
If the user is successfully Shibboleth authenticated he is redirected to
moodle/auth/shibboleth where he also gets authenticated in Moodle.
Moodle basically checks whether the Shibboleth attribute that you mapped
as the username is present. This attribute is only present if a user is
as the username is present. This attribute should only be present if a user is
Shibboleth authenticated.
If the user's Moodle account has not existed yet, it gets automatically created.
Unless the user's firstname, last name and email address is provided, the user
is automatically redirected to the edit profile page by Moodle.
To prevent that every Shibboleth user can access your Moodle site you have to
adapt the 'require valid-user' line in your webserver's config (see step 2) to
allow only specific users.
adapt the 'require valid-user' line in your webserver's config (see step 1) to
allow only specific users. If you defined some authorization rules in step 1,
these are checked by Shibboleth itself. Only users who met these rules
actually can access /auth/shibboleth/index.php and get logged in.
You can use Shibboleth AND another authentication method (it was tested with
manual login only). So if there are a few users that don't have a Shibboleth
manual login). So, if there are a few users that don't have a Shibboleth
login, you could create manual accounts for them and they could use the manual
login. For other authentication methods you first have to configure them and
then set Shibboleth as your authentication method. Users can log in only via one
@@ -107,18 +107,17 @@ authentication method unless they have two accounts in Moodle.
Shibboleth dual login with custom login page
--------------------------------------------------------------------------------
Of course you can create a dual login page that better fits your needs. For this
to work you have to set up the two authentication methods (e.g. 'Manual' and
'Shibboleth', Shibboleth has to be the current authentication method) and
specify an alternate login link to your own dual login page. On that page you
basically need a link to the Shibboleth-protected page
('moodle/auth/shibboleth/shib-protected.php') for the Shibboleth login and a
to work, you have to set up the two authentication methods (e.g. 'Manual' and
'Shibboleth') and specify an alternate login link to your own dual login page.
On that page you basically need a link to the Shibboleth-protected page
('/auth/shibboleth/index.php') for the Shibboleth login and a
form that sends 'username' and 'password' to moodle/login/index.php.
Consult the Moodle documentation for further instructions and requirements.
How to customize the way the Shibboleth user data is used in ILIAS
How to customize the way the Shibboleth user data is used in Moodle
--------------------------------------------------------------------------------
Among the Shibboleth settings in Moodle there is a field that should contain a
path to a php file that can be used as data manipulation API.
path to a php file that can be used as data manipulation hook.
You can use this if you want to further process the way your Shibboleth
attributes are used in Moodle.
@@ -131,11 +130,11 @@ Example 2: The country, city and street are provided in one Shibboleth attribute
and you want these values to be used in the Moodle user profile. So
You have to parse the corresponding attribute to fill the user fields.
If you want to use this API you have to be a skilled PHP programmer. It is
If you want to use this hook you have to be a skilled PHP programmer. It is
strongly recommended that you take a look at the file
moodle/auth/shibboleth/lib.php, especially the function 'auth_get_userinfo'
where this API file is included.
The context of the API file is the same as within this login function. So you
where this file is included.
The context of the file is the same as within this login function. So you
can directly edit the object $result.
Example file:
@@ -151,7 +150,6 @@ Example file:
// institution, street, zipcode, city and country
$address = $_SERVER[$pluginconfig->field_map_address];
list($institution, $street, $zip_city) = split('\$', $address);
ereg(' (.+)',$zip_city, $regs);
$city = $regs[1];
@@ -168,8 +166,7 @@ Example file:
Bugs
--------------------------------------------------------------------------------
The current implementation has not yet been extensively tested. So there may be
bugs. Please send bug reports concerning the Shibboleth part to
Please send bug reports concerning the Shibboleth part to
Lukas Haemmerle <haemmerle@switch.ch>
--------------------------------------------------------------------------------
+2 -2
View File
@@ -3,7 +3,7 @@
$pluginconfig = get_config('auth/shibboleth');
if (!isset($config->auth_instructions) or empty($pluginconfig->shib_user_attribute)) {
$config->auth_instructions = get_string('auth_shib_instructions', 'auth', $CFG->wwwroot.'/auth/shibboleth/shib-protected.php');
$config->auth_instructions = get_string('auth_shib_instructions', 'auth', $CFG->wwwroot.'/auth/shibboleth/index.php');
}
if (!isset ($pluginconfig->user_attribute)) {
@@ -37,7 +37,7 @@
<textarea name="auth_instructions" cols="30" rows="10" wrap="virtual"><?php p($config->auth_instructions) ?></textarea>
</td>
<td>
<?php print_string("auth_shib_instructions_help","auth", htmlspecialchars($CFG->wwwroot.'/auth/shibboleth')) ?>
<?php print_string("auth_shib_instructions_help","auth", htmlspecialchars($CFG->wwwroot.'/auth/shibboleth/index.php')) ?>
<?php helpbutton("text", get_string("helptext")) ?>
</td>
</tr>
+21 -8
View File
@@ -4,16 +4,25 @@
require('../../config.php');
require('lib.php');
if (isloggedin()) { // Nothing to do
redirect($CFG->wwwroot.'/index.php');
if (isloggedin() && $USER->username != 'guest') { // Nothing to do
if (isset($SESSION->wantsurl) and (strpos($SESSION->wantsurl, $CFG->wwwroot) === 0)){
$urltogo = $SESSION->wantsurl; /// Because it's an address in this site
unset($SESSION->wantsurl);
} else {
$urltogo = $CFG->wwwroot.'/'; /// Go to the standard home page
unset($SESSION->wantsurl); /// Just in case
}
redirect($urltogo);
}
$pluginconfig = get_config('auth/shibboleth');
// Check whether Shibboleth is configured properly
if (empty($pluginconfig->shib_user_attribute)) {
error('Shibboleth authentication (\'shib_user_attribute\') is not set up correctly. You probably haven\'t yet configured the Shibboleth authentication. Please consult the README in moodle/auth/shibboleth for further instructions on how to set up Shibboleth authentication.');
}
error(get_string( 'shib_not_set_up_error', 'auth'));
}
/// If we can find the Shibboleth attribute, save it in session and return to main login page
if (!empty($_SERVER[$pluginconfig->shib_user_attribute])) { // Shibboleth auto-login
@@ -51,9 +60,13 @@
redirect($urltogo);
}
}
$SESSION->shibboleth_checked = true; // This will stop us bouncing back here
redirect($CFG->wwwroot.'/login/index.php');
// If we can find any (user independent) Shibboleth attributes but no user
// attributes we probably didn't receive any user attributes
elseif (!empty($_SERVER['HTTP_SHIB_APPLICATION_ID'])){
error(get_string( 'shib_no_attributes_error', 'auth' , '\''.$pluginconfig->shib_user_attribute.'\', \''.$pluginconfig->field_map_firstname.'\', \''.$pluginconfig->field_map_lastname.'\' and \''.$pluginconfig->field_map_email.'\''));
} else {
error(get_string( 'shib_not_set_up_error', 'auth'));
}
?>
+29 -18
View File
@@ -1,6 +1,7 @@
<?PHP // $Id$
//CHANGELOG:
//28.10.2004 SHIBBOLETH Authentication functions v.0.1
//2005-2006 Various extensions and fixes by Lukas Haemmerle
//Distributed under GPL (c)Markus Hagman 2004-
function auth_user_login($username, $password) {
@@ -8,18 +9,14 @@ function auth_user_login($username, $password) {
$pluginconfig = get_config('auth/shibboleth');
/// If we are in the shibboleth directory then we trust the server var
// If we are in the shibboleth directory then we trust the server var
if (!empty($_SERVER[$pluginconfig->shib_user_attribute])) {
return ($_SERVER[$pluginconfig->shib_user_attribute] == $username);
}
/// If we are not, then the server is probably set to not be Shibboleth-only
/// and the user has used the normal login screen, so we redirect to the shibboleth
/// directory for a proper check
redirect($CFG->wwwroot.'/auth/shibboleth/index.php');
/// There's no point doing anything further here
exit;
} else {
// If we are not, the user has used the manual login and the login name is
// unknown, so we return false.
return false;
}
}
function auth_get_userinfo($username) {
@@ -35,7 +32,7 @@ function auth_get_userinfo($username) {
|| empty($_SERVER[$pluginconfig->field_map_lastname])
|| empty($_SERVER[$pluginconfig->field_map_email])
) {
error("Moodle needs certain Shibboleth attributes which are not present in your case. The attributes are: '".$pluginconfig->shib_user_attribute."' ('".$_SERVER[$pluginconfig->shib_user_attribute]."'), '".$pluginconfig->field_map_firstname."' ('".$_SERVER[$pluginconfig->field_map_firstname]."'), '".$pluginconfig->field_map_lastname."' ('".$_SERVER[$pluginconfig->field_map_lastname]."') and '".$pluginconfig->field_map_email."' ('".$_SERVER[$pluginconfig->field_map_email]."')<br>Please contact your Identity Service Provider.");
error(get_string( 'shib_not_all_attributes_error', 'auth' , "'".$pluginconfig->shib_user_attribute."' ('".$_SERVER[$pluginconfig->shib_user_attribute]."'), '".$pluginconfig->field_map_firstname."' ('".$_SERVER[$pluginconfig->field_map_firstname]."'), '".$pluginconfig->field_map_lastname."' ('".$_SERVER[$pluginconfig->field_map_lastname]."') and '".$pluginconfig->field_map_email."' ('".$_SERVER[$pluginconfig->field_map_email]."')"));
}
$attrmap = auth_shib_attributes();
@@ -44,10 +41,14 @@ function auth_get_userinfo($username) {
$search_attribs = array();
foreach ($attrmap as $key=>$value) {
$result[$key]=utf8_decode($_SERVER[$value]);
if (!empty($CFG->unicodedb)) {
$result[$key]=get_first_string($_SERVER[$value]);
} else {
$result[$key]=utf8_decode(get_first_string($_SERVER[$value]));
}
}
// Provide an API to modify the information to fit the Moodle internal
// Provide an API to modify the information to fit the Moodle internal
// data representation
if (
$pluginconfig->convert_data
@@ -59,15 +60,14 @@ function auth_get_userinfo($username) {
// modify the variable $moodleattributes
include($pluginconfig->convert_data);
}
return $result;
}
function auth_shib_attributes(){
//returns array containg attribute mappings between Moodle and shibboleth
global $CFG;
global $CFG;
$config = (array)$CFG;
$pluginconfig = get_config('auth/shibboleth');
$pluginconfig = (array) $pluginconfig;
@@ -81,8 +81,19 @@ function auth_shib_attributes(){
$moodleattributes[$field] = $pluginconfig["field_map_$field"];
}
}
$moodleattributes['username']=$config["shib_user_attribute"];
$moodleattributes['username']=$pluginconfig["shib_user_attribute"];
return $moodleattributes;
return $moodleattributes;
}
function get_first_string($string){
// Cleans and returns first of potential many values (multi-valued attributes)
$list = split( ';', $string);
$clean_string = rtrim($list[0]);
return $clean_string;
}
?>
-7
View File
@@ -1,7 +0,0 @@
<?php
// This file must be Shibboleth protected
// Consult the README for further instructions
require_once("../../config.php");
header("Location: ".$CFG->wwwroot."/auth/shibboleth/");
?>
+12 -8
View File
@@ -17,13 +17,7 @@
if (!empty($id)) {
if (!isteacheredit($id)) {
if (empty($to)) {
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
} else {
if (!isteacheredit($to)) {
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
}
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
} else {
if (!isadmin()) {
@@ -31,6 +25,12 @@
}
}
if (!empty($to)) {
if (!isteacheredit($to)) {
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
}
//Check site
if (!$site = get_site()) {
error("Site not found!");
@@ -116,6 +116,10 @@
//Call the form, depending the step we are
if (!$launch) {
// if we're at the start, clear the cache of prefs
if (isset($SESSION->backupprefs[$course->id])) {
unset($SESSION->backupprefs[$course->id]);
}
include_once("backup_form.html");
} else if ($launch == "check") {
include_once("backup_check.html");
@@ -124,7 +128,7 @@
}
print_simple_box_end();
//Print footer
//Print footer
print_footer();
?>
+53 -107
View File
@@ -20,47 +20,16 @@
}
}
$backupprefs = new StdClass;
$count = 0;
backup_fetch_prefs_from_request($backupprefs,$count,$course);
//Check site
if (!$site = get_site()) {
error("Site not found!");
}
//Checks for the required files/functions to backup every mod
//And check if there is data about it
$count = 0;
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$modfile = "$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;
$$var = optional_param( $var,0);
//Check include user info
$var = "backup_user_info_".$modname;
$$var = optional_param( $var,0);
}
}
//Check other parameters
$backup_metacourse = optional_param('backup_metacourse',1);
$backup_users = optional_param('backup_users',1);
$backup_logs = optional_param('backup_logs',0);
$backup_user_files = optional_param('backup_user_files',1);
$backup_course_files = optional_param('backup_course_files',1);
$backup_messages = optional_param('backup_messages',1);
if ($count == 0) {
notice("No backupable modules are installed!");
}
@@ -70,46 +39,6 @@
<table cellpadding="5">
<?php
//Calculate the backup string
//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";
//And finally, clean everything
$backup_name = clean_filename($backup_name);
//Calculate the backup unique code to allow simultaneus backups (to define
//the temp-directory name and records in backup temp tables
$backup_unique_code = time();
if (empty($to)) {
//Now print the Backup Name tr
echo "<tr>";
@@ -117,7 +46,7 @@
echo get_string("name").":";
echo "</b></td><td>";
//Add as text field
echo "<input type=\"text\" name=\"backup_name\" size=\"40\" value=\"".$backup_name."\" />";
echo "<input type=\"text\" name=\"backup_name\" size=\"40\" value=\"".$backupprefs->backup_name."\" />";
echo "</td></tr>";
//Line
@@ -127,32 +56,30 @@
echo "<tr>";
echo "<td colspan=\"2\" align=\"center\"><b>";
} else {
echo '<input type="hidden" name="backup_name" value="'.$backup_name.'" /></b>';
}
//Here we check if backup_users = None. Then, we switch off every module
//user info, user_files, logs and exercises, workshop and messages backups. A Warning is showed to
//inform the user.
if ($backup_users == 2) {
if ($backupprefs->backup_users == 2) {
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$var = "backup_user_info_".$modname;
if (isset($$var)) {
$$var = 0;
if (isset($backupprefs->$var)) {
$backupprefs->$var = 0;
}
$var = "backup_".$modname;
if (isset($$var)) {
if (isset($backupprefs->$var)) {
if ($modname == "exercise" || $modname == "workshop") {
$$var = 0;
$backupprefs->$var = 0;
}
}
}
$backup_user_files = 0;
$backup_logs = 0;
$backup_messages = 0;
$backupprefs->backup_user_files = 0;
$backupprefs->backup_logs = 0;
$backupprefs->backup_messages = 0;
}
print_simple_box("<font color=\"red\">".get_string("backupnoneusersinfo")."</font>","center", "70%", '', "20", "noticebox");
echo "<hr />";
@@ -169,21 +96,24 @@
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$modfile = $CFG->dirroot.'/mod/'.$modname.'/backuplib.php';
if (!file_exists($modfile)) {
continue;
}
require_once($modfile);
$modbackup = $modname."_backup_mods";
//If exists the lib & function
$var = "exists_".$modname;
if (isset($$var) && $$var) {
if (isset($backupprefs->$var) && $backupprefs->$var) {
$var = "backup_".$modname;
//Only if selected
if ($$var == 1) {
if (!empty($backupprefs->$var) and ($backupprefs->$var == 1)) {
//Print the full tr
echo "<tr>";
echo "<td colspan=\"2\">";
//Add hidden fields
$var = "backup_".$modname;
echo "<input type=\"hidden\" name=\"".$var."\" value=\"".$$var."\" />";
$var = "backup_user_info_".$modname;
echo "<input type=\"hidden\" name=\"".$var."\" value=\"".$$var."\" />";
//Print the mod name
echo "<b>".get_string("include")." ".get_string("modulenameplural",$modname)." ";
//Now look for user-data status
@@ -191,10 +121,29 @@
$backup_user_options[1] = get_string("withuserdata");
$var = "backup_user_info_".$modname;
//Print the user info
echo $backup_user_options[$$var]."</b>";
echo $backup_user_options[$backupprefs->$var]."</b>";
//Call the check function to show more info
$modcheckbackup = $modname."_check_backup_mods";
$table->data = $modcheckbackup($id,$$var,$backup_unique_code);
$var = $modname.'_instances';
$instancestopass = array();
if (!empty($backupprefs->$var) && is_array($backupprefs->$var) && count($backupprefs->$var)) {
$table->data = array();
$countinstances = 0;
foreach ($backupprefs->$var as $instance) {
$var1 = 'backup_'.$modname.'_instance_'.$instance->id;
$var2 = 'backup_user_info_'.$modname.'_instance_'.$instance->id;
if (!empty($backupprefs->$var1)) {
$obj = new StdClass;
$obj->name = $instance->name;
$obj->userdata = $backupprefs->$var2;
$obj->id = $instance->id;
$instancestopass[$instance->id]= $obj;
$countinstances++;
}
}
}
$table->data = $modcheckbackup($id,$backupprefs->$var,$backupprefs->backup_unique_code,$instancestopass);
print_table($table);
echo "</td></tr>";
}
@@ -212,16 +161,16 @@
$user_options[0] = get_string("includeallusers");
$user_options[1] = get_string("includecourseusers");
$user_options[2] = get_string("includenoneusers");
echo $user_options[$backup_users].'</b>';
echo $user_options[$backupprefs->backup_users].'</b>';
//Print info
$table->data = user_check_backup($id,$backup_unique_code,$backup_users,$backup_messages);
$table->data = user_check_backup($id,$backupprefs->backup_unique_code,$backupprefs->backup_users,$backupprefs->backup_messages);
print_table($table);
echo "</td></tr>";
}
//Now print the Logs tr conditionally
if ($backup_logs && empty($to)) {
if ($backupprefs->backup_logs && empty($to)) {
echo "<tr>";
echo "<td colspan=\"2\"><b>";
echo get_string("includelogentries").'</b>';
@@ -232,38 +181,35 @@
}
//Now print the User Files tr conditionally
if ($backup_user_files) {
if ($backupprefs->backup_user_files) {
echo "<tr>";
echo "<td colspan=\"2\"><b>";
echo get_string("includeuserfiles").'</b>';
//Print info
$table->data = user_files_check_backup($id,$backup_unique_code);
$table->data = user_files_check_backup($id,$backupprefs->backup_unique_code);
print_table($table);
echo "</td></tr>";
}
//Now print the Course Files tr conditionally
if ($backup_course_files) {
if ($backupprefs->backup_course_files) {
echo "<tr>";
echo "<td colspan=\"2\"><b>";
echo get_string("includecoursefiles").'</b>';
//Print info
$table->data = course_files_check_backup($id,$backup_unique_code);
$table->data = course_files_check_backup($id,$backupprefs->backup_unique_code);
print_table($table);
echo "</td></tr>";
}
}
// now keep it for next time.
$SESSION->backupprefs[$course->id] = $backupprefs;
?>
</table>
<br />
<center>
<input type="hidden" name="backup_unique_code" value="<?php p($backup_unique_code) ?>" />
<input type="hidden" name="backup_metacourse" value="<?php p($backup_metacourse) ?>" />
<input type="hidden" name="backup_users" value="<?php p($backup_users) ?>" />
<input type="hidden" name="backup_logs" value="<?php p($backup_logs) ?>" />
<input type="hidden" name="backup_user_files" value="<?php p($backup_user_files) ?>" />
<input type="hidden" name="backup_course_files" value="<?php p($backup_course_files) ?>" />
<input type="hidden" name="backup_messages" value="<?php p($backup_messages) ?>" />
<input type="hidden" name="to" value="<?php p($to) ?>" />
<input type="hidden" name="id" value="<?php p($id) ?>" />
<input type="hidden" name="launch" value="execute" />
+11 -71
View File
@@ -26,71 +26,8 @@
error("Site not found!");
}
//Checks for the required files/functions to backup every mod
//And check if there is data about it
$count = 0;
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$modfile = "$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;
$$var = optional_param( $var,0,PARAM_INT );
//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;
$$var = optional_param( $var,0,PARAM_INT );
//Now stores all the mods preferences into an array into preferences
$preferences->mods[$modname]->userinfo = $$var;
//And the name of the mod
$preferences->mods[$modname]->name = $modname;
}
}
//Check other parameters
$backup_metacourse = optional_param( 'backup_metacourse',1,PARAM_INT );
$preferences->backup_metacourse = $backup_metacourse;
$backup_users = optional_param( 'backup_users',1,PARAM_INT );
$preferences->backup_users = $backup_users;
$backup_logs = optional_param( 'backup_logs',0,PARAM_INT );
$preferences->backup_logs = $backup_logs;
$backup_user_files = optional_param( 'backup_user_files',1,PARAM_INT );
$preferences->backup_user_files = $backup_user_files;
$backup_course_files = optional_param( 'backup_course_files',2,PARAM_INT );
$preferences->backup_course_files = $backup_course_files;
$backup_messages = optional_param( 'backup_messages',1,PARAM_INT );
$preferences->backup_messages = $backup_messages;
$id = required_param('id');
$preferences->backup_course = $id;
$backup_name = required_param('backup_name',PARAM_FILE );
$preferences->backup_name = $backup_name;
$backup_unique_code = required_param('backup_unique_code');
$preferences->backup_unique_code = $backup_unique_code;
$preferences = new StdClass;
backup_fetch_prefs_from_request($preferences,$count,$course);
//Another Info
$preferences->moodle_version = $CFG->version;
$preferences->moodle_release = $CFG->release;
@@ -124,10 +61,10 @@
//Check for temp and backup and backup_unique_code directory
//Create them as needed
echo "<li>".get_string("creatingtemporarystructures").'</li>';
$status = check_and_create_backup_dir($backup_unique_code);
$status = check_and_create_backup_dir($preferences->backup_unique_code);
//Empty dir
if ($status) {
$status = clear_backup_dir($backup_unique_code);
$status = clear_backup_dir($preferences->backup_unique_code);
}
//Delete old_entries from backup tables
@@ -144,7 +81,7 @@
echo "<ul>";
echo "<li>".get_string("writingheader").'</li>';
//Obtain the xml file (create and open) and print prolog information
$backup_file = backup_open_xml($backup_unique_code);
$backup_file = backup_open_xml($preferences->backup_unique_code);
echo "<li>".get_string("writinggeneralinfo").'</li>';
//Prints general info about backup to file
if ($backup_file) {
@@ -208,9 +145,10 @@
//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) {
if ($status and !empty($preferences->mods['quiz']->backup)) {
echo "<li>".get_string("writingcategoriesandquestions").'</li>';
if (!$status = quiz_backup_question_categories($backup_file,$preferences)) {
require_once($CFG->dirroot.'/mod/quiz/backuplib.php');
if (!$status = backup_question_categories($backup_file,$preferences)) {
notify("An error occurred while backing up quiz categories");
}
}
@@ -380,6 +318,8 @@
}
error_log($filename);
$SESSION->import_preferences = $preferences;
print_continue($CFG->wwwroot.'/course/import.php?id='.$to.'&fromcourse='.$id.'&filename='.$filename);
print_continue($CFG->wwwroot.'/course/import/activities/index.php?id='.$to.'&fromcourse='.$id.'&filename='.$filename);
}
$SESSION->backupprefs[$course->id] = null; // unset it so we're clear next time.
?>
+76 -4
View File
@@ -33,6 +33,7 @@
$modname = $mod->name;
$modfile = "$CFG->dirroot/mod/$modname/backuplib.php";
$modbackup = $modname."_backup_mods";
$modbackupone = $modname.'_backup_one_mod';
$modcheckbackup = $modname."_check_backup_mods";
if (file_exists($modfile)) {
include_once($modfile);
@@ -40,6 +41,11 @@
$var = "exists_".$modname;
$$var = true;
$count++;
// check that there are instances and we can back them up individually
if (count_records('course_modules','course',$course->id,'module',$mod->id) && function_exists($modbackupone)) {
$var = 'exists_one_'.$modname;
$$var = true;
}
}
}
//Check data
@@ -94,7 +100,7 @@ function selectItemInRadioByName(formId, radioName, selectIndex ) {
}
function selectItemInCheckboxByName(formId, checkName, checked ) {
myForm = document.getElementById(formId)
myForm = document.getElementById(formId);
for (i=0,n=myForm.elements.length;i<n;i++) {
myLen = checkName.length;
myName = myForm.elements[i].name;
@@ -144,19 +150,42 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
$var = "backup_".$modname;
//choose_from_menu($backup_options, $var, $$var, "");
//Print the checkbox
print_checkbox($var, $$var, $$var, get_string("modulenameplural",$modname));
$var = "backup_user_info_".$modname;
print_checkbox($var, $$var, $$var, get_string("modulenameplural",$modname),'','selectItemInCheckboxByName(\'form1\',\'backup_'.$modname.'\',this.checked)');
echo "</td><td align=\"right\">&nbsp;";
echo "</td><td>";
$var = "backup_user_info_".$modname;
if (empty($to)) {
$backup_user_options[0] = get_string("withoutuserdata");
$backup_user_options[1] = get_string("withuserdata");
//choose_from_menu($backup_user_options, $var, $$var, "");
print_checkbox($var, $$var, $$var, get_string("userdata"));
print_checkbox($var, $$var, $$var, get_string("userdata"),'','selectItemInCheckboxByName(\'form1\',\'backup_user_info_'.$modname.'\',this.checked)');
} else {
echo '<input type="hidden" name="'.$var.'" value="0" />';
}
echo "</td></tr>\n";
// if we have the backup_one_mod function, loop here.
$var = 'exists_one_'.$modname;
if (!empty($$var)) {
echo '<tr><td></td><td colspan="3"><table class="backup-form-instances">';
$instances = get_all_instances_in_course($modname,$course);
foreach ($instances as $instance) {
echo '<tr><td>';
$var = 'backup_'.$modname.'_instance_'.$instance->id;
$$var = optional_param($var,1);
print_checkbox($var,$$var,$$var,$instance->name,$instance->name,'this.form.elements[\'backup_'.$modname.'\'].checked=1;');
echo '</td><td align="right">&nbsp;';
$var = 'backup_user_info_'.$modname.'_instance_'.$instance->id;
$$var = optional_param($var,1);
if (empty($to)) {
print_checkbox($var,$$var,$$var,get_string('userdata'),'','this.form.elements[\'backup_user_info_'.$modname.'\'].checked=1;');
} else {
echo '<input type="hidden" name="'.$var.'" value="0" />';
}
echo '</td></tr>';
}
echo '</table></td></tr>';
}
}
}
//Line
@@ -247,12 +276,55 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
echo '<input type="hidden" name="backup_messages" value="0" />';
}
}
$backup_unique_code = time();
//Calculate the backup string
//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";
//And finally, clean everything
$backup_name = clean_filename($backup_name);
//Calculate the backup unique code to allow simultaneus backups (to define
//the temp-directory name and records in backup temp tables
?>
</table>
<br />
<center>
<input type="hidden" name="id" value="<?php p($id) ?>" />
<input type="hidden" name="to" value="<?php p($to) ?>" />
<input type="hidden" name="backup_unique_code" value="<?php p($backup_unique_code); ?>" />
<input type="hidden" name="backup_name" value="<?php p($backup_name); ?>" />
<input type="hidden" name="launch" value="check" />
<input type="submit" value="<?php print_string("continue") ?>" />
<input type="submit" name="cancel" value="<?php print_string("cancel") ?>" />
+61 -23
View File
@@ -98,9 +98,17 @@ function schedule_backup_cron() {
if (!$backup_course) {
mtrace(" ERROR (in backup_courses detection)");
$status = false;
continue;
}
//Now we backup every course with nextstarttime < now
if ($backup_course->nextstarttime > 0 && $backup_course->nextstarttime < $now) {
// Skip backup of unavailable courses that have remained unmodified in a month
$skipped = false;
if (!$course->visible && ($now - $course->timemodified) > 31*24*60*60) { //Hidden + unmodified last month
mtrace(" SKIPPING - hidden+unmodified");
set_field("backup_courses","laststatus","3","courseid",$backup_course->courseid);
$skipped = true;
}
//Now we backup every non skipped course with nextstarttime < now
if (!$skipped && $backup_course->nextstarttime > 0 && $backup_course->nextstarttime < $now) {
//We have to send a email because we have included at least one backup
$emailpending = true;
//Only make the backup if laststatus isn't 2-UNFINISHED (uncontrolled error)
@@ -154,6 +162,7 @@ function schedule_backup_cron() {
$count_ok = count_records('backup_courses','laststatus','1');
$count_error = count_records('backup_courses','laststatus','0');
$count_unfinished = count_records('backup_courses','laststatus','2');
$count_skipped = count_records('backup_courses','laststatus','3');
//Build the message text
//Summary
@@ -161,6 +170,7 @@ function schedule_backup_cron() {
$message .= "==================================================\n";
$message .= " ".get_string('courses').": ".$count_all."\n";
$message .= " ".get_string('ok').": ".$count_ok."\n";
$message .= " ".get_string('skipped').": ".$count_skipped."\n";
$message .= " ".get_string('error').": ".$count_error."\n";
$message .= " ".get_string('unfinished').": ".$count_unfinished."\n\n";
@@ -325,7 +335,7 @@ function schedule_backup_course_configure($course,$starttime = 0) {
$backup_config->backup_sche_coursefiles = 1;
}
if (!isset($backup_config->backup_sche_messages)) {
$backup_config->backup_sche_messages = 1;
$backup_config->backup_sche_messages = 0;
}
if (!isset($backup_config->backup_sche_active)) {
$backup_config->backup_sche_active = 0;
@@ -363,26 +373,46 @@ function schedule_backup_course_configure($course,$starttime = 0) {
$var = "exists_".$modname;
$$var = true;
$count++;
// PENNY NOTES: I have moved from here to the closing brace inside
// by two sets of ifs()
// to avoid the backup failing on a non existant backup.
// If the file/function/whatever doesn't exist, we don't want to set this
// this module in backup preferences at all.
//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;
}
}
//Check data
//Check module info
$var = "backup_".$modname;
if (!isset($$var)) {
$$var = $backup_config->backup_sche_modules;
}
}
// now set instances
if ($coursemods = get_course_mods($course->id)) {
foreach ($coursemods as $mod) {
if (array_key_exists($mod->modname,$preferences->mods)) { // we are to backup this module
if (empty($preferences->mods[$mod->modname]->instances)) {
$preferences->mods[$mod->modname]->instances = array(); // avoid warnings
}
$preferences->mods[$mod->modname]->instances[$mod->instance]->backup = $preferences->mods[$mod->modname]->backup;
$preferences->mods[$mod->modname]->instances[$mod->instance]->userinfo = $preferences->mods[$mod->modname]->userinfo;
// there isn't really a nice way to do this...
$preferences->mods[$mod->modname]->instances[$mod->instance]->name = get_field($mod->modname,'name','id',$mod->instance);
}
//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;
}
}
}
@@ -484,7 +514,13 @@ function schedule_backup_course_configure($course,$starttime = 0) {
//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,$preferences->backup_messages);
//Decide about include users with messages, based on SITEID
if ($preferences->backup_messages && $preferences->backup_course == SITEID) {
$include_message_users = true;
} else {
$include_message_users = false;
}
user_check_backup($course->id,$backup_unique_code,$preferences->backup_users,$include_message_users);
}
//Now calculate the logs
@@ -605,7 +641,7 @@ function schedule_backup_course_execute($preferences,$starttime = 0) {
//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);
$status = backup_question_categories($backup_file,$preferences);
}
//Print logs if selected
@@ -736,7 +772,9 @@ function schedule_backup_course_delete_old_files($preferences,$starttime=0) {
$dirtocheck = $CFG->dataroot."/".$preferences->backup_course."/backupdata";
}
schedule_backup_log($starttime,$preferences->backup_course," checking $dirtocheck");
mtrace(" Keeping backup files in $dirtocheck");
if ($CFG->debug > 7) {
mtrace(" Keeping backup files in $dirtocheck");
}
//Get all the files in $dirtocheck
$files = get_directory_list($dirtocheck,"",false);
+215 -32
View File
@@ -78,7 +78,7 @@
//Insert the record id. backup_users decide it.
//When all users
$status = insert_record("backup_ids",$backupids_rec,false,"backup_code");
$status = insert_record('backup_ids', $backupids_rec, false);
$count_users++;
}
//Do some output
@@ -414,13 +414,20 @@
}
//Return the xml start tag
function start_tag($tag,$level=0,$endline=false) {
function start_tag($tag,$level=0,$endline=false,$attributes=null) {
if ($endline) {
$endchar = "\n";
} else {
$endchar = "";
}
return str_repeat(" ",$level*2)."<".strtoupper($tag).">".$endchar;
$attrstring = '';
if (!empty($attributes) && is_array($attributes)) {
foreach ($attributes as $key => $value) {
$attrstring .= " ".xml_tag_safe_content($key)."=\"".
xml_tag_safe_content($value)."\"";
}
}
return str_repeat(" ",$level*2)."<".strtoupper($tag).$attrstring.">".$endchar;
}
//Return the xml end tag
@@ -434,30 +441,38 @@
}
//Return the start tag, the contents and the end tag
function full_tag($tag,$level=0,$endline=true,$content,$to_utf=true) {
function full_tag($tag,$level=0,$endline=true,$content,$attributes=null) {
global $CFG;
//Here we encode absolute links
$content = backup_encode_absolute_links($content);
//If enabled, we strip all the control chars from the text but tabs, newlines and returns
$st = start_tag($tag,$level,$endline,$attributes);
$co = xml_tag_safe_content($content);
$et = end_tag($tag,0,true);
return $st.$co.$et;
}
function xml_tag_safe_content($content) {
global $CFG;
//If enabled, we strip all the control chars (\x0-\x1f) from the text but tabs (\x9),
//newlines (\xa) and returns (\xd). The delete control char (\x7f) is also included.
//because they are forbiden in XML 1.0 specs. The expression below seems to be
//UTF-8 safe too because it simply ignores the rest of characters.
if (!empty($CFG->backup_strip_controlchars)) {
$content = preg_replace("/(?(?=[[:cntrl:]])[^\n\r\t])/is","",$content);
}
//Start to build the tag
$st = start_tag($tag,$level,$endline);
$co="";
if ($to_utf) {
$co = preg_replace("/\r\n|\r/", "\n", utf8_encode(htmlspecialchars($content)));
$content = preg_replace("/[\x-\x8\xb-\xc\xe-\x1f\x7f]/is","",$content);
if (!empty($CFG->unicodedb)) {
// Don't perform the conversion. Contents are Unicode.
$content = preg_replace("/\r\n|\r/", "\n", htmlspecialchars($content));
} else {
$co = preg_replace("/\r\n|\r/", "\n", htmlspecialchars($content));
}
$et = end_tag($tag,0,true);
return $st.$co.$et;
// Perform the conversion. Contents aren't Unicode.
$content = preg_replace("/\r\n|\r/", "\n", utf8_encode(htmlspecialchars($content)));
}
return $content;
}
//Prints General info about the course
@@ -498,13 +513,40 @@
$included = "true";
if ($element->userinfo) {
$userinfo = "true";
}
}
}
//Prints the mod start
fwrite ($bf,start_tag("MOD",3,true));
fwrite ($bf,full_tag("NAME",4,false,$element->name));
fwrite ($bf,full_tag("INCLUDED",4,false,$included));
fwrite ($bf,full_tag("USERINFO",4,false,$userinfo));
if (isset($preferences->mods[$element->name]->instances)
&& is_array($preferences->mods[$element->name]->instances)
&& count($preferences->mods[$element->name]->instances)) {
fwrite ($bf, start_tag("INSTANCES",4,true));
foreach ($preferences->mods[$element->name]->instances as $id => $object) {
if (!empty($object->backup)) {
//Calculate info
$included = "false";
$userinfo = "false";
if ($object->backup) {
$included = "true";
if ($object->userinfo) {
$userinfo = "true";
}
}
fwrite ($bf, start_tag("INSTANCE",5,true));
fwrite ($bf, full_tag("ID",5,false,$id));
fwrite ($bf, full_tag("NAME",5,false,$object->name));
fwrite ($bf, full_tag("INCLUDED",5,false,$included)) ;
fwrite ($bf, full_tag("USERINFO",5,false,$userinfo));
fwrite ($bf, end_tag("INSTANCE",5,true));
}
}
fwrite ($bf, end_tag("INSTANCES",4,true));
}
//Print the end
fwrite ($bf,end_tag("MOD",3,true));
@@ -609,6 +651,7 @@
fwrite ($bf,full_tag("LANG",3,false,$course->lang));
fwrite ($bf,full_tag("THEME",3,false,$course->theme));
fwrite ($bf,full_tag("COST",3,false,$course->cost));
fwrite ($bf,full_tag("CURRENCY",3,false,$course->currency));
fwrite ($bf,full_tag("MARKER",3,false,$course->marker));
fwrite ($bf,full_tag("VISIBLE",3,false,$course->visible));
fwrite ($bf,full_tag("HIDDENSECTIONS",3,false,$course->hiddensections));
@@ -945,6 +988,14 @@
fwrite ($bf,start_tag("MODS",4,true));
$first_record = false;
}
// if we're doing selected instances, check that too.
if (is_array($preferences->mods[$moduletype]->instances)
&& count($preferences->mods[$moduletype]->instances)
&& (!array_key_exists($course_module[$tok]->instance,$preferences->mods[$moduletype]->instances)
|| empty($preferences->mods[$moduletype]->instances[$course_module[$tok]->instance]->backup))) {
$tok = strtok(",");
continue;
}
//Print mod info from course_modules
fwrite ($bf,start_tag("MOD",5,true));
//Save neccesary info to backup_ids
@@ -952,7 +1003,6 @@
fwrite ($bf,full_tag("TYPE",6,false,$moduletype));
fwrite ($bf,full_tag("INSTANCE",6,false,$course_module[$tok]->instance));
fwrite ($bf,full_tag("ADDED",6,false,$course_module[$tok]->added));
fwrite ($bf,full_tag("DELETED",6,false,$course_module[$tok]->deleted));
fwrite ($bf,full_tag("SCORE",6,false,$course_module[$tok]->score));
fwrite ($bf,full_tag("INDENT",6,false,$course_module[$tok]->indent));
fwrite ($bf,full_tag("VISIBLE",6,false,$course_module[$tok]->visible));
@@ -999,7 +1049,6 @@
//Output all user data
fwrite ($bf,full_tag("ID",4,false,$user_data->id));
fwrite ($bf,full_tag("AUTH",4,false,$user_data->auth));
fwrite ($bf,full_tag("GUID",4,false,$user_data->guid));
fwrite ($bf,full_tag("CONFIRMED",4,false,$user_data->confirmed));
fwrite ($bf,full_tag("POLICYAGREED",4,false,$user_data->policyagreed));
fwrite ($bf,full_tag("DELETED",4,false,$user_data->deleted));
@@ -1029,7 +1078,7 @@
fwrite ($bf,full_tag("LASTACCESS",4,false,$user_data->lastaccess));
fwrite ($bf,full_tag("LASTLOGIN",4,false,$user_data->lastlogin));
fwrite ($bf,full_tag("CURRENTLOGIN",4,false,$user_data->currentlogin));
fwrite ($bf,full_tag("LASTIP",4,false,$user_data->lastIP));
fwrite ($bf,full_tag("LASTIP",4,false,$user_data->lastip));
fwrite ($bf,full_tag("SECRET",4,false,$user_data->secret));
fwrite ($bf,full_tag("PICTURE",4,false,$user_data->picture));
fwrite ($bf,full_tag("URL",4,false,$user_data->url));
@@ -1191,7 +1240,8 @@
//See if it is a valid module to backup
if ($log->module == "course" or
$log->module == "user" or
$preferences->mods[$log->module]->backup == 1) {
(array_key_exists($log->module, $preferences->mods) and $preferences->mods[$log->module]->backup == 1)) {
// logs with 'upload' in module field are ignored, there is no restore code anyway
//Begin log tag
fwrite ($bf,start_tag("LOG",3,true));
@@ -1611,14 +1661,30 @@
$status = true;
//First, re-check if necessary functions exists
$modbackup = $module."_backup_mods";
if (function_exists($modbackup)) {
//Call the function
$status = $modbackup($bf,$preferences);
} else {
//Something was wrong. Function should exist.
$status = false;
require_once($CFG->dirroot.'/mod/'.$module.'/backuplib.php');
if (isset($preferences->mods[$module]->instances)
&& is_array($preferences->mods[$module]->instances)) {
$onemodbackup = $module.'_backup_one_mod';
if (function_exists($onemodbackup)) {
foreach ($preferences->mods[$module]->instances as $instance => $object) {
if (!empty($object->backup)) {
$status = $onemodbackup($bf,$preferences,$instance);
}
}
} else {
$status = false;
}
} else { // whole module.
//First, re-check if necessary functions exists
$modbackup = $module."_backup_mods";
if (function_exists($modbackup)) {
//Call the function
$status = $modbackup($bf,$preferences);
} else {
//Something was wrong. Function should exist.
$status = false;
}
}
return $status;
@@ -1655,6 +1721,7 @@
foreach ($mypreferences->mods as $name => $info) {
//Check if the xxxx_encode_content_links exists
include_once("$CFG->dirroot/mod/$name/backuplib.php");
$function_name = $name."_encode_content_links";
if (function_exists($function_name)) {
$result = $function_name($result,$mypreferences);
@@ -1662,7 +1729,7 @@
}
if ($result != $content && $CFG->debug>7) { //Debug
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />'; //Debug
echo '<br /><hr />'.s($content).'<br />changed to<br />'.s($result).'<hr /><br />'; //Debug
} //Debug
return $result;
@@ -1856,4 +1923,120 @@
return $status;
}
/**
* compatibility function
* with new granular backup
* we need to know
*/
function backup_userdata_selected($preferences,$modname,$modid) {
return ((empty($preferences->mods[$modname]->instances)
&& !empty($preferences->mods[$modname]->userinfo))
|| (is_array($preferences->mods[$modname]->instances)
&& array_key_exists($modid,$preferences->mods[$modname]->instances)
&& !empty($preferences->mods[$modname]->instances[$modid]->userinfo)));
}
function backup_mod_selected($preferences,$modname,$modid) {
return ((empty($preferences->mods[$modname]->instances)
&& !empty($preferences->mods[$modname]->backup))
|| (is_array($preferences->mods[$modname]->instances)
&& array_key_exists($modid,$preferences->mods[$modname]->instances)
&& !empty($preferences->mods[$modname]->instances[$modid]->backup)));
}
/*
* Checks for the required files/functions to backup every mod
* And check if there is data about it
*/
function backup_fetch_prefs_from_request(&$preferences,&$count,$course) {
global $CFG,$SESSION;
// check to see if it's in the session already
if (!empty($SESSION->backupprefs) && array_key_exists($course->id,$SESSION->backupprefs) && !empty($SESSION->backupprefs[$course->id])) {
$sprefs = $SESSION->backupprefs[$course->id];
$preferences = $sprefs;
// refetch backup_name just in case.
$bn = optional_param('backup_name','',PARAM_FILE);
if (!empty($bn)) {
$preferences->backup_name = $bn;
}
$count = 1;
return true;
}
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$modfile = "$CFG->dirroot/mod/$modname/backuplib.php";
$modbackup = $modname."_backup_mods";
$modbackupone = $modname."_backup_one_mod";
$modcheckbackup = $modname."_check_backup_mods";
if (!file_exists($modfile)) {
continue;
}
include_once($modfile);
if (!function_exists($modbackup) || !function_exists($modcheckbackup)) {
continue;
}
$var = "exists_".$modname;
$preferences->$var = true;
$count++;
// check that there are instances and we can back them up individually
if (!count_records('course_modules','course',$course->id,'module',$mod->id) || !function_exists($modbackupone)) {
continue;
}
$var = 'exists_one_'.$modname;
$preferences->$var = true;
$varname = $modname.'_instances';
$preferences->$varname = get_all_instances_in_course($modname,$course);
foreach ($preferences->$varname as $instance) {
$preferences->mods[$modname]->instances[$instance->id]->name = $instance->name;
$var = 'backup_'.$modname.'_instance_'.$instance->id;
$$var = optional_param($var,0);
$preferences->$var = $$var;
$preferences->mods[$modname]->instances[$instance->id]->backup = $$var;
$var = 'backup_user_info_'.$modname.'_instance_'.$instance->id;
$$var = optional_param($var,0);
$preferences->$var = $$var;
$preferences->mods[$modname]->instances[$instance->id]->userinfo = $$var;
$var = 'backup_'.$modname.'_instances';
$preferences->$var = 1; // we need this later to determine what to display in modcheckbackup.
}
//Check data
//Check module info
$preferences->mods[$modname]->name = $modname;
$var = "backup_".$modname;
$$var = optional_param( $var,0);
$preferences->$var = $$var;
$preferences->mods[$modname]->backup = $$var;
//Check include user info
$var = "backup_user_info_".$modname;
$$var = optional_param( $var,0);
$preferences->$var = $$var;
$preferences->mods[$modname]->userinfo = $$var;
}
}
//Check other parameters
$preferences->backup_metacourse = optional_param('backup_metacourse',1,PARAM_INT);
$preferences->backup_users = optional_param('backup_users',1,PARAM_INT);
$preferences->backup_logs = optional_param('backup_logs',0,PARAM_INT);
$preferences->backup_user_files = optional_param('backup_user_files',1,PARAM_INT);
$preferences->backup_course_files = optional_param('backup_course_files',1,PARAM_INT);
$preferences->backup_messages = optional_param('backup_messages',1,PARAM_INT);
$preferences->backup_course = $course->id;
$preferences->backup_name = required_param('backup_name',PARAM_FILE );
$preferences->backup_unique_code = required_param('backup_unique_code');
// put it (back) in the session
$SESSION->backupprefs[$course->id] = $preferences;
}
?>
+10 -13
View File
@@ -1,10 +1,9 @@
Ziba Scott <ziba@linuxbox.com> 11/19/04
Ziba Scott <ziba@linuxbox.com> 06/23/05
This is a beta demonstration of a utility to convert Blackboard
Course export zip files into Moodle course export zip files. It
has been successfully tested with Blackboard 5.5 and
Moodle 1.4.1 and Moodle CVS. There is minimal Blackboard 6 support.
It will convert:
This is a utility to convert Blackboard Course export zip files into
Moodle course export zip files. It has been successfully tested with
Blackboard 5.5 and Moodle 1.4.1 and Moodle CVS. There is minimal
Blackboard 6 support. It will convert:
* Course Name/Title
* Forum Topics
@@ -12,17 +11,14 @@ It will convert:
* Assignments
* External Links
The current status of this project is
exploration/proof-of-concept. We have successfully converted
basic Blackboard course information as well as course documents
and forum topics using the XSLT methods described above.
AUTOMATED OPERATION:
REQUIREMENTS FOR WEB INTERFACE:
*Moodle 1.4.1 or greater
*PHP compiled with --enable-xslt --with-xslt-sablot options
*PHP 4.3 compiled with --enable-xslt --with-xslt-sablot options
(Check php.net for instructions on enabling xslt for your platform)
*Alternatively, PHP 5 compiled with xml and xsl support (-with-xsl)
INSTALLATION:
*Unpack this file into the "backup" directory
@@ -36,10 +32,11 @@ MANUAL OPERATION:
*An XSLT 1.0 processor (like Sablotron)
*A zipping utility
REQUIREMENTS FOR WEB INTERFACE:
REQUIREMENTS FOR COMMAND LINE INTERFACE:
*Linux/Unix
*PHP compiled with --enable-xslt --with-xslt-sablot options.
*PHP 4 compiled with --enable-xslt --with-xslt-sablot options.
*PHP 5 compiled with -with-xsl and the default xml support left in.
*Apache with write access to /tmp
*A commandline zipping utility
+1 -1
View File
@@ -36,7 +36,7 @@ function blackboard_convert($dir){
// Check for a Blackboard manifest file
if (is_readable($dir.'/imsmanifest.xml')){
if (is_readable($dir.'/imsmanifest.xml') && !is_readable($dir.'/moodle.xml')){
if (!function_exists('xslt_create')) { // XSLT MUST be installed for this to work
notify('You need the XSLT library installed in PHP to open this Blackboard file');
+41
View File
@@ -0,0 +1,41 @@
<?php // $Id$
function migrate2utf8_backup_ids_info($recordid){
global $CFG, $globallang;
/// Some trivial checks
if (empty($recordid)) {
log_the_problem_somewhere();
return false;
}
if (!$backupids= get_record('backup_ids', 'id', $recordid)) {
log_the_problem_somewhere();
return false;
}
if ($globallang) {
$fromenc = $globallang;
} else {
$sitelang = $CFG->lang;
$courselang = null;
$userlang = null; //N.E.!!
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
}
/// We are going to use textlib facilities
/// Convert the text
if (($fromenc != 'utf-8') && ($fromenc != 'UTF-8')) {
$result = utfconvert($backupids->info, $fromenc);
$newbackupids = new object;
$newbackupids->id = $recordid;
$newbackupids->info = $result;
migrate2utf8_update_record('backup_ids',$newbackupids);
}
/// And finally, just return the converted field
return $result;
}
?>
+36
View File
@@ -0,0 +1,36 @@
<DBMIGRATION type="backup" VERSION="2005120100">
<TABLES>
<TABLE name="backup_config">
<FIELDS>
<FIELD name="name" method="NO_CONV" type="varchar" length="255" dropindex="name" adduniqueindex="name (name(255))"/>
<FIELD name="value" method="NO_CONV" type="varchar" length="255" />
</FIELDS>
</TABLE>
<TABLE name="backup_courses">
<FIELDS>
<FIELD name="laststatus" method="NO_CONV" type="char" length="1" />
</FIELDS>
</TABLE>
<TABLE name="backup_files">
<FIELDS>
<FIELD name="file_type" method="NO_CONV" type="varchar" length="10" dropindex="backup_files_uk" />
<FIELD name="path" method="NO_CONV" type="varchar" length="255" adduniqueindex="backup_files_uk (backup_code, file_type(10), path(255))"/>
</FIELDS>
</TABLE>
<TABLE name="backup_ids">
<FIELDS>
<FIELD name="table_name" method="NO_CONV" type="varchar" length="30" dropindex="backup_ids_uk" adduniqueindex=" backup_ids_uk(backup_code, table_name(30), old_id)"/>
<FIELD name="info" method="PHP_FUNCTION" type="mediumtext" length="0">
<PHP_FUNCTION>
migrate2utf8_backup_ids_info(RECORDID)
</PHP_FUNCTION>
</FIELD>
</FIELDS>
</TABLE>
<TABLE name="backup_log">
<FIELDS>
<FIELD name="info" method="NO_CONV" type="varchar" length="255" />
</FIELDS>
</TABLE>
</TABLES>
</DBMIGRATION>
+62 -1
View File
@@ -1,4 +1,4 @@
<?PHP //$Id$
<?php //$Id$
//
// This file keeps track of upgrades to Moodle's
// backup/restore utility.
@@ -104,6 +104,67 @@ function backup_upgrade($oldversion=0) {
}
}
if ($oldversion < 2006011600 and $result) {
$result = execute_sql("DROP TABLE {$CFG->prefix}backup_files");
if ($result) {
$result = execute_sql("CREATE TABLE `{$CFG->prefix}backup_files` (
`id` int(10) unsigned NOT NULL auto_increment,
`backup_code` int(10) unsigned NOT NULL default '0',
`file_type` varchar(10) NOT NULL default '',
`path` varchar(255) NOT NULL default '',
`old_id` int(10) unsigned NOT NULL default '0',
`new_id` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `{$CFG->prefix}backup_files_uk` (`backup_code`,`file_type`,`path`)
) TYPE=MyISAM COMMENT='To store and recode ids to user and course files.'");
}
if ($result) {
$result = execute_sql("DROP TABLE {$CFG->prefix}backup_ids");
}
if ($result) {
$result = execute_sql("CREATE TABLE `{$CFG->prefix}backup_ids` (
`id` int(10) unsigned NOT NULL auto_increment,
`backup_code` int(12) unsigned NOT NULL default '0',
`table_name` varchar(30) NOT NULL default '',
`old_id` int(10) unsigned NOT NULL default '0',
`new_id` int(10) unsigned NOT NULL default '0',
`info` mediumtext,
PRIMARY KEY (`id`),
UNIQUE KEY `{$CFG->prefix}backup_ids_uk` (`backup_code` ,`table_name`,`old_id`)
) TYPE=MyISAM COMMENT='To store and convert ids in backup/restore'");
}
}
// code to drop the prefix in tables
if ($oldversion < 2006042100) {
// see bug 5205, silent drops, so should not panic anyone
$result = execute_sql("ALTER TABLE {$CFG->prefix}backup_files DROP INDEX backup_files_uk", false);
$result = execute_sql("ALTER TABLE {$CFG->prefix}backup_files DROP INDEX {$CFG->prefix}backup_files_uk", false);
$result = execute_sql("ALTER TABLE {$CFG->prefix}backup_ids DROP INDEX backup_ids_uk", false);
$result = execute_sql("ALTER TABLE {$CFG->prefix}backup_ids DROP INDEX {$CFG->prefix}backup_ids_uk", false);
$result = execute_sql("ALTER TABLE {$CFG->prefix}backup_files ADD UNIQUE INDEX backup_files_uk(backup_code,file_type(10),path(255))");
$result = execute_sql("ALTER TABLE {$CFG->prefix}backup_ids ADD UNIQUE INDEX backup_ids_uk(backup_code,table_name(30),old_id)");
}
// chaing default nulls to not null default 0
if ($oldversion < 2006042800) {
execute_sql("UPDATE {$CFG->prefix}backup_files SET old_id='0' WHERE old_id IS NULL");
table_column('backup_files','old_id','old_id','int','10','unsigned','0','not null');
execute_sql("UPDATE {$CFG->prefix}backup_files SET new_id='0' WHERE new_id IS NULL");
table_column('backup_files','new_id','new_id','int','10','unsigned','0','not null');
execute_sql("UPDATE {$CFG->prefix}backup_ids SET new_id='0' WHERE new_id IS NULL");
table_column('backup_ids','new_id','new_id','int','10','unsigned','0','not null');
execute_sql("UPDATE {$CFG->prefix}backup_ids SET info='' WHERE info IS NULL");
table_column('backup_ids','info','info','mediumtext','','','','not null');
}
//Finally, return result
return $result;
+10 -6
View File
@@ -3,12 +3,14 @@
#
CREATE TABLE `prefix_backup_files` (
`id` int(10) unsigned NOT NULL auto_increment,
`backup_code` int(10) unsigned NOT NULL default '0',
`file_type` varchar(10) NOT NULL default '',
`path` varchar(255) NOT NULL default '',
`old_id` int(10) unsigned default NULL,
`new_id` int(10) unsigned default NULL,
PRIMARY KEY (`backup_code`,`file_type`,`path`)
`old_id` int(10) unsigned NOT NULL default '0',
`new_id` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `backup_files_uk` (`backup_code`,`file_type`,`path`)
) TYPE=MyISAM COMMENT='To store and recode ids to user and course files.';
# --------------------------------------------------------
@@ -17,12 +19,14 @@ CREATE TABLE `prefix_backup_files` (
#
CREATE TABLE `prefix_backup_ids` (
`id` int(10) unsigned NOT NULL auto_increment,
`backup_code` int(12) unsigned NOT NULL default '0',
`table_name` varchar(30) NOT NULL default '',
`old_id` int(10) unsigned NOT NULL default '0',
`new_id` int(10) unsigned default NULL,
`info` mediumtext,
PRIMARY KEY (`backup_code`,`table_name`,`old_id`)
`new_id` int(10) unsigned NOT NULL default '0',
`info` mediumtext NOT NULL default '',
PRIMARY KEY (`id`),
UNIQUE KEY `backup_ids_uk` (`backup_code` ,`table_name`,`old_id`)
) TYPE=MyISAM COMMENT='To store and convert ids in backup/restore';
# --------------------------------------------------------
+3 -3
View File
@@ -47,9 +47,9 @@ 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,
id number(10) default '0' not null,
name varchar2(255) default '' not null,
value varchar2(255) default '' not null,
constraint pk_baco primary key (id),
constraint uk_baco_name unique (name)
);
+37 -2
View File
@@ -1,4 +1,4 @@
<?PHP //$Id$
<?php //$Id$
//
// This file keeps track of upgrades to Moodle's
// backup/restore utility.
@@ -23,10 +23,45 @@ function backup_upgrade($oldversion=0) {
$result = true;
if ($oldversion < 2006011600 and $result) {
$result = execute_sql("DROP TABLE {$CFG->prefix}backup_files");
if ($result) {
$result = execute_sql("CREATE TABLE {$CFG->prefix}backup_files (
id SERIAL PRIMARY KEY,
backup_code integer NOT NULL default '0',
file_type varchar(10) NOT NULL default '',
path varchar(255) NOT NULL default '',
old_id integer default NULL,
new_id integer default NULL,
CONSTRAINT {$CFG->prefix}backup_files_uk UNIQUE (backup_code, file_type, path))");
}
if ($result) {
$result = execute_sql("DROP TABLE {$CFG->prefix}backup_ids");
}
if ($result) {
$result = execute_sql("CREATE TABLE {$CFG->prefix}backup_ids (
id SERIAL PRIMARY KEY,
backup_code integer NOT NULL default '0',
table_name varchar(30) NOT NULL default '',
old_id integer NOT NULL default '0',
new_id integer default NULL,
info text,
CONSTRAINT {$CFG->prefix}backup_ids_uk UNIQUE (backup_code, table_name, old_id))");
}
}
if ($oldversion < 2006042801) {
table_column('backup_log', 'time', 'time', 'integer', '', '', '0');
table_column('backup_log', 'laststarttime', 'laststarttime', 'integer', '', '', '0');
table_column('backup_log', 'courseid', 'courseid', 'integer', '', '', '0');
table_column('backup_courses', 'lastendtime', 'lastendtime', 'integer', '', '', '0');
table_column('backup_courses', 'laststarttime', 'laststarttime', 'integer', '', '', '0');
table_column('backup_courses', 'courseid', 'courseid', 'integer', '', '', '0');
table_column('backup_courses', 'nextstarttime', 'nextstarttime', 'integer', '', '', '0');
}
//Finally, return result
return $result;
}
+19 -19
View File
@@ -1,35 +1,32 @@
# THIS FILE IS UNTESTED!!!
# PLEASE HELP TEST/FIX IT AND CONTACT MARTIN OR ELOY!
#
# Table structure for table prefix_backup_files
#
CREATE TABLE prefix_backup_files (
id SERIAL PRIMARY KEY,
backup_code integer NOT NULL default '0',
file_type varchar(10) NOT NULL default '',
path varchar(255) NOT NULL default '',
old_id integer default NULL,
new_id integer default NULL
new_id integer default NULL,
CONSTRAINT prefix_backup_files_uk UNIQUE (backup_code, file_type, path)
);
# --------------------------------------------------------
CREATE INDEX prefix_backup_codetypepath_idx ON prefix_backup_files (backup_code,file_type,path);
#
# Table structure for table prefix_backup_ids
#
CREATE TABLE prefix_backup_ids (
backup_code int8 NOT NULL default '0',
id SERIAL PRIMARY KEY,
backup_code integer NOT NULL default '0',
table_name varchar(30) NOT NULL default '',
old_id int8 NOT NULL default '0',
new_id int8 default NULL,
info text
old_id integer NOT NULL default '0',
new_id integer default NULL,
info text,
CONSTRAINT prefix_backup_ids_uk UNIQUE (backup_code, table_name, old_id)
);
CREATE INDEX prefix_backup_codenameid_idx ON prefix_backup_ids (backup_code,table_name,old_id);
#
# Table structure for table prefix_backup_config
@@ -41,27 +38,30 @@ CREATE TABLE prefix_backup_config (
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',
courseid integer UNIQUE NOT NULL default '0',
laststarttime integer NOT NULL default '0',
lastendtime integer NOT NULL default '0',
laststatus varchar(1) NOT NULL default '0',
nextstarttime int8 NOT NULL default '0'
nextstarttime integer 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',
courseid integer NOT NULL default '0',
time integer NOT NULL default '0',
laststarttime integer NOT NULL default '0',
info varchar(255) NOT NULL default ''
);
+130 -8
View File
@@ -1,4 +1,4 @@
<?PHP //$Id$
<?php //$Id$
//This file contains all the general function needed (file manipulation...)
//not directly part of the backup/restore utility
@@ -293,6 +293,8 @@
global $CFG;
$status = true; // Initialize this, next code will change its value if needed
if (!is_dir($to_file)) {
//echo "<br />Creating ".$to_file; //Debug
umask(0000);
@@ -409,10 +411,12 @@
$rec->backup_code = $backup_unique_code;
$rec->table_name = $table;
$rec->old_id = $old_id;
$rec->new_id =$new_id;
$rec->new_id = ($new_id === null? 0 : $new_id);
$rec->info = $info_to_save;
$status = insert_record ("backup_ids", $rec, false,"backup_code");
if (!insert_record('backup_ids', $rec, false)) {
$status = false;
}
}
return $status;
}
@@ -470,26 +474,40 @@
return $status;
}
//This function is used to add slashes and decode from UTF-8
//This function is used to add slashes (and decode from UTF-8 if needed)
//It's used intensivelly when restoring modules and saving them in db
function backup_todb ($data) {
return restore_decode_absolute_links(addslashes(utf8_decode($data)));
global $CFG;
if (empty($CFG->unicodedb)) {
return restore_decode_absolute_links(addslashes(utf8_decode($data)));
} else {
return restore_decode_absolute_links(addslashes($data));
}
}
//This function is used to check that every necessary function to
//backup/restore exists in the current php installation. Thanks to
//gregb@crowncollege.edu by the idea.
function backup_required_functions() {
function backup_required_functions($justcheck=false) {
if(!function_exists('utf8_encode')) {
error('You need to add XML support to your PHP installation');
if (empty($justcheck)) {
error('You need to add XML support to your PHP installation');
} else {
return false;
}
}
return true;
}
//This function send n white characters to the browser and flush the
//output buffer. Used to avoid browser timeouts and to show the progress.
function backup_flush($n=0,$time=false) {
if (defined('RESTORE_SILENTLY_NOFLUSH')) {
return;
}
if ($time) {
$ti = strftime("%X",time());
} else {
@@ -525,4 +543,108 @@
return ($status && $status2);
}
/** this function will restore an entire backup.zip into the specified course
* using standard moodle backup/restore functions, but silently.
* @param string $pathtofile the absolute path to the backup file.
* @param int $destinationcourse the course id to restore to.
* @param boolean $emptyfirst whether to delete all coursedata first.
* @param boolean $userdata whether to include any userdata that may be in the backup file.
*/
function import_backup_file_silently($pathtofile,$destinationcourse,$emptyfirst=false,$userdata=false) {
global $CFG,$SESSION,$USER; // is there such a thing on cron? I guess so..
if (empty($USER)) {
$USER = get_admin();
$USER->admin = 1; // not sure why, but this doesn't get set
}
define('RESTORE_SILENTLY',true); // don't output all the stuff to us.
$debuginfo = 'import_backup_file_silently: ';
$cleanupafter = false;
$errorstr = ''; // passed by reference to restore_precheck to get errors from.
if (!$course = get_record('course','id',$destinationcourse)) {
mtrace($debuginfo.'Course with id $destinationcourse was not a valid course!');
return false;
}
// first check we have a valid file.
if (!file_exists($pathtofile) || !is_readable($pathtofile)) {
mtrace($debuginfo.'File '.$pathtofile.' either didn\'t exist or wasn\'t readable');
return false;
}
// now make sure it's a zip file
require_once($CFG->dirroot.'/lib/filelib.php');
$filename = substr($pathtofile,strrpos($pathtofile,'/')+1);
$mimetype = mimeinfo("type", $filename);
if ($mimetype != 'application/zip') {
mtrace($debuginfo.'File '.$pathtofile.' was of wrong mimetype ('.$mimetype.')' );
return false;
}
// restore_precheck wants this within dataroot, so lets put it there if it's not already..
if (strstr($pathtofile,$CFG->dataroot) === false) {
// first try and actually move it..
if (!check_dir_exists($CFG->dataroot.'/temp/backup/',true)) {
mtrace($debuginfo.'File '.$pathtofile.' outside of dataroot and couldn\'t move it! ');
return false;
}
if (!copy($pathtofile,$CFG->dataroot.'/temp/backup/'.$filename)) {
mtrace($debuginfo.'File '.$pathtofile.' outside of dataroot and couldn\'t move it! ');
return false;
} else {
$pathtofile = 'temp/backup/'.$filename;
$cleanupafter = true;
}
} else {
// it is within dataroot, so take it off the path for restore_precheck.
$pathtofile = substr($pathtofile,strlen($CFG->dataroot.'/'));
}
if (!backup_required_functions()) {
mtrace($debuginfo.'Required function check failed (see backup_required_functions)');
return false;
}
@ini_set("max_execution_time","3000");
raise_memory_limit("128M");
if (!$backup_unique_code = restore_precheck($destinationcourse,$pathtofile,$errorstr,true)) {
mtrace($debuginfo.'Failed restore_precheck (error was '.$errorstr.')');
return false;
}
restore_setup_for_check($SESSION->restore,$backup_unique_code);
// add on some extra stuff we need...
$SESSION->restore->restoreto = 1;
$SESSION->restore->course_id = $destinationcourse;
$SESSION->restore->deleting = $emptyfirst;
// maybe we need users (defaults to 2 in restore_setup_for_check)
if (!empty($userdata)) {
$SESSION->restore->users = 1;
}
// we also need modules...
if ($allmods = get_records("modules")) {
foreach ($allmods as $mod) {
$modname = $mod->name;
//Now check that we have that module info in the backup file
if (isset($SESSION->info->mods[$modname]) && $SESSION->info->mods[$modname]->backup == "true") {
$SESSION->restore->mods[$modname]->restore = true;
$SESSION->restore->mods[$modname]->userinfo = $userdata;
}
}
}
if (!restore_execute($SESSION->restore,$SESSION->info,$SESSION->course_header,$errorstr)) {
mtrace($debuginfo.'Failed restore_execute (error was '.$errorstr.')');
return false;
}
return true;
}
?>
+4 -1
View File
@@ -4,7 +4,7 @@
require_once("../config.php");
require_once("../backup/lib.php");
optional_variable($courseid);
$courseid = optional_param('courseid',0,PARAM_INT);
require_login();
@@ -29,6 +29,7 @@
$strerror = get_string("error");
$strok = get_string("ok");
$strunfinished = get_string("unfinished");
$strskipped = get_string("skipped");
$strcourse = get_string("course");
$strtimetaken = get_string("timetaken","quiz");
$strstatus = get_string("status");
@@ -71,6 +72,8 @@
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"2\" color=\"green\">".$strok."</font></td>";
} else if ($course->laststatus == 2) {
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"2\" color=\"red\">".$strunfinished."</font></td>";
} else if ($course->laststatus == 3) {
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"2\" color=\"green\">".$strskipped."</font></td>";
} else {
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"2\" color=\"red\">".$strerror."</font></td>";
}
+23 -3
View File
@@ -15,14 +15,35 @@
//Optional
$id = optional_param( 'id' );
$file = optional_param( 'file' );;
$file = optional_param( 'file' );
$cancel = optional_param( 'cancel' );
$launch = optional_param( 'launch' );
$to = optional_param( 'to' );
$method = optional_param( 'method' );
$backup_unique_code = optional_param('backup_unique_code',0,PARAM_INT);
//Check login
require_login();
/// With method=manual, we come from the FileManager so we delete all the backup/restore/import session structures
if ($method == 'manual') {
if (isset($SESSION->course_header)) {
unset ($SESSION->course_header);
}
if (isset($SESSION->info)) {
unset ($SESSION->info);
}
if (isset($SESSION->backupprefs)) {
unset ($SESSION->backupprefs);
}
if (isset($SESSION->restore)) {
unset ($SESSION->restore);
}
if (isset($SESSION->import_preferences)) {
unset ($SESSION->import_preferences);
}
}
if (!$to && isset($SESSION->restore->restoreto) && isset($SESSION->restore->importing) && isset($SESSION->restore->course_id)) {
$to = $SESSION->restore->course_id;
}
@@ -116,11 +137,10 @@
//Call the form, depending the step we are
if (!$launch) {
include_once("restore_precheck.html");
} else if ($launch == "form") {
if ($SESSION->restore->importing) {
if (!empty($SESSION->restore->importing)) {
// set up all the config stuff and skip asking the user about it.
restore_setup_for_check($SESSION->restore,$backup_unique_code);
include_once("restore_execute.html");
+29 -7
View File
@@ -14,9 +14,12 @@
}
}
//If restore session info exists, but we are posting parameters
//manually, this has prioriry
if (isset($restore) and isset($restore_restoreto)) {
//Detect if we are coming from the restore form
$fromform = optional_param ('fromform', 0, PARAM_INT);
//If restore session info exists, but we are coming from the form
//it has prioriry
if (isset($restore) and !empty($fromform)) {
unset($restore);
}
@@ -42,6 +45,16 @@
$$var = optional_param( $var,0);
$var = "restore_user_info_".$modname;
$$var = optional_param( $var,0);
$instances = !empty($info->mods[$mod->name]->instances) ? $info->mods[$mod->name]->instances : NULL;
if ($instances === NULL) {
continue;
}
foreach ($instances as $instance) {
$var = 'restore_'.$modname.'_instance_'.$instance->id;
$$var = optional_param($var,0);
$var = 'restore_user_info_'.$modname.'_instance_'.$instance->id;
$$var = optional_param($var,0);
}
}
}
//restoreto
@@ -59,10 +72,8 @@
//restore_messages
$restore_messages = required_param('restore_messages');
//Check we've selected a course
if (!isset($course_id)) {
$course_id = 0;
}
//Check we've selected a course to restore to
$course_id = optional_param('course_id', 0, PARAM_INT);
//We are here, having all we need !!
//Create the restore object and put it in the session
@@ -75,6 +86,16 @@
$restore->mods[$modname]->restore=$$var;
$var = "restore_user_info_".$modname;
$restore->mods[$modname]->userinfo=$$var;
$instances = !empty($info->mods[$mod->name]->instances) ? $info->mods[$mod->name]->instances : NULL;
if ($instances === NULL) {
continue;
}
foreach ($instances as $instance) {
$var = 'restore_'.$modname.'_instance_'.$instance->id;
$restore->mods[$modname]->instances[$instance->id]->restore = $$var;
$var = 'restore_user_info_'.$modname.'_instance_'.$instance->id;
$restore->mods[$modname]->instances[$instance->id]->userinfo = $$var;
}
}
}
$restore->restoreto=$restore_restoreto;
@@ -88,6 +109,7 @@
} else {
//We have the object, so check if we have a new course_id
//passed as parammeter
$course_id = optional_param('course_id', 0, PARAM_INT);
if ($course_id) {
$restore->course_id=$course_id;
}
+3 -346
View File
@@ -41,357 +41,14 @@
if (!$site = get_site()) {
error("Site not found!");
}
//Checks for the required files/functions to restore every module
//and include them
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$modfile = "$CFG->dirroot/mod/$modname/restorelib.php";
//If file exists and we have selected to restore that type of module
if ((file_exists($modfile)) and ($restore->mods[$modname]->restore)) {
include_once($modfile);
}
}
}
//Start the main table
echo "<table cellpadding=\"5\">";
echo "<tr><td>";
//Start the main ul
echo "<ul>";
//Init status
$status = true;
//Localtion of the xml file
$xml_file = $CFG->dataroot."/temp/backup/".$restore->backup_unique_code."/moodle.xml";
//If we've selected to restore into new course
//create it (course)
//Saving conversion id variables into backup_tables
if ($restore->restoreto == 2) {
echo "<li>".get_string("creatingnewcourse");
$oldidnumber = $course_header->course_idnumber;
if (!$status = restore_create_new_course($restore,$course_header)) {
notify("Error while creating the new empty course.");
}
//Print course fullname and shortname and category
if ($status) {
echo "<ul>";
echo "<li>".$course_header->course_fullname." (".$course_header->course_shortname.")".'</li>';
echo "<li>".get_string("category").": ".$course_header->category->name.'</li>';
if (!empty($oldidnumber)) {
echo "<li>".get_string("nomoreidnumber","moodle",$oldidnumber)."</li>";
}
echo "</ul></li>";
//Put the destination course_id
$restore->course_id = $course_header->course_id;
}
} else {
$course = get_record("course","id",$restore->course_id);
if ($course) {
echo "<li>".get_string("usingexistingcourse");
echo "<ul>";
echo "<li>".get_string("from").": ".$course_header->course_fullname." (".$course_header->course_shortname.")".'</li>';
echo "<li>".get_string("to").": ".$course->fullname." (".$course->shortname.")".'</li>';
if (($restore->deleting)) {
echo "<li>".get_string("deletingexistingcoursedata").'</li>';
} else {
echo "<li>".get_string("addingdatatoexisting").'</li>';
}
echo "</ul></li>";
//If we have selected to restore deleting, we do it now.
if ($restore->deleting) {
echo "<li>".get_string("deletingolddata").'</li>';
$status = remove_course_contents($restore->course_id,false) and
delete_dir_contents($CFG->dataroot."/".$restore->course_id,"backupdata");
if ($status) {
//Now , this situation is equivalent to the "restore to new course" one (we
//have a course record and nothing more), so define it as "to new course"
$restore->restoreto = 2;
} else {
notify("An error occurred while deleting some of the course contents.");
}
}
} else {
notify("Error opening existing course.");
$status = false;
}
}
//Now create the course_sections and their associated course_modules
if ($status) {
//Into new course
if ($restore->restoreto == 2) {
echo "<li>".get_string("creatingsections").'</li>';
if (!$status = restore_create_sections($restore,$xml_file)) {
notify("Error creating sections in the existing course.");
}
//Into existing course
} else if ($restore->restoreto == 0 or $restore->restoreto == 1) {
echo "<li>".get_string("checkingsections").'</li>';
if (!$status = restore_create_sections($restore,$xml_file)) {
notify("Error creating sections in the existing course.");
}
//Error
} else {
notify("Neither a new course or an existing one was specified.");
$status = false;
}
}
//Now create users as needed
if ($status and ($restore->users == 0 or $restore->users == 1)) {
echo "<li>".get_string("creatingusers")."<br />";
if (!$status = restore_create_users($restore,$xml_file)) {
notify("Could not restore users.");
}
//Now print info about the work done
if ($status) {
$recs = get_records_sql("select old_id, new_id from {$CFG->prefix}backup_ids
where backup_code = '$restore->backup_unique_code' and
table_name = 'user'");
//We've records
if ($recs) {
$new_count = 0;
$exists_count = 0;
$student_count = 0;
$teacher_count = 0;
$counter = 0;
//Iterate, filling counters
foreach ($recs as $rec) {
//Get full record, using backup_getids
$record = backup_getid($restore->backup_unique_code,"user",$rec->old_id);
if (strpos($record->info,"new") !== false) {
$new_count++;
}
if (strpos($record->info,"exists") !== false) {
$exists_count++;
}
if (strpos($record->info,"student") !== false) {
$student_count++;
} else if (strpos($record->info,"teacher") !== false) {
$teacher_count++;
}
//Do some output
$counter++;
if ($counter % 10 == 0) {
echo ".";
if ($counter % 200 == 0) {
echo "<br />";
}
backup_flush(300);
}
}
//Now print information gathered
echo " (".get_string("new").": ".$new_count.", ".get_string("existing").": ".$exists_count.")";
echo "<ul>";
echo "<li>".get_string("students").": ".$student_count.'</li>';
echo "<li>".get_string("teachers").": ".$teacher_count.'</li>';
echo "</ul>";
} else {
notify("No users were found!");
}
}
}
//Now create metacourse info
if ($status and $restore->metacourse) {
//Only to new courses!
if ($restore->restoreto == 2) {
echo "</li><li>".get_string("creatingmetacoursedata");
if (!$status = restore_create_metacourse($restore,$xml_file)) {
notify("Error creating metacourse in the course.");
}
}
}
//Now create categories and questions as needed (STEP1)
if ($status and ($restore->mods['quiz']->restore)) {
echo "</li><li>".get_string("creatingcategoriesandquestions");
echo "<ul>";
if (!$status = restore_create_questions($restore,$xml_file)) {
notify("Could not restore categories and questions!");
}
echo "</ul></li>";
}
//Now create user_files as needed
if ($status and ($restore->user_files)) {
echo "<li>".get_string("copyinguserfiles");
if (!$status = restore_user_files($restore)) {
notify("Could not restore user files!");
}
//If all is ok (and we have a counter)
if ($status and ($status !== true)) {
//Inform about user dirs created from backup
echo "<ul>";
echo "<li>".get_string("userzones").": ".$status;
echo "</li></ul>";
}
}
//Now create course files as needed
if ($status and ($restore->course_files)) {
echo "</li><li>".get_string("copyingcoursefiles")."</li>";
if (!$status = restore_course_files($restore)) {
notify("Could not restore course files!");
}
//If all is ok (and we have a counter)
if ($status and ($status !== true)) {
//Inform about user dirs created from backup
echo "<ul>";
echo "<li>".get_string("filesfolders").": ".$status;
echo "</ul>";
}
}
//Now create messages as needed
if ($status and ($restore->messages)) {
echo "<li>".get_string("creatingmessagesinfo");
if (!$status = restore_create_messages($restore,$xml_file)) {
notify("Could not restore messages!");
}
echo "</li>";
}
//Now create scales as needed
if ($status) {
echo "<li>".get_string("creatingscales").'</li>';
if (!$status = restore_create_scales($restore,$xml_file)) {
notify("Could not restore custom scales!");
}
}
//Now create groups as needed
if ($status) {
echo "<li>".get_string("creatinggroups").'</li>';
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").'</li>';
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");
if (!$status = restore_create_modules($restore,$xml_file)) {
notify("Could not restore modules!");
}
}
//Now create gradebook as needed -- AFTER modules!!!
if ($status) {
echo "<li>".get_string("creatinggradebook");
if (!$status = restore_create_gradebook($restore,$xml_file)) {
notify("Could not restore gradebook!");
}
}
//Bring back the course blocks -- do it AFTER the modules!!!
if($status) {
//If we are deleting and bringing into a course or making a new course, same situation
if($restore->restoreto == 0 || $restore->restoreto == 2) {
echo '<li>'.get_string('creatingblocks').'</li>';
if (!$status = restore_create_blocks($restore, $info->backup_block_format, $course_header->blockinfo, $xml_file)) {
notify('Error while creating the course blocks');
}
}
}
//Now create log entries as needed
if ($status and ($restore->logs)) {
echo "</li><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 !!
if ($status) {
echo "</li><li>".get_string("checkinginstances").'</li>';
if (!$status = restore_check_instances($restore)) {
notify("Could not adjust instances in course_modules!");
}
}
//Now, if all is OK, adjust activity events
if ($status) {
echo "<li>".get_string("refreshingevents").'</li>';
if (!$status = restore_refresh_events($restore)) {
notify("Could not refresh events for activities!");
}
}
//Now, if all is OK, adjust inter-activity links
if ($status) {
echo "<li>".get_string("decodinginternallinks");
if (!$status = restore_decode_content_links($restore)) {
notify("Could not refresh events for activities!");
}
}
//Now, with backup files prior to version 2005041100,
//convert all the wiki texts in the course to markdown
if ($status && $restore->backup_version < 2005041100) {
echo "<li>".get_string("convertingwikitomarkdown");
if (!$status = restore_convert_wiki2markdown($restore)) {
notify("Could not convert wiki texts to markdown!");
}
}
//Now if all is OK, update:
// - course modinfo field
// - categories table
// - add user as teacher
if ($status) {
echo "</li><li>".get_string("checkingcourse").'</li>';
//modinfo field
rebuild_course_cache($restore->course_id);
//categories table
$course = get_record("course","id",$restore->course_id);
fix_course_sortorder();
//Make the user a teacher if the course hasn't teachers (bug 2381)
if (!isadmin()) {
if (!$checktea = get_records('user_teachers','course', $restore->course_id)) {
//Add the teacher to the course
$status = add_teacher($USER->id, $restore->course_id);
}
}
}
//Cleanup temps (files and db)
if ($status) {
echo "<li>".get_string("cleaningtempdata").'</li>';
if (!$status = clean_temp_data ($restore)) {
notify("Could not clean up temporary data from files and database");
}
}
//End the main ul
echo "</ul>";
//End the main table
echo "</td></tr>";
echo "</table>";
$errorstr = '';
$status = restore_execute($restore,$info,$course_header,$errorstr);
if (!$status) {
error ("An error has occurred and the restore could not be completed!");
}
if (!$restore->importing) {
echo $output;
if (empty($restore->importing)) {
//Print final message
print_simple_box(get_string("restorefinished"),"center");
} else {

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