Index: lang/en_utf8/block_glossary_random.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lang/en_utf8/block_glossary_random.php,v
retrieving revision 1.2.8.1
diff -u -r1.2.8.1 block_glossary_random.php
--- lang/en_utf8/block_glossary_random.php 25 Jun 2008 03:01:50 -0000 1.2.8.1
+++ lang/en_utf8/block_glossary_random.php 19 Aug 2009 13:10:55 -0000
@@ -10,7 +10,8 @@
$string['intro'] = 'Make sure you have at least one glossary with at least one entry added to this course. Then you can adjust the following settings';
$string['invisible'] = '(to be continued)';
$string['lastmodified'] = 'Last modified entry';
-$string['nextone'] = 'Next entry';
+$string['nextone'] = 'Next entry (sort by date)';
+$string['nextonealphabetical'] = 'Next entry (sort by alphabet)';
$string['noentriesyet'] = 'There are no entries yet in the chosen glossary.';
$string['notyetconfigured'] = 'Please configure this block using the edit icon.';
$string['notyetglossary'] = 'You need to have at least one glossary to choose.';
Index: blocks/glossary_random/block_glossary_random.php
===================================================================
RCS file: /cvsroot/moodle/moodle/blocks/glossary_random/block_glossary_random.php,v
retrieving revision 1.20.6.6
diff -u -r1.20.6.6 block_glossary_random.php
--- blocks/glossary_random/block_glossary_random.php 27 Apr 2008 01:55:49 -0000 1.20.6.6
+++ blocks/glossary_random/block_glossary_random.php 19 Aug 2009 13:10:55 -0000
@@ -3,6 +3,7 @@
define('BGR_RANDOMLY', '0');
define('BGR_LASTMODIFIED', '1');
define('BGR_NEXTONE', '2');
+define('BGR_NEXTONE_ALPHABETICAL', '3');
class block_glossary_random extends block_base {
function init() {
@@ -43,9 +44,11 @@
$limitfrom = 0;
$limitnum = 1;
+ $ORDER = 'timemodified';
switch ($this->config->type) {
+
case BGR_RANDOMLY:
$i = rand(1,$numberofentries);
$limitfrom = $i-1;
@@ -53,6 +56,7 @@
break;
case BGR_NEXTONE:
+ case BGR_NEXTONE_ALPHABETICAL:
if (isset($this->config->previous)) {
$i = $this->config->previous + 1;
} else {
@@ -63,8 +67,11 @@
}
$limitfrom = $i-1;
$SORT = 'ASC';
+
+ case BGR_NEXTONE_ALPHABETICAL:
+ $ORDER = 'concept';
break;
-
+
default: // BGR_LASTMODIFIED
$i = $numberofentries;
$limitfrom = 0;
@@ -76,7 +83,7 @@
' FROM '.$CFG->prefix.'glossary_entries'.
' WHERE glossaryid = '.$this->config->glossary.
' AND approved = 1 '.
- 'ORDER BY timemodified '.$SORT, $limitfrom, $limitnum)) {
+ 'ORDER BY '.$ORDER.' '.$SORT, $limitfrom, $limitnum)) {
$entry = reset($entry);
@@ -136,6 +143,7 @@
$type[0] = get_string('random','block_glossary_random');
$type[1] = get_string('lastmodified','block_glossary_random');
$type[2] = get_string('nextone','block_glossary_random');
+ $type[3] = get_string('nextonealphabetical','block_glossary_random');
$this->config->nexttime = usergetmidnight(time()) + DAYSECS * $this->config->refresh;
Index: lang/en_utf8/help/glossary/newentry.html
===================================================================
RCS file: /cvsroot/moodle/moodle/lang/en_utf8/help/glossary/newentry.html,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 newentry.html
--- lang/en_utf8/help/glossary/newentry.html 25 Jun 2008 03:01:50 -0000 1.1.2.1
+++ lang/en_utf8/help/glossary/newentry.html 19 Aug 2009 13:10:55 -0000
@@ -1,5 +1,7 @@
Last modified entry will always display the entry that was last modified,
and Random entry will choose a new one at random every time. The option
-Next entry will cycle through the entries in order. This last option is
-especially useful when a number of days is also chosen, allowing you to make a
+Next entry (sort by date) will cycle through the entries in the order that
+they were entered in the glossary. The option
+Next entry (sort by alphabet) will cycle through the entries in alphabetical order.
+These last two options are especially useful when a number of days is also chosen, allowing you to make a
Quote of the week or a Tip of the day that everyone sees.