Compare commits

...

64 Commits

Author SHA1 Message Date
moodler 575eba292a Preparing for release in a couple of hours 2004-07-16 13:15:26 +00:00
moodler 0a2294525c Fixing up last merge problem 2004-07-16 13:13:35 +00:00
moodler 4b685ab2a3 Fixed typo for globalglossary 2004-07-16 13:07:14 +00:00
moodler 00231a7498 Adding latest ADOdb to stable 2004-07-16 12:15:46 +00:00
stronk7 ad6c367583 Ooops!! I thought I had sent this to CVS some days ago.
Now both type of links (slasharguments on and off) are
detected in the backup process. And the restore process
take care of the slasharguments seting in destination
and translate all the links to the correct format.
I think it's really a nice addition, ;-)
Ready to 1.3.3 bump!!!
Bug 1634
(http://moodle.org/bugs/bug.php?op=show&bugid=1634)
2004-07-15 22:59:20 +00:00
moodler 7ffa4254e2 Fix for bug 1514 2004-07-15 05:59:59 +00:00
moodler 86fb51fe69 Added $bodytags variable in themes 2004-07-14 06:47:06 +00:00
moodler bc05b1544d Added bodytags parameter for print_header, to help SCORM module insert onload() to pages 2004-07-14 06:41:56 +00:00
moodler e2d3d77173 Fixes from Deen Foxx BUg 1638 2004-07-13 13:53:41 +00:00
moodler 6b63e94a29 Fixed XSS bug #1637 2004-07-13 03:49:20 +00:00
stronk7 350e44bf21 Now, for glossaries using the 'Entry List' format, their
entry->description is viewable with the standard popup window.

Bug 1636
(http://moodle.org/bugs/bug.php?op=show&bugid=1636)
2004-07-12 17:08:45 +00:00
stronk7 f97355847a In 'categories view' (all and only one), now attachements, edit, comment
and delete are working properly. Thanks to frank@nomios.de!!
See bug 1632
(http://moodle.org/bugs/bug.php?op=show&bugid=1632)
2004-07-12 16:33:04 +00:00
stronk7 ee84cd6c76 Updated to 1.3.2 (from trunk) 2004-07-11 23:08:04 +00:00
moodler 14824286cb Small fix to detect_munged_arguments to make Thiagi game shells work.
They have a '..' in the arguments, so we are allowing one of these only.

I wonder if this is Ger's problem too.
2004-07-11 16:01:09 +00:00
stronk7 3f4e0d9d6a Now, course->summary
section->summary
     user->description
are properly transformed if, in their contents, there was some
file.php call.
See bug 1631
(http://moodle.org/bugs/bug.php?op=show&bugid=1631)
2004-07-10 22:37:45 +00:00
stronk7 2b8fb55a4d Latest changes from Antonio Vergara in HEAD rev. 2004-07-09 15:20:45 +00:00
moodler aa55bb6666 And moving on ... 2004-07-09 09:47:04 +00:00
moodler 90c644a587 Latest release notes for 1.3.2 (in STable) 2004-07-09 08:30:26 +00:00
moodler 30772a2aaf Latest SCORM from development now merged into stable 2004-07-09 05:53:46 +00:00
stronk7 4287e72159 Updated because they are very old (Moodle 1.1.1).
Changes apllied from 1.4 TRUNK.
2004-07-08 21:22:57 +00:00
moodler 79b71ea0cd All current language files have been merged from the main development branch 2004-07-08 15:35:28 +00:00
stronk7 5180efaa90 Now only restored wikis (posts and resources) are re-encoded when
restoring to a existing course. Bug 1571.
(http://moodle.org/bugs/bug.php?op=show&bugid=1571)
2004-07-08 05:59:50 +00:00
moodler 1a55aa43a2 Preparing for release today 2004-07-08 01:21:20 +00:00
moodler eb34e77f15 Add require login to be safe (more checks than just isadmin) 2004-07-08 01:16:29 +00:00
stronk7 935ba6ed19 Force to destroy the php session. Without this, some buggy PHP versions
can have problems under certain situations. :-)
2004-07-07 19:28:26 +00:00
moodler ea944efe7f A fix to prevent breaking of lines in multibyte languages 2004-07-07 15:04:52 +00:00
moodler 4f8442c56d Preparing for 1.3.2 release 2004-07-06 01:57:58 +00:00
moodler fe544ceab4 Made forum search form slightly smaller 2004-07-05 05:45:09 +00:00
moodler b65fdd3b54 Allow students to always see editing teachers in their course 2004-07-04 11:08:47 +00:00
moodler 6478428784 FIxes for showing user discussions from groups 2004-07-04 07:38:51 +00:00
moodler 660381d2b0 Fixes for recent activity 2004-07-03 12:56:14 +00:00
moodler 65aede08b6 This fixes some rather serious bugs with how groups are used in group-oriented
forums.

The zero group was used to define both the

   - ungrouped people
   - the posts that all groups should see

The groupid field in the forums is now a signed field and a new value -1 has
been introduced.

   0  --> ungrouped people
   -1 --> the posts that all groups should see

Things are now a lot more intuitive.  Teachers can post to individual
groups or to ALL groups at once.   Recent news display now makes sense etc.
2004-07-03 12:09:34 +00:00
moodler cc1ec30e2d Made assignment submission counting more robust 2004-07-03 10:25:50 +00:00
moodler 5f90f9fad6 Updated to English 2004-07-03 09:16:19 +00:00
moodler 60d17e47a0 FIxed bug 1607 - user sorting 2004-07-02 02:44:34 +00:00
stronk7 94826e8e57 Minor copy/paste bug solved... :-) 2004-07-01 18:56:22 +00:00
stronk7 ae39746289 Some polishing of "TAB" chars in source code done.
Minor changes in glossary export/import to include the displayformat field.
Added a new feature (it was hidden and uncompleted in source code):
Import a glossary file, creating automatically a new glossary activity.
Bug 1606.
http://moodle.org/bugs/bug.php?op=show&bugid=1606
2004-07-01 18:52:44 +00:00
gustav_delius 49fe4f99e1 using fullname() on info page, fixing bug 1596 2004-06-29 21:46:32 +00:00
stronk7 4997042474 Take care of empty aliases in glossary xml files when importing them.
See bug 1599. Thanks to skodak. :-)
http://moodle.org/bugs/bug.php?op=show&bugid=1599
2004-06-28 23:54:00 +00:00
stronk7 1194026729 Modified to delete temp files older than 4 hours (previously it was
configured to 48 hours). Force to execute the clean before doing the
backup itself. This should avoid the disk full of temp backup files
issue. See bug 1520.
http://moodle.org/bugs/bug.php?op=show&bugid=1520
2004-06-27 22:28:19 +00:00
moodler 20761eb71d Some fixes for locales in a very multilibgual site (eg moodle.org) 2004-06-21 12:39:31 +00:00
gustav_delius 734bdb63bf Site option forcelogin is now respected by /mod/forum/search.php, fixing bug 1566 2004-06-14 20:06:15 +00:00
stronk7 e0dd8f3260 Added a new check in selectItemInMenuByName() javascript to apply the
select only to menus by checking element.type == select-one. Thanks to
Antonio Vicent.
2004-06-13 01:07:16 +00:00
gustav_delius 578ba7762e fixed bug 1553 which gave error with empty jump menu 2004-06-09 08:35:47 +00:00
moodler e044b5a536 A glossary marked global can now be unmarked again later 2004-06-07 08:40:39 +00:00
moodler 63f6422df2 Updating release name 2004-06-07 08:37:51 +00:00
moodler 8097f8d7c7 Fixed a bug reported here: http://moodle.org/mod/forum/discuss.php?d=8737
Students now will not see a forum rating menu if "teachers only" has been selected.
2004-06-07 06:12:55 +00:00
moodler ac90c4a264 Fixed problem with mediaplugins filter being too greedy when there
were multiple links in the same line of HTML code.
2004-06-06 14:25:23 +00:00
gustav_delius 345692a64d Fixed bug 1531, section links to invisible sections now greyed out or hidden 2004-06-05 12:03:22 +00:00
gustav_delius 86a8e9070b Fixed bug 1531, section links to invisible sections now greyed out or hidden 2004-06-05 11:56:51 +00:00
moodler 6555eabb0c Latest release notes for 1.3.1 2004-06-04 16:14:20 +00:00
moodler dcc6326eb9 Slip those popular » characters into the navigation bar 2004-06-04 13:15:45 +00:00
moodler e8fb94a3cd Label this as Moodle 1.3.1 2004-06-04 07:55:19 +00:00
moodler 79dd6106dd Removed PHP_SELF ... bug 1522 2004-06-03 14:22:20 +00:00
moodler 031dd5f017 OK, for bug fixes this is a pretty big checkin!! :-/
I finally was able to see the HTML Editor bug in IE/XP that everyone
was talking about, and it's a very serious bug as it makes Moodle 1.3
almost unusable for these people.  :-(  :-(

So, I eventually found out that the problem is that the Javascript that
attaches the editor has troubles when it is embedded within the table                                                   that course/mod.php puts around the mod.html forms in each module.
(Only in IE and only sometimes, mind you).

While testing I also had a good look at a long standing issue which is the
inconsistency of the mod.html forms when using the editor.

So, to fix both I decided to put the HTML editor calls OUTSIDE the mod.html
in the mod.php file.  This means that all modules get the HTML editor by default
on all text areas during activity module setup by default.

I've been running through this for the past few hours and it seems
pretty stable now and a lot more consistent, so I'm checking it in
as big fix towards the Moodle 1.3.1 we have to have.

Unfortunately it also means the API has changed a bit  ... I had to
update all the module dependencies to this exact version (or later).

Please test this "stable" version hard using the standard modules only
and I'll merge these changes over to the trunk in a day or so and update
all known third-party modules.
2004-06-03 13:07:49 +00:00
moodler 507ee65e59 Fix for bug 1070 where HTML editor body was not always being shown. 2004-06-03 08:14:07 +00:00
defacer 56b19c309e Fix for an (apparently old but only recently discovered by me) issue from the
forums where require_once() would fail to do the "once" part unless you use
absolute pathnames.
2004-06-02 08:03:05 +00:00
stronk7 99dac04aeb Solved bug 1491 in all the "linking" filters.
(http://moodle.org/bugs/bug.php?op=show&bugid=1491)
Bugfix 001
2004-05-30 00:28:52 +00:00
gustav_delius 12f18ea1ab A hack to fix bug 1488. html editor needs $course object defined. Should perhaps be solved differently in the long run. 2004-05-29 16:19:32 +00:00
stronk7 1626376373 One simple change to test cvs branching... 2004-05-29 15:19:15 +00:00
moodler 7729acff90 On second thoughts, we must not touch the version date,
so that people can upgrade properly to Moodle 1.4 later.
2004-05-29 14:27:33 +00:00
moodler b35cd9c592 Update version number for stable. No need to merge this obviously 2004-05-29 14:25:39 +00:00
gustav_delius a69a278684 previous fix now also works in weekly format 2004-05-29 09:12:33 +00:00
gustav_delius 61cc70ae45 section links now preserve focused view, see http://moodle.org/mod/forum/discuss.php?d=7648#37555 2004-05-29 08:40:41 +00:00
772 changed files with 20907 additions and 67966 deletions
+1 -6
View File
@@ -105,7 +105,7 @@
/// Get and sort the existing blocks
if (false === ($blocks = get_records('blocks'))) {
if (!$blocks = get_records('blocks')) {
error('No blocks found!'); // Should never happen
}
@@ -117,11 +117,6 @@
$blockbyname[$blockobject->get_title()] = $block->id;
$blockobjects[$block->id] = $blockobject;
}
if(empty($blockbyname)) {
error('One or more blocks are registered in the database, but they all failed to load!');
}
ksort($blockbyname);
/// Print the table of all blocks
+87 -175
View File
@@ -2,8 +2,8 @@
<table cellpadding=9 cellspacing=0 >
<tr valign=top>
<td align=right><p>lang:</td>
<td>
<td align=right><p>lang:</td>
<td>
<?php choose_from_menu (get_list_of_languages(), "lang", $config->lang, "", "", ""); ?>
</td>
<td>
@@ -11,9 +11,9 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>langmenu:</td>
<td>
<?php
<td align=right><p>langmenu:</td>
<td>
<?php
unset($options);
$options[0] = get_string("no");
$options[1] = get_string("yes");
@@ -26,8 +26,8 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>langlist:</td>
<td>
<td align=right><p>langlist:</td>
<td>
<input name=langlist type=text size=40 value="<?php p($config->langlist) ?>">
</td>
<td>
@@ -35,8 +35,8 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>locale:</td>
<td>
<td align=right><p>locale:</td>
<td>
<input name=locale type=text size=10 value="<?php p($config->locale) ?>">
</td>
<td>
@@ -44,7 +44,7 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>timezone:</td>
<td align=right><p>timezone:</td>
<td><?php
if (abs($config->timezone) > 13) {
$config->timezone = 99;
@@ -71,16 +71,16 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>country:</td>
<td><?php choose_from_menu (get_list_of_countries(), "country", $config->country, get_string("selectacountry"), "") ?>
</td>
<td align=right><p>country:</td>
<td><?php choose_from_menu (get_list_of_countries(), "country", $config->country, get_string("selectacountry"), "") ?>
</td>
<td>
<?php print_string("configcountry") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>smtphosts:</td>
<td>
<td align=right><p>smtphosts:</td>
<td>
<input name=smtphosts type=text size=30 value="<?php p($config->smtphosts)?>">
</td>
<td>
@@ -88,8 +88,8 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>smtpuser:</td>
<td>
<td align=right><p>smtpuser:</td>
<td>
<input name=smtpuser type=text size=10 value="<?php p($config->smtpuser)?>">
</td>
<td rowspan=2>
@@ -97,24 +97,15 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>smtppass:</td>
<td>
<td align=right><p>smtppass:</td>
<td>
<input name=smtppass type=text size=10 value="<?php p($config->smtppass)?>">
</td>
</tr>
</TR>
<tr valign=top>
<td align=right><p>noreplyaddress:</td>
<td>
<input name=noreplyaddress type=text size=30 value="<?php p($config->noreplyaddress)?>">
</td>
<td>
<?php print_string("confignoreplyaddress") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>gdversion:</td>
<td>
<?php
<td align=right><p>gdversion:</td>
<td>
<?php
unset($options);
$options[0] = get_string("gdnot");
$options[1] = get_string("gd1");
@@ -132,7 +123,7 @@
<tr valign=top>
<td align=right><p>htmleditor:</td>
<td>
<?php
<?php
unset($options);
$options[0] = get_string("allownot");
$options[1] = get_string("allow");
@@ -144,9 +135,9 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>maxeditingtime:</td>
<td>
<?php
<td align=right><p>maxeditingtime:</td>
<td>
<?php
unset($options);
$options[3600] = get_string("numminutes", "", 60);
$options[2700] = get_string("numminutes", "", 45);
@@ -163,9 +154,9 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>longtimenosee:</td>
<td>
<?php
<td align=right><p>longtimenosee:</td>
<td>
<?php
unset($options);
$options[1000] = get_string("numdays", "", 1000);
$options[365] = get_string("numdays", "", 365);
@@ -187,9 +178,9 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>deleteunconfirmed:</td>
<td>
<?php
<td align=right><p>deleteunconfirmed:</td>
<td>
<?php
unset($options);
$options[0] = get_string("never");
$options[168] = get_string("numdays", "", 7);
@@ -211,9 +202,9 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>loglifetime:</td>
<td>
<?php
<td align=right><p>loglifetime:</td>
<td>
<?php
unset($options);
$options[0] = get_string("neverdeletelogs");
$options[1000] = get_string("numdays", "", 1000);
@@ -232,56 +223,10 @@
<?php print_string("configloglifetime") ?>
</td>
</tr>
<tr valign="top">
<td align="right"><p>displayloginfailures:</p></td>
<td>
<?php
unset($options);
$options[''] = get_string('nobody');
$options['admin'] = get_string('administrators');
$options['teacher'] = get_string('administratorsandteachers');
$options['everybody'] = get_string('everybody');
choose_from_menu($options, "displayloginfailures",$config->displayloginfailures,"","","");
?>
</td>
<td>
<?php print_string("configdisplayloginfailures") ?>
</td>
</tr>
<tr valign="top">
<td align="right"><p>notifyloginfailures:</p></td>
<td>
<?php
unset($options);
$options[''] = get_string('nobody');
$options['mainadmin'] = get_string('administrator');
$options['alladmins'] = get_string('administratorsall');
choose_from_menu($options,"notifyloginfailures",$config->notifyloginfailures,"","","");
?>
</td>
<td>
<?php print_string('confignotifyloginfailures') ?>
</td>
</tr>
<tr valign="top">
<td align="right"><p>notifyloginthreshold:</p></td>
<td>
<?php
unset($options);
for ($i=1; $i<=100; $i++) {
$options[$i] = "$i";
}
choose_from_menu($options,"notifyloginthreshold",$config->notifyloginthreshold,"","","");
?>
</td>
<td>
<?php print_string('confignotifyloginthreshold') ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>sessiontimeout:</td>
<td>
<?php
<td align=right><p>sessiontimeout:</td>
<td>
<?php
unset($options);
$options[14400] = get_string("numhours", "", 4);
$options[10800] = get_string("numhours", "", 3);
@@ -301,8 +246,8 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>sessioncookie:</td>
<td>
<td align=right><p>sessioncookie:</td>
<td>
<input name=sessioncookie type=text size=10 value="<?php p($config->sessioncookie)?>">
</td>
<td>
@@ -310,8 +255,8 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>zip:</td>
<td>
<td align=right><p>zip:</td>
<td>
<input name=zip type=text size=30 value="<?php p($config->zip) ?>">
</td>
<td>
@@ -319,8 +264,8 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>unzip:</td>
<td>
<td align=right><p>unzip:</td>
<td>
<input name=unzip type=text size=30 value="<?php p($config->unzip) ?>">
</td>
<td>
@@ -328,8 +273,8 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>slasharguments:</td>
<td>
<td align=right><p>slasharguments:</td>
<td>
<?php unset($options);
$options[0] = "file.php?file=/pic.jpg";
$options[1] = "file.php/pic.jpg";
@@ -342,8 +287,8 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>proxyhost:</td>
<td>
<td align=right><p>proxyhost:</td>
<td>
<input name=proxyhost type=text size=30 value="<?php p($config->proxyhost) ?>">
</td>
<td rowspan=2>
@@ -351,15 +296,15 @@
</td>
</TR>
<tr valign=top>
<td align=right><p>proxyport:</td>
<td>
<td align=right><p>proxyport:</td>
<td>
<input name=proxyport type=text size=5 value="<?php p($config->proxyport) ?>">
</td>
</tr>
<tr valign=top>
<td align=right><p>debug:</td>
<td>
<?php
<td align=right><p>debug:</td>
<td>
<?php
unset($options);
$options[7] = get_string("no");
$options[15] = get_string("yes");
@@ -372,9 +317,9 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>framename:</td>
<td>
<?php
<td align=right><p>framename:</td>
<td>
<?php
if (empty($config->framename)) {
$config->framename = "_top";
}
@@ -386,9 +331,9 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>secureforms:</td>
<td>
<?php
<td align=right><p>secureforms:</td>
<td>
<?php
unset($options);
$options[0] = get_string("no");
$options[1] = get_string("yes");
@@ -401,9 +346,9 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>teacherassignteachers:</td>
<td>
<?php
<td align=right><p>teacherassignteachers:</td>
<td>
<?php
unset($options);
$options[0] = get_string("no");
$options[1] = get_string("yes");
@@ -416,9 +361,9 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>allowunenroll:</td>
<td>
<?php
<td align=right><p>allowunenroll:</td>
<td>
<?php
unset($options);
$options[0] = get_string("no");
$options[1] = get_string("yes");
@@ -431,9 +376,9 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>maxbytes:</td>
<td>
<?php
<td align=right><p>maxbytes:</td>
<td>
<?php
$options = get_max_upload_sizes();
choose_from_menu ($options, "maxbytes", $config->maxbytes, "");
?>
@@ -443,9 +388,9 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>fullnamedisplay:</td>
<td>
<?php
<td align=right><p>fullnamedisplay:</td>
<td>
<?php
unset($options);
$options['language'] = get_string('language');
$options['firstname lastname'] = get_string('firstname') . ' + ' . get_string('lastname');
@@ -460,9 +405,9 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>extendedusernamechars:</td>
<td>
<?php
<td align=right><p>extendedusernamechars:</td>
<td>
<?php
unset($options);
$options[0] = get_string("no");
$options[1] = get_string("yes");
@@ -475,24 +420,9 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>autologinguests:</td>
<td>
<?php
unset($options);
$options[0] = get_string('no');
$options[1] = get_string('yes');
choose_from_menu ($options, "autologinguests", $config->autologinguests, "", "", "");
?>
</td>
<td>
<?php print_string("configautologinguests") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>forcelogin:</td>
<td>
<?php
<td align=right><p>forcelogin:</td>
<td>
<?php
unset($options);
$options[0] = get_string('no');
$options[1] = get_string('yes');
@@ -505,9 +435,9 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>forceloginforprofiles:</td>
<td>
<?php
<td align=right><p>forceloginforprofiles:</td>
<td>
<?php
unset($options);
$options[0] = get_string('no');
$options[1] = get_string('yes');
@@ -520,9 +450,9 @@
</td>
</tr>
<tr valign=top>
<td align=right><p>opentogoogle:</td>
<td>
<?php
<td align=right><p>opentogoogle:</td>
<td>
<?php
unset($options);
$options[0] = get_string("no");
$options[1] = get_string("yes");
@@ -547,37 +477,19 @@
?>
</td>
<td>
<?php
<?php
print_string("configenablerssfeeds");
//Check for required functions...
if(!function_exists('utf8_encode')) {
echo "<font color=\"red\"> You need to add XML support to your PHP installation.</font>";
}
?>
</td>
</tr>
<tr valign=top>
<td align=right><p>digestmailtime:</td>
<td>
<?php
$hours = array();
for ($i=0; $i<=23; $i++) {
$hours[$i] = sprintf("%02d",$i);
}
choose_from_menu($hours, 'digestmailtime', $config->digestmailtime, "");
?>
</td>
<td>
<?php
print_string('configdigestmailtime');
}
?>
</td>
</tr>
<tr>
<td colspan=3 align=center>
<input type="submit" value="<?php print_string("savechanges") ?>"></td>
<input type="submit" value="<?php print_string("savechanges") ?>"></td>
</tr>
</table>
+1 -14
View File
@@ -117,12 +117,7 @@
$cachelifetime = time() - $CFG->cachetext;
delete_records_select("cache_text", "timemodified < '$cachelifetime'");
}
if (!empty($CFG->notifyloginfailures)) {
notify_login_failures();
}
} // End of occasional clean-up tasks
}
if (file_exists("$CFG->dataroot/cronextra.php")) {
include("$CFG->dataroot/cronextra.php");
@@ -166,14 +161,6 @@
}
}
/// 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)) {
echo $enrol->log;
}
//Unset session variables and destroy it
@session_unset();
@session_destroy();
-75
View File
@@ -1,75 +0,0 @@
<?PHP // $Id$
// enrol.php - allows admin to edit all enrollment variables
// Yes, enrol is correct English spelling.
include("../config.php");
require_login();
if (!$site = get_site()) {
redirect("index.php");
}
if (!isadmin()) {
error("Only the admin can use this page");
}
if (isset($_GET['enrolment'])) {
$enrolname = $_GET['enrol'];
} else {
$enrolname = $CFG->enrol;
}
require_once("$CFG->dirroot/enrol/$enrolname/enrol.php"); /// Open the class
$enrolment = new enrolment_plugin();
/// If data submitted, then process and store.
if ($config = data_submitted()) {
if ($enrolment->process_config($config)) {
redirect("enrol.php", get_string("changessaved"), 1);
}
}
/// Otherwise fill and print the form.
$str = get_strings(array('enrolments', 'users', 'administration'));
if (empty($config)) {
$page->config = $CFG;
} else {
$page->config = $config;
}
$modules = get_list_of_plugins("enrol");
foreach ($modules as $module) {
$page->options[$module] = get_string("enrolname", "enrol_$module");
}
asort($page->options);
$form = $enrolment->config_form($page);
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_heading($page->options[$CFG->enrol]);
echo "<CENTER><P><B>";
echo "NOT COMPLETE";
echo "<P><B>";
echo "<form TARGET=\"{$CFG->framename}\" NAME=\"authmenu\" method=\"post\" action=\"auth.php\">";
print_string("chooseauthmethod","auth");
choose_from_menu ($options, "auth", $auth, "","document.location='auth.php?auth='+document.authmenu.auth.options[document.authmenu.auth.selectedIndex].value", "");
echo "</B></P></CENTER>";
print_footer();
exit;
?>
+30 -32
View File
@@ -122,26 +122,6 @@
die;
}
/// Insert default values for any important configuration variables
include_once("$CFG->dirroot/lib/defaults.php");
foreach ($defaults as $name => $value) {
if (!isset($CFG->$name)) {
$CFG->$name = $value;
set_config($name, $value);
$configchange = true;
}
}
/// If any new configurations were found then send to the config page to check
if (!empty($configchange)) {
redirect("config.php");
}
/// Check version of Moodle code on disk compared with database
/// and upgrade if possible.
@@ -332,6 +312,25 @@
}
/// Insert default values for any important configuration variables
include_once("$CFG->dirroot/lib/defaults.php");
foreach ($defaults as $name => $value) {
if (!isset($CFG->$name)) {
$CFG->$name = $value;
set_config($name, $value);
$configchange = true;
}
}
/// If any new configurations were found then send to the config page to check
if (!empty($configchange)) {
redirect("config.php");
}
/// Set up the overall site name etc.
if (! $site = get_site()) {
redirect("site.php");
@@ -395,8 +394,7 @@
$userdata = "<font size=+1>&nbsp;</font><a href=\"auth.php\">".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 />";
if (is_internal_auth()) {
$userdata .= "<font size=+1>&nbsp;</font><a href=\"$CFG->wwwroot/$CFG->admin/user.php?newuser=true\">".
get_string("addnewuser")."</a> - <font size=1>".
@@ -405,19 +403,17 @@
get_string("uploadusers")."</a> - <font size=1>".
get_string("adminhelpuploadusers")."</font><br />";
}
$userdata .= "<hr><font size=+1>&nbsp;</font><a href=\"enrol.php\">".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\">".get_string("assignstudents")."</a> - <font size=1>".
get_string("adminhelpassignstudents")."</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=\"admin.php\">".get_string("assignadmins")."</a> - <font size=1>".
get_string("adminhelpassignadmins")."</font><br />";
$userdata .= "<font size=+1>&nbsp;</font><a href=\"creators.php\">".get_string("assigncreators")."</a> - <font size=1>".
get_string("adminhelpassigncreators")."</font><br />";
$userdata .= "<font size=+1>&nbsp;</font><a href=\"../course/index.php?edit=on\">".get_string("assignteachers")."</a> - <font size=1>".
get_string("adminhelpassignteachers").
" <img src=\"../pix/t/user.gif\" height=11 width=11></font><br />";
$userdata .= "<font size=+1>&nbsp;</font><a href=\"creators.php\">".get_string("assigncreators")."</a> - <font size=1>".
get_string("adminhelpassigncreators")."</font><br />";
$userdata .= "<font size=+1>&nbsp;</font><a href=\"admin.php\">".get_string("assignadmins")."</a> - <font size=1>".
get_string("adminhelpassignadmins")."</font><br />";
$userdata .= "<font size=+1>&nbsp;</font><a href=\"../course/index.php?edit=off\">".get_string("assignstudents")."</a> - <font size=1>".
get_string("adminhelpassignstudents")."</font>";
$table->data[] = array("<font size=+1><b><a href=\"users.php\">".get_string("users")."</a></b>", $userdata);
@@ -463,3 +459,5 @@
print_footer($site);
?>
+4 -15
View File
@@ -27,21 +27,14 @@
case "missing":
$navigation = "<A HREF=\"lang.php\">$strlanguage</A> -> $strmissingstrings";
$title = $strmissingstrings;
$button = '<form target="'.$CFG->framename.'" method="get" action="'.$CFG->wwwroot.'/admin/lang.php">'.
'<input type="hidden" name="mode" value="compare" />'.
'<input type="submit" value="'.$strcomparelanguage.'" /></form>';
break;
case "compare":
$navigation = "<A HREF=\"lang.php\">$strlanguage</A> -> $strcomparelanguage";
$title = $strcomparelanguage;
$button = '<form target="'.$CFG->framename.'" method="get" action="'.$CFG->wwwroot.'/admin/lang.php">'.
'<input type="hidden" name="mode" value="missing" />'.
'<input type="submit" value="'.$strmissingstrings.'" /></form>';
break;
default:
$title = $strlanguage;
$navigation = $strlanguage;
$button = '';
break;
}
@@ -49,8 +42,7 @@
print_header("$site->shortname: $title", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> -> $navigation",
'', '', true, $button);
"<a href=\"configure.php\">$strconfiguration</a> -> $navigation");
if (!$mode) {
$currlang = current_language();
@@ -110,18 +102,15 @@
$value = str_replace("$"."a", "\\$"."a", $value);
$value = str_replace("%%","%",$value);
if ($first) {
echo "<p><b>".get_string("stringsnotset","","$langdir/$file")."</b></p><pre>";
echo "</PRE><HR><P><B>".get_string("stringsnotset","","$langdir/$file")."</B></P><PRE>";
$first = false;
$somethingfound = true;
}
echo "$"."string['$key'] = \"$value\";<br />";
echo "$"."string['$key'] = \"$value\";<BR>";
}
}
if (!$first) {
echo '</pre><hr />';
}
}
if (! $files = get_directory_list("$CFG->dirroot/lang/en/help", "CVS")) {
error("Could not find English language help files!");
}
+18 -28
View File
@@ -2,13 +2,13 @@
<table cellpadding=9 cellspacing=0 >
<tr valign=top>
<td align=right><P><?php print_string("fullsitename") ?>:</td>
<td><input type="text" name="fullname" size="50" maxlength="254" value="<?php p($form->fullname) ?>">
<td><input type="text" name="fullname" size=50 value="<?php p($form->fullname) ?>">
<?php if (isset($err["fullname"])) formerr($err["fullname"]); ?>
</td>
</tr>
<tr valign=top>
<td align=right><P><?php print_string("shortsitename") ?>:</td>
<td><input type="text" name="shortname" size="15" maxlength="15" value="<?php p($form->shortname) ?>">
<td><input type="text" name="shortname" size=50 value="<?php p($form->shortname) ?>">
<?php if (isset($err["shortname"])) formerr($err["shortname"]); ?>
</td>
</tr>
@@ -66,42 +66,32 @@
</td>
</tr>
<tr valign=top>
<td align="right"><P><?php print_string("sitesection") ?>:</td>
<td><?php
unset($choices);
$choices["0"] = get_string("no");
$choices["1"] = get_string("yes");
choose_from_menu ($choices, "numsections", $form->numsections, "");
?>
</td>
</tr>
<tr valign=top>
<td align=right><p><?php print_string("wordforteacher") ?>:</td>
<td><input type="text" name="teacher" maxlength="100" size="25" value="<?php p($form->teacher) ?>">
(<?php print_string("wordforteachereg") ?>)
<td align=right><p><?php print_string("wordforteacher") ?>:</td>
<td><input type="text" name="teacher" maxlength="100" size=25 value="<?php p($form->teacher) ?>">
(<?php print_string("wordforteachereg") ?>)
<?php if (isset($err["teacher"])) formerr($err["teacher"]); ?>
</td>
</td>
</tr>
<tr valign=top>
<td align=right><p><?php print_string("wordforteachers") ?>:</td>
<td><input type="text" name="teachers" maxlength="100" size="25" value="<?php p($form->teachers) ?>">
(<?php print_string("wordforteacherseg") ?>)
<td align=right><p><?php print_string("wordforteachers") ?>:</td>
<td><input type="text" name="teachers" maxlength="100" size=25 value="<?php p($form->teachers) ?>">
(<?php print_string("wordforteacherseg") ?>)
<?php if (isset($err["teachers"])) formerr($err["teachers"]); ?>
</td>
</td>
</tr>
<tr valign=top>
<td align=right><p><?php print_string("wordforstudent") ?>:</td>
<td><input type="text" name="student" maxlength="100" size="25" value="<?php p($form->student) ?>">
(<?php print_string("wordforstudenteg") ?>)
<td align=right><p><?php print_string("wordforstudent") ?>:</td>
<td><input type="text" name="student" maxlength="100" size=25 value="<?php p($form->student) ?>">
(<?php print_string("wordforstudenteg") ?>)
<?php if (isset($err["student"])) formerr($err["student"]); ?>
</td>
</td>
</tr>
<tr valign=top>
<td align=right><p><?php print_string("wordforstudents") ?>:</td>
<td><input type="text" name="students" maxlength="100" size="25" value="<?php p($form->students) ?>">
(<?php print_string("wordforstudentseg") ?>)
<td align=right><p><?php print_string("wordforstudents") ?>:</td>
<td><input type="text" name="students" maxlength="100" size=25 value="<?php p($form->students) ?>">
(<?php print_string("wordforstudentseg") ?>)
<?php if (isset($err["students"])) formerr($err["students"]); ?>
</td>
</td>
</tr>
<tr>
<td></td>
-6
View File
@@ -29,11 +29,6 @@
error("Serious Error! Could not update the site record! (id = $form->id)");
}
} else {
// [pj] We are about to create the site, so let's add some blocks...
// calendar_month is included as a Moodle feature advertisement ;-)
require_once('../lib/blocklib.php');
$form->blockinfo = blocks_get_default_blocks(NULL, 'site_main_menu,admin,course_list:course_summary,calendar_month');
if ($newid = insert_record("course", $form)) {
$cat->name = get_string("miscellaneous");
if (insert_record("course_categories", $cat)) {
@@ -65,7 +60,6 @@
$form->shortname = "";
$form->summary = "";
$form->newsitems = 3;
$form->numsections = 0;
$form->id = "";
$form->category = 0;
$form->format = "social";
+1 -4
View File
@@ -331,9 +331,6 @@
}
echo "</form>";
echo "</td></tr></table>";
if (is_internal_auth()){
print_heading("<a href=\"user.php?newuser=true\">".get_string("addnewuser")."</a>");
}
print_table($table);
@@ -343,7 +340,7 @@
}
if (is_internal_auth()){
if ($CFG->auth == "email" || $CFG->auth == "none" || $CFG->auth == "manual"){
print_heading("<a href=\"user.php?newuser=true\">".get_string("addnewuser")."</a>");
}
-71
View File
@@ -1,71 +0,0 @@
Moodle - FirstClass authentication module
-----------------------------------------
This module uses the FirstClass Flexible Provisining Protocol (FPP) to communicate between the FirstClass server
and the Moodle host.
Installation
------------
1. Enable FPP on the FirstClass server
FPP is not doumented in the FirstClass documentation and is not enable by default.
To enable the protocol you need to edit the file \FCPO\Server\Netinfo. Open the file and insert the
following lines.
// TCP port for Flexible Provisioning Protocol (FPP).
TCPFPPPORT = 3333
2. Create an account on the FirstClass server with privilege "Subadministrator".
Using the FPP protocoll this module logs in to the FirstClass server and issuess batch admin commands.
Batch admin command can only be issued in the context of a user with subadministrative privileges.
Default account name is "fcMoodle".
3. Check that the FPP protocoll is working by running a Telnet session. If everyting is working you
should get a "+0" answer from the server.
> telnet yourhost.domain.com 3333
+0
Check that the "fcMoodle" is working by entering the following sequens of commands:
> telnet yourhost.domain.com 3333
+0
fcMoodle
+0
the_password_you_gave_fcmoodle
+0
Get user some_user_id 1201
1201 0 some_user_id
+0
4. On the Moodle host go to the directory where you have installed Moodle.
Open the folder "auth", where all other authentication modules are installed,
and create a new directory with the name "fc".
Copy the files "config.html", "fcFPP.php" and "lib.php" to the "auth" directory.
Now you need to add som strings to the language file. This distribution contains
string for the English (en) and Swedish (sv) translation.
Open the file "auth.php" in the folder "lang/sv" and paste the text from the file
"auth.php - sv.txt" at the end of the file above the line "?>"
Open the file "auth.php" in the folder "lang/en" and paste the text from the file
"auth.php - en.txt" at the end of the file above the line "?>"
-84
View File
@@ -1,84 +0,0 @@
<?PHP
if (!isset($config->auth_fchost)) {
$config->auth_fchost = "127.0.0.1";
}
if (!isset($config->auth_fcfppport)) {
$config->auth_fcfppport = "3333";
}
if (!isset($config->auth_fcuserid)) {
$config->auth_fcuserid = "fcMoodle";
}
if (!isset($config->auth_fcpasswd)) {
$config->auth_fcpasswd = "";
}
if (!isset($config->auth_fccreators)) {
$config->auth_fccreators = "";
}
?>
<TR valign="top" BGCOLOR="<?php echo $THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_fchost:</TD>
<TD>
<INPUT name=auth_fchost TYPE=text SIZE=30 VALUE="<?php echo $config->auth_fchost?>">
<?php if (isset($err["auth_fchost"])) formerr($err["auth_fchost"]); ?>
</TD>
<TD>
<?php print_string("auth_fchost","auth") ?>
</TD>
</TR>
<TR valign="top" BGCOLOR="<?php echo $THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_fcfppport:</TD>
<TD>
<INPUT name=auth_fcfppport TYPE=text SIZE=30 VALUE="<?php echo $config->auth_fcfppport?>">
<?php if (isset($err["auth_fcfppport"])) formerr($err["auth_fchost"]); ?>
</TD>
<TD>
<?php print_string("auth_fcfppport","auth") ?>
</TD>
</TR>
<TR valign="top" BGCOLOR="<?php echo $THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_fcuserid:</TD>
<TD>
<INPUT name=auth_fcuserid TYPE=text SIZE=30 MAXLENGTH=15 VALUE="<?php echo $config->auth_fcuserid?>">
<?php if (isset($err["auth_fcuserid"])) formerr($err["auth_fcuserid"]); ?>
</TD>
<TD>
<?php print_string("auth_fcuserid","auth") ?>
</TD>
</TR>
<TR valign="top" BGCOLOR="<?php echo $THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_fcpasswd:</TD>
<TD>
<INPUT name=auth_fcpasswd TYPE=password SIZE=30 MAXLENGTH=12 VALUE="<?php echo $config->auth_fcpasswd?>">
<?php if (isset($err["auth_fcpasswd"])) formerr($err["auth_fcpasswd"]); ?>
</TD>
<TD>
<?php print_string("auth_fcpasswd","auth") ?>
</TD>
</TR>
<TR valign="top" BGCOLOR="<?php echo $THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_fccreators:</TD>
<TD>
<INPUT name=auth_fccreators TYPE=text SIZE=30 VALUE="<?php echo $config->auth_fccreators?>">
<?php if (isset($err["auth_fccreators"])) formerr($err["auth_fccreators"]); ?>
</TD>
<TD>
<?php print_string("auth_fccreators","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>
-218
View File
@@ -1,218 +0,0 @@
<?php
/************************************************************************/
/* fcFPP: Php class for FirstClass Flexible Provisining Protocol */
/* ============================================================= */
/* */
/* Copyright (c) 2004 SKERIA Utveckling, Teknous */
/* http://skeria.skelleftea.se */
/* */
/* Flexible Provisioning Protocol is a real-time, IP based protocol */
/* which provides direct access to the scriptable remote administration */
/* subsystem of the core FirstClass Server. Using FPP, it is possible to*/
/* implement automated provisioning and administration systems for */
/* FirstClass, avoiding the need for a point and click GUI. FPP can also*/
/* be used to integrate FirstClass components into a larger unified */
/* system. */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
/* Author: Torsten Anderson, torsten.anderson@skeria.skelleftea.se
*/
class fcFPP
{
var $_hostname; // hostname of FirstClass server we are connection to
var $_port; // port on which fpp is running
var $_conn = 0; // socket we are connecting on
var $_debug = FALSE; // set to true to see some debug info
// class constructor
function fcFPP($host="localhost", $port="3333")
{
$this->_hostname = $host;
$this->_port = $port;
$this->_user = "";
$this->_pwd = "";
}
// open a connection to the FirstClass server
function open()
{
if($this->_debug) echo "Connecting to host ";
$host = $this->_hostname;
$port = $this->_port;
if($this->_debug) echo "[$host:$port]..";
// open the connection to the FirstClass server
$conn = fsockopen($host, $port, $errno, $errstr, 5);
if(!$conn)
{
echo "connection failed!".$errno. $errstr;
return false;
}
// We are connected
if($this->_debug) echo "connected!";
// Read connection message.
$line = fgets ($conn); //+0
$line = fgets ($conn); //new line
// store the connection in this class, so we can use it later
$this->_conn = & $conn;
return true;
}
// close any open connections
function close()
{
// get the current connection
$conn = &$this->_conn;
// close it if it's open
if($conn)
{
fclose($conn);
// cleanup the variable
unset($this->_conn);
return true;
}
return;
}
// Authenticate to the FirstClass server
function login($userid, $passwd)
{
// we did have a connection right?!
if($this->_conn)
{
# Send username
fputs($this->_conn,"$userid\r\n");
$line = fgets ($this->_conn); //new line
$line = fgets ($this->_conn); //+0
$line = fgets ($this->_conn); //new line
# Send password
fputs($this->_conn,"$passwd\r\n");
$line = fgets ($this->_conn); //new line
$line = fgets ($this->_conn); //+0
$line = fgets ($this->_conn); //+0 or message
if($this->_debug) echo $line;
if (preg_match ("/^\+0/", $line)) { //+0, user with subadmin privileges
$this->_user = $userid;
$this->_pwd = $passwd;
return TRUE;
} elseif (preg_match ("/^\Sorry/",$line)){ //Denied access but a valid user and password
return TRUE;
} else { //Invalid user or password
return FALSE;
}
}
return FALSE;
}
// Get the list of groups the user is a member of
function getGroups($userid){
$groups = array();
// we must be logged in as a user with subadmin privileges
if($this->_conn AND $this->_user) {
# Send BA-command to get groups
fputs($this->_conn,"GET USER '" . $userid . "' 4 -1\r");
$line = "";
while (!$line) {
$line = trim(fgets ($this->_conn));
}
$n = 0;
while ($line AND !preg_match("/^\+0/", $line) AND $line != "-1003") {
list( , , $groups[$n++]) = explode(" ",$line,3);
$line = trim(fgets ($this->_conn));
}
if($this->_debug) echo "getGroups:" . implode(",",$groups);
}
return $groups;
}
// Check if the user is member of any of the groups.
// Return the list of groups the user is member of.
function isMemberOf($userid, $groups){
$usergroups = array_map("strtolower",$this->getGroups($userid));
$groups = array_map("strtolower",$groups);
$result = array_intersect($groups,$usergroups);
if($this->_debug) echo "isMemberOf:" . implode(",",$result);
return $result;
}
function getUserInfo($userid, $field){
$userinfo = "";
if($this->_conn AND $this->_user) {
# Send BA-command to get data
fputs($this->_conn,"GET USER '" . $userid . "' " . $field . "\r");
$line = "";
while (!$line) {
$line = trim(fgets ($this->_conn));
}
$n = 0;
while ($line AND !preg_match("/^\+0/", $line)) {
list( , , $userinfo) = explode(" ",$line,3);
$line = trim(fgets ($this->_conn));
}
if($this->_debug) echo "getUserInfo:" . $userinfo;
}
return str_replace('\r',' ',trim($userinfo,'"'));
}
function getResume($userid){
$resume = "";
$pattern = "/\[.+:.+\..+\]/"; // Remove references to pictures in resumes
if($this->_conn AND $this->_user) {
# Send BA-command to get data
fputs($this->_conn,"GET RESUME '" . $userid . "' 6\r");
$line = "";
while (!$line) {
$line = trim(fgets ($this->_conn));
}
$n = 0;
while ($line AND !preg_match("/^\+0/", $line)) {
$resume .= preg_replace($pattern,"",str_replace('\r',"\n",trim($line,'6 ')));
$line = trim(fgets ($this->_conn));
//print $line;
}
if($this->_debug) echo "getResume:" . $resume;
}
return $resume;
}
}
?>
-154
View File
@@ -1,154 +0,0 @@
<?php // $Id$
// FirstClass authentication using FirstClass Flexible Provisining Protocol
/* Author: Torsten Anderson, torsten.anderson@skeria.skelleftea.se
CHANGELOG
README
Module will authenticate user against FirstClass server and check if user belongs to any of
the defined creator groups.
User authenticates using their existing FirstClass username and password.
Where possible userdata is copied from the FirstClass directory to Moodle. You may
want to modify this.
Module requires the fcFPP class to do it's jobb.
*/
require('fcFPP.php');
function auth_user_login ($username, $password) {
/// Returns true if the username and password work
/// and false if they don't
global $CFG;
$hostname = $CFG->auth_fchost;
$port = $CFG->auth_fcfppport;
$retval = FALSE;
if (!$username or !$password) { // Don't allow blank usernames or passwords
return $retval;
}
$fpp = new fcFPP($hostname,$port);
if ($fpp->open()) {
if ($fpp->login($username,$password)){
$retval = TRUE;
}
}
$fpp->close();
return $retval;
}
function auth_get_userinfo($username){
// Get user information from FirstCLass server and return it in an array.
// Localize this routine to fit your needs.
/*
Moodle FirstCLass fieldID in UserInfo form
------ -----------------------------------
firstname 1202
lastname 1204
email 1252
icq -
phone1 1206
phone2 1207 (Fax)
institution -
department -
address 1205
city -
country -
lang -
timezone 8030 (Not used yet. Need to figure out how FC codes timezones)
description Get data from users resume. Pictures will be removed.
*/
global $CFG;
$hostname = $CFG->auth_fchost;
$port = $CFG->auth_fcfppport;
$userid = $CFG->auth_fcuserid;
$passwd = $CFG->auth_fcpasswd;
$userinfo = array();
$fpp = new fcFPP($hostname,$port);
if ($fpp->open()) {
if ($fpp->login($userid,$passwd)){
$userinfo['firstname'] = $fpp->getUserInfo($username,"1202");
$userinfo['lastname'] = $fpp->getUserInfo($username,"1204");
$userinfo['email'] = strtok($fpp->getUserInfo($username,"1252"),',');
$userinfo['phone1'] = $fpp->getUserInfo($username,"1206");
$userinfo['phone2'] = $fpp->getUserInfo($username,"1207");
$userinfo['description'] = $fpp->getResume($username);
}
}
$fpp->close();
foreach($userinfo as $key => $value) {
if (!$value) {
unset($userinfo[$key]);
}
}
return $userinfo;
}
function auth_iscreator($username=0) {
//Get users group membership from the FirstClass server user and check if
// user is member of one of the groups of creators.
global $CFG, $USER;
if (! $CFG->auth_fccreators) {
return false;
}
if (! $username) {
$username=$USER->username;
}
$fcgroups = array();
$hostname = $CFG->auth_fchost;
$port = $CFG->auth_fcfppport;
$userid = $CFG->auth_fcuserid;
$passwd = $CFG->auth_fcpasswd;
$fpp = new fcFPP($hostname,$port);
if ($fpp->open()) {
if ($fpp->login($userid,$passwd)){
$fcgroups = $fpp->getGroups($username);
}
}
$fpp->close();
if ((! $fcgroups)) {
return false;
}
$creators = explode(";",$CFG->auth_fccreators);
foreach($creators as $creator) {
If (in_array($creator, $fcgroups)) return true;
}
return false;
}
-6
View File
@@ -557,7 +557,6 @@
fwrite ($bf,full_tag("PASSWORD",3,false,$course->password));
fwrite ($bf,full_tag("FULLNAME",3,false,$course->fullname));
fwrite ($bf,full_tag("SHORTNAME",3,false,$course->shortname));
fwrite ($bf,full_tag("IDNUMBER",3,false,$course->idnumber));
fwrite ($bf,full_tag("SUMMARY",3,false,$course->summary));
fwrite ($bf,full_tag("FORMAT",3,false,$course->format));
fwrite ($bf,full_tag("SHOWGRADES",3,false,$course->showgrades));
@@ -569,7 +568,6 @@
fwrite ($bf,full_tag("STUDENTS",3,false,$course->students));
fwrite ($bf,full_tag("GUEST",3,false,$course->guest));
fwrite ($bf,full_tag("STARTDATE",3,false,$course->startdate));
fwrite ($bf,full_tag("ENROLPERIOD",3,false,$course->enrolperiod));
fwrite ($bf,full_tag("NUMSECTIONS",3,false,$course->numsections));
//fwrite ($bf,full_tag("SHOWRECENT",3,false,$course->showrecent)); INFO: This is out in 1.3
fwrite ($bf,full_tag("MAXBYTES",3,false,$course->maxbytes));
@@ -577,7 +575,6 @@
fwrite ($bf,full_tag("GROUPMODE",3,false,$course->groupmode));
fwrite ($bf,full_tag("GROUPMODEFORCE",3,false,$course->groupmodeforce));
fwrite ($bf,full_tag("LANG",3,false,$course->lang));
fwrite ($bf,full_tag("COST",3,false,$course->cost));
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));
@@ -749,7 +746,6 @@
fwrite ($bf,full_tag("URL",4,false,$user_data->url));
fwrite ($bf,full_tag("DESCRIPTION",4,false,$user_data->description));
fwrite ($bf,full_tag("MAILFORMAT",4,false,$user_data->mailformat));
fwrite ($bf,full_tag("MAILDIGEST",4,false,$user_data->maildigest));
fwrite ($bf,full_tag("MAILDISPLAY",4,false,$user_data->maildisplay));
fwrite ($bf,full_tag("HTMLEDITOR",4,false,$user_data->htmleditor));
fwrite ($bf,full_tag("AUTOSUBSCRIBE",4,false,$user_data->autosubscribe));
@@ -798,8 +794,6 @@
fwrite ($bf,full_tag("AUTHORITY",6,false,$tea->authority));
fwrite ($bf,full_tag("TEA_ROLE",6,false,$tea->role));
fwrite ($bf,full_tag("EDITALL",6,false,$tea->editall));
fwrite ($bf,full_tag("TIMESTART",6,false,$tea->timestart));
fwrite ($bf,full_tag("TIMEEND",6,false,$tea->timeend));
fwrite ($bf,full_tag("TIMEMODIFIED",6,false,$tea->timemodified));
fwrite ($bf,full_tag("TIMEACCESS",6,false,$tea->timeaccess));
//Print ROLE end
+1 -1
View File
@@ -296,7 +296,7 @@
rebuild_course_cache($restore->course_id);
//categories table
$course = get_record("course","id",$restore->course_id);
fix_course_sortorder();
fix_course_sortorder($course->category);
}
//Cleanup temps (files and db)
-10
View File
@@ -109,16 +109,6 @@
echo "</tr></td>";
echo "</table>";
//We compare Moodle's versions
if ($CFG->version < $info->backup_moodle_version && $status) {
$message->serverversion = $CFG->version;
$message->serverrelease = $CFG->release;
$message->backupversion = $info->backup_moodle_version;
$message->backuprelease = $info->backup_moodle_release;
print_simple_box(get_string('noticenewerbackup','',$message), "center", "70%", "$THEME->cellheading2", "20", "noticebox");
}
//Now we print in other table, the backup and the course it contains info
if ($info and $course_header and $status) {
//First, the course info
+3 -24
View File
@@ -125,6 +125,7 @@
}
$formatwiki = FORMAT_WIKI;
$typewiki = WIKITEXT;
//FORUM: Decode every POST (message) in the course
//Check we are restoring forums
@@ -175,13 +176,12 @@
//Check we are restoring resources
if ($restore->mods['resource']->restore == 1) {
echo "<li>".get_string("from")." ".get_string("modulenameplural","resource");
//Get all course resources of type='text' and options=FORMAT_WIKI being restored
//Get all course resources of type=8 WIKITEXT being restored
if ($resources = get_records_sql ("SELECT r.id, r.alltext
FROM {$CFG->prefix}resource r,
{$CFG->prefix}backup_ids b
WHERE r.course = $restore->course_id AND
r.type = 'text' AND
r.options = $formatwiki AND
r.type = $typewiki AND
b.backup_code = $restore->backup_unique_code AND
b.table_name = 'resource' AND
b.new_id = r.id")) {
@@ -536,7 +536,6 @@
$course->password = addslashes($course_header->course_password);
$course->fullname = addslashes($course_header->course_fullname);
$course->shortname = addslashes($course_header->course_shortname);
$course->idnumber = addslashes($course_header->course_idnumber);
$course->summary = restore_decode_absolute_links(addslashes($course_header->course_summary));
$course->format = addslashes($course_header->course_format);
$course->showgrades = addslashes($course_header->course_showgrades);
@@ -548,7 +547,6 @@
$course->students = addslashes($course_header->course_students);
$course->guest = addslashes($course_header->course_guest);
$course->startdate = addslashes($course_header->course_startdate);
$course->enrolperiod = addslashes($course_header->course_enrolperiod);
$course->numsections = addslashes($course_header->course_numsections);
//$course->showrecent = addslashes($course_header->course_showrecent); INFO: This is out in 1.3
$course->maxbytes = addslashes($course_header->course_maxbytes);
@@ -556,7 +554,6 @@
$course->groupmode = addslashes($course_header->course_groupmode);
$course->groupmodeforce = addslashes($course_header->course_groupmodeforce);
$course->lang = addslashes($course_header->course_lang);
$course->cost = addslashes($course_header->course_cost);
$course->marker = addslashes($course_header->course_marker);
$course->visible = addslashes($course_header->course_visible);
$course->hiddensections = addslashes($course_header->course_hiddensections);
@@ -2180,9 +2177,6 @@
case "SHORTNAME":
$this->info->course_shortname = $this->getContents();
break;
case "IDNUMBER":
$this->info->course_idnumber = $this->getContents();
break;
case "SUMMARY":
$this->info->course_summary = $this->getContents();
break;
@@ -2216,9 +2210,6 @@
case "STARTDATE":
$this->info->course_startdate = $this->getContents();
break;
case "ENROLPERIOD":
$this->info->course_enrolperiod = $this->getContents();
break;
case "NUMSECTIONS":
$this->info->course_numsections = $this->getContents();
break;
@@ -2240,9 +2231,6 @@
case "LANG":
$this->info->course_lang = $this->getContents();
break;
case "COST":
$this->info->course_cost = $this->getContents();
break;
case "MARKER":
$this->info->course_marker = $this->getContents();
break;
@@ -2509,9 +2497,6 @@
case "MAILFORMAT":
$this->info->tempuser->mailformat = $this->getContents();
break;
case "MAILDIGEST":
$this->info->tempuser->maildigest = $this->getContents();
break;
case "MAILDISPLAY":
$this->info->tempuser->maildisplay = $this->getContents();
break;
@@ -2554,12 +2539,6 @@
case "EDITALL":
$this->info->temprole->editall = $this->getContents();
break;
case "TIMESTART":
$this->info->temprole->timestart = $this->getContents();
break;
case "TIMEEND":
$this->info->temprole->timeend = $this->getContents();
break;
case "TIMEMODIFIED":
$this->info->temprole->timemodified = $this->getContents();
break;
+2 -2
View File
@@ -5,6 +5,6 @@
// database (backup_version) to determine whether upgrades should
// be performed (see db/backup_*.php)
$backup_version = 2004073000; // The current version is a date (YYYYMMDDXX)
$backup_version = 2004052403; // The current version is a date (YYYYMMDDXX)
$backup_release = "1.4 development"; // User-friendly version number
$backup_release = "1.3.3"; // User-friendly version number
@@ -26,7 +26,7 @@ class CourseBlock_activity_modules extends MoodleBlock {
if ($modnamesused) {
foreach ($modnamesused as $modname => $modfullname) {
if ($modname != 'label') {
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/mod/'.$modname.'/index.php?id='.$this->course->id.'">'.$modnamesplural[$modname].'</a>';
$this->content->items[] = '<a href="../mod/'.$modname.'/index.php?id='.$this->course->id.'">'.$modnamesplural[$modname].'</a>';
$this->content->icons[] = '<img src="'.$CFG->modpixpath.'/'.$modname.'/icon.gif" height="16" width="16" alt="">';
}
}
+6 -53
View File
@@ -5,14 +5,12 @@ class CourseBlock_admin extends MoodleBlock {
$this->title = get_string('administration');
$this->content_type = BLOCK_TYPE_LIST;
$this->course = $course;
$this->version = 2005052800;
$this->version = 2004041000;
}
function applicable_formats() {
return COURSE_FORMAT_WEEKS | COURSE_FORMAT_TOPICS | COURSE_FORMAT_SOCIAL | COURSE_FORMAT_SITE;
}
function get_content() {
global $USER, $CFG, $THEME;
require_once($CFG->dirroot.'/mod/forum/lib.php');
if($this->content !== NULL) {
return $this->content;
@@ -23,52 +21,6 @@ class CourseBlock_admin extends MoodleBlock {
$this->content->icons = array();
$this->content->footer = '';
if($this->course->id == 1) {
$this->load_content_for_site();
}
else {
$this->load_content_for_course();
}
return $this->content;
}
function load_content_for_site() {
global $CFG;
if (isadmin()) {
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/configure.php">'.get_string('configuration').'</a>...';
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/admin.gif" height="16" width="16" alt="" />';
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/users.php">'.get_string('users').'</a>...';
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/users.gif" height="16" width="16" alt="" />';
}
if (iscreator()) {
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/course/index.php?edit=on">'.get_string('courses').'</a>';
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/course.gif" height="16" width="16" alt="" />';
}
if (isadmin()) {
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/course/log.php?id=1">'.get_string('logs').'</a>';
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/log.gif" height="16" width="16" alt="" />';
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/files/index.php?id=1">'.get_string('sitefiles').'</a>';
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/files.gif" height="16" width="16" alt="" />';
if (file_exists($CFG->dirroot.'/'.$CFG->admin.'/'.$CFG->dbtype)) {
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/'.$CFG->dbtype.'/frame.php">'.get_string('managedatabase').'</a>';
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/db.gif" height="16" width="16" alt="" />';
}
$this->content->footer = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/">'.get_string('admin').'</a>...';
}
}
function load_content_for_course() {
global $CFG, $USER;
require_once($CFG->dirroot.'/mod/forum/lib.php');
if (isguest()) {
return $this->content;
}
@@ -130,7 +82,6 @@ class CourseBlock_admin extends MoodleBlock {
}
} else if (!isguest()) { // Students menu
if ($this->course->showgrades) {
$this->content->items[]='<a href="grade.php?id='.$this->course->id.'">'.get_string('grades').'...</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/grades.gif" height="16" width="16" alt="">';
@@ -151,6 +102,8 @@ class CourseBlock_admin extends MoodleBlock {
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" height="16" width="16" alt="">';
}
}
return $this->content;
}
}
@@ -5,11 +5,7 @@ class CourseBlock_calendar_month extends MoodleBlock {
$this->title = get_string('calendar', 'calendar');
$this->content_type = BLOCK_TYPE_TEXT;
$this->course = $course;
$this->version = 2005052600;
}
function applicable_formats() {
return COURSE_FORMAT_WEEKS | COURSE_FORMAT_TOPICS | COURSE_FORMAT_SOCIAL | COURSE_FORMAT_SITE;
$this->version = 2004052400;
}
function get_content() {
@@ -5,11 +5,7 @@ class CourseBlock_calendar_upcoming extends MoodleBlock {
$this->title = get_string('upcomingevents', 'calendar');
$this->content_type = BLOCK_TYPE_TEXT;
$this->course = $course;
$this->version = 2004052600;
}
function applicable_formats() {
return COURSE_FORMAT_WEEKS | COURSE_FORMAT_TOPICS | COURSE_FORMAT_SOCIAL | COURSE_FORMAT_SITE;
$this->version = 2004052400;
}
function get_content() {
@@ -26,7 +22,7 @@ class CourseBlock_calendar_upcoming extends MoodleBlock {
$this->content = New object;
$this->content->text = '';
$this->content->footer = '<br /><a href="'.$CFG->wwwroot.'/calendar/view.php?view=upcoming&amp;course='.$this->course->id.'">'.get_string('gotocalendar', 'calendar').'</a>...';
$this->content->footer .= '<br /><a href="'.$CFG->wwwroot.'/calendar/event.php?action=new&amp;course='.$this->course->id.'">'.get_string('newevent', 'calendar').'</a>...';
$this->content->footer .= '<br /><a href="'.$CFG->wwwroot.'/calendar/event.php?action=new">'.get_string('newevent', 'calendar').'</a>...';
if($this->course === NULL) {
// Overrides: use no course at all
+8 -40
View File
@@ -2,33 +2,10 @@
class CourseBlock_course_list extends MoodleBlock {
function CourseBlock_course_list ($course) {
$this->title = get_string('courses');
$this->title = get_string('mycourses');
$this->content_type = BLOCK_TYPE_LIST;
$this->course = $course;
$this->version = 2005052600;
}
function has_config() {
return true;
}
function print_config() {
global $CFG, $THEME;
print_simple_box_start('center', '', $THEME->cellheading);
include($CFG->dirroot.'/blocks/'.$this->name().'/config.html');
print_simple_box_end();
return true;
}
function handle_config($config) {
foreach ($config as $name => $value) {
set_config($name, $value);
}
return true;
}
function applicable_formats() {
return COURSE_FORMAT_WEEKS | COURSE_FORMAT_TOPICS | COURSE_FORMAT_SOCIAL | COURSE_FORMAT_SITE;
$this->version = 2004041800;
}
function get_content() {
@@ -50,15 +27,8 @@ class CourseBlock_course_list extends MoodleBlock {
$icon = "<img src=\"$CFG->wwwroot/theme/$CFG->theme/pix/i/course.gif\"".
" height=\"16\" width=\"16\" alt=\"".get_string("course")."\">";
}
$adminseesall = true;
if (isset($CFG->block_course_list_adminview)) {
if ( $CFG->block_course_list_adminview == 'own'){
$adminseesall = false;
}
}
if (isset($USER->id) and !(isadmin() and $adminseesall)) { // Just print My Courses
if (isset($USER->id) and !isadmin()) { // Just print My Courses
if ($courses = get_my_courses($USER->id)) {
foreach ($courses as $course) {
if (!$course->category) {
@@ -70,10 +40,8 @@ class CourseBlock_course_list extends MoodleBlock {
$this->content->icons[]=$icon;
}
$this->title = get_string('mycourses');
$this->content->footer = "<a href=\"$CFG->wwwroot/course/index.php\">".get_string("fulllistofcourses")."</a>...";
if ($this->content->items) { // make sure we don't return an empty list
return $this->content;
}
$this->content->footer = "<p><a href=\"$CFG->wwwroot/course/index.php\">".get_string("fulllistofcourses")."</a>...";
return $this->content;
}
}
@@ -85,12 +53,12 @@ class CourseBlock_course_list extends MoodleBlock {
$this->content->items[]="<a $linkcss href=\"$CFG->wwwroot/course/category.php?id=$category->id\">$category->name</a>";
$this->content->icons[]=$icon;
}
$this->content->footer = "<a href=\"$CFG->wwwroot/course/\">".get_string("searchcourses")."</a>...";
$this->content->footer = "<p><a href=\"$CFG->wwwroot/course/\">".get_string("searchcourses")."</a>...";
$this->title = get_string('categories');
} else { // Just print course names of single category
$category = array_shift($categories);
$courses = get_courses($category->id);
if ($courses) {
foreach ($courses as $course) {
$linkcss = $course->visible ? "" : " class=\"dimmed\" ";
@@ -98,7 +66,7 @@ class CourseBlock_course_list extends MoodleBlock {
"href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</a>";
$this->content->icons[]=$icon;
}
$this->content->footer = "<a href=\"$CFG->wwwroot/course/index.php\">".get_string("fulllistofcourses")."</a>...";
$this->content->footer = "<p><a href=\"$CFG->wwwroot/course/index.php\">".get_string("fulllistofcourses")."</a>...";
} else {
$this->content->items = array();
$this->content->icons = array();
-31
View File
@@ -1,31 +0,0 @@
<form method="post" action="block.php">
<table cellpadding="9" cellspacing="0">
<tr valign="top">
<td align="right"><p>block_course_list_adminview:</td>
<td>
<input name="block" type="hidden" value="<?php echo intval($_REQUEST['block']); ?>" />
<select name="block_course_list_adminview">
<option value="all" <?php if(isset($CFG->block_course_list_adminview)){
if($CFG->block_course_list_adminview == "all"){ p("selected");}
}else{
p("selected");
}?>
><?php p(get_string('allcourses', 'block_course_list')) ?></option>
<option value="own" <?php if(isset($CFG->block_course_list_adminview)){
if($CFG->block_course_list_adminview == "own"){ p("selected"); }
}?>
><?php p(get_string('owncourses', 'block_course_list')) ?></option>
</select>
</td>
<td>
<?php print_string("configadminview", "block_course_list") ?>
</td>
</tr>
<tr>
<td colspan="3" align="center">
<input type="submit" value="<?php print_string("savechanges") ?>"></td>
</tr>
</table>
</form>
+7 -24
View File
@@ -2,45 +2,28 @@
class CourseBlock_course_summary extends MoodleBlock {
function CourseBlock_course_summary ($course) {
if (empty($course->category)) { // Site level
$this->title = get_string('frontpagedescription');
} else {
$this->title = get_string('blockname','block_course_summary');
}
$this->title = get_string('blockname','block_course_summary');
$this->content_type = BLOCK_TYPE_TEXT;
$this->course = $course;
$this->version = 2004052600;
}
function applicable_formats() {
return COURSE_FORMAT_WEEKS | COURSE_FORMAT_TOPICS | COURSE_FORMAT_SOCIAL | COURSE_FORMAT_SITE;
$this->version = 2004041400;
}
function get_content() {
global $CFG, $THEME;
global $USER, $CFG;
if($this->content !== NULL) {
return $this->content;
}
$this->content = New stdClass;
$this->content->text = format_text($this->course->summary, FORMAT_HTML);
if (isediting($this->course->id)) {
if (empty($this->course->category)) {
$editpage = $CFG->wwwroot.'/admin/site.php';
} else {
$editpage = $CFG->wwwroot.'/course/edit.php?id='.$this->course->id;
}
$this->content->text .= "<div align=\"right\"><a href=\"$editpage\"><img src=\"$CFG->pixpath/t/edit.gif\" /></a></div>";
}
$this->content = New object;
$this->content->text = '';
$this->content->footer = '';
$this->content->text = format_text($this->course->summary, FORMAT_HTML);
return $this->content;
}
function hide_header() {
return true;
}
function hide_header() {return true;}
}
?>
+15 -40
View File
@@ -66,46 +66,22 @@ class MoodleBlock {
case BLOCK_TYPE_NUKE:
case BLOCK_TYPE_TEXT:
if(empty($this->content->text) && empty($this->content->footer)) {
if(empty($this->edit_controls)) {
// No content, no edit controls, so just shut up
break;
}
else {
// No content but editing, so show something at least
$this->print_shadow();
}
break;
}
else {
if($this->hide_header() && empty($this->edit_controls)) {
// Header wants to hide, no edit controls to show, so no header it is
print_side_block(NULL, $this->content->text, NULL, NULL, $this->content->footer, $this->html_attributes());
}
else {
// The full treatment, please
print_side_block($title, $this->content->text, NULL, NULL, $this->content->footer, $this->html_attributes());
}
if ($this->edit_controls !== NULL || !$this->hide_header()) {
print_side_block($title, $this->content->text, NULL, NULL, $this->content->footer);
} else {
print_side_block(NULL, $this->content->text, NULL, NULL, $this->content->footer);
}
break;
case BLOCK_TYPE_LIST:
if(empty($this->content->items) && empty($this->content->footer)) {
if(empty($this->edit_controls)) {
// No content, no edit controls, so just shut up
break;
}
else {
// No content but editing, so show something at least
$this->print_shadow();
}
break;
}
else {
if($this->hide_header() && empty($this->edit_controls)) {
// Header wants to hide, no edit controls to show, so no header it is
print_side_block(NULL, '', $this->content->items, $this->content->icons, $this->content->footer, $this->html_attributes());
}
else {
// The full treatment, please
print_side_block($title, '', $this->content->items, $this->content->icons, $this->content->footer, $this->html_attributes());
}
if ($this->edit_controls !== NULL || !$this->hide_header()) {
print_side_block($title, '', $this->content->items, $this->content->icons, $this->content->footer);
} else {
print_side_block(NULL, '', $this->content->items, $this->content->icons, $this->content->footer);
}
break;
}
@@ -117,7 +93,6 @@ class MoodleBlock {
}
print_side_block($title, '&nbsp;', NULL, NULL, '');
}
function add_edit_controls($options, $blockid) {
global $CFG, $THEME;
@@ -204,7 +179,7 @@ class MoodleBlock {
$errors[] = 'version_not_set';
$correct = false;
}
$allformats = COURSE_FORMAT_WEEKS | COURSE_FORMAT_TOPICS | COURSE_FORMAT_SOCIAL | COURSE_FORMAT_SITE;
$allformats = COURSE_FORMAT_WEEKS | COURSE_FORMAT_TOPICS | COURSE_FORMAT_SOCIAL;
if(!($this->applicable_formats() & $allformats)) {
$errors[] = 'no_course_formats';
$correct = false;
@@ -230,19 +205,19 @@ class MoodleBlock {
}
function applicable_formats() {
// Default case: the block can be used in all course types
return COURSE_FORMAT_WEEKS | COURSE_FORMAT_TOPICS | COURSE_FORMAT_SOCIAL | COURSE_FORMAT_SITE;
return COURSE_FORMAT_WEEKS | COURSE_FORMAT_TOPICS | COURSE_FORMAT_SOCIAL;
}
function preferred_width() {
// Default case: the block wants to be 180 pixels wide
return 180;
}
function hide_header() {
//Default, false--> the header is shown
//Default, false--> the header is showed
return false;
}
function html_attributes() {
// Default case: just an id for the block, with our name in it
return array('id' => 'block_'.$this->name());
// Default case: we want no extra attributes
return false;
}
}
+1 -6
View File
@@ -5,11 +5,7 @@ class CourseBlock_news_items extends MoodleBlock {
$this->title = get_string('latestnews');
$this->content_type = BLOCK_TYPE_TEXT;
$this->course = $course;
$this->version = 2004052600;
}
function applicable_formats() {
return COURSE_FORMAT_WEEKS | COURSE_FORMAT_TOPICS | COURSE_FORMAT_SOCIAL | COURSE_FORMAT_SITE;
$this->version = 2004041200;
}
function get_content() {
@@ -20,7 +16,6 @@ class CourseBlock_news_items extends MoodleBlock {
}
require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->dirroot.'/mod/forum/lib.php');
$this->content = New object;
$this->content->text = '';
+1 -5
View File
@@ -5,11 +5,7 @@ class CourseBlock_online_users extends MoodleBlock {
$this->title = get_string('blockname','block_online_users');
$this->content_type = BLOCK_TYPE_TEXT;
$this->course = $course;
$this->version = 2004052700;
}
function applicable_formats() {
return COURSE_FORMAT_WEEKS | COURSE_FORMAT_TOPICS | COURSE_FORMAT_SOCIAL | COURSE_FORMAT_SITE;
$this->version = 2004041800;
}
function has_config() {return true;}
+11 -13
View File
@@ -5,7 +5,7 @@ class CourseBlock_participants extends MoodleBlock {
$this->title = get_string('people');
$this->content_type = BLOCK_TYPE_LIST;
$this->course = $course;
$this->version = 2004052600;
$this->version = 2004041800;
}
function get_content() {
@@ -23,31 +23,29 @@ class CourseBlock_participants extends MoodleBlock {
$strgroups = get_string('groups');
$strgroupmy = get_string('groupmy');
$this->content->items[]='<a title="'.get_string('listofallpeople').'" href="'.$CFG->wwwroot.'/user/index.php?id='.$this->course->id.'">'.get_string('participants').'</a>';
$this->content->items[]='<a title="'.get_string('listofallpeople').'" href="../user/index.php?id='.$this->course->id.'">'.get_string('participants').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/users.gif" height="16" width="16" alt="">';
if ($this->course->groupmode or !$this->course->groupmodeforce) {
if ($this->course->groupmode == VISIBLEGROUPS or isteacheredit($this->course->id)) {
$this->content->items[]='<a title="'.$strgroups.'" href="'.$CFG->wwwroot.'/course/groups.php?id='.$this->course->id.'">'.$strgroups.'</a>';
$this->content->items[]='<a title="'.$strgroups.'" href="groups.php?id='.$this->course->id.'">'.$strgroups.'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/group.gif" height="16" width="16" alt="">';
} else if ($this->course->groupmode == SEPARATEGROUPS and $this->course->groupmodeforce) {
// Show nothing
} else if ($currentgroup = get_current_group($this->course->id)) {
$this->content->items[]='<a title="'.$strgroupmy.'" href="'.$CFG->wwwroot.'/course/group.php?id='.$this->course->id.'">'.$strgroupmy.'</a>';
$this->content->items[]='<a title="'.$strgroupmy.'" href="group.php?id='.$this->course->id.'">'.$strgroupmy.'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/group.gif" height="16" width="16" alt="">';
}
}
if(!empty($USER)) {
$fullname = fullname($USER, true);
$editmyprofile = '<a title="'.$fullname.'" href="'.$CFG->wwwroot.'/user/edit.php?id='.$USER->id.'&amp;course='.$this->course->id.'">'.get_string('editmyprofile').'</a>';
if ($USER->description) {
$this->content->items[]= $editmyprofile;
} else {
$this->content->items[]= $editmyprofile." <blink>*</blink>";
}
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" height="16" width="16" alt="">';
$fullname = fullname($USER, true);
$editmyprofile = '<a title="'.$fullname.'" href="../user/edit.php?id='.$USER->id.'&amp;course='.$this->course->id.'">'.get_string('editmyprofile').'</a>';
if ($USER->description) {
$this->content->items[]= $editmyprofile;
} else {
$this->content->items[]= $editmyprofile." <blink>*</blink>";
}
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" height="16" width="16" alt="">';
return $this->content;
}
@@ -1,134 +0,0 @@
<?php //$Id$
class CourseBlock_site_main_menu extends MoodleBlock {
function CourseBlock_site_main_menu ($course) {
$this->title = get_string('mainmenu');
$this->content_type = BLOCK_TYPE_LIST;
$this->course = $course;
$this->version = 2004052700;
}
function applicable_formats() {
return COURSE_FORMAT_SITE;
}
function get_content() {
global $USER, $CFG;
if ($this->content !== NULL) {
return $this->content;
}
if (empty($this->course)) {
return '';
}
$this->content = New stdClass;
$this->content->items = array();
$this->content->icons = array();
$this->content->footer = '';
$isteacher = isteacher($this->course->id);
$isediting = isediting($this->course->id);
$ismoving = ismoving($this->course->id);
$sections = get_all_sections($this->course->id);
$section = $sections[0];
if($section->sequence || $isediting) {
get_all_mods($this->course->id, $mods, $modnames, $modnamesplural, $modnamesused);
}
$groupbuttons = $this->course->groupmode;
$groupbuttonslink = (!$this->course->groupmodeforce);
if ($ismoving) {
$strmovehere = get_string('movehere');
$strmovefull = strip_tags(get_string('movefull', '', "'$USER->activitycopyname'"));
$strcancel= get_string('cancel');
$stractivityclipboard = $USER->activitycopyname;
}
$modinfo = unserialize($this->course->modinfo);
$editbuttons = '';
if ($ismoving) {
$this->content->icons[] = '&nbsp;<img align="bottom" src="'.$CFG->pixpath.'/t/move.gif" height="11" width="11">';
$this->content->items[] = $USER->activitycopyname.'&nbsp;(<a href="'.$CFG->wwwroot.'/course/mod.php?cancelcopy=true">'.$strcancel.'</a>)';
}
if (!empty($section->sequence)) {
$sectionmods = explode(',', $section->sequence);
foreach ($sectionmods as $modnumber) {
if (empty($mods[$modnumber])) {
continue;
}
$mod = $mods[$modnumber];
if ($isediting && !$ismoving) {
if ($groupbuttons) {
if (! $mod->groupmodelink = $groupbuttonslink) {
$mod->groupmode = $this->course->groupmode;
}
} else {
$mod->groupmode = false;
}
$editbuttons = '<br />'.make_editing_buttons($mod, true, true);
} else {
$editbuttons = '';
}
if ($mod->visible || $isteacher) {
if ($ismoving) {
if ($mod->id == $USER->activitycopy) {
continue;
}
$this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?moveto='.$mod->id.'">'.
'<img height="16" width="80" src="'.$CFG->pixpath.'/movehere.gif" alt="'.$strmovehere.'" border="0"></a>';
$this->content->icons[] = '';
}
$instancename = urldecode($modinfo[$modnumber]->name);
if (!empty($CFG->filterall)) {
$instancename = filter_text('<nolink>'.$instancename.'</nolink>', $this->course->id);
}
$linkcss = $mod->visible ? '' : ' class="dimmed" ';
if (!empty($modinfo[$modnumber]->extra)) {
$extra = urldecode($modinfo[$modnumber]->extra);
} else {
$extra = '';
}
if (!empty($modinfo[$modnumber]->icon)) {
$icon = $CFG->pixpath.'/'.urldecode($modinfo[$modnumber]->icon);
} else {
$icon = $CFG->modpixpath.'/'.$mod->modname.'/icon.gif';
}
if ($mod->modname == 'label') {
$this->content->items[] = format_text($extra, FORMAT_HTML).$editbuttons;
$this->content->icons[] = '';
} else {
$this->content->items[] = '<a title="'.$mod->modfullname.'" '.$linkcss.' '.$extra.
' href="'.$CFG->wwwroot.'/mod/'.$mod->modname.'/view.php?id='.$mod->id.'">'.$instancename.'</a>'.$editbuttons;
$this->content->icons[] = '<img src="'.$icon.'" height="16" width="16" alt="'.$mod->modfullname.'">';
}
}
}
}
if ($ismoving) {
$this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?movetosection='.$section->id.'">'.
'<img height="16" width="80" src="'.$CFG->pixpath.'/movehere.gif" alt="'.$strmovehere.'" border="0"></a>';
$this->content->icons[] = '';
}
if ($isediting && $modnames) {
$this->content->footer = '<div style="text-align: right;">'.
print_section_add_menus($this->course, 0, $modnames, true, true).'</div>';
} else {
$this->content->footer = '';
}
return $this->content;
}
}
?>
@@ -15,12 +15,9 @@ class CourseBlock_social_activities extends MoodleBlock {
function get_content() {
global $USER, $CFG;
if ($this->content !== NULL) {
if($this->content !== NULL) {
return $this->content;
}
if (empty($this->course)) {
return '';
}
$this->content = New object;
$this->content->items = array();
@@ -49,8 +46,8 @@ class CourseBlock_social_activities extends MoodleBlock {
$editbuttons = '';
if ($ismoving) {
$this->content->icons[] = '&nbsp;<img align="bottom" src="'.$CFG->pixpath.'/t/move.gif" height="11" width="11">';
$this->content->items[] = $USER->activitycopyname.'&nbsp;(<a href="'.$CFG->wwwroot.'/course/mod.php?cancelcopy=true">'.$strcancel.'</a>)';
$this->content->items[] = '&nbsp;<img align="bottom" src="'.$CFG->pixpath.'/t/move.gif" height="11" width="11">';
$this->content->icons[] = $USER->activitycopyname.'&nbsp;(<a href="'.$CFG->wwwroot.'/course/mod.php?cancelcopy=true">'.$strcancel.'</a>)';
}
if (!empty($section->sequence)) {
@@ -92,11 +89,6 @@ class CourseBlock_social_activities extends MoodleBlock {
} else {
$extra = '';
}
if (!empty($modinfo[$modnumber]->icon)) {
$icon = $CFG->pixpath.'/'.urldecode($modinfo[$modnumber]->icon);
} else {
$icon = $CFG->modpixpath.'/'.$mod->modname.'/icon.gif';
}
if ($mod->modname == 'label') {
$this->content->items[] = format_text($extra, FORMAT_HTML).$editbuttons;
@@ -104,7 +96,7 @@ class CourseBlock_social_activities extends MoodleBlock {
} else {
$this->content->items[] = '<a title="'.$mod->modfullname.'" '.$linkcss.' '.$extra.
' href="'.$CFG->wwwroot.'/mod/'.$mod->modname.'/view.php?id='.$mod->id.'">'.$instancename.'</a>'.$editbuttons;
$this->content->icons[] = '<img src="'.$icon.'" height="16" width="16" alt="'.$mod->modfullname.'">';
$this->content->icons[] = '<img src="'.$CFG->modpixpath.'/'.$mod->modname.'/icon.gif" height="16" width="16" alt="'.$mod->modfullname.'">';
}
}
}
@@ -118,7 +110,8 @@ class CourseBlock_social_activities extends MoodleBlock {
if ($isediting && $modnames) {
$this->content->footer = '<div style="text-align: right;">'.
print_section_add_menus($this->course, 0, $modnames, true, true).'</div>';
popup_form($CFG->wwwroot.'/course/mod.php?id='.$this->course->id.'&amp;section='.$section->section.'&amp;add=',
$modnames, 'section0', '', get_string('add').'...', 'mods', get_string('activities'), true) . '</div>';
} else {
$this->content->footer = '';
}
+1 -1
View File
@@ -5,4 +5,4 @@
// database (blocks_version) to determine whether upgrades should
// be performed (see db/backup_*.php)
$blocks_version = 2004052700; // The current version is a date (YYYYMMDDXX)
$blocks_version = 2004052400; // The current version is a date (YYYYMMDDXX)
+9 -31
View File
@@ -39,9 +39,9 @@
/////////////////////////////////////////////////////////////////////////////
require_once('../config.php');
require_once($CFG->dirroot.'/calendar/lib.php');
require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->dirroot.'/mod/forum/lib.php');
require_once('lib.php');
require_once('../course/lib.php');
require_once('../mod/forum/lib.php');
require_login();
@@ -71,22 +71,6 @@
$defaultformat = FORMAT_MOODLE;
}
// If a course has been supplied in the URL, change the filters to show that one
if(!empty($_GET['course'])) {
if(is_numeric($_GET['course']) && $_GET['course'] > 0 && record_exists('course', 'id', $_GET['course'])) {
if($_GET['course'] == 1) {
// If coming from the home page, show all courses
$SESSION->cal_courses_shown = calendar_get_default_courses(true);
calendar_set_referring_course(0);
}
else {
// Otherwise show just this one
$SESSION->cal_courses_shown = intval($_GET['course']);
calendar_set_referring_course($SESSION->cal_courses_shown);
}
}
}
switch($_REQUEST['action']) {
case 'delete':
$title = get_string('deleteevent', 'calendar');
@@ -221,7 +205,7 @@
switch($_REQUEST['action']) {
case 'delete':
if(!empty($_REQUEST['confirm']) && $_REQUEST['confirm'] == 1) {
if($_REQUEST['confirm'] == 1) {
// Kill it and redirect to day view
if(($event = get_record('event', 'id', $_REQUEST['id'])) !== false) {
/// Log the event delete.
@@ -248,7 +232,7 @@
$d = $eventtime['mday'];
$y = $eventtime['year'];
// Display confirmation form
print_side_block_start(get_string('deleteevent', 'calendar').': '.$event->name, array('class' => 'mycalendar'));
print_side_block_start(get_string('deleteevent', 'calendar').': '.$event->name, '', 'mycalendar');
include('event_delete.html');
print_side_block_end();
}
@@ -279,13 +263,7 @@
$form->minutes = '';
}
}
if (!empty($form->courseid)) { // Fixes bug 1488
$course = get_record('course', 'id', $form->courseid);
} else {
$course = $site;
}
print_side_block_start(get_string('editevent', 'calendar'), array('class' => 'mycalendar'));
print_side_block_start(get_string('editevent', 'calendar'), '', 'mycalendar');
include('event_edit.html');
print_side_block_end();
if ($usehtmleditor) {
@@ -415,7 +393,7 @@
$header = ' ('.$header.')';
}
print_side_block_start(get_string('newevent', 'calendar').$header, array('class' => 'mycalendar'));
print_side_block_start(get_string('newevent', 'calendar').$header, '', 'mycalendar');
if($_REQUEST['type'] == 'select') {
$defaultcourse = $SESSION->cal_course_referer;
if(isteacheredit($defaultcourse, $USER->id)) {
@@ -447,7 +425,7 @@
$defaultcourses = calendar_get_default_courses();
calendar_set_filters($courses, $groups, $users, $defaultcourses, $defaultcourses);
print_side_block_start(get_string('monthlyview', 'calendar'));
print_side_block_start(get_string('monthlyview', 'calendar'), '', 'sideblockmain');
list($prevmon, $prevyr) = calendar_sub_month($mon, $yr);
list($nextmon, $nextyr) = calendar_add_month($mon, $yr);
@@ -530,7 +508,7 @@ function calendar_get_allowed_types(&$allowed) {
$allowed->courses = false; // This may change just below
$allowed->site = isadmin($USER->id);
if(!empty($SESSION->cal_course_referer) && $SESSION->cal_course_referer > 1 && isteacheredit($SESSION->cal_course_referer, $USER->id)) {
if(!empty($SESSION->cal_course_referer) && isteacheredit($SESSION->cal_course_referer, $USER->id)) {
$allowed->courses = array($SESSION->cal_course_referer => 1);
$allowed->groups = get_groups($SESSION->cal_course_referer);
}
+4
View File
@@ -1,3 +1,7 @@
<?php
// The following is a hack to fix bug 1488
$course = get_record('course', 'id', ($form->courseid) ? $form->courseid : $site->id);
?>
<form method="post" action="event.php" name="edit">
<table cellpadding=5>
<tr>
+105 -131
View File
@@ -130,8 +130,7 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
// We want to have easy access by day, since the display is on a per-day basis.
// Arguments passed by reference.
//calendar_events_by_day($events, $display->tstart, $eventsbyday, $durationbyday, $typesbyday);
calendar_events_by_day($events, $m, $y, $eventsbyday, $durationbyday, $typesbyday);
calendar_events_by_day($events, $display->tstart, $eventsbyday, $durationbyday, $typesbyday);
$content .= '<table class="calendarmini">'; // Begin table
$content .= '<thead><tr>'; // Header row: day names
@@ -195,7 +194,7 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
$popupalt = '';
} else if ($event->courseid > 1 and empty($event->groupid)) { // Course event
$popupicon = $CFG->pixpath.'/c/course.gif';
$popupalt = '';
$popupalt = '';
} else if ($event->groupid) { // Group event
$popupicon = $CFG->pixpath.'/c/group.gif';
$popupalt = '';
@@ -203,11 +202,10 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
$popupicon = $CFG->pixpath.'/c/user.gif';
$popupalt = '';
}
$popupcontent .= '<div><img height="16" width="16" src="'.$popupicon.'" style="vertical-align: middle; margin-right: 4px;" alt="'.$popupalt.'" /><a href="'.$dayhref.'">'.$event->name.'</a></div>';
$popupcontent .= '<div><img height=16 width=16 src=\\\''.$popupicon.'\\\' style=\\\'vertical-align: middle; margin-right: 4px;\\\' alt=\\\''.$popupalt.'\\\' /><a href=\\\''.$dayhref.'\\\'>'.addslashes(htmlspecialchars($event->name)).'</a></div>';
}
$popupcaption = get_string('eventsfor', 'calendar', userdate($events[$eventid]->timestart, $strftimetimedayshort));
$popupcontent = str_replace("'", "\'", htmlspecialchars($popupcontent));
$popup = 'onmouseover="return overlib(\''.$popupcontent.'\', CAPTION, \''.$popupcaption.'\');" onmouseout="return nd();"';
// Class and cell content
@@ -279,12 +277,13 @@ function calendar_get_upcoming($courses, $groups, $users, $daysinfuture, $maxeve
$processed = 0;
$now = time(); // We 'll need this later
$usermidnighttoday = usergetmidnight($now);
$nowsecs = $now % SECS_IN_DAY; // this too
$nowdays = $now - $nowsecs; // and this
if ($fromtime) {
$display->tstart = $fromtime;
} else {
$display->tstart = $usermidnighttoday;
$display->tstart = usergetmidnight(time());
}
// This effectively adds as many days as needed, and the final SECS_IN_DAY - 1
@@ -316,27 +315,29 @@ function calendar_get_upcoming($courses, $groups, $users, $daysinfuture, $maxeve
if($events !== false) {
foreach($events as $event) {
if($processed >= $display->maxevents) {
break;
}
if($processed >= $display->maxevents) break;
$startdate = usergetdate($event->timestart);
$enddate = usergetdate($event->timestart + $event->timeduration);
$usermidnightstart = usergetmidnight($event->timestart);
$starttimesecs = $event->timestart % SECS_IN_DAY; // Seconds after that day's midnight
$starttimedays = $event->timestart - $starttimesecs; // Timestamp of midnight of that day
if($event->timeduration) {
// To avoid doing the math if one IF is enough :)
$usermidnightend = usergetmidnight($event->timestart + $event->timeduration);
$endtimesecs = ($event->timestart + $event->timeduration) % SECS_IN_DAY; // Seconds after that day's midnight
$endtimedays = ($event->timestart + $event->timeduration) - $endtimesecs; // Timestamp of midnight of that day
}
else {
$usermidnightend = $usermidnightstart;
$endtimesecs = $starttimesecs;
$endtimedays = $starttimedays;
}
// Keep in mind: $starttimeXXX, $endtimeXXX and $nowXXX are all in GMT-based
// OK, now to get a meaningful display...
// First of all we have to construct a human-readable date/time representation
if($event->timestart + $event->timeduration < $now) {
// First of all we have to construct a human-readable date/time representation
if($endtimedays < $nowdays || $endtimedays == $nowdays && $endtimesecs <= $nowsecs) {
// It has expired, so we don't care about duration
$day = calendar_day_representation($event->timestart + $event->timeduration, $now);
$time = calendar_time_representation($event->timestart + $event->timeduration);
@@ -347,8 +348,8 @@ function calendar_get_upcoming($courses, $groups, $users, $daysinfuture, $maxeve
}
else if($event->timeduration) {
// It has a duration
if($usermidnightstart == $usermidnightend) {
// But it's all on the same day
if($starttimedays == $endtimedays) {
// But it's all on one day
$day = calendar_day_representation($event->timestart, $now);
$timestart = calendar_time_representation($event->timestart);
$timeend = calendar_time_representation($event->timestart + $event->timeduration);
@@ -449,6 +450,7 @@ function calendar_sql_where($tstart, $tend, $users, $groups, $courses, $withdura
if(is_bool($users) && is_bool($groups) && is_bool($courses)) {
return false;
}
if(is_array($users) && !empty($users)) {
// Events from a number of users
if(!empty($whereclause)) $whereclause .= ' OR';
@@ -464,13 +466,6 @@ function calendar_sql_where($tstart, $tend, $users, $groups, $courses, $withdura
if(!empty($whereclause)) $whereclause .= ' OR';
$whereclause .= ' userid != 0 AND courseid = 0 AND groupid = 0';
}
else if($users === false) {
// No user at all
if(!empty($whereclause)) {
$whereclause .= ' OR';
}
$whereclause .= ' 0';
}
if(is_array($groups) && !empty($groups)) {
// Events from a number of groups
if(!empty($whereclause)) $whereclause .= ' OR';
@@ -486,21 +481,10 @@ function calendar_sql_where($tstart, $tend, $users, $groups, $courses, $withdura
if(!empty($whereclause)) $whereclause .= ' OR ';
$whereclause .= ' groupid != 0';
}
if(is_array($courses)) {
// A number of courses (maybe none at all!)
if(!empty($courses)) {
if(!empty($whereclause)) {
$whereclause .= ' OR';
}
$whereclause .= ' groupid = 0 AND courseid IN ('.implode(',', $courses).')';
}
else {
// This means NO courses, not that we don't care!
if(!empty($whereclause)) {
$whereclause .= ' OR';
}
$whereclause .= ' 0';
}
if(is_array($courses) && !empty($courses)) {
// A number of courses
if(!empty($whereclause)) $whereclause .= ' OR';
$whereclause .= ' groupid = 0 AND courseid IN ('.implode(',', $courses).')';
}
else if(is_numeric($courses)) {
// One course
@@ -532,7 +516,6 @@ function calendar_sql_where($tstart, $tend, $users, $groups, $courses, $withdura
// Just basic time filtering
$whereclause = $timeclause;
}
return $whereclause;
}
@@ -628,11 +611,7 @@ function calendar_filter_controls($type, $vars = NULL, $course = NULL) {
$getvars = '&amp;from='.$type;
break;
case 'course':
if (isset($_GET['id'])) {
$getvars = '&amp;from=course&amp;id='.$_GET['id'];
} else {
$getvars = '&amp;from=course';
}
$getvars = '&amp;from=course&amp;id='.$_GET['id'];
if (isset($course->groupmode) and !$course->groupmode and $course->groupmodeforce) {
$groupevents = false;
}
@@ -659,7 +638,7 @@ function calendar_filter_controls($type, $vars = NULL, $course = NULL) {
$content .= '<td style="width: 8px;"></td><td><a href="'.CALENDAR_URL.'set.php?var=showcourses'.$getvars.'" title="'.get_string('tt_showcourse', 'calendar').'">'.get_string('courseevents', 'calendar').'</a></td>'."\n";
}
if(!empty($USER) && !isguest($USER->id)) {
if(!isguest($USER->id)) {
$content .= "</tr>\n<tr>";
if($groupevents) {
@@ -705,28 +684,27 @@ function calendar_day_representation($tstamp, $now = false, $usecommonwords = tr
// To have it in one place, if a change is needed
$formal = userdate($tstamp, $shortformat);
$datestamp = usergetdate($tstamp);
$datenow = usergetdate($now);
// Reverse TZ compensation: make GMT stamps correspond to user's TZ
$tzfix = calendar_get_tz_offset();
$tstamp += $tzfix;
$now += $tzfix;
$eventdays = intval($tstamp / SECS_IN_DAY);
$nowdays = intval($now / SECS_IN_DAY);
if($usecommonwords == false) {
// We don't want words, just a date
return $formal;
}
else if($datestamp['year'] == $datenow['year'] && $datestamp['yday'] == $datenow['yday']) {
else if($eventdays == $nowdays) {
// Today
return get_string('today', 'calendar');
}
else if(
($datestamp['year'] == $datenow['year'] && $datestamp['yday'] == $datenow['yday'] - 1 ) ||
($datestamp['year'] == $datenow['year'] - 1 && $datestamp['mday'] == 31 && $datestamp['mon'] == 12 && $datenow['yday'] == 1)
) {
else if($eventdays == $nowdays - 1) {
// Yesterday
return get_string('yesterday', 'calendar');
}
else if(
($datestamp['year'] == $datenow['year'] && $datestamp['yday'] == $datenow['yday'] + 1 ) ||
($datestamp['year'] == $datenow['year'] + 1 && $datenow['mday'] == 31 && $datenow['mon'] == 12 && $datestamp['yday'] == 1)
) {
else if($eventdays == $nowdays + 1) {
// Tomorrow
return get_string('tomorrow', 'calendar');
}
@@ -781,12 +759,23 @@ function calendar_mktime_check($m, $d, $y, $default = false) {
}
}
function calendar_month_name($month) {
if(is_int($month)) {
// 1 ... 12 integer converted to month name
$months = array('january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december');
return get_string($months[$month - 1], 'calendar');
}
else {
return get_string(strtolower($month), 'calendar');
}
}
function calendar_wday_name($englishname) {
return get_string(strtolower($englishname), 'calendar');
}
function calendar_days_in_month($month, $year) {
return intval(date('t', mktime(0, 0, 0, $month, 1, $year)));
return date('t', mktime(0, 0, 0, $month, 1, $year));
}
function calendar_get_sideblock_upcoming($courses, $groups, $users, $daysinfuture, $maxevents) {
@@ -832,7 +821,7 @@ function calendar_sub_month($month, $year) {
}
}
function calendar_events_by_day($events, $month, $year, &$eventsbyday, &$durationbyday, &$typesbyday) {
function calendar_events_by_day($events, $starttime, &$eventsbyday, &$durationbyday, &$typesbyday) {
$eventsbyday = array();
$typesbyday = array();
$durationbyday = array();
@@ -841,66 +830,61 @@ function calendar_events_by_day($events, $month, $year, &$eventsbyday, &$duratio
return;
}
// Reverse TZ compensation: make GMT stamps (from event table) correspond to user's TZ
$tzfix = calendar_get_tz_offset();
foreach($events as $event) {
$eventdaystart = 1 + floor(($event->timestart + $tzfix - $starttime) / SECS_IN_DAY);
$eventdayend = 1 + floor(($event->timestart + $event->timeduration + $tzfix - $starttime) / SECS_IN_DAY);
$startdate = usergetdate($event->timestart);
$enddate = usergetdate($event->timestart + $event->timeduration);
// Give the event to its day
$eventsbyday[$eventdaystart][] = $event->id;
// Simple arithmetic: $year * 13 + $month is a distinct integer for each distinct ($year, $month) pair
if(!($startdate['year'] * 13 + $startdate['mon'] <= $year * 13 + $month) && ($enddate['year'] * 13 + $enddate['mon'] >= $year * 13 + $month)) {
// Out of bounds
continue;
// Mark the day as having such an event
if($event->courseid == 1 && $event->groupid == 0) {
$typesbyday[$eventdaystart]['startglobal'] = true;
}
else if($event->courseid > 1 && $event->groupid == 0) {
$typesbyday[$eventdaystart]['startcourse'] = true;
}
else if($event->groupid) {
$typesbyday[$eventdaystart]['startgroup'] = true;
}
else if($event->userid) {
$typesbyday[$eventdaystart]['startuser'] = true;
}
$eventdaystart = intval($startdate['mday']);
// Mark all days up to and including ending day as duration
if($eventdaystart < $eventdayend) {
if($startdate['mon'] == $month && $startdate['year'] == $year) {
// Give the event to its day
$eventsbyday[$eventdaystart][] = $event->id;
// Normally this should be
// Mark the day as having such an event
if($event->courseid == 1 && $event->groupid == 0) {
$typesbyday[$eventdaystart]['startglobal'] = true;
}
else if($event->courseid > 1 && $event->groupid == 0) {
$typesbyday[$eventdaystart]['startcourse'] = true;
}
else if($event->groupid) {
$typesbyday[$eventdaystart]['startgroup'] = true;
}
else if($event->userid) {
$typesbyday[$eventdaystart]['startuser'] = true;
// $bound = min($eventdayend, $display->maxdays);
// for($i = $eventdaystart + 1; $i <= $bound; ++$i) {
// So that we don't go on marking days after the end of
// the month if the event continues. However, this code
// has moved and now we don't have access to $display->maxdays.
// In order to save the overhead of recomputing it, we just
// use this "dumb" approach. Anyway, the function that called
// us already knows up to what day it should display.
for($i = $eventdaystart + 1; $i <= $eventdayend; ++$i) {
$durationbyday[$i][] = $event->id;
if($event->courseid == 1 && $event->groupid == 0) {
$typesbyday[$i]['durationglobal'] = true;
}
else if($event->courseid > 1 && $event->groupid == 0) {
$typesbyday[$i]['durationcourse'] = true;
}
else if($event->groupid) {
$typesbyday[$i]['durationgroup'] = true;
}
else if($event->userid) {
$typesbyday[$i]['durationuser'] = true;
}
}
}
if($event->timeduration == 0) {
// Proceed with the next
continue;
}
// The event starts on $month $year or before. So...
$lowerbound = $startdate['mon'] == $month && $startdate['year'] == $year ? intval($startdate['mday']) : 0;
// Also, it ends on $month $year or later...
$upperbound = $enddate['mon'] == $month && $enddate['year'] == $year ? intval($enddate['mday']) : calendar_days_in_month($month, $year);
// Mark all days between $lowerbound and $upperbound (inclusive) as duration
for($i = $lowerbound + 1; $i <= $upperbound; ++$i) {
$durationbyday[$i][] = $event->id;
if($event->courseid == 1 && $event->groupid == 0) {
$typesbyday[$i]['durationglobal'] = true;
}
else if($event->courseid > 1 && $event->groupid == 0) {
$typesbyday[$i]['durationcourse'] = true;
}
else if($event->groupid) {
$typesbyday[$i]['durationgroup'] = true;
}
else if($event->userid) {
$typesbyday[$i]['durationuser'] = true;
}
}
}
return;
}
@@ -938,21 +922,11 @@ function calendar_session_vars() {
$SESSION->cal_show_course = true;
}
if(!isset($SESSION->cal_show_user)) {
$SESSION->cal_show_user = true;
$SESSION->cal_show_user = isset($USER->id) ? $USER->id : false;
}
if(empty($SESSION->cal_courses_shown)) {
$SESSION->cal_courses_shown = calendar_get_default_courses(true);
}
if(empty($SESSION->cal_users_shown)) {
// The empty() instead of !isset() here makes a whole world of difference,
// as it will automatically change to the user's id when the user first logs
// in. With !isset(), it would never do that.
$SESSION->cal_users_shown = isset($USER->id) ? $USER->id : false;
}
else if(is_numeric($SESSION->cal_users_shown) && !empty($USER->id) && $SESSION->cal_users_shown != $USER->id) {
// Follow the white rabbit, for example if a teacher logs in as a student
$SESSION->cal_users_shown = $USER->id;
}
}
function calendar_overlib_html() {
@@ -1013,8 +987,12 @@ function calendar_set_filters(&$courses, &$group, &$user, $courseeventsfrom = NU
}
if($SESSION->cal_show_user || $ignorefilters) {
// This doesn't work for arrays yet (maybe someday it will)
$user = $SESSION->cal_users_shown;
// This ignores the "which user to see" setting
// The functionality to do that does exist, but this was
// the most painless way to solve bug 1323. And anyway,
// it wasn't being used anywhere.
$user = $USER->id;
//$user = $SESSION->cal_show_user;
}
else {
$user = false;
@@ -1032,7 +1010,7 @@ function calendar_set_filters(&$courses, &$group, &$user, $courseeventsfrom = NU
// For each course...
foreach($groupcourses as $courseid) {
// If the user is an editing teacher in there,
if(!empty($USER->id) && isteacheredit($courseid, $USER->id)) {
if(isteacheredit($courseid, $USER->id)) {
// Show events from all groups
if(($grouprecords = get_groups($courseid)) !== false) {
$grouparray = array_merge($grouparray, array_keys($grouprecords));
@@ -1058,10 +1036,6 @@ function calendar_set_filters(&$courses, &$group, &$user, $courseeventsfrom = NU
function calendar_edit_event_allowed($event) {
global $USER;
if(empty($USER) || isguest($USER->id)) {
return false;
}
if (isadmin($USER->id)) return true; // Admins are allowed anything
if ($event->courseid > 1) {
@@ -1098,7 +1072,7 @@ function calendar_get_default_courses($ignoreref = false) {
}
$courses = array();
if(!empty($USER->id) && isadmin($USER->id)) {
if(isadmin($USER->id)) {
$courses = get_records_sql('SELECT id, 1 FROM '.$CFG->prefix.'course');
return $courses;
}
@@ -1158,7 +1132,7 @@ function calendar_preferences_button() {
global $CFG, $USER;
// Guests have no preferences
if (empty($USER->id) || isguest()) {
if (empty($USER->id) or isguest()) {
return '';
}
+4 -3
View File
@@ -1,8 +1,9 @@
<?PHP // $Id$
// preferences.php - user prefs for calendar
require_once('../config.php');
require_once($CFG->dirroot.'/calendar/lib.php');
require("../config.php");
require_once('lib.php');
if (isset($SESSION->cal_course_referer)) {
if (! $course = get_record("course", "id", $SESSION->cal_course_referer)) {
@@ -16,7 +17,7 @@
/// If data submitted, then process and store.
if ($form = data_submitted()) {
if ($form = data_submitted()) {
print_header();
foreach ($form as $preference => $value) {
switch ($preference) {
+9 -5
View File
@@ -39,7 +39,9 @@
/////////////////////////////////////////////////////////////////////////////
require_once('../config.php');
require_once($CFG->dirroot.'/calendar/lib.php');
require_once('lib.php');
require_login();
require_variable($_GET['from']);
require_variable($_GET['var']);
@@ -50,9 +52,6 @@
optional_variable($_GET['cal_y']);
switch($_GET['var']) {
case 'setuser':
// Not implemented yet (or possibly at all)
break;
case 'setcourse':
$id = intval($_GET['id']);
if($id == 0) {
@@ -86,7 +85,12 @@
$SESSION->cal_show_global = !$SESSION->cal_show_global;
break;
case 'showuser':
$SESSION->cal_show_user = !$SESSION->cal_show_user;
if($SESSION->cal_show_user) {
$SESSION->cal_show_user = false;
}
else {
$SESSION->cal_show_user = $USER->id;
}
break;
}
+24 -39
View File
@@ -41,8 +41,11 @@
// Display the calendar page.
require_once('../config.php');
require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->dirroot.'/calendar/lib.php');
require_once('../course/lib.php');
require_login();
require_once('lib.php');
optional_variable($_GET['view'], 'upcoming');
optional_variable($_GET['course'], 0);
@@ -92,20 +95,12 @@
// If a course has been supplied in the URL, change the filters to show that one
if(!empty($_GET['course'])) {
if(is_numeric($_GET['course']) && $_GET['course'] > 0 && record_exists('course', 'id', $_GET['course'])) {
if($_GET['course'] == 1) {
// If coming from the home page, show all courses
$SESSION->cal_courses_shown = calendar_get_default_courses(true);
calendar_set_referring_course(0);
}
else {
// Otherwise show just this one
$SESSION->cal_courses_shown = intval($_GET['course']);
calendar_set_referring_course($SESSION->cal_courses_shown);
}
$SESSION->cal_courses_shown = intval($_GET['course']);
calendar_set_referring_course($SESSION->cal_courses_shown);
}
}
if(empty($USER) || isguest($USER->id)) {
if(isguest($USER->id)) {
$defaultcourses = calendar_get_default_courses();
calendar_set_filters($courses, $groups, $users, $defaultcourses, $defaultcourses);
}
@@ -117,8 +112,7 @@
// but NOT for the "main page" course
if($SESSION->cal_course_referer > 1 &&
($shortname = get_field('course', 'shortname', 'id', $SESSION->cal_course_referer)) !== false) {
// If we know about the referring course, show a return link and ALSO require login!
require_login();
// If we know about the referring course, show a return link
$nav = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$SESSION->cal_course_referer.'">'.$shortname.'</a> -> '.$nav;
}
@@ -157,7 +151,7 @@
// START: Last column (3-month display)
echo '<td style="vertical-align: top; width: 180px;">';
print_side_block_start(get_string('monthlyview', 'calendar'));
print_side_block_start(get_string('monthlyview', 'calendar'), '', 'sideblockmain');
list($prevmon, $prevyr) = calendar_sub_month($mon, $yr);
list($nextmon, $nextyr) = calendar_add_month($mon, $yr);
$getvars = 'cal_d='.$day.'&amp;cal_m='.$mon.'&amp;cal_y='.$yr; // For filtering
@@ -183,7 +177,7 @@
function calendar_show_day($d, $m, $y, $courses, $groups, $users) {
global $CFG, $THEME, $USER;
global $CFG, $THEME, $db;
if (!checkdate($m, $d, $y)) {
$now = usergetdate(time());
@@ -198,8 +192,9 @@ function calendar_show_day($d, $m, $y, $courses, $groups, $users) {
$events = calendar_get_upcoming($courses, $groups, $users, 1, 100, $starttime);
// New event button
if (empty($USER) || isguest()) {
if (isguest()) {
$text = get_string('dayview', 'calendar').': '.calendar_course_filter_selector($getvars);
} else {
$text = '<div style="float: left;">'.get_string('dayview', 'calendar').': '.
calendar_course_filter_selector($getvars).'</div><div style="float: right;">';
@@ -212,7 +207,7 @@ function calendar_show_day($d, $m, $y, $courses, $groups, $users) {
$text.= '</form></div>';
}
print_side_block_start($text, array('class' => 'mycalendar'));
print_side_block_start($text, '', 'mycalendar');
echo '<p>'.calendar_top_controls('day', array('d' => $d, 'm' => $m, 'y' => $y)).'</p>';
if (empty($events)) {
@@ -226,16 +221,6 @@ function calendar_show_day($d, $m, $y, $courses, $groups, $users) {
// First, print details about events that start today
foreach ($events as $event) {
if ($event->timestart >= $starttime && $event->timestart <= $endtime) { // Print it now
/*
print_object($event->time);
$dayend = calendar_day_representation($event->timestart + $event->timeduration);
$timeend = calendar_time_representation($event->timestart + $event->timeduration);
$enddate = usergetdate($event->timestart + $event->timeduration);
// Set printable representation
echo calendar_get_link_tag($dayend, CALENDAR_URL.'view.php?view=day'.$morehref.'&amp;', $enddate['mday'], $enddate['mon'], $enddate['year']).' ('.$timeend.')';
*/
unset($event->time);
calendar_print_event($event);
@@ -315,10 +300,10 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users) {
}
// Extract information: events vs. time
calendar_events_by_day($events, $m, $y, $eventsbyday, $durationbyday, $typesbyday);
calendar_events_by_day($events, $display->tstart, $eventsbyday, $durationbyday, $typesbyday);
// New event button
if(empty($USER) || isguest()) {
if(isguest()) {
$text = get_string('detailedmonthview', 'calendar').': '.calendar_course_filter_selector($getvars);
}
else {
@@ -331,7 +316,7 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users) {
$text.= '</form></div>';
}
print_side_block_start($text, array('class' => 'mycalendar'));
print_side_block_start($text, '', 'mycalendar');
echo calendar_top_controls('month', array('m' => $m, 'y' => $y));
@@ -481,7 +466,7 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users) {
echo "</tr>\n";
if(!empty($USER) && !isguest($USER->id)) {
if(!isguest($USER->id)) {
echo '<tr>';
// Group events
if($SESSION->cal_show_groups) {
@@ -513,7 +498,7 @@ function calendar_show_upcoming_events($courses, $groups, $users, $futuredays, $
$events = calendar_get_upcoming($courses, $groups, $users, $futuredays, $maxevents);
// New event button
if(empty($USER) || isguest()) {
if(isguest()) {
$text = get_string('upcomingevents', 'calendar').': '.calendar_course_filter_selector('from=upcoming');
} else {
@@ -528,7 +513,7 @@ function calendar_show_upcoming_events($courses, $groups, $users, $futuredays, $
$text.= '</form></div>';
}
print_side_block_start($text, array('class' => 'mycalendar'));
print_side_block_start($text, '', 'mycalendar');
if ($events) {
foreach ($events as $event) {
calendar_print_event($event);
@@ -577,11 +562,11 @@ function calendar_print_event($event) {
if (calendar_edit_event_allowed($event)) {
echo '<div align="right">';
if (empty($event->cmid)) {
$editlink = CALENDAR_URL.'event.php?action=edit&amp;id='.$event->id;
$editlink = CALENDAR_URL.'event.php?action=edit&amp;id='.$event->id;
$deletelink = CALENDAR_URL.'event.php?action=delete&amp;id='.$event->id;
} else {
$editlink = $CFG->wwwroot.'/course/mod.php?update='.$event->cmid.'&amp;return=true';
$deletelink = $CFG->wwwroot.'/course/mod.php?delete='.$event->cmid;
$editlink = "$CFG->wwwroot/mod/$event->modulename/view.php?id=$event->cmid";
$deletelink = "$CFG->wwwroot/course/mod.php?delete=$event->cmid";
}
echo ' <a href="'.$editlink.'"><img
src="'.$CFG->pixpath.'/t/edit.gif" alt="'.get_string('tt_editevent', 'calendar').'"
@@ -599,7 +584,7 @@ function calendar_print_event($event) {
function calendar_course_filter_selector($getvars = '') {
global $USER, $SESSION;
if (empty($USER) || isguest($USER->id)) {
if (isguest($USER->id)) {
return '';
}
-6
View File
@@ -161,12 +161,6 @@ $CFG->admin = 'admin';
// most likely doesn't work yet. THIS IS FOR DEVELOPERS ONLY, IT IS
// NOT RECOMMENDED FOR PRODUCTION SITES
// $CFG->unicode = true;
//
// Turning this on will make Moodle use a https connection just for the
// login page (providing a secure login), and then afterwards revert
// back to the normal http URL. Requires https to be enabled on the
// web server.
// $CFG->loginhttps = true;
+7 -15
View File
@@ -57,14 +57,7 @@
/// Resort the category if requested
if (!empty($_GET['resort'])) {
if ($courses = get_courses($category->id, "fullname ASC")) {
$count = 0;
foreach ($courses as $course) {
set_field('course', 'sortorder', $count, 'id', $course->id);
$count++;
}
fix_course_sortorder();
}
fix_course_sortorder($category->id, "fullname ASC");
}
}
@@ -80,16 +73,16 @@
if ($creatorediting) {
if ($adminediting) {
print_header("$site->shortname: $category->name", "$site->fullname: $strcourses",
print_header("$site->shortname: $category->name", "$site->fullname: $strcourses",
"<a href=\"../$CFG->admin/index.php\">$stradministration</a> -> ".
"<a href=\"index.php\">$strcategories</a> -> $category->name",
"", "", true, $navbaritem);
} else {
print_header("$site->shortname: $category->name", "$site->fullname: $strcourses",
print_header("$site->shortname: $category->name", "$site->fullname: $strcourses",
"<a href=\"index.php\">$strcategories</a> -> $category->name", "", "", true, $navbaritem);
}
} else {
print_header("$site->shortname: $category->name", "$site->fullname: $strcourses",
print_header("$site->shortname: $category->name", "$site->fullname: $strcourses",
"<a href=\"index.php\">$strcategories</a> -> $category->name", "", "", true, $navbaritem);
}
@@ -133,7 +126,8 @@
if (!set_field("course", "category", $destcategory->id, "id", $course->id)) {
notify("An error occurred - course not moved!");
}
fix_course_sortorder();
fix_course_sortorder($destcategory->id);
fix_course_sortorder($category->id);
$category = get_record("course_categories", "id", $category->id);
}
}
@@ -208,7 +202,7 @@
}
}
fix_course_sortorder();
fix_course_sortorder($category->id);
} // End of editing stuff
@@ -236,8 +230,6 @@
/// Print out all the courses
unset($course); // To avoid unwanted language effects later
$courses = get_courses_page($category->id, "c.sortorder ASC", "c.*", $totalcount, $page*$perpage, $perpage);
$numcourses = count($courses);
-35
View File
@@ -12,9 +12,6 @@
if (!isset($form->lang)) {
$form->lang = '';
}
if (!isset($form->enrolperiod)) {
$form->enrolperiod = 0;
}
?>
<FORM METHOD="post" action="edit.php" NAME="form">
<table cellpadding=9 cellspacing=0 >
@@ -43,13 +40,6 @@
<?php if (isset($err["shortname"])) formerr($err["shortname"]); ?>
</td>
</tr>
<tr valign=top>
<td align="right"><P><?php print_string("idnumber") ?>:</td>
<td><input type="text" name="idnumber" maxlength="100" size="10" value="<?php p($form->idnumber) ?>">
<?php helpbutton("courseidnumber", get_string("idnumber")) ?>
<?php if (isset($err["idnumber"])) formerr($err["idnumber"]); ?>
</td>
</tr>
<tr valign=top>
<td align="right"><P><?php print_string("summary") ?>:</td>
<td><?php
@@ -74,20 +64,6 @@
helpbutton("coursestartdate", get_string("startdate"));
?></td>
</tr>
<tr valign=top>
<td align="right"><P><?php print_string("enrolperiod") ?>:</td>
<td>
<?php
$periodmenu[0] = get_string('unlimited');
for ($i=1; $i<=365; $i++) {
$seconds = $i * 86400;
$periodmenu[$seconds] = get_string('numdays', '', $i);
}
choose_from_menu ($periodmenu, "enrolperiod", "$form->enrolperiod", "");
helpbutton("enrolperiod", get_string("enrolperiod"));
?>
</td>
</tr>
<tr valign=top>
<td align="right"><P><?php print_string("numberweeks") ?>:</td>
<td><?php
@@ -146,17 +122,6 @@
helpbutton("guestaccess", get_string("opentoguests")); ?>
</td>
</tr>
<?php
if ($CFG->enrol != 'internal') {
?>
<tr valign=top>
<td align="right"><P><?php print_string("cost") ?>:</td>
<td><input type="text" name="cost" maxlength="6" size=6 value="<?php p($form->cost) ?>">
</td>
</tr>
<?php
}
?>
<tr valign=top>
<td align="right"><P><?php print_string("hiddensections") ?>:</td>
<td><?php
+11 -13
View File
@@ -1,9 +1,9 @@
<?PHP // $Id$
// Edit course settings
require_once("../config.php");
require_once("lib.php");
require_once("$CFG->libdir/blocklib.php");
require_once("../config.php");
require_once("lib.php");
require_once("$CFG->libdir/blocklib.php");
optional_variable($id, 0); // course id
optional_variable($category, 0); // category id
@@ -36,7 +36,7 @@
/// If data submitted, then process and store.
if ($form = data_submitted()) {
if ($form = data_submitted()) {
check_for_restricted_user($USER->username, "$CFG->wwwroot/course/view.php?id=$course->id");
@@ -51,8 +51,8 @@
if (!empty($course)) {
if (update_record("course", $form)) {
add_to_log($course->id, "course", "update", "edit.php?id=$id", "");
fix_course_sortorder();
redirect("view.php?id=$course->id", get_string("changessaved"));
fix_course_sortorder($form->category);
redirect("view.php?id=$course->id", get_string("changessaved"));
} else {
error("Serious Error! Could not update the course record! (id = $form->id)");
}
@@ -73,7 +73,7 @@
$section->section = 0;
$section->id = insert_record("course_sections", $section);
fix_course_sortorder();
fix_course_sortorder($form->category);
add_to_log($newcourseid, "course", "new", "view.php?id=$newcourseid", "");
if (isadmin()) { // Redirect admin to add teachers
@@ -101,14 +101,14 @@
error("Serious Error! Could not create the new course!");
}
}
die;
die;
} else {
foreach ($err as $key => $value) {
$focus = "form.$key";
}
}
}
}
/// Otherwise fill and print the form.
@@ -124,8 +124,6 @@
$form->password = "";
$form->guest = 0;
$form->numsections = 10;
$form->idnumber = '';
$form->cost = '';
$form->newsitems = 5;
$form->showgrades = 1;
$form->groupmode = 0;
@@ -169,7 +167,7 @@
$strcategories = get_string("categories");
if (!empty($course)) {
print_header($streditcoursesettings, "$course->fullname",
print_header($streditcoursesettings, "$course->fullname",
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>
-> $streditcoursesettings", $focus);
} else {
@@ -180,7 +178,7 @@
print_heading($streditcoursesettings);
print_simple_box_start("center", "", "$THEME->cellheading");
include("edit.html");
include("edit.html");
print_simple_box_end();
print_footer($course);
+96 -23
View File
@@ -1,16 +1,16 @@
<?PHP // $Id$
// Depending on the current enrolment method, this page
// presents the user with whatever they need to know when
// they try to enrol in a course.
// Asks for a course pass key, once only, and enrols that user
require_once("../config.php");
require_once("lib.php");
require_once("$CFG->dirroot/enrol/$CFG->enrol/enrol.php");
require_variable($id);
require_login();
$strloginto = get_string("loginto", "", $course->shortname);
$strcourses = get_string("courses");
if (! $course = get_record("course", "id", $id) ) {
error("That's an invalid course id");
}
@@ -21,17 +21,57 @@
check_for_restricted_user($USER->username);
$enrol = new enrolment_plugin();
/// Check the submitted enrollment key if there is one
/// Refreshing enrolment data in the USER session
$enrol->get_student_courses($USER);
$enrol->get_teacher_courses($USER);
if ($form = data_submitted()) {
if ($form->password == $course->password) {
if (isguest()) {
add_to_log($course->id, "course", "guest", "view.php?id=$course->id", $_SERVER['REMOTE_ADDR']);
} else if (!record_exists("user_students", "userid", $USER->id, "course", $course->id)) {
if (! enrol_student($USER->id, $course->id)) {
error("An error occurred while trying to enrol you.");
}
$subject = get_string("welcometocourse", "", $course->fullname);
$a->coursename = $course->fullname;
$a->profileurl = "$CFG->wwwroot/user/view.php?id=$USER->id&course=$course->id";
$message = get_string("welcometocoursetext", "", $a);
if (! $teacher = get_teacher($course->id)) {
$teacher = get_admin();
}
email_to_user($USER, $teacher, $subject, $message);
add_to_log($course->id, "course", "enrol", "view.php?id=$course->id", "$USER->id");
}
$USER->student[$course->id] = true;
if ($SESSION->wantsurl) {
$destination = $SESSION->wantsurl;
unset($SESSION->wantsurl);
} else {
$destination = "$CFG->wwwroot/course/view.php?id=$course->id";
}
redirect($destination);
} else {
$errormsg = get_string("enrolmentkeyhint", "", substr($course->password,0,1));
}
}
/// Double check just in case they are actually enrolled already
/// This might occur if they were enrolled during this session
if ( !empty($USER->student[$course->id]) or !empty($USER->teacher[$course->id]) ) {
/// This might occur if they were manually enrolled during this session
if (record_exists("user_students", "userid", $USER->id, "course", $course->id)) {
$USER->student[$course->id] = true;
if ($SESSION->wantsurl) {
$destination = $SESSION->wantsurl;
@@ -39,26 +79,59 @@
} else {
$destination = "$CFG->wwwroot/course/view.php?id=$course->id";
}
redirect($destination);
}
/// Double check just in case they are enrolled to start in the future
if ($student = get_record('user_students', 'userid', $USER->id, 'course', $course->id)) {
$message = get_string('enrolmentnotyet', '', userdate($student->timestart));
print_header();
notice($message, $CFG->wwwroot);
/// Automatically enrol into courses without password
if ($course->password == "") { // no password, so enrol
if (isguest()) {
add_to_log($course->id, "course", "guest", "view.php?id=$course->id", "$USER->id");
} else if (empty($confirm)) {
print_header($strloginto, $course->fullname, "<a href=\".\">$strcourses</a> -> $strloginto");
echo "<br />";
notice_yesno(get_string("enrolmentconfirmation"), "enrol.php?id=$course->id&confirm=1", $CFG->wwwroot);
print_footer();
exit;
} else {
if (! enrol_student($USER->id, $course->id)) {
error("An error occurred while trying to enrol you.");
}
add_to_log($course->id, "course", "enrol", "view.php?id=$course->id", "$USER->id");
$USER->student[$course->id] = true;
if ($SESSION->wantsurl) {
$destination = $SESSION->wantsurl;
unset($SESSION->wantsurl);
} else {
$destination = "$CFG->wwwroot/course/view.php?id=$course->id";
}
redirect($destination);
}
}
/// Check the submitted enrollment key if there is one
if ($form = data_submitted()) {
$enrol->check_entry($form, $course);
$teacher = get_teacher($course->id);
if (!isset($password)) {
$password = "";
}
$enrol->print_entry($course);
/// Easy!
print_header($strloginto, $course->fullname, "<A HREF=\".\">$strcourses</A> -> $strloginto", "form.password");
print_course($course);
include("enrol.html");
print_footer();
?>
+1 -1
View File
@@ -57,7 +57,7 @@
echo '<td style="vertical-align: top; width: '.$preferred_width_right.'px;">';
print_course_blocks($course, $rightblocks, BLOCK_RIGHT);
if ($editing && !empty($missingblocks)) {
block_print_blocks_admin($course, $missingblocks);
block_print_blocks_admin($course->id, $missingblocks);
}
print_spacer(1, 120, true);
echo '</td>';
+12 -6
View File
@@ -98,7 +98,7 @@
$thissection = $sections[$section];
if ($thissection->summary or $thissection->sequence or isediting($course->id)) {
echo '<tr id="section_0">';
echo "<tr>";
echo "<td nowrap bgcolor=\"$THEME->cellheading\" class=\"topicsoutlineside\" valign=top width=20>&nbsp;</td>";
echo "<td valign=top bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontent\" width=\"100%\">";
@@ -115,7 +115,10 @@
print_section($course, $thissection, $mods, $modnamesused);
if (isediting($course->id)) {
print_section_add_menus($course, $section, $modnames);
echo "<div align=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$section&add=",
$modnames, "section$section", "", "$stradd...", "mods", $stractivities);
echo "</div>";
}
echo "</td>";
@@ -187,11 +190,11 @@
echo "</td>";
if (!isteacher($course->id) and !$thissection->visible) { // Hidden for students
echo '<td id="section_'.($section).'" style="vertical-align:top; text-align: center; width: 100%;" '.$colormain.'>';
echo "<td valign=top align=center $colormain width=\"100%\">";
echo get_string("notavailable");
echo "</td>";
} else {
echo '<td id="section_'.($section).'" style="vertical-align:top; width: 100%;" '.$colormain.'>';
echo "<td valign=top $colormain width=\"100%\">";
echo format_text($thissection->summary, FORMAT_HTML);
@@ -205,7 +208,10 @@
print_section($course, $thissection, $mods, $modnamesused);
if (isediting($course->id)) {
print_section_add_menus($course, $section, $modnames);
echo "<div align=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$section&add=",
$modnames, "section$section", "", "$stradd...");
echo "</div>";
}
echo "</td>";
@@ -275,7 +281,7 @@
echo '<td style="vertical-align: top; width: '.$preferred_width_right.'px;">';
print_course_blocks($course, $rightblocks, BLOCK_RIGHT);
if ($editing && !empty($missingblocks)) {
block_print_blocks_admin($course, $missingblocks);
block_print_blocks_admin($course->id, $missingblocks);
}
print_spacer(1, 120, true);
echo '</td>';
+9 -3
View File
@@ -104,7 +104,10 @@
print_section($course, $thissection, $mods, $modnamesused);
if (isediting($course->id)) {
print_section_add_menus($course, $section, $modnames);
echo "<div align=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$section&add=",
$modnames, "section$section", "", "$stradd...", "mods", $stractivities);
echo "</div>";
}
echo "</td>";
@@ -198,7 +201,10 @@
print_section($course, $thissection, $mods, $modnamesused);
if (isediting($course->id)) {
print_section_add_menus($course, $section, $modnames);
echo "<div align=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$section&add=",
$modnames, "section$section", "", "$stradd...");
echo "</div>";
}
echo "</td>";
@@ -261,7 +267,7 @@
echo '<td style="vertical-align: top; width: '.$preferred_width_right.'px;">';
print_course_blocks($course, $rightblocks, BLOCK_RIGHT);
if ($editing && !empty($missingblocks)) {
block_print_blocks_admin($course, $missingblocks);
block_print_blocks_admin($course->id, $missingblocks);
}
print_spacer(1, 120, true);
echo '</td>';
+9 -5
View File
@@ -2,8 +2,8 @@
// For most people, just lists the course categories
// Allows the admin to create, delete and rename course categories
require_once("../config.php");
require_once("lib.php");
require_once("../config.php");
require_once("lib.php");
if (!$site = get_site()) {
error("Site isn't defined!");
@@ -76,7 +76,7 @@
$straction = get_string("action");
$straddnewcategory = get_string("addnewcategory");
print_header("$site->shortname: $strcategories", "$site->fullname",
print_header("$site->shortname: $strcategories", "$site->fullname",
"<a href=\"../$CFG->admin/index.php\">$stradministration</a> -> $strcategories",
"addform.addcategory", "", true, update_categories_button());
@@ -231,6 +231,7 @@
$categories = get_categories();
$default = 99999;
foreach ($categories as $category) {
fix_course_sortorder($category->id);
if ($category->id < $default) {
$default = $category->id;
}
@@ -238,14 +239,17 @@
/// Find any orphan courses that don't yet have a valid category and set to default
if ($courses = get_courses()) {
$foundorphans = false;
foreach ($courses as $course) {
if ($course->category and !isset($categories[$course->category])) {
set_field("course", "category", $default, "id", $course->id);
$foundorphans = true;
}
}
if ($foundorphans) {
fix_course_sortorder($default);
}
}
fix_course_sortorder();
/// Print form for creating new categories
+458 -241
View File
File diff suppressed because it is too large Load Diff
+3 -4
View File
@@ -5,7 +5,6 @@
require_once("lib.php");
require_variable($id); // Course ID
optional_variable($group, -1); // Group to display
optional_variable($user, 0); // User to display
optional_variable($date, 0); // Date to display
optional_variable($modname, ""); // course_module->id
@@ -60,11 +59,11 @@
print_heading("$course->fullname: $userinfo, $dateinfo (".usertimezone().")");
print_log_selector_form($course, $user, $date, $modname, $modid, $modaction, $group);
print_log_selector_form($course, $user, $date, $modname, $modid, $modaction);
print_log($course, $user, $date, "l.time DESC", $page, $perpage,
"log.php?id=$course->id&chooselog=1&user=$user&date=$date&modid=$modid&modaction=$modaction&group=$group",
$modname, $modid, $modaction, $group);
"log.php?id=$course->id&chooselog=1&user=$user&date=$date&modid=$modid&modaction=$modaction",
$modname, $modid, $modaction);
} else {
if ($course->category) {
+2 -64
View File
@@ -1,6 +1,6 @@
<?PHP // $Id$
// Moves, adds, updates, duplicates or deletes modules in a course
// Moves, adds, updates or deletes modules in a course
require("../config.php");
require("lib.php");
@@ -60,9 +60,6 @@
if (is_string($return)) {
error($return, "view.php?id=$course->id");
}
$SESSION->returnpage = "$CFG->wwwroot/mod/$mod->modulename/view.php?id=$mod->coursemodule";
add_to_log($course->id, "course", "update mod",
"../mod/$mod->modulename/view.php?id=$mod->coursemodule",
"$mod->modulename $mod->instance");
@@ -107,9 +104,6 @@
if (! set_field("course_modules", "section", $sectionid, "id", $mod->coursemodule)) {
error("Could not update the course module with the correct section");
}
$SESSION->returnpage = "$CFG->wwwroot/mod/$mod->modulename/view.php?id=$mod->coursemodule";
add_to_log($course->id, "course", "add mod",
"../mod/$mod->modulename/view.php?id=$mod->coursemodule",
"$mod->modulename $mod->instance");
@@ -117,7 +111,6 @@
"view.php?id=$mod->coursemodule",
"$mod->instance", $mod->coursemodule);
break;
case "delete":
if (! $deleteinstancefunction($mod->instance)) {
notify("Could not delete the $mod->modulename (instance)");
@@ -463,57 +456,6 @@
$pageheading = get_string("updatinga", "moodle", $fullmodulename);
}
} else if (isset($_GET['duplicate'])) { // value = course module
if (! $cm = get_record("course_modules", "id", $_GET['duplicate'])) {
error("This course module doesn't exist");
}
if (! $course = get_record("course", "id", $cm->course)) {
error("This course doesn't exist");
}
if (!isteacheredit($course->id)) {
error("You can't modify this course!");
}
if (! $module = get_record("modules", "id", $cm->module)) {
error("This module doesn't exist");
}
if (! $form = get_record($module->name, "id", $cm->instance)) {
error("The required instance of this module doesn't exist");
}
if (! $cw = get_record("course_sections", "id", $cm->section)) {
error("This course section doesn't exist");
}
if (isset($return)) {
$SESSION->returnpage = "$CFG->wwwroot/mod/$module->name/view.php?id=$cm->id";
}
$section = get_field('course_sections', 'section', 'id', $cm->section);
$form->coursemodule = $cm->id;
$form->section = $section; // The section ID
$form->course = $course->id;
$form->module = $module->id;
$form->modulename = $module->name;
$form->instance = $cm->instance;
$form->mode = "add";
$sectionname = get_string("name$course->format");
$fullmodulename = strtolower(get_string("modulename", $module->name));
if ($form->section) {
$heading->what = $fullmodulename;
$heading->in = "$sectionname $cw->section";
$pageheading = get_string("duplicatingain", "moodle", $heading);
} else {
$pageheading = get_string("duplicatinga", "moodle", $fullmodulename);
}
} else if (isset($_GET['add'])) {
@@ -540,9 +482,6 @@
$form->instance = "";
$form->coursemodule = "";
$form->mode = "add";
if (isset($_GET['type'])) {
$form->type = $_GET['type'];
}
$sectionname = get_string("name$course->format");
$fullmodulename = get_string("modulename", $module->name);
@@ -590,7 +529,6 @@
if ($usehtmleditor = can_use_html_editor()) {
$defaultformat = FORMAT_HTML;
$editorfields = '';
} else {
$defaultformat = FORMAT_MOODLE;
}
@@ -603,7 +541,7 @@
print_simple_box_end();
if ($usehtmleditor and empty($nohtmleditorneeded)) {
use_html_editor($editorfields);
use_html_editor();
}
} else {
-365
View File
@@ -1,365 +0,0 @@
<?PHP // $Id$
// Displays all activity for non-quiz modules for a course
///This version allows students to see their own activity, but not that of others.
///For teachers only, clicking on a student's name brings up the Moodle user activity summary.
require_once("../config.php");
require_once("lib.php");
require_once("../lib/datalib.php");
//module, location of user data,pointer
$quick_dataloc["assignment"] = array("assignment_submissions","assignment");
$quick_dataloc["choice"] = array("choice_answers","choice");
$quick_dataloc["dialogue"] = array("dialogue_entries","dialogue");
$quick_dataloc["discussion"] = array("forum_posts","discussion");
$quick_dataloc["journal"] = array("journal_entries","journal");
$quick_dataloc["quiz"] = array("quiz_attempts","quiz");
$quick_dataloc["survey"] = array("survey_analysis","survey");
$quick_dataloc["workshop"] = array("workshop_submissions","workshopid");
$usemods = ",assignment,choice,dialogue,forum,journal,quiz,survey,workshop";
$modlist = get_records("modules","visible",1);
foreach ($modlist as $nowmod){
if (strpos($usemods,$nowmod->name)){
$modnames[$nowmod->id] = $nowmod->name;
}
}
//needed for cases when a particular module type needs special treatment (assignment,forum)
$modname_value = array_flip($modnames);
require_variable($id); // course id
optional_variable($download, ""); // to download data
require_login();
if (! $course = get_record("course", "id", $id)) {
error("Course ID was incorrect");
}
//take each event and create an array type/event/user hierarchy
//we need to get the entire list of enrolled students for the course so that we can list by student
if (isteacher($course->id)) {
$isstudent = 0;
} elseif (isstudent($course->id)) {
$isstudent = 1;
} else {
error("You are not registered for this course");
}
$courseid = $course->id;
//Get the ids of all course users
$allusers = quick_findusers($course->id);
//Get all postings from this course's users
$allposts = quick_findposts($course->id);
//count posts per user by looping thru $allposts and put counts in $post_counts
foreach ($allposts as $thispost){
$post_counts[$thispost->forumid][$thispost->userid]++;
}
$allmods = quick_moduleorder($course->id);
//Now take all mods and build an object $mod_info for only those modules that will be reported
//Concurrently build a $mods_week array that says how many columns will be in the header per week
$modcount = -1;
foreach($allmods as $thismod){
$modcount++;
//get the info on this module from course_modules
$nowmod = get_record("course_modules","id",$thismod[mod]);
$noworder = get_record("course_sections","id",$nowmod->section);
//only add to array the module is contained in the $modnames array
if ($modnames[$nowmod->module]){
//section is the entry in course_sections which says which instances
///reside in the section and which week/section they are in
$mod_info[$modcount][section] = $nowmod->section;
//module is the type of module (assignment, forum, etc.)
$mod_info[$modcount][module] = $nowmod->module;
//modid is the id of the module in "course_modules" table
$mod_info[$modcount][modid] = $nowmod->id;
//week is the current week/section that the module resides in
$mod_info[$modcount][week] = $noworder->section;
//instance in the relevant module table will yield the name
$mod_info[$modcount][instance] = $nowmod->instance;
//Count how many instances in each week for colspan purposes
if ($mods_week[$noworder->section]){
$mods_week[$noworder->section]++;
} else {
$mods_week[$noworder->section] = 1;
}
//Now add the name of the module to $mods_info
$mod_info[$modcount][name] = get_field($modnames[$nowmod->module],"name","id",$nowmod->instance);
} else {
$modcount--;
}
}
//Catalog by user all activity for every module
//This will include modules to be ignored later, but it is easier this way
//Data for each user can be retrieved by matching$rec->name with $mod_info name(created above)
//Create a comma-delimited string in $user_data with the IDs of each user in an array of mod type(module) + modid
foreach ($modnames as $nowtype => $nowname){
$now_module = $nowname;
$now_user_table = $quick_dataloc[$now_module][0]; //name of table containing individual user records
$now_pointer = $quick_dataloc[$now_module][1]; // the field in above with pointer to table with name of activity
// Now set up a table for each separate instance of the module with a listing of the users
$allrecs = quick_findrecs($now_module,$now_user_table,$now_pointer,$course->id);
if ($allrecs) {
foreach ($allrecs as $rec){
$np = $rec->instance;
if ($nowname == "assignment"){
// For assignments, a record is created for all students when the assmt is created
//the timemodified is 0 until the student submits an assignment
if ($rec->timemodified != 0) {
$user_data[$nowtype][$np] = $user_data[$nowtype][$np] . ",$rec->userid,";
}
} else {
$user_data[$nowtype][$np] = $user_data[$nowtype][$np] . ",$rec->userid,";
}
}
}
}
if ($allposts) {
foreach ($allposts as $rec){
$forumval = $modname_value["forum"];
$user_data[$forumval][$rec->forumid] = $user_data[$forumval][$rec->forumid] . ",$rec->userid,";
// echo "<br>" . $rec->forumid . $rec->name . "<br>";
}
}
//now go through the $mod_info array in order of the users, and find whether each user contributed, put in $user_contribs
foreach($allusers as $user){
$uid = $user->id;
foreach ($mod_info as $thismod){
if(strlen($user_data[$thismod[module]][$thismod[instance]]) < 2){
$user_contribs[$uid][] = "-";
continue;
}
//For forums count the number of contributions. For others, just "x" or "-";
if ($thismod[module] == $modname_value["forum"]) {
$puid = $post_counts[$uid];
if ($post_counts[$thismod[instance]][$uid] > 0){
$user_contribs[$uid][] = $post_counts[$thismod[instance]][$uid];
} else {
$user_contribs[$uid][] = "-";
}
} else {
//see if "comma+userid+comma " exists
$sstring = ",$user->id,";
if(strpos($user_data[$thismod[module]][$thismod[instance]],$sstring)> -1){
$user_contribs[$uid][] = "X";
}else {
$user_contribs[$uid][] = "-";
}
}
}
}
//if Excel spreadsheet requested
if ($download == "xls") {
require_once("$CFG->libdir/excel/Worksheet.php");
require_once("$CFG->libdir/excel/Workbook.php");
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$course->shortname"."_quickreport.xls");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: public");
$workbook = new Workbook("-");
// Creating the first worksheet
$myxls = &$workbook->add_worksheet('Quick Report');
$myxls->write_string(0,0,$quiz->name);
$myxls->set_column(0,0,25);
$formaty =& $workbook->add_format();
$formaty->set_bg_color('yellow');
$formatyc =& $workbook->add_format();
$formatyc->set_bg_color('yellow');
$formatyc->set_bold(1);
$formatyc->set_align('center');
$formatc =& $workbook->add_format();
$formatc->set_align('center');
$formatb =& $workbook->add_format();
$formatb->set_bold(1);
$row = 1;
$col = 2;
/// Print names of all the fields
///First labels to show week/section
if ($course->format == "weeks") {$formatname = "Week";} else {$formatname = "Section";}
foreach($mods_week as $week=>$wkcount){
for ($i = 0; $i < $wkcount;$i++) {
$col++;
$col_label = "$formatname $week";
$myxls->write_string($row,$col,$col_label,$formatb);
}
}
//now labels for module names
$row++;
$col=0;
$myxls->write_string($row,$col,"Student",$formatb);
$col++;
$myxls->write_string($row,$col,"Picture",$formatb);
$col++;
$myxls->write_string($row,$col,"Profile",$formatb);
//get the names of each module instance and put in header
foreach($mod_info as $thiscat=>$thismod){
$modname = ucwords($modnames[$thismod[module]]);
$col++;
$col_label = "$modname $thismod[name]";
$myxls->write_string($row,$col,$col_label,$formatb);
}
/// Print all the user data
$row++;
foreach ($user_contribs as $userid=>$thisuser){
$row++;
$col=0;
$fullname = ucwords($allusers[$userid]->lastname) . ", " . ucwords($allusers[$userid]->firstname);
$myxls->write_string($row,$col,$fullname,$formatb);
$col++;
if($allusers[$userid]->picture){
$myxls->write_string($row,$col,"X",$formatc);
} else {
$myxls->write_string($row,$col,"-",$formatc);
}
$col++;
if (strlen($allusers[$userid]->description) > 10) {
$myxls->write_string($row,$col,"X",$formatc);
} else {
$myxls->write_string($row,$col,"-",$formatc);
}
foreach ($thisuser as $thismod) {
$col++;
$myxls->write_string($row,$col,$thismod,$formatc);
}
}
$workbook->close();
exit;
}
quick_headers($course);
$quick_bgcount = 0;
echo "<table>";
//printer header line with weeks
$options["id"] = $course->id;
$options["download"] = "xls";
print ( "<tr valign=top><td colspan=3>");
print_single_button("quickreport.php", $options, get_string("downloadexcel"));
print ("</td>");
if ($course->format == "weeks") {$formatname = "Week";} else {$formatname = "Section";}
foreach($mods_week as $week=>$wkcount){
print "<td colspan=$wkcount>$formatname $week</td>";
}
echo "<tr valign=top><td width='150'>Student</td><td>Picture</td><td>Profile</td>";
//get the names of each module instance and put in header
foreach($mod_info as $thiscat=>$thismod){
$modname = ucwords($modnames[$thismod[module]]);
print ("<td> $modname <br><font size=-1>$thismod[name]</font></td>");
}
echo "</tr>\n";
foreach ($user_contribs as $userid=>$thisuser){
$quick_bgcount++;
if ($quick_bgcount%3 == 0) {
echo "<tr align=center bgcolor='#ffffff'>";
} else {
echo "<tr align=center>";
}
$fullname = ucwords($allusers[$userid]->lastname) . ", " . ucwords($allusers[$userid]->firstname);
if (!$isstudent){
$fullname = "<a href=user.php?id=$course->id&user=$userid>$fullname</a>";
}
echo "<td align=left><b>$fullname</b></td>";
$picture = print_user_picture($userid, $course->id, $allusers[$userid]->picture, false, true);
echo "<td>" . $picture . "</td>";
if (strlen($allusers[$userid]->description) > 10) {quick_show("X");} else {quick_show("-");}
foreach ($thisuser as $thismod) {
quick_show($thismod);
}
echo "</tr>\n";
}
echo "</table>\n";
print_footer($course);
function quick_findusers($courseid){
global $CFG,$USER,$isstudent;
if ($isstudent){
$studcondition = "AND a.id = $USER->id";
} else {
$studcondition = "";
}
$allusers = get_records_sql("SELECT a.id,a.lastname, a.firstname,a.picture,a.description,b.course
FROM {$CFG->prefix}user a,
{$CFG->prefix}user_students b
WHERE b.course = $courseid AND
b.userid = a.id $studcondition
ORDER BY a.lastname ASC, a.firstname ASC");
return $allusers;
}
function quick_findrecs($tbl1,$tbl2,$pointer,$courseid){
global $CFG;
$allrecs = get_records_sql("SELECT b.id,a.id, c.id,c.lastname, c.firstname,a.course,a.name ,b.userid,b.timemodified, b.$pointer as instance
FROM {$CFG->prefix}$tbl1 a,
{$CFG->prefix}$tbl2 b,
{$CFG->prefix}user c,
{$CFG->prefix}course_modules d
WHERE a.course = $courseid AND
a.id = b.$pointer AND
c.id = b.userid AND
d.instance = b.$pointer");
/// ORDER BY e.section ASC
// print("<h3>All records: $tbl1</h3>");
// print_object($allrecs);
return $allrecs;
}
function quick_findposts($courseid){
global $CFG;
//this will allow records to be identified by Forum but not by thread (no b.id)
$allposts = get_records_sql("SELECT
c.id, c.userid,a.id as forumid,a.name
FROM {$CFG->prefix}forum a,
{$CFG->prefix}forum_discussions b,
{$CFG->prefix}forum_posts c
WHERE b.course = $courseid AND
a.id = b.forum AND
c.discussion = b.id
ORDER BY forumid ASC");
return $allposts;
}
function quick_moduleorder($courseid){
//using course_sections which gives the sections & sequence, build an array with each section + item pair
// echo "<br>Course= " . $courseid . "<br>";
$allmods = get_records("course_sections","course",$courseid,"section","id,section,sequence");
// print_object($allmods);
// $modsequence
foreach ($allmods as $thisweek){
// print_object($thisweek);
if ($thisweek->sequence){
// print ("$thisweek->sequence");
$weeklist = explode(",",$thisweek->sequence);
foreach($weeklist as $activity){
$all_list[] =array("mod"=>$activity,"sec"=>$thisweek->section);
}
// print_object($weeklist);
} else {
// print ("<br>No modules this week<br>");
}
}
return $all_list;
}
function quick_headers($course){
global $CFG;
print_header("$course->shortname: 'Quick Report'", "$course->fullname",
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>
-> 'Quick Report'");
}
function quick_show($x){
echo "<td align=center>";
print ("$x");
echo "</td>";
}
?>
+3 -8
View File
@@ -42,7 +42,8 @@
<a href=\"recent.php?id=$course->id\">$strrecentactivity</a> -> $userinfo, $dateinfo", "");
} else {
print_header("$course->shortname: $strrecentactivity", "$course->fullname",
"<a href=\"recent.php?id=$course->id\">$strrecentactivity</a> -> $userinfo, $dateinfo", "");
"<a href=\"../$CFG->admin/index.php\">$stradministration</a> ->
<a href=\"recent.php?id=$course->id\">$strrecentactivity</a> -> $userinfo, $dateinfo", "");
}
print_heading("$course->fullname: $userinfo, $dateinfo (".usertimezone().")");
@@ -66,21 +67,15 @@
"<a href=\"view.php?id=$course->id\">$course->shortname</a> -> $strrecentactivity", "");
} else {
print_header("$course->shortname: $strrecentactivity", "$course->fullname",
"$strrecentactivity", "");
"<a href=\"../$CFG->admin/index.php\">$stradministration</a> -> $strrecentactivity", "");
}
print_heading(get_string("activitysince", "", userdate($date)));
if (!isset($advancedfilter)) {
$advancedfilter = 0;
}
print_recent_selector_form($course, $advancedfilter);
}
if (!isset($modid)) {
$modid="activity/All";
}
$tmpmodid = $modid;
switch ($tmpmodid) {
+1 -10
View File
@@ -59,14 +59,7 @@
/// Add a student if one is specified
if (!empty($add)) {
check_for_restricted_user($USER->username, "$CFG->wwwroot/course/student.php?id=$course->id");
if ($course->enrolperiod) {
$timestart = time();
$timeend = $timestart + $course->enrolperiod;
} else {
$timestart = $timeend = 0;
}
if (! enrol_student($add, $course->id, $timestart, $timeend)) {
if (! enrol_student($add, $course->id)) {
error("Could not add that student to this course!");
}
}
@@ -74,7 +67,6 @@
/// Remove a student if one is specified.
if (!empty($remove)) {
check_for_restricted_user($USER->username, "$CFG->wwwroot/course/student.php?id=$course->id");
if (! unenrol_student($remove, $course->id)) {
error("Could not remove that student from this course!");
}
@@ -83,7 +75,6 @@
/// Remove all students from specified course
if (!empty($removeall)) {
check_for_restricted_user($USER->username, "$CFG->wwwroot/course/student.php?id=$course->id");
$students = get_course_students($course->id, "u.lastname ASC, u.firstname ASC");
foreach ($students as $student) {
if (! unenrol_student($student->id, $course->id)) {
+2 -2
View File
@@ -20,8 +20,8 @@
require_login($course->id);
if ($user->id != $USER->id and !isteacheredit($course->id)) {
error("You must be a teacher with editing rights to do this");
if ($user->id != $USER->id and !isteacher($course->id)) {
error("You must be a teacher to do this");
}
if ($user->id == $USER->id and !$CFG->allowunenroll) {
+4 -4
View File
@@ -2,9 +2,9 @@
// Display the course home page.
require_once('../config.php');
require_once('lib.php');
require_once($CFG->libdir.'/blocklib.php');
require_once("../config.php");
require_once("lib.php");
require_once("$CFG->libdir/blocklib.php");
optional_variable($id);
optional_variable($name);
@@ -199,6 +199,6 @@
require("$CFG->dirroot/course/format/$course->format/format.php"); // Include the actual course format
print_footer(NULL, $course);
print_footer();
?>
+1 -13
View File
@@ -1,3 +1,4 @@
body, td, th, li {
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
}
@@ -116,16 +117,3 @@ ul {
margin-top: 10px;
}
.commandline {
font-family: "Courier New", Courier, mono;
font-size: x-small;
background-color: #FBFBFB;
margin: auto auto 20px 30px;
padding: 5px;
width: compact;
font-weight: bold;
border: 1px solid #999999;
white-space: nowrap;
clear: both;
float: none;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

-15
View File
@@ -1,15 +0,0 @@
ENROLMENT MODULES
-----------------
(Yes, that's the correct English spelling ;-) )
enrol.class.php contains the base class and explains
all the possible functions that an enrolment module
can have.
Each plugin is in a subfolder here and extends the
base class as necessary.
Martin Dougiamas and Shane Elliott, Moodle.com
-324
View File
@@ -1,324 +0,0 @@
<?php /// $Id$
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.org //
// //
// Copyright (C) 2004 Martin Dougiamas http://moodle.com //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details: //
// //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
/**
* enrolment_base is the base class for enrolment plugins
*
* This class provides all the functionality for an enrolment plugin
* In fact it includes all the code for the default, "internal" method
* so that other plugins can override these as necessary.
*/
class enrolment_base {
var $errormsg;
/**
* Returns information about the courses a student has access to
*
* Set the $user->student course array
* Set the $user->timeaccess course array
*
* @param user referenced object, must contain $user->id already set
*/
function get_student_courses(&$user) {
if ($students = get_records("user_students", "userid", $user->id)) {
$currenttime = time();
foreach ($students as $student) {
/// Is course visible?
if (get_field("course", "visible", "id", $student->course)) {
/// Is the student enrolment active right now?
if ( ( $student->timestart == 0 or ( $currenttime > $student->timestart )) and
( $student->timeend == 0 or ( $currenttime < $student->timeend )) ) {
$user->student[$student->course] = true;
$user->timeaccess[$student->course] = $student->timeaccess;
}
}
}
}
}
/**
* Returns information about the courses a student has access to
*
* Set the $user->teacher course array
* Set the $user->teacheredit course array
* Set the $user->timeaccess course array
*
* @param user referenced object, must contain $user->id already set
*/
function get_teacher_courses(&$user) {
if ($teachers = get_records("user_teachers", "userid", $user->id)) {
$currenttime = time();
foreach ($teachers as $teacher) {
/// Is teacher only teaching this course for a specific time period?
if ( ( $teacher->timestart == 0 or ( $currenttime > $teacher->timestart )) and
( $teacher->timeend == 0 or ( $currenttime < $teacher->timeend )) ) {
$user->teacher[$teacher->course] = true;
if ($teacher->editall) {
$user->teacheredit[$teacher->course] = true;
}
$user->timeaccess[$teacher->course] = $teacher->timeaccess;
}
}
}
}
/**
* Prints the entry form/page for this enrolment
*
* This is only called from course/enrol.php
* Most plugins will probably override this to print payment
* forms etc, or even just a notice to say that manual enrolment
* is disabled
*
* @param course current course object
*/
function print_entry($course) {
global $CFG, $USER, $SESSION, $THEME;
$strloginto = get_string("loginto", "", $course->shortname);
$strcourses = get_string("courses");
/// Automatically enrol into courses without password
if ($course->password == "") { // no password, so enrol
if (isguest()) {
add_to_log($course->id, "course", "guest", "view.php?id=$course->id", "$USER->id");
} else if (empty($_GET['confirm'])) {
print_header($strloginto, $course->fullname, "<a href=\".\">$strcourses</a> -> $strloginto");
echo "<br />";
notice_yesno(get_string("enrolmentconfirmation"), "enrol.php?id=$course->id&confirm=1", $CFG->wwwroot);
print_footer();
exit;
} else {
if ($course->enrolperiod == 0) {
$timestart = 0;
$timeend = 0;
} else {
$timestart = time();
$timeend = time() + $course->enrolperiod;
}
if (! enrol_student($USER->id, $course->id, $timestart, $timeend)) {
error("An error occurred while trying to enrol you.");
}
add_to_log($course->id, "course", "enrol", "view.php?id=$course->id", "$USER->id");
$USER->student[$course->id] = true;
if ($SESSION->wantsurl) {
$destination = $SESSION->wantsurl;
unset($SESSION->wantsurl);
} else {
$destination = "$CFG->wwwroot/course/view.php?id=$course->id";
}
redirect($destination);
}
}
$teacher = get_teacher($course->id);
if (!isset($password)) {
$password = "";
}
print_header($strloginto, $course->fullname, "<A HREF=\".\">$strcourses</A> -> $strloginto", "form.password");
print_course($course);
include("$CFG->dirroot/enrol/internal/enrol.html");
print_footer();
}
/**
* The other half to print_entry, this checks the form data
*
* This function checks that the user has completed the task on the
* enrolment entry page and then enrolls them.
*
* @param form the form data submitted, as an object
* @param course the current course, as an object
*/
function check_entry($form, $course) {
global $CFG, $USER, $SESSION, $THEME;
if ($form->password == $course->password) {
if (isguest()) {
add_to_log($course->id, "course", "guest", "view.php?id=$course->id", $_SERVER['REMOTE_ADDR']);
} else if (!record_exists("user_students", "userid", $USER->id, "course", $course->id)) {
if (! enrol_student($USER->id, $course->id)) {
error("An error occurred while trying to enrol you.");
}
$subject = get_string("welcometocourse", "", $course->fullname);
$a->coursename = $course->fullname;
$a->profileurl = "$CFG->wwwroot/user/view.php?id=$USER->id&course=$course->id";
$message = get_string("welcometocoursetext", "", $a);
if (! $teacher = get_teacher($course->id)) {
$teacher = get_admin();
}
email_to_user($USER, $teacher, $subject, $message);
add_to_log($course->id, "course", "enrol", "view.php?id=$course->id", "$USER->id");
}
$USER->student[$course->id] = true;
if ($SESSION->wantsurl) {
$destination = $SESSION->wantsurl;
unset($SESSION->wantsurl);
} else {
$destination = "$CFG->wwwroot/course/view.php?id=$course->id";
}
redirect($destination);
} else {
$this->errormsg = get_string("enrolmentkeyhint", "", substr($course->password,0,1));
}
}
/**
* Prints a form for configuring the current enrolment plugin
*
* This function is called from admin/enrol.php, and outputs a
* full page with a form for defining the current enrolment plugin.
*
* @param page an object containing all the data for this page
*/
function config_form($page) {
return "";
}
/**
* Processes and stored configuration data for the enrolment plugin
*
* Processes and stored configuration data for the enrolment plugin
*
* @param config all the configuration data as entered by the admin
*/
function process_config($config) {
return true;
}
/**
* This function is run by admin/cron.php every time
*
* The cron function can perform regular checks for the current
* enrollment plugin. For example it can check a foreign database,
* all look for a file to pull data in from
*
*/
function cron() {
// Delete students from all courses where their enrolment period has expired
$select = "timeend > '0' AND timeend < '" . time() . "'";
if ($students = get_records_select('user_students', $select)) {
foreach ($students as $student) {
unenrol_student($student->userid, $student->course);
}
}
if ($teachers = get_records_select('user_teachers', $select)) {
foreach ($teachers as $teacher) {
remove_teacher($teacher->userid, $teacher->course);
}
}
}
/**
* Returns the relevant icons for a course
*
* Returns the relevant icons for a course
*
* @param course the current course, as an object
*/
function get_access_icons($course) {
global $CFG;
$str = '';
if ($course->guest) {
$strallowguests = get_string("allowguests");
$str .= "<a title=\"$strallowguests\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
$str .= "<img vspace=4 alt=\"$strallowguests\" height=16 width=16 border=0 src=\"$CFG->pixpath/i/guest.gif\"></a>&nbsp;&nbsp;";
}
if ($course->password) {
$strrequireskey = get_string("requireskey");
$str .= "<a title=\"$strrequireskey\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
$str .= "<img vspace=4 alt=\"$strrequireskey\" height=16 width=16 border=0 src=\"$CFG->pixpath/i/key.gif\"></a>";
}
return $str;
}
} /// end of class
?>
-228
View File
@@ -1,228 +0,0 @@
<?php
require_once("$CFG->dirroot/enrol/enrol.class.php");
// The following flags are set in the configuration
// $CFG->enrol_flatfilelocation: where is the file we are looking for?
// $CFG->enrol_flatfilemailusers: send email to users when they are enrolled in a course
// $CFG->enrol_flatfilemailadmin: email the log from the cron job to the admin
// $CFG->enrol_flatfileallowinternal: allow internal enrolment in courses
class enrolment_plugin extends enrolment_base {
var $log;
/// Override the base print_entry() function
function print_entry($course) {
global $CFG;
if (! empty($CFG->enrol_flatfileallowinternal) ) {
parent::print_entry($course);
} else {
print_header();
notice(get_string("enrolmentnointernal"), $CFG->wwwroot);
}
}
/// Override the base check_entry() function
function check_entry($form, $course) {
global $CFG;
if (! empty($CFG->enrol_flatfileallowinternal) ) {
parent::check_entry($form, $course);
}
}
/**
* Override the base cron() function to read in a file
*
* Comma separated file assumed to have four or six fields per line:
* operation, role, idnumber(user), idnumber(course) [, starttime, endtime]
* where:
* operation = add | del
* role = student | teacher | teacheredit
* idnumber(user) = idnumber in the user table NB not id
* idnumber(course) = idnumber in the course table NB not id
* starttime = start time (in seconds since epoch) - optional
* endtime = end time (in seconds since epoch) - optional
*/
function cron() {
global $CFG;
/// call the base class
parent::cron();
if (empty($CFG->enrol_flatfilelocation)) {
$filename = "$CFG->dataroot/1/enrolments.txt"; // Default location
} else {
$filename = $CFG->enrol_flatfilelocation;
}
if ( file_exists($filename) ) {
$this->log = userdate(time()) . "\n";
$this->log .= "Flatfile enrol cron found file: $filename\n\n";
if (($fh = fopen($filename, "r")) != false) {
$line = 0;
while (!feof($fh)) {
$line++;
$fields = explode( ",", str_replace( "\r", "", fgets($fh) ) );
/// If a line is incorrectly formatted ie does not have 4 comma separated fields then ignore it
if (count($fields) != 4 and count($fields) !=6) {
if ( count($fields) > 1 or strlen($fields[0]) > 1) { // no error for blank lines
$this->log .= "$line: Line incorrectly formatted - ignoring\n";
}
continue;
}
$fields[0] = trim(strtolower($fields[0]));
$fields[1] = trim(strtolower($fields[1]));
$fields[2] = trim($fields[2]);
$fields[3] = trim($fields[3]);
$this->log .= "$line: $fields[0] $fields[1] $fields[2] $fields[3] ";
if (!empty($fields[5])) {
$fields[4] = (int)trim($fields[4]);
$fields[5] = (int)trim($fields[5]);
$this->log .= "$fields[4] $fields[5]";
} else {
$fields[4] = 0;
$fields[5] = 0;
}
$this->log .= ":";
/// check correct formatting of operation field
if ($fields[0] != "add" and $fields[0] != "del") {
$this->log .= "Unknown operation in field 1 - ignoring line\n";
continue;
}
/// check correct formatting of role field
if ($fields[1] != "student" and $fields[1] != "teacher" and $fields[1] != "teacheredit") {
$this->log .= "Unknown role in field2 - ignoring line\n";
continue;
}
if (! $user = get_record("user", "idnumber", $fields[2]) ) {
$this->log .= "Unknown user idnumber in field 3 - ignoring line\n";
continue;
}
if (! $course = get_record("course", "idnumber", $fields[3]) ) {
$this->log .= "Unknown course idnumber in field 4 - ignoring line\n";
continue;
}
if ($fields[4] > $fields[5]) {
$this->log .= "Start time was later than end time - ignoring line\n";
continue;
}
unset($elog);
switch ($fields[1]) {
case "student":
if ($fields[0] == "add") {
if (! enrol_student($user->id, $course->id, $fields[4], $fields[5])) {
$elog = "Error enrolling in course\n";
}
} else {
if (! unenrol_student($user->id, $course->id)) {
$elog = "Error unenrolling from course\n";
}
}
break;
case "teacher":
if ($fields[0] == "add") {
if (! add_teacher($user->id, $course->id, 0, '', $fields[4], $fields[5])) {
$elog = "Error adding teacher to course\n";
}
} else {
if (! remove_teacher($user->id, $course->id)) {
$elog = "Error removing teacher from course\n";
}
}
break;
case "teacheredit":
if ($fields[0] == "add") {
if (! add_teacher($user->id, $course->id, 1, '', $fields[4], $fields[5])) {
$elog = "Error adding teacher to course\n";
}
} else {
if (! remove_teacher($user->id, $course->id)) {
$elog = "Error removing teacher from course\n";
}
}
break;
default: // should never get here as checks made above for correct values of $fields[1]
} // end of switch
if ( (! empty($CFG->enrol_flatfilemailusers)) and empty($elog) and ($fields[0] == "add") ) {
$subject = get_string("welcometocourse", "", $course->fullname);
$a->coursename = $course->fullname;
$a->profileurl = "$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id";
$message = get_string("welcometocoursetext", "", $a);
if ($fields[1] == "student") {
if (! $teacher = get_teacher($course->id)) {
$teacher = get_admin();
}
} else {
$teacher = get_admin();
}
email_to_user($user, $teacher, $subject, $message);
}
if (empty($elog)) {
$elog = "OK\n";
}
$this->log .= $elog;
} // end of while loop
fclose($fh);
} // end of if(file_open)
if(! @unlink($filename)) {
email_to_user(get_admin(), get_admin(), get_string("filelockedmailsubject", "enrol_flatfile"), get_string("filelockedmail", "enrol_flatfile", $filename));
$this->log .= "Error unlinking file $filename\n";
}
if (! empty($CFG->enrol_flatfilemailadmin)) {
email_to_user(get_admin(), get_admin(), "Flatfile Enrolment Log", $this->log);
}
} // end of if(file_exists)
} // end of function
} // end of class
?>
-6
View File
@@ -1,6 +0,0 @@
add, student, 5, CF101
add, teacher, 6, CF101
add, teacheredit, 7, CF101
del, student, 8, CF101
del, student, 17, CF101
add, student, 21, CF101, 1091115000, 1091215000
-45
View File
@@ -1,45 +0,0 @@
<table cellpadding="20" align="center">
<tr valign="top">
<td>
<p align="center">
<?php
if ($teacher) {
$teachername = "<a href=\"../user/view.php?id=$teacher->id&course=$site->id\">".
"$teacher->firstname $teacher->lastname</a>.";
} else {
$teachername = get_string("yourteacher", "", strtolower($course->teacher));
}
print_string("enrolmentkeyfrom", "", $teachername);
?>
</p>
</td>
</tr>
<tr valign=top>
<td class="generalbox" bgcolor="<?php p($THEME->cellcontent) ?>"><center><?php if (! empty($this->errormsg)) {formerr($this->errormsg);} ?></center>
<form name="form" method="post" action="enrol.php">
<table>
<tr>
<td width="50%" align="right"><p><?php print_string("enrolmentkey") ?>:</p></td>
<td width="50%">
<input type="password" name="password" size="20" value="<?php p($password) ?>" >
<input type="hidden" name="id" value="<?php p($course->id) ?>" >
</td>
<tr>
<td width="50%">&nbsp;</td>
<td width="50%">
<table cellpadding="1" cellspacing="0" align="center">
<tr>
<td><input type="submit" value="<?php print_string("login") ?>">&nbsp;&nbsp;</form></td>
<td><form action="<?php p($CFG->wwwroot)?>/index.php" method=post>
<input type="submit" value="<?php print_string("cancel") ?>"></form></td>
</tr>
</table>
</td>
</table>
</td>
</tr>
</table>
-8
View File
@@ -1,8 +0,0 @@
<?php
require_once("$CFG->dirroot/enrol/enrol.class.php");
class enrolment_plugin extends enrolment_base {
/// nothing to do - it's already perfect!
}
?>
-40
View File
@@ -1,40 +0,0 @@
<div align="center">
<p><?php print_string("paymentrequired") ?></p>
<p><b><?php echo get_string("cost").": $CFG->enrol_paypalcurrency $cost"; ?></b></p>
<p><?php print_string("paymentinstant") ?></p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<?php p($CFG->enrol_paypalbusiness)?>">
<input type="hidden" name="item_name" value="<?php p($course->fullname) ?>">
<input type="hidden" name="item_number" value="<?php p($course->shortname) ?>">
<input type="hidden" name="quantity" value="1">
<input type="hidden" name="on0" value="<?php print_string("user") ?>">
<input type="hidden" name="os0" value="<?php echo fullname($USER) ?>">
<input type="hidden" name="custom" value="<?php echo "$USER->id-$course->id" ?>">
<input type="hidden" name="currency_code" value="<?php p($CFG->enrol_paypalcurrency) ?>">
<input type="hidden" name="amount" value="<?php p($cost) ?>">
<input type="hidden" name="for_auction" value="false">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="notify_url" value="<?php echo "$CFG->wwwroot/enrol/paypal/ipn.php"?>">
<input type="hidden" name="return" value="<?php echo "$CFG->wwwroot/enrol/paypal/return.php?id=$course->id" ?>">
<input type="hidden" name="cancel_return" value="<?php echo $CFG->wwwroot ?>">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="cbt" value="<?php print_string("continuetocourse") ?>">
<input type="hidden" name="first_name" value="<?php p($USER->firstname) ?>">
<input type="hidden" name="last_name" value="<?php p($USER->lastname) ?>">
<input type="hidden" name="address" value="<?php p($USER->address) ?>">
<input type="hidden" name="city" value="<?php p($USER->city) ?>">
<input type="hidden" name="email" value="<?php p($USER->email) ?>">
<input type="hidden" name="country" value="<?php p($USER->country) ?>">
<input type="submit" value="<?php print_string("sendpaymentbutton", "enrol_paypal") ?>">
</form>
</div>
-103
View File
@@ -1,103 +0,0 @@
<?php
require_once("$CFG->dirroot/enrol/enrol.class.php");
class enrolment_plugin extends enrolment_base {
/// Override the base print_entry() function
function print_entry($course) {
global $CFG, $USER;
$strloginto = get_string("loginto", "", $course->shortname);
$strcourses = get_string("courses");
$teacher = get_teacher($course->id);
if ( (float) $course->cost < 0 ) {
$cost = (float) $CFG->enrol_cost;
} else {
$cost = (float) $course->cost;
}
$cost = format_float($cost, 2);
if (abs($cost) < 0.01) { // no cost, default to base class entry to course
parent::print_entry($course);
} else {
print_header($strloginto, $course->fullname,
"<a href=\"$CFG->wwwroot/courses/\">$strcourses</a> -> $strloginto");
print_course($course, "80%");
print_simple_box_start("center");
include("$CFG->dirroot/enrol/paypal/enrol.html");
echo "</div>";
print_simple_box_end();
print_footer();
}
} // end of function print_entry()
/// Override the base check_entry() function
/// This should never be called for this type of enrolment anyway
function check_entry($form, $course) {
}
/// Override the get_access_icons() function
function get_access_icons($course) {
global $CFG;
$str = '';
if ( (float) $course->cost < 0) {
$cost = (float) $CFG->enrol_cost;
} else {
$cost = (float) $course->cost;
}
if (abs($cost) < 0.01) {
$str = parent::get_access_icons($course);
} else {
$strrequirespayment = get_string("requirespayment");
$strcost = get_string("cost");
if (empty($CFG->enrol_paypalcurrency)) {
$CFG->enrol_paypalcurrency = 'USD';
}
switch ($CFG->enrol_paypalcurrency) {
case 'EUR': $currency = '&euro;'; break;
case 'CAD': $currency = '$'; break;
case 'GBP': $currency = '&pound;'; break;
case 'JPY': $currency = '&yen;'; break;
default: $currency = '$'; break;
}
$str .= "<p>$strcost: <a title=\"$strrequirespayment\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
$str .= "$currency".format_float($cost,2).'</a></p>';
}
return $str;
}
} // end of class definition
-199
View File
@@ -1,199 +0,0 @@
<?php // $Id$
/**
* Listens for Instant Payment Notification from Paypal
*
* This script waits for Payment notification from Paypal,
* then double checks that data by sending it back to Paypal.
* If Paypal verifies this then it sets up the enrolment for that
*
* Set the $user->timeaccess course array
*
* @param user referenced object, must contain $user->id already set
*/
require("../../config.php");
require("enrol.php");
/// Keep out casual intruders
if (empty($_POST) or !empty($_GET)) {
error("Sorry, you can not use the script that way.");
}
/// Read all the data from Paypal and get it ready for later
$req = 'cmd=_notify-validate';
foreach ($_POST as $key => $value) {
$value = urlencode(stripslashes($value));
$req .= "&$key=$value";
$data->$key = urldecode($value);
}
$custom = explode('-', $data->custom);
$data->userid = $custom[0];
$data->courseid = $custom[1];
$data->payment_amount = $data->mc_gross;
$data->payment_currency = $data->mc_currency;
/// get the user and course records
if (! $user = get_record("user", "id", $data->userid) ) {
email_paypal_error_to_admin("Not a valid user id", $data);
die;
}
if (! $course = get_record("course", "id", $data->courseid) ) {
email_paypal_error_to_admin("Not a valid course id", $data);
die;
}
/// Open a connection back to PayPal to validate the data
$header = '';
$header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
$fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30);
if (!$fp) { /// Could not open a socket to Paypal - FAIL
echo "<p>Error: could not access paypal.com</p>";
email_paypal_error_to_admin("Could not access paypal.com to verify payment", $data);
die;
}
/// Connection is OK, so now we post the data to validate it
fputs ($fp, $header.$req);
/// Now read the response and check if everything is OK.
while (!feof($fp)) {
$result = fgets($fp, 1024);
if (strcmp($result, "VERIFIED") == 0) { // VALID PAYMENT!
// check the payment_status and payment_reason
// If status is not completed or pending then unenrol the student if already enrolled
// and notify admin
if ($data->payment_status != "Completed" and $data->payment_status != "Pending") {
unenrol_student($data->userid, $data->courseid);
email_paypal_error_to_admin("Status not completed or pending. User unenrolled from course", $data);
die;
}
// If status is pending and reason is other than echeck then we are on hold until further notice
// Email user to let them know. Email admin.
if ($data->payment_status == "Pending" and $data->pending_reason != "echeck") {
email_to_user($user, getadmin(), "Moodle: Paypal payment", "Your Paypal payment is pending.");
email_paypal_error_to_admin("Payment pending", $data);
die;
}
// If our status is not completed or not pending on an echeck clearance then ignore and die
// This check is redundant at present but may be useful if paypal extend the return codes in the future
if (! ( $data->payment_status == "Completed" or
($data->payment_status == "Pending" and $data->pending_reason == "echeck") ) ) {
die;
}
// At this point we only proceed with a status of completed or pending with a reason of echeck
if ($existing = get_record("enrol_paypal", "txn_id", $data->txn_id)) { // Make sure this transaction doesn't exist already
email_paypal_error_to_admin("Transaction $data->txn_id is being repeated!", $data);
die;
}
if ($data->business != $CFG->enrol_paypalbusiness) { // Check that the email is the one we want it to be
email_paypal_error_to_admin("Business email is $data->business (not $CFG->enrol_paypalbusiness)", $data);
die;
}
if (!$user = get_record('user', 'id', $data->userid)) { // Check that user exists
email_paypal_error_to_admin("User $data->userid doesn't exist", $data);
die;
}
if (!$course = get_record('course', 'id', $data->courseid)) { // Check that course exists
email_paypal_error_to_admin("Course $data->courseid doesn't exist", $data);;
die;
}
// Check that amount paid is the correct amount
if ( (float) $course->cost < 0 ) {
$cost = (float) $CFG->enrol_cost;
} else {
$cost = (float) $course->cost;
}
$cost = format_float($cost, 2);
if ($data->payment_gross < $cost) {
email_paypal_error_to_admin("Amount paid is not enough ($data->payment_gross < $cost))", $data);
die;
}
// ALL CLEAR !
if (!insert_record("enrol_paypal", $data)) { // Insert a transaction record
email_paypal_error_to_admin("Error while trying to insert valid transaction", $data);
}
if (!enrol_student($user->id, $course->id)) { // Enrol the student
email_paypal_error_to_admin("Error while trying to enrol ".fullname($user)." in '$course->fullname'", $data);
die;
} else {
$teacher = get_teacher($course->id);
if (!empty($CFG->enrol_paypalmailstudents)) {
$a->coursename = "$course->fullname";
$a->profileurl = "$CFG->wwwroot/user/view.php?id=$user->id";
email_to_user($user, $teacher, get_string("enrolmentnew", '', $course->shortname), get_string('welcometocoursetext', '', $a));
}
if (!empty($CFG->enrol_paypalmailteachers)) {
email_to_user($teacher, $user, get_string("enrolmentnew", '', $course->shortname), "I have enrolled in your class via Paypal");
}
}
} else if (strcmp ($result, "INVALID") == 0) { // ERROR
insert_record("enrol_paypal", $data);
email_paypal_error_to_admin("Received an invalid payment notification!! (Fake payment?)", $data);
}
}
fclose($fp);
exit;
/// FUNCTIONS //////////////////////////////////////////////////////////////////
function email_paypal_error_to_admin($subject, $data) {
$admin = get_admin();
$site = get_admin();
$message = "$site->fullname: Transaction failed.\n\n$subject\n\n";
foreach ($data as $key => $value) {
$message .= "$key => $value\n";
}
email_to_user($admin, $admin, "PAYPAL ERROR: ".$subject, $message);
}
?>
-34
View File
@@ -1,34 +0,0 @@
<?php // $Id$
require("../../config.php");
require_once("$CFG->dirroot/enrol/$CFG->enrol/enrol.php");
require_variable($id);
if (!$course = get_record("course", "id", $id)) {
redirect($CFG->wwwroot);
}
require_login();
/// Refreshing enrolment data in the USER session
$enrol = new enrolment_plugin();
$enrol->get_student_courses($USER);
if ($SESSION->wantsurl) {
$destination = $SESSION->wantsurl;
unset($SESSION->wantsurl);
} else {
$destination = "$CFG->wwwroot/course/view.php?id=$course->id";
}
if (isstudent($course->id) or isteacher($course->id)) {
redirect($destination, get_string('paymentthanks', '', $course->fullname));
} else { /// Somehow they aren't enrolled yet! :-(
print_header();
notice(get_string('paymentsorry', '', $course), $destination);
}
?>
+2 -3
View File
@@ -18,7 +18,7 @@ function mimeinfo($element, $filename) {
"dv" => array ("type"=>"video/x-dv", "icon"=>"video.gif"),
"doc" => array ("type"=>"application/msword", "icon"=>"word.gif"),
"dif" => array ("type"=>"video/x-dv", "icon"=>"video.gif"),
"eps" => array ("type"=>"application/postscript", "icon"=>"pdf.gif"),
"eps" => array ("type"=>"application/postscript", "icon"=>"image.gif"),
"gif" => array ("type"=>"image/gif", "icon"=>"image.gif"),
"gtar" => array ("type"=>"application/x-gtar", "icon"=>"zip.gif"),
"gz" => array ("type"=>"application/g-zip", "icon"=>"zip.gif"),
@@ -47,9 +47,8 @@ function mimeinfo($element, $filename) {
"pic" => array ("type"=>"image/pict", "icon"=>"image.gif"),
"pict" => array ("type"=>"image/pict", "icon"=>"image.gif"),
"png" => array ("type"=>"image/png", "icon"=>"image.gif"),
"pps" => array ("type"=>"application/vnd.ms-powerpoint", "icon"=>"powerpoint.gif"),
"ppt" => array ("type"=>"application/vnd.ms-powerpoint", "icon"=>"powerpoint.gif"),
"ps" => array ("type"=>"application/postscript", "icon"=>"pdf.gif"),
"ps" => array ("type"=>"application/postscript", "icon"=>"image.gif"),
"qt" => array ("type"=>"video/quicktime", "icon"=>"video.gif"),
"ra" => array ("type"=>"audio/x-realaudio", "icon"=>"audio.gif"),
"ram" => array ("type"=>"audio/x-pn-realaudio", "icon"=>"audio.gif"),
+1 -10
View File
@@ -11,10 +11,6 @@
$CFG->texfilterdir = "filter/tex";
$CFG->algebrafilterdir = "filter/algebra";
$CFG->algebraimagedir = "filter/algebra";
if ( (PHP_OS == "WINNT") || (PHP_OS == "WIN32") || (PHP_OS == "Windows") ) {
$CFG->algebrafilterdirwin = "filter\\algebra";
}
$query = urldecode($_SERVER['QUERY_STRING']);
error_reporting(E_ALL);
@@ -90,7 +86,7 @@ function algebra2tex($algebra) {
if ( (PHP_OS == "WINNT") || (PHP_OS == "WIN32") || (PHP_OS == "Windows") ) {
$algebra = "\"". str_replace('"','\"',$algebra) . "\"";
$cmd = "cd $CFG->dirroot\\$CFG->algebrafilterdirwin & algebra2tex.pl $algebra";
$cmd = "cd $CFG->dirroot/$CFG->algebrafilterdir & algebra2tex.pl $algebra";
} else {
$algebra = escapeshellarg($algebra);
$cmd = "cd $CFG->dirroot/$CFG->algebrafilterdir; ./algebra2tex.pl $algebra";
@@ -215,12 +211,7 @@ function tex2image($texexp, $md5) {
break;
}
if (!$cmd) {
if (is_executable("$CFG->dirroot/$CFG->texfilterdir/mimetex")) { /// Use the custom binary
$commandpath="$CFG->dirroot/$CFG->texfilterdir/mimetex";
$cmd = "$CFG->dirroot/$CFG->texfilterdir/mimetex -e $pathname ". escapeshellarg($texexp);
} else {
error($error_message1);
}
}
system($cmd, $status);
}
+1 -6
View File
@@ -42,11 +42,6 @@
// File path to the directory where mathml_filter.php resides
$CFG->algebrafilterdir = "filter/algebra";
$CFG->texfilterdir = "filter/tex";
if ( (PHP_OS == "WINNT") || (PHP_OS == "WIN32") || (PHP_OS == "Windows") ) {
$CFG->algebrafilterdirwin = "filter\\algebra";
}
/// These lines are important - the variable must match the name
/// of the actual function below
@@ -166,7 +161,7 @@ function algebra_filter ($courseid, $text) {
$algebra = preg_replace('!\r\n?!',' ',$algebra);
if ( (PHP_OS == "WINNT") || (PHP_OS == "WIN32") || (PHP_OS == "Windows") ) {
$algebra = "\"". str_replace('"','\"',$algebra) . "\"";
$cmd = "cd $CFG->dirroot\\$CFG->algebrafilterdirwin & algebra2tex.pl $algebra";
$cmd = "cd $CFG->dirroot/$CFG->algebrafilterdir & algebra2tex.pl $algebra";
} else {
$algebra = escapeshellarg($algebra);
$cmd = "cd $CFG->dirroot/$CFG->algebrafilterdir; ./algebra2tex.pl $algebra";
-27
View File
@@ -114,33 +114,6 @@ function mediaplugin_filter($courseid, $text) {
$text = preg_replace($search, $replace, $text);
}
if (empty($CFG->filter_mediaplugin_ignore_mpg)) {
$search = '/<a(.*?)href=\"([^<]+)\.(mpe?g)\"([^>]*)>(.*?)<\/a>/i';
$replace = '\\0<p class="mediaplugin"><object width="240" height="180">';
$replace .= '<param name="src" value="\\2.\\3">';
$replace .= '<param name="controller" value="true">';
$replace .= '<param name="autoplay" value="false">';
$replace .= '<embed src="\\2.\\3" width="240" height="180" controller="true" autoplay="false"> </embed>';
$replace .= '</object></p>';
$text = preg_replace($search, $replace, $text);
}
if (empty($CFG->filter_mediaplugin_ignore_avi)) {
$search = '/<a(.*?)href=\"([^<]+)\.avi\"([^>]*)>(.*?)<\/a>/i';
$replace = '\\0<p class="mediaplugin"><object width="240" height="180">';
$replace .= '<param name="src" value="\\2.avi">';
$replace .= '<param name="controller" value="true">';
$replace .= '<param name="autoplay" value="false">';
$replace .= '<embed src="\\2.avi" width="240" height="180" controller="true" autoplay="false"> </embed>';
$replace .= '</object></p>';
$text = preg_replace($search, $replace, $text);
}
return $text;
}
-5
View File
@@ -119,12 +119,7 @@
break;
}
if (!$cmd) {
if (is_executable("$CFG->dirroot/$CFG->texfilterdir/mimetex")) { /// Use the custom binary
$commandpath="$CFG->dirroot/$CFG->texfilterdir/mimetex";
$cmd = "$CFG->dirroot/$CFG->texfilterdir/mimetex -e $pathname ". escapeshellarg($texexp);
} else {
error($error_message1);
}
}
system($cmd, $status);
}
+1 -22
View File
@@ -36,7 +36,7 @@
$helpfound = true;
include("$filepath"); // The actual helpfile
if ($module == "moodle" and ($file == "index.html" or $file == "mods.html")) {
if ($module == "moodle" && ($file == "index.html" || $file == "mods.html")) {
// include file for each module
if (!$modules = get_records("modules", "visible", 1)) {
@@ -57,27 +57,6 @@
$filepath = "$CFG->dirroot/lang/$lang/help/$mod->name/$file";
if (file_exists("$filepath")) {
echo '<hr size="1" />';
include("$filepath"); // The actual helpfile
break;
}
}
}
}
if ($module == "moodle" and ($file == "resource/types.html")) { // RESOURCES
require_once("$CFG->dirroot/mod/resource/lib.php");
$typelist = resource_get_resource_types();
$typelist['label'] = get_string('resourcetypelabel', 'resource');
foreach ($typelist as $type => $name) {
foreach ($langs as $lang) {
if (empty($lang)) {
continue;
}
$filepath = "$CFG->dirroot/lang/$lang/help/resource/type/$type.html";
if (file_exists("$filepath")) {
echo '<hr size="1" />';
include("$filepath"); // The actual helpfile
break;
}
+125 -213
View File
@@ -1,16 +1,9 @@
<?PHP // $Id$
// index.php - the front page.
// Bounds for block widths
define('BLOCK_L_MIN_WIDTH', 160);
define('BLOCK_L_MAX_WIDTH', 210);
define('BLOCK_R_MIN_WIDTH', 160);
define('BLOCK_R_MAX_WIDTH', 210);
require_once("config.php");
require_once("course/lib.php");
require_once('lib/blocklib.php');
require_once("mod/resource/lib.php");
require_once("mod/resource/lib.php");
require_once("mod/forum/lib.php");
if (! $site = get_site()) {
@@ -28,12 +21,7 @@
}
if (empty($USER->id)) {
if (empty($CFG->loginhttps)) {
$wwwroot = $CFG->wwwroot;
} else {
$wwwroot = str_replace('http','https',$CFG->wwwroot);
}
$loginstring = "<font size=2><a href=\"$wwwroot/login/index.php\">".get_string("login")."</a></font>";
$loginstring = "<font size=2><a href=\"$CFG->wwwroot/login/index.php\">".get_string("login")."</a></font>";
} else {
$loginstring = "<font size=1>".user_login_string($site)."</font>";
}
@@ -50,225 +38,149 @@
"<meta name=\"description\" content=\"".s(strip_tags($site->summary))."\">",
true, "", "$loginstring$langmenu");
$editing = isediting($site->id);
$firstcolumn = false; // for now
$lastcolumn = false; // for now
$side = 175;
$courseformat = COURSE_FORMAT_SITE;
// Doing this now so we can pass the results to block_action()
// and dodge the overhead of doing the same work twice.
$blocks = $site->blockinfo;
$delimpos = strpos($blocks, ':');
if($delimpos === false) {
// No ':' found, we have all left blocks
$leftblocks = explode(',', $blocks);
$rightblocks = array();
}
else if($delimpos === 0) {
// ':' at start of string, we have all right blocks
$blocks = substr($blocks, 1);
$leftblocks = array();
$rightblocks = explode(',', $blocks);
}
else {
// Both left and right blocks
$leftpart = substr($blocks, 0, $delimpos);
$rightpart = substr($blocks, $delimpos + 1);
$leftblocks = explode(',', $leftpart);
$rightblocks = explode(',', $rightpart);
$site_summary_editbuttons = '';
if (isediting($site->id)) {
$site_summary_editbuttons = "<br><center><a href=\"$CFG->admin/site.php\"><img src=\"pix/i/edit.gif\" border=0></a>";
}
if($editing) {
if (isset($_GET['blockaction'])) {
if (isset($_GET['blockid'])) {
block_action($site, $leftblocks, $rightblocks, strtolower($_GET['blockaction']), intval($_GET['blockid']));
}
}
// This has to happen after block_action() has possibly updated the two arrays
$allblocks = array_merge($leftblocks, $rightblocks);
$missingblocks = array();
$recblocks = get_records('blocks','visible','1');
// Note down which blocks are going to get displayed
blocks_used($allblocks, $recblocks);
if($editing && $recblocks) {
foreach($recblocks as $recblock) {
// If it's not hidden or displayed right now...
if(!in_array($recblock->id, $allblocks) && !in_array(-($recblock->id), $allblocks)) {
// And if it's applicable for display in this format...
if(block_method_result($recblock->name, 'applicable_formats') & $courseformat) {
// Add it to the missing blocks
$missingblocks[] = $recblock->id;
}
}
}
}
}
else {
// Note down which blocks are going to get displayed
$allblocks = array_merge($leftblocks, $rightblocks);
$recblocks = get_records('blocks','visible','1');
blocks_used($allblocks, $recblocks);
if ($site->summary) {
$lastcolumn = true;
}
// If the block width cache is not set, set it
if(!isset($SESSION->blockcache->width->{$site->id}) || $editing) {
// This query might be optimized away if we 're in editing mode
if(!isset($recblocks)) {
$recblocks = get_records('blocks','visible','1');
}
$preferred_width_left = blocks_preferred_width($leftblocks, $recblocks);
$preferred_width_right = blocks_preferred_width($rightblocks, $recblocks);
// This may be kind of organizational overkill, granted...
// But is there any real need to simplify the structure?
$SESSION->blockcache->width->{$site->id}->left = $preferred_width_left;
$SESSION->blockcache->width->{$site->id}->right = $preferred_width_right;
}
else {
$preferred_width_left = $SESSION->blockcache->width->{$site->id}->left;
$preferred_width_right = $SESSION->blockcache->width->{$site->id}->right;
}
$preferred_width_left = min($preferred_width_left, BLOCK_L_MAX_WIDTH);
$preferred_width_left = max($preferred_width_left, BLOCK_L_MIN_WIDTH);
$preferred_width_right = min($preferred_width_right, BLOCK_R_MAX_WIDTH);
$preferred_width_right = max($preferred_width_right, BLOCK_R_MIN_WIDTH);
?>
<table width="100%" border="0" cellspacing="5" cellpadding="5">
<tr>
<?PHP
<?PHP
$sections = get_all_sections($site->id);
if ($site->newsitems > 0 or $sections[0]->sequence or isediting($site->id) or isadmin()) {
if(block_have_active($leftblocks) || $editing) {
echo '<td style="vertical-align: top; width: '.$preferred_width_left.'px;">';
print_course_blocks($site, $leftblocks, BLOCK_LEFT);
echo '</td>';
}
echo "<td width=\"$side\" valign=top nowrap>";
$firstcolumn=true;
if ($sections[0]->sequence or isediting($site->id)) {
get_all_mods($site->id, $mods, $modnames, $modnamesplural, $modnamesused);
print_section_block(get_string("mainmenu"), $site, $sections[0],
$mods, $modnames, $modnamesused, true, $side);
}
echo '<td style="vertical-align: top;">';
if (isadmin()) {
echo "<div align=\"center\">".update_course_icon($site->id)."</div>";
echo "<br />";
}
switch ($CFG->frontpage) {
case FRONTPAGENEWS: // print news links on the side
print_courses_sideblock(0, "$side");
break;
case FRONTPAGECOURSELIST:
case FRONTPAGECATEGORYNAMES:
if ($site->newsitems) {
if ($news = forum_get_course_forum($site->id, "news")) {
print_side_block_start(get_string("latestnews"), $side, "sideblocklatestnews");
echo "<font size=\"-2\">";
forum_print_latest_discussions($news->id, $site->newsitems, "minimal", "", false);
echo "</font>";
print_side_block_end();
}
}
break;
}
print_spacer(1,$side);
}
if (iscreator()) {
if (!$firstcolumn) {
echo "<td width=\"$side\" valign=top nowrap>";
$firstcolumn=true;
}
print_admin_links($site->id, $side);
}
if ($firstcolumn) {
echo "</td>";
}
if ($lastcolumn) {
echo "<td width=\"70%\" valign=\"top\">";
} else {
echo "<td width=\"100%\" valign=\"top\">";
}
switch ($CFG->frontpage) { /// Display the main part of the front page.
case FRONTPAGENEWS:
if (! $newsforum = forum_get_course_forum($site->id, "news")) {
error("Could not find or create a main news forum for the site");
}
/// Print Section
if ($site->numsections > 0) {
print_simple_box_start('center', '100%', $THEME->cellcontent, 5, 'sitetopic');
if (isset($USER->id)) {
$SESSION->fromdiscussion = "$CFG->wwwroot";
if (forum_is_subscribed($USER->id, $newsforum->id)) {
$subtext = get_string("unsubscribe", "forum");
} else {
$subtext = get_string("subscribe", "forum");
}
$headertext = "<table border=0 width=100% cellpadding=0 cellspacing=0 class=headingblockcontent><tr>
<td>$newsforum->name</td>
<td align=right><font size=1>
<a href=\"mod/forum/subscribe.php?id=$newsforum->id\">$subtext</a>
</td></tr></table>";
} else {
$headertext = $newsforum->name;
}
print_heading_block($headertext);
print_spacer(8,1);
forum_print_latest_discussions($newsforum->id, $site->newsitems);
break;
/// If currently moving a file then show the current clipboard
if (ismoving($site->id)) {
$stractivityclipboard = strip_tags(get_string("activityclipboard", "", addslashes($USER->activitycopyname)));
echo "<p><font size=2>";
echo "$stractivityclipboard&nbsp;&nbsp;(<a href=\"course/mod.php?cancelcopy=true\">".get_string("cancel")."</a>)";
echo "</font></p>";
}
case FRONTPAGECOURSELIST:
case FRONTPAGECATEGORYNAMES:
if (isset($USER->id) and !isset($USER->admin)) {
print_heading_block(get_string("mycourses"));
print_spacer(8,1);
print_my_moodle();
} else {
if (count_records("course_categories") > 1) {
if ($CFG->frontpage == FRONTPAGECOURSELIST) {
print_heading_block(get_string("availablecourses"));
} else {
print_heading_block(get_string("categories"));
}
print_spacer(8,1);
print_simple_box_start("center", "100%");
print_whole_category_list();
print_simple_box_end();
print_course_search("", false, "short");
} else {
print_heading_block(get_string("availablecourses"));
print_spacer(8,1);
print_courses(0, "100%");
}
}
break;
}
if (!$section = get_record('course_sections', 'course', $site->id, 'section', 1)) {
delete_records('course_sections', 'course', $site->id, 'section', 1); // Just in case
$section->course = $site->id;
$section->section = 1;
$section->summary = '';
$section->visible = 1;
$section->id = insert_record('course_sections', $section);
}
echo "</td>";
echo format_text($section->summary, FORMAT_HTML);
if ($editing) {
$streditsummary = get_string('editsummary');
echo "<a title=\"$streditsummary\" ".
" href=\"course/editsection.php?id=$section->id\"><img src=\"$CFG->pixpath/t/edit.gif\" ".
" height=11 width=11 border=0 alt=\"$streditsummary\"></a><br />";
}
echo '<br clear="all">';
get_all_mods($site->id, $mods, $modnames, $modnamesplural, $modnamesused);
print_section($site, $section, $mods, $modnamesused, true);
if ($editing) {
print_section_add_menus($site, $section->section, $modnames);
}
print_simple_box_end();
print_spacer(10);
}
switch ($CFG->frontpage) { /// Display the main part of the front page.
case FRONTPAGENEWS:
if (! $newsforum = forum_get_course_forum($site->id, "news")) {
error("Could not find or create a main news forum for the site");
}
if (isset($USER->id)) {
$SESSION->fromdiscussion = "$CFG->wwwroot";
if (forum_is_subscribed($USER->id, $newsforum->id)) {
$subtext = get_string("unsubscribe", "forum");
} else {
$subtext = get_string("subscribe", "forum");
}
$headertext = "<table border=0 width=100% cellpadding=0 cellspacing=0 class=headingblockcontent><tr>
<td>$newsforum->name</td>
<td align=right><font size=1>
<a href=\"mod/forum/subscribe.php?id=$newsforum->id\">$subtext</a>
</td></tr></table>";
} else {
$headertext = $newsforum->name;
}
print_heading_block($headertext);
print_spacer(8,1);
forum_print_latest_discussions($newsforum->id, $site->newsitems);
break;
case FRONTPAGECOURSELIST:
case FRONTPAGECATEGORYNAMES:
if (isset($USER->id) and !isset($USER->admin)) {
print_heading_block(get_string("mycourses"));
print_spacer(8,1);
print_my_moodle();
} else {
if (count_records("course_categories") > 1) {
if ($CFG->frontpage == FRONTPAGECOURSELIST) {
print_heading_block(get_string("availablecourses"));
} else {
print_heading_block(get_string("categories"));
}
print_spacer(8,1);
print_simple_box_start("center", "100%");
print_whole_category_list();
print_simple_box_end();
print_course_search("", false, "short");
} else {
print_heading_block(get_string("availablecourses"));
print_spacer(8,1);
print_courses(0, "100%");
}
}
break;
}
echo '</td>';
if(block_have_active($rightblocks) || $editing || isadmin()) {
echo '<td style="vertical-align: top; width: '.$preferred_width_right.'px;">';
if (isadmin()) {
echo '<div align="center">'.update_course_icon($site->id).'</div>';
echo '<br />';
}
print_course_blocks($site, $rightblocks, BLOCK_RIGHT);
if ($editing && !empty($missingblocks)) {
block_print_blocks_admin($site, $missingblocks);
}
echo '</td>';
}
?>
if ($lastcolumn) {
echo "<td width=\"30%\" valign=\"top\">";
print_simple_box(format_text($site->summary, FORMAT_HTML).$site_summary_editbuttons,
"", "100%", $THEME->cellcontent2, 5, "siteinfo");
print_spacer(1,$side);
echo "</td>";
}
?>
</tr>
</table>
<?PHP print_footer('home'); // Please do not modify this line ?>
<?PHP print_footer("home"); // Please do not modify this line ?>
-1
View File
@@ -177,7 +177,6 @@ $string['PL'] = '
$string['PM'] = 'ÓÇäÊ ÈííÑ æãíßæáæä';
$string['PN'] = 'ÈÊßÇíÑä';
$string['PR'] = '(ÈæíÑÊæÑíßæ( ÇáæáÇíÇÊ ÇáãÊÍÏÉ ';
$string['PS'] = 'Palestine';
$string['PT'] = 'ÇáÈÑÊÛÇá';
$string['PW'] = 'ÈÇáÇæ';
$string['PY'] = 'ÈÇÑÇÌæÇí';
-10
View File
@@ -1,10 +0,0 @@
<?PHP // $Id$
// block_course_list.php - created with Moodle 1.4 development (2004060400)
$string['allcourses'] = 'L\'administrador veu tots els cursos';
$string['blockname'] = 'Llista de cursos';
$string['configadminview'] = 'Configuració de la visualització de l\'administrador';
$string['owncourses'] = 'L\'administrador veu els seus cursos';
?>
+1 -2
View File
@@ -1,8 +1,7 @@
<?PHP // $Id$
// block_course_summary.php - created with Moodle 1.4 development (2004070800)
// block_course_summary.php - created with Moodle 1.3 development (2004041800)
$string['blockname'] = 'Resum del curs';
$string['siteinfo'] = 'Informació del lloc';
?>
-111
View File
@@ -1,111 +0,0 @@
<?PHP // $Id$
// calendar.php - created with Moodle 1.3 (2004052500)
$string['april'] = 'abril';
$string['august'] = 'agost';
$string['calendar'] = 'Calendari';
$string['calendarheading'] = 'Calendari $a';
$string['clickhide'] = 'feu clic per ocultar';
$string['clickshow'] = 'feu clic per mostrar';
$string['confirmeventdelete'] = 'Esteu segur que voleu suprimir aquest esdeveniment?';
$string['courseevents'] = 'Esdeveniments del curs';
$string['dayview'] = 'Visualització del dia';
$string['daywithnoevents'] = 'Aquest dia no té esdeveniments.';
$string['december'] = 'desembre';
$string['default'] = 'Per defecte';
$string['deleteevent'] = 'Suprimeix esdeveniment';
$string['detailedmonthview'] = 'Visualització detallada del mes';
$string['durationminutes'] = 'Durada en minuts';
$string['durationnone'] = 'Sense durada';
$string['durationuntil'] = 'Fins';
$string['editevent'] = 'S\'està editant l\'esdeveniment';
$string['errorbeforecoursestart'] = 'No es pot definir l\'esdeveniment abans de la data d\'inici del curs';
$string['errorinvaliddate'] = 'La data no és vàlida';
$string['errorinvalidminutes'] = 'Especifiqueu la durada en minuts (entre 1 i 999).';
$string['errorinvalidrepeats'] = 'Especifiqueu el nombre d\'esdeveniments (entre 1 i 999).';
$string['errornodescription'] = 'La descripció és necessària';
$string['errornoeventname'] = 'El nom és necessari';
$string['eventdate'] = 'Data';
$string['eventdescription'] = 'Descripció';
$string['eventduration'] = 'Durada';
$string['eventendtime'] = 'Final';
$string['eventinstanttime'] = 'Hora';
$string['eventkind'] = 'Tipus d\'esdeveniment';
$string['eventname'] = 'Nom';
$string['eventrepeat'] = 'Es repeteix';
$string['eventsfor'] = 'Esdeveniments $a';
$string['eventstarttime'] = 'Data d\'inici';
$string['eventtime'] = 'Hora';
$string['eventview'] = 'Informació sobre l\'esdeveniment';
$string['expired'] = 'Ha vençut';
$string['explain_lookahead'] = 'Aquesta preferència defineix el nombre (màxim) de dies que falten per a l\'esdeveniment per tal que es visualitzi com un esdeveniment pròxim. Si us plau teniu en compte que <strong>no es garanteix</strong> que es visualitzin tots els esdeveniments que comencen en aquest lapse; si n\'hi ha massa (més que la preferència \"Nombre màxim d\'esdeveniments pròxims\") aleshores els esdeveniments més llunyans no es mostraran.';
$string['explain_maxevents'] = 'Aquesta preferència defineix el nombre màxim d\'esdeveniments pròxims que es pot visualitzar. Si trieu aquí un nombre gran, és possible que la visualització dels esdeveniments pròxims ocupi molt d\'espai de pantalla.';
$string['explain_startwday'] = 'Aquesta preferència configura el mode de visualització de tots els calendaris mensuals. Useu-la per visualitzar-los al vostre gust.';
$string['explain_timeformat'] = 'Podeu triar de veure l\'hora en format de 12 o 24 hores. Si trieu \"per defecte\", aleshores el format es determinarà automàticament segons les convencions de l\'idioma del lloc.';
$string['february'] = 'febrer';
$string['fri'] = 'dv';
$string['friday'] = 'divendres';
$string['globalevents'] = 'Esdeveniments globals';
$string['gotocalendar'] = 'Vés al calendari';
$string['groupevents'] = 'Esdeveniments de grup';
$string['hidden'] = 'ocult';
$string['january'] = 'gener';
$string['july'] = 'juliol';
$string['june'] = 'juny';
$string['manyevents'] = '$a esdeveniments';
$string['march'] = 'març';
$string['may'] = 'maig';
$string['mon'] = 'dl';
$string['monday'] = 'dilluns';
$string['monthlyview'] = 'Visualització del mes';
$string['newevent'] = 'Nou esdeveniment';
$string['noupcomingevents'] = 'No hi ha esdeveniments pròxims.';
$string['november'] = 'novembre';
$string['october'] = 'octubre';
$string['oneevent'] = 'un esdeveniment';
$string['pref_lookahead'] = 'Esdeveniments pròxims';
$string['pref_maxevents'] = 'Nombre màxim d\'esdeveniments pròxims';
$string['pref_startwday'] = 'Primer dia de la setmana';
$string['pref_timeformat'] = 'Format de visualització de l\'hora';
$string['preferences'] = 'Preferències';
$string['preferences_available'] = 'Preferències personals';
$string['repeatnone'] = 'No es repeteix';
$string['repeatweeksl'] = 'Es repeteix cada setmana, crea ara';
$string['repeatweeksr'] = 'esdeveniments';
$string['sat'] = 'ds';
$string['saturday'] = 'dissabte';
$string['september'] = 'setembre';
$string['shown'] = 'mostrat';
$string['spanningevents'] = 'Esdeveniments en marxa';
$string['sun'] = 'dg';
$string['sunday'] = 'diumenge';
$string['thu'] = 'dj';
$string['thursday'] = 'dijous';
$string['timeformat_12'] = '12 hores (am/pm)';
$string['timeformat_24'] = '24 hores';
$string['today'] = 'Avui';
$string['tomorrow'] = 'Demà';
$string['tt_deleteevent'] = 'Suprimeix esdeveniment';
$string['tt_editevent'] = 'Edita esdeveniment';
$string['tt_hidecourse'] = 'S\'estan mostrant els esdeveniments del curs (feu clic per ocultar)';
$string['tt_hideglobal'] = 'S\'estan mostrant els esdeveniments globals (feu clic per ocultar)';
$string['tt_hidegroups'] = 'S\'estan mostrant els esdeveniments de grup (feu clic per ocultar)';
$string['tt_hideuser'] = 'S\'estan mostrant els esdeveniments de l\'usuari (feu clic per ocultar)';
$string['tt_showcourse'] = 'Els esdeveniments del curs estan ocults (feu clic per mostrar)';
$string['tt_showglobal'] = 'Els esdeveniments globals estan ocults (feu clic per mostrar)';
$string['tt_showgroups'] = 'Els esdeveniments de grup estan ocults (feu clic per mostrar)';
$string['tt_showuser'] = 'Els esdeveniments de l\'usuari estan ocults (feu clic per mostrar)';
$string['tue'] = 'dt';
$string['tuesday'] = 'dimarts';
$string['typecourse'] = 'Esdeveniment del curs';
$string['typegroup'] = 'Esdeveniment de grup';
$string['typesite'] = 'Esdeveniment del lloc';
$string['typeuser'] = 'Esdeveniment de l\'usuari';
$string['upcomingevents'] = 'Esdeveniments pròxims';
$string['userevents'] = 'Esdeveniments de l\'usuari';
$string['wed'] = 'dc';
$string['wednesday'] = 'dimecres';
$string['yesterday'] = 'Ahir';
?>
+1 -1
View File
@@ -38,6 +38,6 @@ $string['seesession'] = 'Visualitza aquesta sessi
$string['sessions'] = 'Sessions de xat';
$string['strftimemessage'] = '%%H:%%M';
$string['studentseereports'] = 'Tothom pot veure les sessions anteriors';
$string['viewreport'] = 'Visualitza les sessions de xat anteriors';
$string['viewreport'] = 'Vissualitza les sessions de xat anteriors';
?>
+4 -4
View File
@@ -13,8 +13,8 @@
<h1>Introducci&oacute;</h1>
<blockquote>
<p>Moodle &eacute;s un paquet de programari per a creaci&oacute; de cursos basats en internet i llocs web. &Eacute;s un projecte de desenvolupament en marxa, dissenyat per donar suport a un marc educatiu <a href="?file=philosophy.html">constructivista social</a>. </p>
<p>Moodle es distribueix lliurement com a programari de <a href="http://www.opensource.org/docs/definition_plain.html" target="_top">codi font obert</a> (sota la <a href="http://www.gnu.org/copyleft/gpl.html" target="_top">Llic&egrave;ncia P&uacute;blica GNU</a>). B&agrave;sicament aix&ograve; significa que Moodle t&eacute; drets d'autor (copyright), per&ograve; l'usuari gaudeix de llibertats addicionals. Se us permet copiar, utilitzar i modificar Moodle sempre que: <strong>faciliteu el codi a altres</strong>; <strong>no modifiqueu o suprimiu la llic&egrave;ncia i el copyright original</strong> i <strong>apliqueu la mateixa llic&egrave;ncia a qualsevol producte derivat</strong>. Per a m&eacute;s informaci&oacute; llegiu la llic&egrave;ncia i contacteu si us plau directament amb el <a href="http://moodle.org/user/view.php?id=1&amp;course=1">propietari dels drets</a> si teniu cap pregunta.
<p>Moodle &eacute;s un paquet de programari per a creaci&oacute; de cursos basats en internet i llocs web. &Eacute;s un projecte de desenvolupament en marxa, dissenyat per donar suport a un marc educatiu <a href="?file=philosophy.html">construccionista social</a>. </p>
<p>Moodle es distribueix lliurement com a programari de <a href="http://www.opensource.org/docs/definition_plain.html" target="_top">codi font obert</a> (sota la <a href="http://www.gnu.org/copyleft/gpl.html" target="_top">Llic&egrave;ncia P&uacute;blica GNU</a>). B&agrave;sicament aix&ograve; significa que Moodle t&eacute; drets d'autor (copyright), per&ograve; l'usuari gaudeix de llibertats addicionals. Se us permet copiar, utilitzar i modificar Moodle sempre que: <strong>faciliteu el codi a altres</strong>; <strong>no modifiqueu o suprimiu la llic&egrave;ncia i el copyright original</strong>, i <strong>apliqueu la mateixa llic&egrave;ncia a qualsevol producte derivat</strong>. Per a m&eacute;s informaci&oacute; llegiu la llic&egrave;ncia i contacteu si us plau directament amb el <a href="http://moodle.org/user/view.php?id=1&amp;course=1">propietari dels drets</a> si teniu cap pregunta.
</p>
<p>Moodle funcionar&agrave; en qualsevol ordinador que pugui executar <a href="http://www.php.net/" target="_top">PHP</a> i &eacute;s compatible amb molts tipus de bases de dades (particularment <a href="http://www.mysql.com/" target="_top">MySQL</a>).</p>
<p>El mot Moodle era originalment un acr&ograve;nim de Modular Object-Oriented Dynamic Learning Environment (Entorn d'Aprenentatge Din&agrave;mic i Modular Orientat a l'Objecte), cosa que &eacute;s &uacute;til principalment a programadors i te&ograve;rics de l'educaci&oacute;. Tamb&eacute; &eacute;s un verb que descriu el proc&eacute;s de vagarejar ociosament, fent les coses a mesura que se us acudeixen: una manera de divertir-se joguinejant que tot sovint porta noves percepcions i creativitat. S'aplica, aix&iacute;, tant a l'estil de desenvolupament de Moodle com a una possible manera d'apropar-se l'estudiant a l'aprenentatge, o el professor a l'ensenyament, en un curs en l&iacute;nia. Aquell qui fa servir Moodle &eacute;s un Moodler.</p>
@@ -22,7 +22,7 @@
</blockquote>
<p><br>
</p>
<p align="CENTER"><font size="1"><a href="." target="_top">Documentaci&oacute; de Moodle</a></font></p>
<p align="CENTER"><font size="1"><a href="." target="_top">Documentaci de Moodle</a></font></p>
<p align="CENTER"><font size="1">Version: $Id$</font></p>
</body>
</html>
</html>
-5
View File
@@ -1,5 +0,0 @@
<?php
$string['enrolname'] = "Fitxer de text";
$string['filelockedmailsubject'] = "Error important: fitxer d'inscripcions";
$string['filelockedmail'] = "El procés del cron no pot suprimir el fitxer de text que esteu utilitzant per a les inscripcions (\$a). Generalment això és degut a un error de permisos. Corregiu els permisos per tal que Moodle pugui suprimir el fitxer, o si no es podria tornar a processar repetidament.";
?>
-6
View File
@@ -1,6 +0,0 @@
<?php
$string['enrolname'] = "Intern";
?>
+3 -4
View File
@@ -1,5 +1,5 @@
<?PHP // $Id$
// glossary.php - created with Moodle 1.4 development (2004070800)
// glossary.php - created with Moodle 1.3 (2004052500)
$string['addcomment'] = 'Afegeix un comentari';
@@ -23,7 +23,7 @@ $string['back'] = 'Enrere';
$string['cantinsertcat'] = 'No s\'ha pogut inserir la categoria';
$string['cantinsertrec'] = 'No s\'ha pogut inserir el registre';
$string['cantinsertrel'] = 'No s\'ha pogut inserir la relació categoria-entrada';
$string['casesensitive'] = 'Distingeix majúscules i minúscules';
$string['casesensitive'] = 'Aquesta entrada distingeix entre majúscules i minúscules';
$string['categories'] = 'Categories';
$string['category'] = 'Categoria';
$string['categorydeleted'] = 'La categoria s\'ha suprimit';
@@ -99,8 +99,7 @@ $string['exporttomainglossary'] = 'Exporta al glossari principal';
$string['filetoimport'] = 'Fitxer per importar';
$string['fillfields'] = 'El concepte i la definició són camps obligatoris.';
$string['filtername'] = 'Enllaços automàtics al glossari';
$string['fullmatch'] = 'Enllaça només paraules completes';
$string['globalglossary'] = 'Glossari global';
$string['fullmatch'] = 'Relaciona només les paraules completes';
$string['glossaryleveldefaultsettings'] = 'Paràmetres per defecte al nivell de glossari';
$string['glossarytype'] = 'Tipus de glossari';
$string['glosssaryexported'] = 'S\'ha exportat el glossari.';
+24 -24
View File
@@ -1,40 +1,40 @@
<?PHP // $Id$
// lesson.php - created with Moodle 1.4 development (2004062600)
// lesson.php - created with Moodle 1.3 development (2004041800)
$string['actionaftercorrectanswer'] = 'Acció després d\'una resposta correcta';
$string['addabranchtable'] = 'Afegeix una taula de ramificació';
$string['addanendofbranch'] = 'Afegeix un final de ramificació';
$string['addaquestionpage'] = 'Afegeix una pàgina de pregunta';
$string['addabranchtable'] = 'Afegeix una Taula de secció';
$string['addanendofbranch'] = 'Afegeix un Fi de secció';
$string['addaquestionpage'] = 'Afegeix una Pàgina de pregunta';
$string['answer'] = 'Resposta';
$string['answersfornumerical'] = 'Les respostes de les preguntes numèriques haurien de ser parells de valors mínims i màxims ';
$string['answersfornumerical'] = 'Per a les respostes de les preguntes Numèriques haurien d\'aparellar-se els valors Mínims i Màxims ';
$string['attempt'] = 'Intent: $a';
$string['attempts'] = 'Intents';
$string['available'] = 'Disponible des de';
$string['branchtable'] = 'Taula de ramificació';
$string['canretake'] = '$a es pot repetir';
$string['branchtable'] = 'Taula de secció';
$string['canretake'] = 'Es pot repetir';
$string['casesensitive'] = 'Majúscules i minúscules';
$string['checkbranchtable'] = 'Comprova la taula de ramificació';
$string['checkbranchtable'] = 'Comprova la Taula de secció';
$string['checknavigation'] = 'Comprova la navegació';
$string['checkquestion'] = 'Comprova la pregunta';
$string['confirmdeletionofthispage'] = 'Confirma la supressió d\'aquesta pàgina';
$string['congratulations'] = 'Felicitacions: heu arribat al final de la lliçó';
$string['congratulations'] = 'Felicitacions - heu arribat a la fi de la lliçó';
$string['continue'] = 'Continua';
$string['deadline'] = 'Data límit';
$string['deleting'] = 'S\'està suprimint';
$string['deletingpage'] = 'S\'està suprimint la pàgina: $a';
$string['description'] = 'Descripció';
$string['displayofgrade'] = 'Visualització de la qualificació (només estudiants)';
$string['endofbranch'] = 'Final de la ramificació';
$string['endoflesson'] = 'Final de la lliçó';
$string['displayofgrade'] = 'Visualització de la nota (pels estudiants)';
$string['endofbranch'] = 'Fi de la secció';
$string['endoflesson'] = 'Fi de la lliçó';
$string['fileformat'] = 'Format de fitxer';
$string['firstanswershould'] = 'La primera resposta hauria de saltar a la pàgina \"Correcta\"';
$string['gradeis'] = 'La qualificació és $a';
$string['firstanswershould'] = 'La primera resposta hauria de saltar a la pàgina &quot;Correct&quot';
$string['gradeis'] = 'La nota és $a';
$string['handlingofretakes'] = 'Gestió de les repeticions';
$string['here'] = 'aquí';
$string['importquestions'] = 'Importa preguntes';
$string['jump'] = 'Salt';
$string['maximumnumberofanswersbranches'] = 'Nombre màxim de respostes/ramificacions';
$string['jump'] = 'Salta';
$string['maximumnumberofanswersbranches'] = 'Nombre màxim de respostes/secció';
$string['maximumnumberofattempts'] = 'Nombre màxim d\'intents';
$string['minimumnumberofquestions'] = 'Nombre màxim de preguntes';
$string['modulename'] = 'Lliçó';
@@ -43,11 +43,11 @@ $string['movepagehere'] = 'Mou la p
$string['moving'] = 'S\'està movent la pàgina: $a';
$string['movingtonextpage'] = 'S\'està movent a la pàgina següent';
$string['multianswer'] = 'Multiresposta';
$string['multipleanswer'] = 'Múltiples respostes';
$string['multipleanswer'] = 'Respostes diverses';
$string['nextpage'] = 'Pàgina següent';
$string['noanswer'] = 'No s\'ha donat cap resposta';
$string['noattemptrecordsfound'] = 'No s\'ha trobat cap registre d\'intents: no hi ha qualificació.';
$string['normal'] = 'Normal: segueix el camí de la lliçó';
$string['noattemptrecordsfound'] = 'No s\'han trobat cap registre d\'intents: no hi ha nota';
$string['normal'] = 'Normal - segueix el camí de la Lliçó';
$string['notdefined'] = 'No està definit';
$string['notitle'] = 'Sense títol';
$string['numberofcorrectanswers'] = 'Nombre de respostes correctes: $a';
@@ -63,13 +63,13 @@ $string['pagetitle'] = 'T
$string['pleasecheckoneanswer'] = 'Si us plau, marqueu una resposta';
$string['pleasecheckoneormoreanswers'] = 'Si us plau, marqueu una o més respostes';
$string['pleaseenteryouranswerinthebox'] = 'Si us plau, introduïu la resposta al quadre';
$string['pleasematchtheabovepairs'] = 'Si us plau, relacioneu les parelles de dalt';
$string['pleasematchtheabovepairs'] = 'Si us plau, relaciona les parelles de dalt';
$string['questionoption'] = 'Opció de pregunta';
$string['questiontype'] = 'Tipus de pregunta';
$string['reached'] = 'S\'ha aconseguit';
$string['redisplaypage'] = 'Torna a mostrar la pàgina';
$string['response'] = 'Reacció';
$string['sanitycheckfailed'] = 'La comprovació ha fallat: S\'ha suprimit aquest intent.';
$string['response'] = 'Resposta del sistema';
$string['sanitycheckfailed'] = 'La comprovació ha fallat: aquest intent s\'ha suprimit';
$string['savepage'] = 'Desa la pàgina';
$string['showanunansweredpage'] = 'Mostra una pàgina no contestada';
$string['showanunseenpage'] = 'Mostra una pàgina no vista';
@@ -79,11 +79,11 @@ $string['thatsthewronganswer'] = 'Aquesta resposta
$string['thefollowingpagesjumptothispage'] = 'Les pàgines següents salten a aquesta pàgina';
$string['thispage'] = 'Aquesta pàgina';
$string['useeditor'] = 'Utilitza l\'editor';
$string['usemaximum'] = 'Utilitza la màxima';
$string['usemaximum'] = 'Utilitza el màxim';
$string['usemean'] = 'Utilitza la mitjana';
$string['youhaveseen'] = 'Ja heu vist més d\'una pàgina d\'aquesta lliçó.<br /> Voleu començar a la darrera pàgina que vau veure?';
$string['youranswer'] = 'La vostra resposta';
$string['yourcurrentgradeis'] = 'La vostra puntuació actual és $a';
$string['youshouldview'] = 'Hauríeu de veure almenys: $a';
$string['youshouldview'] = 'Hauríeu de veure almenys $a';
?>
+2 -8
View File
@@ -1,5 +1,5 @@
<?PHP // $Id$
// quiz.php - created with Moodle 1.4 development (2004070800)
// quiz.php - created with Moodle 1.4 development (2004062600)
$string['acceptederror'] = 'Error acceptat';
@@ -8,7 +8,7 @@ $string['addquestions'] = 'Afegeix preguntes';
$string['addquestionstoquiz'] = 'Afegeix preguntes al qüestionari actual';
$string['addselectedtoquiz'] = 'Afegeix la selecció al qüestionari';
$string['aiken'] = 'Format Aiken';
$string['allowreview'] = 'Permet la revisió';
$string['allowreview'] = 'Permeteu la revisió';
$string['alreadysubmitted'] = 'Sembla que ja heu tramès aquest intent';
$string['alwaysavailable'] = 'Disponible sempre';
$string['answer'] = 'Resposta';
@@ -77,7 +77,6 @@ $string['editquestions'] = 'Edita preguntes';
$string['errorsdetected'] = 'S\'ha(n) detectat $a error(s)';
$string['exportfilename'] = 'quiz';
$string['exportname'] = 'Nom del fitxer';
$string['exportnameformat'] = '%%Y%%m%%d-%%H%%M';
$string['exportquestions'] = 'Exporta preguntes en un fitxer';
$string['false'] = 'Fals';
$string['feedback'] = 'Retroacció';
@@ -129,7 +128,6 @@ $string['notenoughsubquestions'] = 'No heu definit prou subpreguntes!<br />
Voleu tornar enrere i arreglar aquesta pregunta?';
$string['numerical'] = 'Numèrica';
$string['paragraphquestion'] = 'Tipus de pregunta no compatible: pregunta de paràgraf a la línia $a. Aquesta pregunta s\'ha ignorat.';
$string['passworderror'] = 'La contrasenya és incorrecta';
$string['percentcorrect'] = 'El percentatge és correcte';
$string['publish'] = 'Publica';
$string['publishedit'] = 'Heu de tenir permisos en el curs per afegir o editar preguntes d\'aquesta categoria';
@@ -168,9 +166,6 @@ $string['reportmulti_resp'] = 'Respostes individuals';
$string['reportoverview'] = 'Visió de conjunt';
$string['reportregrade'] = 'S\'han recalculat les qualificacions';
$string['reportsimplestat'] = 'Estadística simple';
$string['requirepassword'] = 'Demana contrasenya';
$string['requirepasswordmessage'] = 'Per realitzar aquest qüestionari heu de saber la contrasenya';
$string['requiresubnet'] = 'Restringeix adreces';
$string['review'] = 'Revisió';
$string['save'] = 'Desa';
$string['savegrades'] = 'Desa les qualificacions';
@@ -186,7 +181,6 @@ $string['showcorrectanswer'] = 'Voleu incloure la resposta correcta en la retroa
$string['showfeedback'] = 'Voleu mostrar la retroacció al final?';
$string['shuffleanswers'] = 'Barreja respostes';
$string['shufflequestions'] = 'Barreja preguntes';
$string['subneterror'] = 'Aquest qüestionari ha estat bloquejat i només és accessible des de certes ubicacions. A hores d\'ara el vostre ordinador no és un dels que han estat autoritzats.';
$string['time'] = 'Temps';
$string['timecompleted'] = 'Completat';
$string['timeleft'] = 'Temps restant';
+2 -2
View File
@@ -1,12 +1,12 @@
<?PHP // $Id$
// scorm.php - created with Moodle 1.4 development (2004070800)
// scorm.php - created with Moodle 1.4 development (2004062600)
$string['autocontinue'] = 'Continuació automàtica';
$string['browse'] = 'Explora';
$string['browsed'] = 'Explorat';
$string['browsemode'] = 'Mode d\'exploració';
$string['chooseapacket'] = 'Trieu o actualitzeu un paquet SCORM';
$string['chooseapacket'] = 'Tria o actualitza un paquet SCORM';
$string['completed'] = 'Completat';
$string['coursepacket'] = 'Paquet de curs';
$string['coursestruct'] = 'Estructura del curs';
-10
View File
@@ -1,10 +0,0 @@
<?PHP // $Id$
// block_course_list.php - created with Moodle 1.4 development (2004070800)
$string['allcourses'] = 'Správce vidí v¹echny kurzy';
$string['blockname'] = 'Seznam kurzù';
$string['configadminview'] = 'Viditelnost kurzù pro správce';
$string['owncourses'] = 'Správce vidí své kurzy';
?>
+1 -2
View File
@@ -1,8 +1,7 @@
<?PHP // $Id$
// block_course_summary.php - created with Moodle 1.4 development (2004070800)
// block_course_summary.php - created with Moodle 1.3 (2004052500)
$string['blockname'] = 'Souhrn kurzu';
$string['siteinfo'] = 'Informace o stránkách';
?>
+1 -1
View File
@@ -2,6 +2,6 @@
// block_social_activities.php - created with Moodle 1.3 (2004052500)
$string['blockname'] = 'Spoleèné èinnosti';
$string['blockname'] = 'Èinnosti';
?>
+2 -11
View File
@@ -1,32 +1,23 @@
<?PHP // $Id$
// choice.php - created with Moodle 1.4 development (2004070800)
// choice.php - created with Moodle 1.2 Beta (2004022400)
$string['allowupdate'] = 'Umo¾nit aktualizaci hlasování';
$string['answered'] = 'Zodpovìzeno';
$string['choice'] = 'Hlasování $a';
$string['choiceclose'] = 'A¾ do';
$string['choicename'] = 'Název hlasování';
$string['choiceopen'] = 'Otevøené';
$string['choicetext'] = 'Text hlasování';
$string['modulename'] = 'Hlasování';
$string['modulenameplural'] = 'Hlasování';
$string['mustchooseone'] = 'Pøed ulo¾ením musíte vybrat odpovìï. ®ádné zmìny nebyly ulo¾eny.';
$string['notanswered'] = 'Dosud nezodpovìzeno';
$string['notopenyet'] = 'Je mi líto, tato èinnost není a¾ do $a dostupná';
$string['privacy'] = 'Dùvìrnost výsledkù';
$string['publish'] = 'Zveøejnit výsledky';
$string['publishafteranswer'] = 'Ukázat výsledky studentùm poté, co odpoví';
$string['publishafterclose'] = 'Ukázat výsledky studentùm a¾ po uzavøení hlasování';
$string['publishalways'] = 'V¾dy zobrazovat výsledky studentùm';
$string['publishanonymous'] = 'Zveøejnit výsledky anonymnì, nezobrazovat jména studentù';
$string['publishnames'] = 'Zveøejnit výsledky vèetnì jmen studentù a jejich volby';
$string['publishnot'] = 'Nezobrazovat výsledky studentùm';
$string['responses'] = 'Odpovìdí';
$string['responsesto'] = 'Odpovìdi na $a';
$string['savemychoice'] = 'Ulo¾it mou volbu';
$string['showunanswered'] = 'Zobrazit sloupec ';
$string['timerestrict'] = 'Omezit odpovídání na tuto dobu';
$string['showunanswered'] = 'Zobrazit sloupec \"Dosud nezodpovìzeno\"';
$string['viewallresponses'] = 'Zobrazit $a odpovìdí';
?>
-9
View File
@@ -1,9 +0,0 @@
<?PHP // $Id$
// enrol_flatfile.php - created with Moodle 1.4 development (2004070800)
$string['enrolname'] = 'Ze souboru';
$string['filelockedmail'] = 'Textovy soubor, ktery pouzivate pro zapisy ($a), nemuze byt odstranen procesem cron. Vetsinou je to zpusobeno spatne nastavenymi pravy. Prosim, opravte prava tak, aby mohl Moodle tento soubor odstranit. Jinak muze dochazet k jeho opakovanemu zpracovani.';
$string['filelockedmailsubject'] = 'Dulezita chyba: Soubor se zapisy';
?>
-7
View File
@@ -1,7 +0,0 @@
<?PHP // $Id$
// enrol_internal.php - created with Moodle 1.4 development (2004070800)
$string['enrolname'] = 'Interní zápis';
?>
-8
View File
@@ -1,8 +0,0 @@
<?PHP // $Id$
// enrol_paypal.php - created with Moodle 1.4 development (2004070800)
$string['enrolname'] = 'Platba pøes Paypal';
$string['sendpaymentbutton'] = 'Poslat platbu pøes slu¾bu Paypal';
?>
-19
View File
@@ -1,19 +0,0 @@
Fonty
-----
Tento adresar obsahuje fonty, ktere jsou pouzivany pri
vytvareni obrazku s texty.
Momentalne je pouzivan jediny soubor default.ttf
Pokud zde jazyk neuvadi svuj font, je misto nej pouzit font
/lang/en/fonts/default.ttf
Multibyte retezce potrebuji dekodovat, protoze TrueType
rutiny predpokladaji ISO fonty nebo Unicode retezce.
Pokud zde existuje soubor s nazvem lang_decode.php,
ktery obsahuje funkci lang_decode(), bude tato pouzita
na kazdy retezec.
$Id$
Binary file not shown.
+2 -13
View File
@@ -1,5 +1,5 @@
<?PHP // $Id$
// forum.php - created with Moodle 1.4 development (2004070800)
// forum.php - created with Moodle 1.3 (2004052500)
$string['addanewdiscussion'] = 'Přidat nový příspěvek';
@@ -16,7 +16,6 @@ $string['configenablerssfeeds'] = 'T
$string['configlongpost'] = 'Příspěvek delší než tato vložená hodnota (HTML kód se nepočítá) je považován za dlouhý.';
$string['configmanydiscussions'] = 'Maximální počet diskusí vo fóru zobrazovaný na jedné stránce.';
$string['configmaxbytes'] = 'Výchozí maximální velikost přílohy ve všech fórech na těchto stránkách (může být upravena nastavením kurzu a dalšími lokálními proměnnými)';
$string['configreplytouser'] = 'Když je příspěvek odesílán odběratelům, má email v poli Od: obsahovat adresu autora příspěvku? Příjemce tak může odpovídat přímo autorovi emailem a ne přes diskusní fórum. I když je zde zvolena hodnota \'Ano\', uživatelé si mohou ve svých profilech nastavit skrývání svém emailové adresy.';
$string['configshortpost'] = 'Příspěvek kratší než tato vložená hodnota (HTML kód se nepočítá) je považován za krátký.';
$string['couldnotadd'] = 'Neznámá chyba! Nemohu přidat váš příspěvek';
$string['couldnotdeleteratings'] = 'Je mi líto, již ohodnocený příspěvek nemůže být odstraněn';
@@ -26,13 +25,8 @@ $string['delete'] = 'Odstranit';
$string['deleteddiscussion'] = 'Téma diskuse bylo odstraněno';
$string['deletedpost'] = 'Příspěvek byl odstraněn';
$string['deletesure'] = 'Jste si jistí, že chcete odstranit tento příspěvek?';
$string['digestmailheader'] = 'Toto je vas denni souhrn novych prispevku v diskusich na strankach $a->sitename. Chcete-li zmenit nastaveni techto odberu, jdete na $a->userprefs.';
$string['digestmailprefs'] = 'vas uzivatelsky profil';
$string['digestmailsubject'] = '$a: souhrn novych prispevku';
$string['digestsentusers'] = 'Souhrnné emaily úspěšně zaslány $a uživatelům.';
$string['discussion'] = 'Diskuse';
$string['discussionmoved'] = 'Tato diskuse byla přesunuta do \'$a\'.';
$string['discussionname'] = 'Název diskuse';
$string['discussions'] = 'Diskuse';
$string['discussionsstartedby'] = 'Diskusi zahájil(a) $a';
$string['discussionsstartedbyrecent'] = 'Diskusi právě zahájil(a) $a';
@@ -70,7 +64,7 @@ $string['modulenameplural'] = 'F
$string['more'] = 'více';
$string['movethisdiscussionto'] = 'Přesunout tuto diskusi do ...';
$string['namenews'] = 'Novinky';
$string['namesocial'] = 'Společné fórum';
$string['namesocial'] = 'Společenské fórum';
$string['nameteacher'] = 'Učitelské fórum';
$string['newforumposts'] = 'Nové příspěvky';
$string['nodiscussions'] = 'V tomto fóru zatím nejsou žádná témata diskuse';
@@ -98,13 +92,8 @@ $string['postrating1'] = 'Vykazuje zejm
$string['postrating2'] = 'Rovnoměrně samostatné i kolektivní';
$string['postrating3'] = 'Vykazuje zejména KOLEKTIVNÍ poznávání';
$string['posts'] = 'Příspěvky';
$string['posttoforum'] = 'Poslat do fóra';
$string['postupdated'] = 'Váš příspěvek byl aktualizován';
$string['processingdigest'] = 'Zpracovávám souhrnný email pro uživatele $a';
$string['processingpost'] = 'Zpracovávám příspěvek $a';
$string['prune'] = 'Oddělit';
$string['prunedpost'] = 'Z příspěvku byla vytvořena nová diskuse';
$string['pruneheading'] = 'Oddělit a přesunout tento příspěvek do nové diskuse.';
$string['rate'] = 'Hodnotit';
$string['rating'] = 'Hodnocení';
$string['ratingeveryone'] = 'Kdokoliv může hodnotit příspěvky';
+2 -2
View File
@@ -15,10 +15,10 @@ Tato t
určovat žádné datumy.
</UL>
<P><B>Diskusní uspořádání</B></P>
<P><B>Společenské uspořádání</B></P>
<UL>
Toto uspořádání je zaměřeno na jedno hlavní diskusní fórum -
"Společné fórum", které se objevuje v seznamu na hlavní stránce.
"Společenské fórum", které se objevuje v seznamu na hlavní stránce.
Toto uspořádání je vhodné pro volnější kurzy bez pevné organizace.
Dokonce se nemusí jednat ani o kurzy, ale například o školní či třídní
nástěnku.
+6 -28
View File
@@ -1,5 +1,5 @@
<?PHP // $Id$
// moodle.php - created with Moodle 1.4 development (2004070800)
// moodle.php - created with Moodle 1.3 (2004052500)
$string['action'] = 'Akce';
@@ -40,7 +40,6 @@ $string['adminhelpconfiguration'] = 'Nastavte, jak budou str
$string['adminhelpconfigvariables'] = 'Nastavte proměnné, které ovlivňují obecné fungování těchto stránek';
$string['adminhelpcourses'] = 'Nadefinujte kurzy a jejich kategorie a přiřaďte k nim učitele.';
$string['adminhelpedituser'] = 'Projděte seznam uživatelských účtů a kterýkoliv z nich upravte';
$string['adminhelpenrolments'] = 'Vyberte interní nebo externí způsob řízení zápisů do kurzů';
$string['adminhelplanguage'] = 'Kontrola a úprava stávajícího jazyka';
$string['adminhelplogs'] = 'Procházet protokoly aktivit na těchto stránkách';
$string['adminhelpmanageblocks'] = 'Správa instalovaných bloků a jejich nastavení';
@@ -57,7 +56,7 @@ $string['administrator'] = 'Spr
$string['administrators'] = 'Správci';
$string['advancedfilter'] = 'Pokročilý filtr';
$string['again'] = 'znovu';
$string['all'] = 'Vše';
$string['all'] = 'Všechny';
$string['allactivities'] = 'Všechny činnosti';
$string['alldays'] = 'Všechny dny';
$string['allfieldsrequired'] = 'Všechna pole jsou požadována';
@@ -71,7 +70,7 @@ $string['alphabet'] = 'A,
$string['alphanumerical'] = 'Může obsahovat jen znaky abecedy a číslice';
$string['alreadyconfirmed'] = 'Registrace již byla potvrzena';
$string['always'] = 'Vždy';
$string['answer'] = 'Odpověď';
$string['answer'] = 'Odpovědět';
$string['areyousuretorestorethis'] = 'Přejete si pokračovat?';
$string['areyousuretorestorethisinfo'] = 'Budete moci přidat tuto zálohu k již existujícímu kurzu nebo z ní vytvořit nový kurz.';
$string['assessment'] = 'Hodnocení';
@@ -140,12 +139,10 @@ $string['closewindow'] = 'Zav
$string['comparelanguage'] = 'Porovnat a upravit současný jazyk';
$string['complete'] = 'Podrobný';
$string['configallowunenroll'] = 'Je-li toto nastaveno na \'Ano\', mohou se studenti sami vyškrtávat z kurzů. Jinak je může z kurzu vyškrtnout toliko učitel nebo správce.';
$string['configautologinguests'] = 'Mají být návštěvníci vašich stránek automaticky přihlášeni jako hosté, když vstupují do kurzů, které umožńují hostům vstup?';
$string['configcachetext'] = 'Na větších stránkách nebo na stránkách, které používají textové filtry, může toto nastavení provoz stránek výrazně urychlit. Po dobu určenou zde zůstane zpracovaný text v mezipaměti a bude okamžitě použit. Nastavení příliš malé hodnoty může zobrazování stránek trochu zpomalit, nastavení příliš velké hodnoty zase způsobí, že obnovení textu (např. nové odkazy apod.) se projeví až po delší době.';
$string['configcountry'] = 'Pokud zde nastavíte zemi, pak bude přednastavená pro všechny nové uživatele. Zůstane-li toto pole prázdné, bude nutné nastavit zemi u každého nového uživatele.';
$string['configdebug'] = 'Při zapnutí dojde ke zvýšení vlastnosti PHP \'error_reporting\' a bude zobrazováno více varování. Užitečné hlavně pro vývojáře.';
$string['configdeleteunconfirmed'] = 'Používáte-li ověřování emailem, nastavíte tímto dobu, po kterou se bude čekat na potvrzení registrace. Po uplynutí této doby budou nepotvrzené žádosti o založení účtu odstraněny.';
$string['configdigestmailtime'] = 'Lidem, kteří si nastaví souhrnné odebírání novinek emailem, bude tento souhrn odesílán každý den. Tímto nastavujete, v kolik hodin budou tyto souhrnné emaily odesílány (první cron, který se spouští po této hodině, emaily odešle).';
$string['configenablerssfeeds'] = 'Tímto nastavením povolujete funkce RSS kanálů napříč celou instalací Moodle. Stále ještě musíte povolit funkce RSS u jednotlivých modulů v nabídce Správa modulů na stránce Správa.';
$string['configenablerssfeedsdisabled'] = 'Toto nastavení není dostupné, protože funkce RSS kanálů byly na těchto stránkách zakázány. Chcete-li je povolit, jděte do nabídky Proměnné na stránce Správa.';
$string['configerrorlevel'] = 'Vyberte množství zobrazovaných varování PHP. Většinou je nejlepší volbou \'Normální\'.';
@@ -170,7 +167,6 @@ $string['configloglifetime'] = 'Toto ur
$string['configlongtimenosee'] = 'Pokud se studenti nepřihlásí po velmi dlouhou dobu, jsou automaticky vyškrtnuti z kurzů. Tento parametr určuje maximální možnou dobu, po kterou se student nemusí přihlásit.';
$string['configmaxbytes'] = 'Toto určuje maximální možnou velikost souborů nahrávaných uploadem na tyto stránky. Toto nastavení je limitováno PHP proměnnou upload_max_filesize a nastavením Apache LimitRequestBody. Na druhou stranu toto nastavení limituje velikosti, které lze nastavit na úrovni kurzů nebo modulů.';
$string['configmaxeditingtime'] = 'Kolik času mají uživatelé na opravu odeslaných příspěvků. Doporučujeme nastavit 30 minut.';
$string['confignoreplyaddress'] = 'Emaily jsou někdy zasílány pod něčím jménem (např. příspěvky ve fórech). V případech, kdy by se na email nemělo odpovídat přímo odesilateli (např. protože nechce zveřejňovat svou adresu), bude použita jako adresa odesílatele (adresa Od:) adresa zde uvedená.';
$string['configopentogoogle'] = 'Povolíte-li toto nastavení, umožníte vyhledávači Google, aby vstoupil na vaše stránky jako host. Navíc lidé, kteří se k vám dostanou přes vyhledávání v Google, budou automaticky přihlášení jako host. Povšimněte si, že toto umožní transparentní přístup pouze do kurzů, které mají povolen vstup hostů.';
$string['configproxyhost'] = 'Pokud tento <B>server</B> používá proxy (např. firewall) pro připojení k Internetu, zadejte hostname a port proxy. Jinak nechejte pole prázdné.';
$string['configsecureforms'] = 'Moodle může používat vyšší úroveň zabezpečení při přijímání údajů z webových formulářů. Je-li tato volba povolena, pak je proměnná prohlížeče HTTP_REFERER ověřována proti aktuální adrese formuláře. V několika málo případech však toto může způsobovat problémy, zejména používá-li uživatel firewall (např. Zonealarm) nastavený tak, aby proměnnou HTTP_REFERER z webového provozu odřízl. Příznakem tohoto jsou problémy s formuláři. Pokud tedy uživatelé mají problém například na přihlašovací stránce, možná budete chtít tuto metodu zakázat a tím ulehčit práci případným útokům na hesla uživatelů (brute-force password attacks). Jste-li na pochybách, ponechejte zde hodnotu \'Ano\'.';
@@ -190,14 +186,12 @@ $string['confirm'] = 'Potvrzen
$string['confirmed'] = 'Vaše registrace byla potvrzena';
$string['confirmednot'] = 'Vaše registrace ještě nebyla potvrzena!';
$string['continue'] = 'Pokračovat';
$string['continuetocourse'] = 'Klikněte zde pro vstup do kurzu';
$string['cookiesenabled'] = 'Musíte povolit \'cookies\' ve vašem prohlížeči';
$string['copy'] = 'kopie';
$string['copyingcoursefiles'] = 'Kopíruji soubory kurzu';
$string['copyinguserfiles'] = 'Kopíruji soubory uživatele';
$string['copyingzipfile'] = 'Kopíruji ZIP soubor';
$string['copyrightnotice'] = 'Autorská práva';
$string['cost'] = 'Cena';
$string['country'] = 'Země';
$string['course'] = 'Kurz';
$string['courseavailable'] = 'Tento kurz je studentům dostupný';
@@ -285,9 +279,6 @@ $string['down'] = 'Dol
$string['downloadexcel'] = 'Stáhnout ve formátu Excel';
$string['downloadtext'] = 'Stáhnout v textovém formátu';
$string['doyouagree'] = 'Přečetli jste si tyto podmínky a rozuměli jim?';
$string['duplicate'] = 'Duplikovat';
$string['duplicatinga'] = 'Duplikuje se: $a';
$string['duplicatingain'] = 'Duplikuje se $a->what v $a->in';
$string['edit'] = 'Upravit $a';
$string['editcoursesettings'] = 'Upravit nastavení kurzu';
$string['editfiles'] = 'Upravit soubory';
@@ -307,13 +298,9 @@ Na strance \'$a->sitename\' je pozadovano zrizeni noveho uzivatelskeho uctu s va
Potvrdte prosim tuto zadost na teto webove adrese: $a->link
Toto je automaticky generovany email a neni nutne na nej odpovidat jeho odesilateli. Potrebujete-li pomoc, spojte se se spravcem stranek $a->admin';
Potrebujete-li pomoc, spojte se se spravcem stranek $a->admin';
$string['emailconfirmationsubject'] = '$a: potvrzeni uctu';
$string['emailconfirmsent'] = '<P>Na vaši adresu <B>$a</B> byl odeslán email s jednoduchými pokyny k dokončení vaší registrace.<P>Narazíte-li na nějaké obtíže, spojte se se správcem těchto stránek.';
$string['emaildigest'] = 'Typ souhrnných emailů';
$string['emaildigestcomplete'] = 'Kompletní (denně email s plným textem příspěvků)';
$string['emaildigestoff'] = 'Nepoužívat souhrny (jeden email na každý příspěvek)';
$string['emaildigestsubjects'] = 'Předměty (denně email pouze s předměty příspěvků)';
$string['emaildisable'] = 'Zobrazení emailové adresy zakázáno';
$string['emaildisplay'] = 'Zobrazit email';
$string['emaildisplaycourse'] = 'Zobrazovat mou emailovou adresu pouze dalším účastníkům kurzu';
@@ -340,9 +327,6 @@ $string['enrolmentconfirmation'] = 'Chyst
$string['enrolmentkey'] = 'Klíč k zápisu';
$string['enrolmentkeyfrom'] = 'Tento kurz vyžaduje \'klíč k zápisu\' - vstupní<br>heslo, které můžete obdržet od $a';
$string['enrolmentkeyhint'] = 'Tento klíč k zápisu nebyl správný, zkuste to ještě jednou<br>(Napovím vám - klíč začíná na \'$a\')';
$string['enrolmentnew'] = 'Nový zápis v $a';
$string['enrolmentnointernal'] = 'Ruční zápisy nejsou momentálně umožněny.';
$string['enrolments'] = 'Zápisy';
$string['entercourse'] = 'Klikněte pro vstup do kurzu';
$string['enteremailaddress'] = 'Zadejte svou emailovou adresu, na kterou vám bude zasláno nové heslo.';
$string['error'] = 'Chyba';
@@ -666,10 +650,6 @@ Na va
<B>s vaším novým heslem.</B>
<P>
Nové heslo bylo vygenerováno automaticky, takže si jej možná budete chtít <A HREF=$a->link>změnit</A>.';
$string['paymentinstant'] = 'Pomocí následujícího tlačítka můžete provést platbu a během několika minut se zapsat do kurzu!';
$string['paymentrequired'] = 'Tento kurz je placený';
$string['paymentsorry'] = 'Díky za vaši platbu! Naneštěstí však ještě úplně neproběhla a dosud nejste registrováni pro vstup do kurzu \"$a->fullname\". Zkuste ještě chvíli počkat a vstupte do kurzu znovu. Pokud problémy přetrvají, kontaktujte vašeho $a->teacher nebo správce těchto stránek';
$string['paymentthanks'] = 'Díky za vaši platbu! Nyní jste zapsáni do kurzu:<br />\"$a\"';
$string['people'] = 'Osoby';
$string['personalprofile'] = 'Osobní profil';
$string['phone'] = 'Telefon';
@@ -708,7 +688,6 @@ $string['rename'] = 'P
$string['renamefileto'] = 'Přejmenovat <b>$a</b> na';
$string['required'] = 'Vyžadováno';
$string['requireskey'] = 'Tento kutz vyžaduje klíč k zápisu';
$string['requirespayment'] = 'Tento kurz vyžaduje placený přístup';
$string['resortcoursesbyname'] = 'Přeuspořádat kurzy podle jména';
$string['resources'] = 'Zdroje';
$string['restore'] = 'Obnovit';
@@ -770,14 +749,13 @@ $string['sitefiles'] = 'Soubory';
$string['sitelogs'] = 'Protokol stránek';
$string['sitenews'] = 'Novinky stránek';
$string['sites'] = 'Stránky';
$string['sitesection'] = 'Zahrnout úvodní sekci';
$string['sitesettings'] = 'Nastavení stránek';
$string['size'] = 'Velikost';
$string['sizeb'] = 'bytů';
$string['sizegb'] = 'Gb';
$string['sizekb'] = 'Kb';
$string['sizemb'] = 'Mb';
$string['socialheadline'] = 'Společná diskuse - nejnovější témata';
$string['socialheadline'] = 'Společenská diskuse - nejnovější témata';
$string['someallowguest'] = 'Některé kurzy umožňují vstup pro hosty';
$string['someerrorswerefound'] = 'Některé informace chyběly nebo nebyly správné. Podrobnosti uvedeny dále.';
$string['sortby'] = 'Třídit podle';
@@ -847,7 +825,7 @@ $string['update'] = 'Aktualizovat';
$string['updated'] = 'Aktualizováno $a';
$string['updatemyprofile'] = 'Aktualizovat profil';
$string['updatesevery'] = 'Aktualizovat každých $a vteřin';
$string['updatethis'] = 'Aktivita $a - upravit nastavení';
$string['updatethis'] = 'Aktualizovat tento $a';
$string['updatethiscourse'] = 'Aktualizovat tento kurz';
$string['updatinga'] = 'Aktualizuji $a';
$string['updatingain'] = 'Aktualizuji $a->what v $a->in';
+1 -19
View File
@@ -1,5 +1,5 @@
<?PHP // $Id$
// quiz.php - created with Moodle 1.4 development (2004070800)
// quiz.php - created with Moodle 1.3 (2004052500)
$string['acceptederror'] = 'Pøijatelná chyba';
@@ -41,7 +41,6 @@ $string['categorymove'] = 'Kategorie \'$a->name\' obsahuje $a->count
$string['categorymoveto'] = 'Pøesunout je do této kategorie';
$string['choice'] = 'Mo¾nost';
$string['choices'] = 'Mo¾nosti';
$string['confirmstartattempt'] = 'Tento test má èasový limit. Jste si jistí, ¾e chcete teï zaèít?';
$string['correctanswer'] = 'Správná odpovìï';
$string['correctanswers'] = 'Správné odpovìdi';
$string['corrresp'] = 'Správná odezva';
@@ -75,10 +74,6 @@ $string['editingshortanswer'] = '
$string['editingtruefalse'] = 'Úprava - Pravda/Nepravda úloha';
$string['editquestions'] = 'Upravit úlohy';
$string['errorsdetected'] = 'Poèet zji¹tìných chyb: $a';
$string['exportfilename'] = 'test';
$string['exportname'] = 'Jméno souboru';
$string['exportnameformat'] = '%%Y-%%m-%%d-%%H-%%M';
$string['exportquestions'] = 'Exportovat úlohy do souboru';
$string['false'] = 'Nepravda';
$string['feedback'] = 'Vysvìtlení';
$string['fileformat'] = 'Formát souboru';
@@ -102,7 +97,6 @@ $string['listitems'] = 'Seznam polo
$string['marks'] = 'Pokusù';
$string['match'] = 'Pøiøazování';
$string['matchanswer'] = 'Pøiøazená odpovìï';
$string['minutes'] = 'Minuty';
$string['missinganswer'] = 'Na øádku $a je pøíli¹ málo hodnot :ANSWER, :Lx, :Rx. Musíte definovat alespoò dvì mo¾né odpovìdi.';
$string['missingcorrectanswer'] = 'Musíte urèit správnou odpovìï';
$string['missingname'] = 'Chybí název úlohy';
@@ -121,15 +115,12 @@ $string['noquestions'] = 'Zat
$string['noresponse'] = 'Bez odezvy';
$string['noreview'] = 'Není vám dovoleno pøezkou¹et tento test';
$string['noreviewuntil'] = 'Není vám dovoleno pøezkou¹et tento test a¾ do $a';
$string['noscript'] = 'Pro pokraèování musíte povolit JavaScript';
$string['notenoughanswers'] = 'Tento typ úlohy vy¾aduje nejménì $a odpovìdí';
$string['notenoughsubquestions'] = 'Není definováno dost podotázek!<br>Chcete se vrátit zpìt a opravit tuto úlohu?';
$string['numerical'] = 'Numerická úloha';
$string['paragraphquestion'] = 'Odstavcová úloha na øádku $a není podporovaná. Úloha bude ignorována';
$string['passworderror'] = 'Vlo¾ené heslo nebylo správné';
$string['percentcorrect'] = 'Procent správnì';
$string['publish'] = 'Zveøejnit';
$string['publishedit'] = 'Pro úpravu nebo pøidávání v této kategorii musíte mít pøíslu¹ná práva v kurzu, který ji zveøejòuje.';
$string['qti'] = 'Formát IMS QTI';
$string['question'] = 'Úloha';
$string['questioninuse'] = 'Úloha \'$a\' je právì pou¾ívána:';
@@ -143,8 +134,6 @@ $string['quizcloses'] = 'Test se uzav
$string['quiznotavailable'] = 'Test nebude pøístupný a¾ do: $a';
$string['quizopen'] = 'Zpøístupnit test';
$string['quizopens'] = 'Test zpøístupnìn';
$string['quiztimelimit'] = 'Èasový limit: $a';
$string['quiztimer'] = 'Èasomíra';
$string['random'] = 'Náhodnì vybraná úloha';
$string['randomcreate'] = 'Vytvoøit náhodnì vybrané úlohy';
$string['randomsamatch'] = 'Pøiøazování pro náhodnì vybrané úlohy se struènou odpovìdí';
@@ -165,9 +154,6 @@ $string['reportmulti_resp'] = 'Odezvy jednotlivc
$string['reportoverview'] = 'Pøehled';
$string['reportregrade'] = 'Pøebodovat pokusy';
$string['reportsimplestat'] = 'Jednoduchá statistika';
$string['requirepassword'] = 'Vy¾aduje heslo';
$string['requirepasswordmessage'] = 'Potøebujete znát heslo k tomuto testu, abyste se jej mohli pokusit absolvovat.';
$string['requiresubnet'] = 'Vy¾aduje sí»ovou adresu';
$string['review'] = 'Revize';
$string['save'] = 'Ulo¾it';
$string['savegrades'] = 'Ulo¾it obodování';
@@ -183,12 +169,8 @@ $string['showcorrectanswer'] = 'Uk
$string['showfeedback'] = 'Ukázat hodnocení po odpovìdi?';
$string['shuffleanswers'] = 'Zamíchat odpovìdi';
$string['shufflequestions'] = 'Zamíchat úlohy';
$string['subneterror'] = 'Je mi líto, ale tento test byl nastaven tak, aby k nìmu bylo mo¾né pøistupovat jen z nìkterých poèítaèù. Momentálnì sedíte u poèítaèe mimo tuto dovolenou oblast.';
$string['time'] = 'Èas';
$string['timecompleted'] = 'Hotovo';
$string['timeleft'] = 'Zbývající èas';
$string['timelimit'] = 'Èasový limit';
$string['timesup'] = 'Èas vypr¹el!';
$string['timetaken'] = 'Uplynulý èas';
$string['toomanyrandom'] = 'Poèet po¾adovaných náhodných úloh je vìt¹í, ne¾ kolik jich tato kategorie obsahuje! ($a)';
$string['true'] = 'Pravda';
+1 -5
View File
@@ -1,5 +1,5 @@
<?PHP // $Id$
// scorm.php - created with Moodle 1.4 development (2004070800)
// scorm.php - created with Moodle 1.3 (2004052500)
$string['autocontinue'] = 'Automatické pokraèování';
@@ -8,10 +8,6 @@ $string['browsed'] = 'Proch
$string['browsemode'] = 'Re¾im procházení';
$string['chooseapacket'] = 'Vybrat nebo aktualizovat balík SCORM';
$string['completed'] = 'Dokonèeno';
$string['configframesize'] = 'Velikost horního rámce s navigací v pixelech pøi procházení balíkem SCORM.';
$string['configpopup'] = 'Má být pøi pøidávání nového balíku SCORM, který mù¾e být otevírán v novém popup oknì, tato mo¾nost implicitnì povolena?';
$string['configpopupheight'] = 'Jaká má být implicitní vý¹ka nových popup oken';
$string['configpopupresizable'] = 'Mají mít popup okna implicitnì promìnnou velikost?';
$string['coursepacket'] = 'Balík kurzu';
$string['coursestruct'] = 'Struktura kurzu';
$string['datadir'] = 'Chyba souborového systému: Nelze vytvoøit adresáø s daty kurzu';

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