Permalink
Browse files

- Corrections in EN language. Thanks to Przemek!

- Added a "All categories" link to the category drop-down box in Category view.
- Better display of categorized entries (more organized).
- SelectLetter, Special and All captions are now properly showed when some of the their flags are not set.
- Properly use of course module visibility (in case someone directly access the URL)
  • Loading branch information...
willcast
willcast committed Sep 23, 2003
1 parent a1f8ff8 commit 914cb260dc0a5271ac2c019fc147d02dc6f0f584
View
@@ -23,27 +23,29 @@
$string['displayformatdefault'] = "Simple, dictionary style";
$string['displayformat1'] = "Full without author.";
$string['displayformat2'] = "Full with author.";
+$string['editentry'] = "Edit entry";
+$string['editcategories'] = "Edit categories";
$string['entries'] = "Entries";
$string['entrieswithoutcategory'] = "Entries without category";
$string['entry'] = "Entry";
-$string['editentry'] = "Edit entry";
-$string['editcategories'] = "Edit categories";
-$string['entryalreadyexist'] = "Entry already exist.";
+$string['entryalreadyexist'] = "Entry already exists.";
$string['entrydeleted'] = "Entry deleted.";
$string['entryexported'] = "Entry succesfully exported.";
+$string['explainspecial'] = "<b>Special</b> will show all concepts that do not begin with a letter.<br>";
+$string['explainalphabet'] = "Select the letter you want to look for.<p>";
+$string['explainall'] = "<b>ALL</b> will show all entries in one page.";
$string['exporttomainglossary'] = "Export to main glossary";
$string['glossarytype'] = "Glossary Type";
$string['mainglossary'] = "Main glossary";
$string['modulename'] = "Glossary";
$string['modulenameplural'] = "Glossaries";
$string['newglossaryentries'] = "New glossary entries:";
-$string['nocategorized'] = "No categorized";
+$string['nocategorized'] = "Not categorized";
$string['noentries'] = "No entries found in this section";
$string['noentry'] = "No entry found.";
$string['searchconcept'] = "Search:";
$string['searchindefinition'] = "Search in concept AND definitions?";
-$string['secundaryglossary'] = "Secundary glossary";
-$string['selectletter'] = "Select the letter you want to look for.<p><b>Special</b> will show all concepts that does not begin with a letter.<br><b>ALL</b> will show all entries in one page.";
+$string['secundaryglossary'] = "Secondary glossary";
$string['showspecial'] = "Show 'Special' link";
$string['showalphabet'] = "Show alphabet";
$string['showall'] = "Show 'ALL' link";
@@ -53,4 +55,3 @@
$string['writtenby'] = "By";
?>
-
@@ -1,4 +1,4 @@
-<P ALIGN=CENTER><B>Allow duplicated entries</B></P>
-
-<P>You can specify if the system should or should not accept duplicated entries in the current glossary.
-
+<P ALIGN=CENTER><B>Allow duplicated entries</B></P>
+
+<P>You can specify if the system should or should not accept duplicated entries in the current glossary.
+
@@ -1,10 +1,10 @@
-<P ALIGN=CENTER><B>Display format</B></P>
-
-<P>The system has three builed-in formats to display entries. You can create your own format if you want.
-<p>The default view, is quite simple. It looks like a conventional dictionary.
-<p>The second view, shows the entry in a forum-like format, without the author's data.
-<p>And the third one, shows the entry also in a forum-like format but with the author's data.
-<hr>
-<p>If you want to create your own format, you should create a .PHP file and give it a number as its name. See into mod/glossary/formats which should be the next number.
-<p>Then, create a funcion called <b>glossary_print_entry_by_format($course, $cm, $glossary, $entry)</b> and dump all your creativity.
-<p>The last stemp is to insert a new entry in every language lack you use called <b>displayformat[number]</b>, and give it a meaninful description.
+<P ALIGN=CENTER><B>Display format</B></P>
+
+<P>The system has three built-in formats to display entries. You can create your own format if you want.
+<p>The default view is quite simple. It looks like a conventional dictionary.
+<p>The second view shows the entry in a forum-like format, without the author's data.
+<p>And the third one shows the entry also in a forum-like format but with the author's data.
+<hr>
+<p>If you want to create your own format, you should create a .PHP file and give it a number as its name. See into mod/glossary/formats which should be the next number.
+<p>Then, create a funcion called <b>glossary_print_entry_by_format($course, $cm, $glossary, $entry)</b> and dump all your creativity.
+<p>The last stemp is to insert a new entry in every language pack you use called <b>displayformat[number]</b>, and give it a meaningful description.
@@ -1,15 +1,15 @@
-<p>Glossary</p>
-
-<ul>
-
- <li><a href="help.php?module=glossary&file=studentcanpost.html">Students can post entries</a>
-
- <li><a href="help.php?module=glossary&file=allowduplicatedentries.html">Allow duplicated entries</a>
-
- <li><a href="help.php?module=glossary&file=displayformat.html">Display formats</a>
-
- <li><a href="help.php?module=glossary&file=mainglossary.html">Defining the main glossary of the course</a>
-
-
-</ul>
-
+<p>Glossary</p>
+
+<ul>
+
+ <li><a href="help.php?module=glossary&file=studentcanpost.html">Students can post entries</a>
+
+ <li><a href="help.php?module=glossary&file=allowduplicatedentries.html">Allow duplicated entries</a>
+
+ <li><a href="help.php?module=glossary&file=displayformat.html">Display formats</a>
+
+ <li><a href="help.php?module=glossary&file=mainglossary.html">Defining the main glossary of the course</a>
+
+
+</ul>
+
@@ -1,5 +1,5 @@
-<P ALIGN=CENTER><B>Defining the main glossary of the course</B></P>
-
-<P>The system allows to export entries from any secondary glossary to the main one of the course.
-<p>In order to do this, you should specify which glossary is the main one.
-<p>Note: You can have only one glossary by course.
+<P ALIGN=CENTER><B>Defining the main glossary of the course</B></P>
+
+<P>The system allows to export entries from any secondary glossary to the main one of the course.
+<p>In order to do this, you should specify which glossary is the main one.
+<p>Note: You can have only one main glossary per course.
@@ -1,6 +1,6 @@
-<P><IMG VALIGN=absmiddle SRC="<?php echo $CFG->wwwroot?>/mod/glossary/icon.gif">&nbsp;<B>Glossary</B></P>
-<UL>
-<P>This resource allows to create and maintain a dictionary or a list of definitions.<br />
-The entries could be created by teachers or by students and can the show in different formats.<br />
-You can search terms. The glossary also allows to export entries from one glossary to other (the main one) within the same course.
-</UL>
+<P><IMG VALIGN=absmiddle SRC="<?php echo $CFG->wwwroot?>/mod/glossary/icon.gif">&nbsp;<B>Glossary</B></P>
+<UL>
+<P>This resource allows to create and maintain a dictionary or a list of definitions.<br />
+The entries could be created by teachers or by students and can be shown in different formats.<br />
+You can search for terms. The glossary also allows to export entries from one glossary to another (the main one) within the same course.
+</UL>
@@ -1,4 +1,4 @@
-<P ALIGN=CENTER><B>Students can post entries</B></P>
-
-<P>You can specify if an user can or cannot add, edit or delete his/her own entries in this glossary.
-<p><b>Note:</b> A teacher could edit or delete any entry at any time.
+<P ALIGN=CENTER><B>Students can post entries</B></P>
+
+<P>You can specify whether a user can or cannot add, edit or delete his/her own entries in this glossary.
+<p><b>Note:</b> A teacher can edit or delete any entry at any time.
View
@@ -31,6 +31,9 @@
$string['entryalreadyexist'] = "Esta entrada ya existe.";
$string['entrydeleted'] = "Entrada borrada.";
$string['entryexported'] = "Entrada exportada con éxito.";
+$string['explainspecial'] = "<b>Especial</b> mostrará todos los conceptos que comiencen con símbolos.<br>";
+$string['explainalphabet'] = "Seleccione la letra que desea buscar.<p>";
+$string['explainall'] = "<b>TODAS</b> mostrará todas las entradas en una página.";
$string['exporttomainglossary'] = "Exportar todo el glosario";
$string['glossarytype'] = "Tipo de glosario";
$string['mainglossary'] = "Glosario principal";
@@ -43,7 +46,6 @@
$string['searchconcept'] = "Buscar:";
$string['searchindefinition'] = "¿Buscar en conceptos Y definiciones?";
$string['secundaryglossary'] = "Glosario secundario";
-$string['selectletter'] = "Seleccione la letra que desea buscar.<p><b>Especial</b> mostrará todos los conceptos que comiencen con símbolos.<br><b>TODAS</b> mostrará todas las entradas en una página.";
$string['showspecial'] = "Mostrar enlace 'Especial'";
$string['showalphabet'] = "Mostrar alfabeto";
$string['showall'] = "Mostrar enlace 'TODAS'";
@@ -57,7 +57,7 @@ function glossary_upgrade($oldversion) {
if ( $oldversion < 2003092102 ) {
execute_sql("ALTER TABLE `{$CFG->prefix}glossary_entries_categories` DROP PRIMARY KEY ");
- execute_sql("ALTER TABLE `{$CFG->prefix}glossary_entries_categories` ADD `ID` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST");
+ execute_sql("ALTER TABLE `{$CFG->prefix}glossary_entries_categories` ADD `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST");
}
return true;
View
@@ -15,13 +15,8 @@
<td>
<?
$categories = get_records("glossary_categories","glossaryid",$glossary->id);
- echo "<select size=\"";
- if ( count($categories) > 7 ) {
- echo 7;
- }else {
- echo count($categories);
- }
- echo "\" name=\"categories[]\" multiple=\"yes\">";
+ echo "<select size=\"6\" name=\"categories[]\" multiple=\"yes\">";
+ echo "<option value=0>" . get_string("nocategorized","glossary") . "</optioon>";
foreach ( $categories as $category ) {
echo " <option ";
View
@@ -59,14 +59,16 @@
$PermissionGranted = 1;
if ( !$glossary->allowduplicatedentries ) {
- $dupentries = get_records("glossary_entries","UCASE(concept)", strtoupper($newentry->concept));
- if ($dupentries) {
+ $dupentries = get_records("glossary_entries","UCASE(concept)", strtoupper($newentry->concept));
+ if ($dupentries) {
foreach ($dupentries as $curentry) {
- if ( $curentry->id != $entry) {
- $PermissionGranted = 0;
+ if ( $glossary->id == $curentry->glossaryid ) {
+ if ( $curentry->id != $entry ) {
+ $PermissionGranted = 0;
+ }
}
}
- }
+ }
}
if ( $PermissionGranted ) {
$newentry->attachment = $_FILES["attachment"];
@@ -76,12 +78,12 @@
unset($newentry->attachment);
}
if (! update_record("glossary_entries", $newentry)) {
- error("Could not update your glossary");
- } else {
- add_to_log($course->id, "glossary", "update entry", "view.php?id=$cm->id&eid=$newentry->id", "$newentry->id");
- }
+ error("Could not update your glossary");
+ } else {
+ add_to_log($course->id, "glossary", "update entry", "view.php?id=$cm->id&eid=$newentry->id", "$newentry->id");
+ }
} else {
- error("Could not update this glossary entry because this concept already exist.");
+ error("Could not update this glossary entry because this concept already exist.");
}
} else {
$newentry->userid = $USER->id;
@@ -125,11 +127,13 @@
if ( $categories ) {
$newcategory->entryid = $newentry->id;
foreach ($categories as $category) {
- $newcategory->categoryid =$category;
- insert_record("glossary_entries_categories",$newcategory);
+ if ( $category > 0 ) {
+ $newcategory->categoryid =$category;
+ insert_record("glossary_entries_categories",$newcategory);
+ }
}
}
- redirect("view.php?id=$cm->id&eid=$newentry->id&currentview=$currentview&cat=$cat");
+ redirect("view.php?id=$cm->id&eid=$newentry->id");
die;
}
}
View
@@ -169,7 +169,7 @@ function glossary_get_entries($glossaryid, $entrylist) {
}
function glossary_print_entry($course, $cm, $glossary, $entry,$currentview="",$cat="") {
- global $THEME, $USET, $CFG;
+ global $THEME, $USER, $CFG;
$PermissionGranted = 0;
$formatfile = "$CFG->dirroot/mod/glossary/formats/$glossary->displayformat.php";
@@ -540,12 +540,20 @@ function print_tabbed_table_start($data, $CurrentTab, $tTHEME = NULL) {
} else {
$CurrentColor = $TabColor;
}
- ?>
- <td width="<? p($TabWidth) ?>%" bgcolor="<? p($CurrentColor) ?>" align="center">
- <b><a href="<? p($data[$TabProccessed]->link) ?>"><? p($data[$TabProccessed]->caption) ?></a></b></td>
- <? if ($col < $TabsPerRow) { ?>
- <td width="<? p($TabSeparation) ?>" align="center">&nbsp;</td>
- <? }
+
+ echo "<td width=\"$TabWidth%\" bgcolor=\"$CurrentColor\" align=\"center\"><b>";
+ if ($TabProccessed != $CurrentTab) {
+ echo "<a href=\"" . $data[$TabProccessed]->link . "\">";
+ }
+ echo $data[$TabProccessed]->caption;
+ if ($TabProccessed != $CurrentTab) {
+ echo "</a>";
+ }
+ echo "</b></td>";
+
+ if ( $col < $TabsPerRow ) {
+ echo "<td width=\"$TabSeparation\" align=\"center\">&nbsp;</td>";
+ }
} else {
$CurrentColor = "";
}
@@ -566,12 +574,19 @@ function print_tabbed_table_start($data, $CurrentTab, $tTHEME = NULL) {
} else {
$CurrentColor = $TabColor;
}
- ?>
- <td width="<? p($TabWidth) ?>%" bgcolor="<? p($CurrentColor) ?>" align="center">
- <b><a href="<? p($data[$TabProccessed]->link) ?>"><? p($data[$TabProccessed]->caption) ?></a></b></td>
- <? if ($col < $TabsPerRow) { ?>
- <td width="<? p($TabSeparation) ?>" align="center">&nbsp;</td>
- <? }
+ echo "<td width=\"$TabWidth%\" bgcolor=\"$CurrentColor\" align=\"center\"><b>";
+ if ($TabProccessed != $CurrentTab) {
+ echo "<a href=\"" . $data[$TabProccessed]->link . "\">";
+ }
+ echo $data[$TabProccessed]->caption;
+ if ($TabProccessed != $CurrentTab) {
+ echo "</a>";
+ }
+ echo "</b></td>";
+
+ if ($col < $TabsPerRow) {
+ echo "<td width=\"$TabSeparation\" align=\"center\">&nbsp;</td>";
+ }
} else {
if ($NumRows > 1) {
$CurrentColor = $TabColor;
@@ -610,13 +625,23 @@ function glossary_print_alphabet_menu($cm, $glossary, $l) {
$strspecial = get_string("special", "glossary");
$strallentries = get_string("allentries", "glossary");
- echo "<CENTER>$strselectletter";
+ if ($glossary->showalphabet) {
+ $output .= get_string("explainalphabet","glossary");
+ }
+ if ($glossary->showspecial) {
+ $output .= get_string("explainspecial","glossary");
+ }
+ if ($glossary->showall) {
+ $output .= get_string("explainall","glossary");
+ }
+
+ echo "<CENTER>$output<p>";
if ( $glossary->showspecial ) {
if ( $l == "SPECIAL" ) {
- echo "<p><b>$strspecial</b> | ";
+ echo "<b>$strspecial</b> | ";
} else {
- echo "<p><a href=\"$CFG->wwwroot/mod/glossary/view.php?id=$cm->id&l=SPECIAL\">$strspecial</a> | ";
+ echo "<a href=\"$CFG->wwwroot/mod/glossary/view.php?id=$cm->id&l=SPECIAL\">$strspecial</a> | ";
}
}
@@ -645,7 +670,7 @@ function glossary_print_alphabet_menu($cm, $glossary, $l) {
}
}
}
-function glossary_print_categories_menu($course, $cm, $glossary, $category) {
+function glossary_print_categories_menu($course, $cm, $glossary, $cat, $category) {
global $CFG, $THEME;
echo "<table border=0 width=100%>";
echo "<tr>";
@@ -663,11 +688,19 @@ function glossary_print_categories_menu($course, $cm, $glossary, $category) {
if ( $category ) {
echo $category->name;
} else {
- echo get_string("entrieswithoutcategory","glossary");
+ if ( $cat < 0 ) {
+ echo get_string("entrieswithoutcategory","glossary");
+ $selected = "-1";
+ } elseif ( $cat == 0 ) {
+ echo get_string("allcategories","glossary");
+ $selected = "0";
+ }
}
echo "</b></td>";
echo "<td align=center width=20%>";
- $menu[0] = get_string("nocategorized","glossary");
+ $menu["0"] = get_string("allcategories","glossary");
+ $menu["-1"] = get_string("nocategorized","glossary");
+// $menu[""] = "-----------------------------------------";
$categories = get_records("glossary_categories", "glossaryid", $glossary->id, "name ASC");
if ( $categories ) {
@@ -680,7 +713,7 @@ function glossary_print_categories_menu($course, $cm, $glossary, $category) {
}
}
- echo popup_form("$CFG->wwwroot/mod/glossary/view.php?id=$cm->id&currentview=categories&cat=", $menu, "catmenu", $selected, get_string("jumpto"),
+ echo popup_form("$CFG->wwwroot/mod/glossary/view.php?id=$cm->id&currentview=categories&cat=", $menu, "catmenu", $selected, "",
"", "", false);
echo "</td>";
Oops, something went wrong.

0 comments on commit 914cb26

Please sign in to comment.