Permalink
Browse files

- Rewrite of the internal API in order to, hopefully, create an easy …

…way to handle the flow of data internally and externally.

- Adding a new frame: Browse by Author
- A new, friendly way to show entries (asked by Martin): view?id=cm&mode=term&hook=[concept | alias ]
- Handling user activies, outline and complete.
- Properly showing new entries in recent activity box.
- Adding a flag to categories to specify if a category should or should not be automatically linked.
- Adding some missing strings and files as well.
- Adding a field to each glossary that specify how many entries by pages it should show.
  • Loading branch information...
willcast
willcast committed Nov 15, 2003
1 parent 45376a5 commit 1ac87c73976764fe43dbef8f1a0dd6ce205a3147
View
@@ -3,15 +3,18 @@
$string['addcomment'] = "Add comment";
$string['addentry'] = "Add a new entry";
-$string['approve'] = "Approve";
+$string['addingcomment'] = "Add a comment";
$string['aliases'] = "Alias(es)";
$string['allentries'] = "ALL";
$string['allcategories'] = "All Categories";
$string['allowcomments'] = "Allow comments on entries";
$string['allowduplicatedentries'] = "Duplicated entries allowed";
$string['answer'] = "Answer";
+$string['approve'] = "Approve";
+$string['authorview'] = "Browse by Author";
$string['areyousuredelete'] = "Are you sure you want to delete this entry?";
$string['areyousuredeletecomment'] = "Are you sure you want to delete this comment?";
+$string['areyousureexport'] = "Are you sure you want to export this entry to";
$string['ascending'] = "(ascending)";
$string['attachment'] = "Attachment";
$string['back'] = "Back";
@@ -62,6 +65,7 @@
$string['editingcomment'] = "Editing comment";
$string['entries'] = "Entries";
$string['importedentries'] = "Imported entries";
+$string['entbypage'] = "Entries shown by page";
$string['entrieswithoutcategory'] = "Entries without category";
$string['entry'] = "Entry";
$string['entryalreadyexist'] = "Entry already exists";
@@ -88,11 +92,13 @@
$string['glosssaryexported'] = "Glossary exported.";
$string['importcategories'] = "Import categories";
$string['isglobal'] = "Is this glossary global?";
+$string['linkcategory'] = "Automatically link this category";
$string['mainglossary'] = "Main glossary";
$string['modulename'] = "Glossary";
$string['modulenameplural'] = "Glossaries";
$string['maxtimehaspassed'] = "Sorry, but the maximum time for editing this comment (\$a) has passed!";
$string['newglossary'] = "New glossary";
+$string['newentries'] = "New glossary entries";
$string['newglossaryentries'] = "New glossary entries:";
$string['newglossarycreated'] = "New glossary created.";
$string['notcategorised'] = "Not categorised";
@@ -101,6 +107,7 @@
$string['nocomments'] = "(No comments found on this entry)";
$string['noentries'] = "No entries found in this section";
$string['noentry'] = "No entry found.";
+$string['numberofentries'] = "Number of entries";
$string['onebyline'] = "(one by line)";
$string['printerfriendly'] = "Printer-friendly version";
$string['question'] = "Question";
@@ -0,0 +1,7 @@
+<P ALIGN=CENTER><B>Definition destination of imported entries</B></P>
+
+<P>You can specify where do you want to import the entries:</p>
+<ul>
+<li><strong>Current Glossary:</strong> Will append the imported entries to the current glossary.</li>
+<li><strong>New Glossary:</strong> Will create a new glossary based on the information found in the XML file selected and will insert the new entries on it.</li>
+</ul>
@@ -0,0 +1,7 @@
+<P ALIGN=CENTER><B>Defining number of entries shown by page</B></P>
+
+<P>You can specify the number of entries shown by page. This number depends on the configuration of the glossary.</p>
+
+<p>The more automatically linked entries you have, the lower this number should be in order to avoid long answer time from the application.</p>
+
+<p>Note: If you get a timout error when browsing a glossary, it probable needs to have a lower number of entries shown by page.</p>
@@ -0,0 +1,3 @@
+<P ALIGN=CENTER><B>File to import</B></P>
+
+<P>Select the XML file which contains the entries to import.</p>
@@ -0,0 +1,3 @@
+<P ALIGN=CENTER><B>Importing categories</B></P>
+
+<P>By default, all the entries will be imported. You can specify if you want the categories to be imported as well (it will import the relationship between the imported categories and the imported entries also).</p>
@@ -11,7 +11,12 @@
<li><a href="help.php?module=glossary&file=studentcanpost.html">Students can post entries</a>
<li><a href="help.php?module=glossary&file=allowcomments.html">Comments on entries</a>
<li><a href="help.php?module=glossary&file=displayformat.html">Display formats for entries</a>
+ <li><a href="help.php?module=glossary&file=entbypage.html">Number of entries shown by page</a>
<li><a href="help.php?module=glossary&file=shows.html">Browsing options in Alphabet View frame</a>
+ <li><a href="help.php?module=glossary&file=linkcategories.html">Automatically linking categories</a>
+ <li><a href="help.php?module=glossary&file=filetoimport.html">Importing entries</a>
+ <li><a href="help.php?module=glossary&file=importcategories.html">Importing categories</a>
+ <li><a href="help.php?module=glossary&file=destination.html">Destination of the entries to import</a>
</ul>
</blockquote>
@@ -0,0 +1,5 @@
+<P ALIGN=CENTER><B>Automatically linking categories</B></P>
+
+<P>You can specify if you want the categories to be automatically linked or not.</p>
+
+<p>Note: Categories are linked based on a case sensitive, full whole match.</p>
View
@@ -6,8 +6,8 @@
require_variable($id); // Course Module ID
optional_variable($eid); // Entry ID
- optional_variable($tab,GLOSSARY_APPROVAL_VIEW);
- optional_variable($l,"ALL");
+ optional_variable($mode,"approval");
+ optional_variable($hook,"ALL");
if (! $cm = get_record("course_modules", "id", $id)) {
error("Course Module ID was incorrect");
@@ -33,6 +33,6 @@
} else {
add_to_log($course->id, "glossary", "approve entry", "showentry.php?id=$cm->id&eid=$eid", "$eid");
}
- redirect("view.php?id=$cm->id&tab=$tab&l=$l",get_string("entryapproved","glossary"),1);
+ redirect("view.php?id=$cm->id&mode=$mode&hook=$hook",get_string("entryapproved","glossary"),1);
die;
?>
@@ -90,6 +90,7 @@ function backup_glossary_categories ($bf,$preferences,$glossary, $userinfo) {
fwrite ($bf,full_tag("ID",6,false,$glo_cat->id));
fwrite ($bf,full_tag("GLOSSARYID",6,false,$glo_cat->glossaryid));
fwrite ($bf,full_tag("NAME",6,false,$glo_cat->name));
+ fwrite ($bf,full_tag("USEDYNALINK",6,false,$glo_cat->usedynalink));
$status = backup_glossary_entries_categories ($bf,$preferences,$glo_cat->id);
View
@@ -80,8 +80,28 @@
echo "<br />";
}
- glossary_print_entry($course, $cm, $glossary, $entry);
+ echo "<p align=center>";
+ echo "<table class=\"generalbox\" width=\"70%\" align=\"center\" border=\"0\" cellpadding=\"5\" cellspacing=\"0\">";
+ echo "<tr bgcolor=$THEME->cellheading2><td align=center>";
+ echo "<table border=0 width=100%><tr><td width=33%></td><td width=33% align=center>";
+ echo get_string("commentson","glossary") . " <b>$entry->concept</b></td>";
+ echo "<td width=33% align=right>";
+ echo "</td></tr></table>";
+
+ echo "</td></tr>";
+ echo "<tr><TD WIDTH=100% BGCOLOR=\"#FFFFFF\">";
+ if ($entry->attachment) {
+ $entry->course = $course->id;
+ echo "<table border=0 align=right><tr><td>";
+ echo glossary_print_attachments($entry,"html");
+ echo "</td></tr></table>";
+ }
+ echo "<b>$entry->concept</b>: ";
+ echo format_text($entry->definition, $entry->format);
+ echo "</td>";
+ echo "</TR></table>";
+
echo "<center>";
echo "<br />";
View
@@ -11,20 +11,20 @@
<tr valign=top>
<td align=right><p>glossary_entbypage:</td>
<td>
- <input name=glossary_entbypage type=text size=5 value="<?php p($CFG->glossary_entbypage) ?>">
+ <input name=glossary_entbypage type=text size=3 value="<?php p($CFG->glossary_entbypage) ?>">
</td>
<td>
<?php print_string("entbypage", "glossary") ?>
</td>
</tr>
<tr valign=top>
- <td align=right><p>students_can_post_entries:</td>
+ <td align=right><p>glossary_studentspost:</td>
<td>
- <SELECT size=1 name=cnfstudentcanpost>
+ <SELECT size=1 name=glossary_studentspost>
<?php
$yselected = "";
$nselected = "";
- if ($CFG->cnfstudentcanpost) {
+ if ($CFG->glossary_studentspost) {
$yselected = " SELECTED ";
} else {
$nselected = " SELECTED ";
@@ -39,13 +39,13 @@
</td>
</tr>
<tr valign=top>
- <td align=right><p>allow_duplicated_entries:</td>
+ <td align=right><p>glossary_dupentries:</td>
<td>
- <SELECT size=1 name=cnfallowdupentries>
+ <SELECT size=1 name=glossary_dupentries>
<?php
$yselected = "";
$nselected = "";
- if ($CFG->cnfallowdupentries) {
+ if ($CFG->glossary_dupentries) {
$yselected = " SELECTED ";
} else {
$nselected = " SELECTED ";
@@ -60,13 +60,13 @@
</td>
</tr>
<tr valign=top>
- <td align=right><p>allow_comments:</td>
+ <td align=right><p>glossary_allowcomments:</td>
<td>
- <SELECT size=1 name=cngallowcomments>
+ <SELECT size=1 name=glossary_allowcomments>
<?php
$yselected = "";
$nselected = "";
- if ($CFG->cngallowcomments) {
+ if ($CFG->glossary_allowcomments) {
$yselected = " SELECTED ";
} else {
$nselected = " SELECTED ";
@@ -77,17 +77,17 @@
</SELECT>
</td>
<td>
- <?php print_string("cngallowcomments", "glossary") ?>
+ <?php print_string("cnfallowcomments", "glossary") ?>
</td>
</tr>
<tr valign=top>
- <td align=right><p>automatically_link_glossaries:</td>
+ <td align=right><p>glossary_linkbydefault:</td>
<td>
- <SELECT size=1 name=cnflinkglossaries>
+ <SELECT size=1 name=glossary_linkbydefault>
<?php
$yselected = "";
$nselected = "";
- if ($CFG->cnflinkglossaries) {
+ if ($CFG->glossary_linkbydefault) {
$yselected = " SELECTED ";
} else {
$nselected = " SELECTED ";
@@ -102,13 +102,13 @@
</td>
</tr>
<tr valign=top>
- <td align=right><p>default_approval_status:</td>
+ <td align=right><p>glossary_defaultapproval:</td>
<td>
- <SELECT size=1 name=cnfapprovalstatus>
+ <SELECT size=1 name=glossary_defaultapproval>
<?php
$yselected = "";
$nselected = "";
- if ($CFG->cnfapprovalstatus) {
+ if ($CFG->glossary_defaultapproval) {
$yselected = " SELECTED ";
} else {
$nselected = " SELECTED ";
@@ -126,13 +126,13 @@
<td colspan = 3 align=center><strong>Entry Level Default Settings</strong></td>
</tr>
<tr valign=top>
- <td align=right><p>automatically_link_entry:</td>
+ <td align=right><p>glossary_linkentries:</td>
<td>
- <SELECT size=1 name=cnflinkentry>
+ <SELECT size=1 name=glossary_linkentries>
<?php
$yselected = "";
$nselected = "";
- if ($CFG->cnflinkentry) {
+ if ($CFG->glossary_linkentries) {
$yselected = " SELECTED ";
} else {
$nselected = " SELECTED ";
@@ -147,13 +147,13 @@
</td>
</tr>
<tr valign=top>
- <td align=right><p>case_sensitive:</td>
+ <td align=right><p>glossary_casesensitive:</td>
<td>
- <SELECT size=1 name=cnfcasesensitive>
+ <SELECT size=1 name=glossary_casesensitive>
<?php
$yselected = "";
$nselected = "";
- if ($CFG->cnfcasesensitive) {
+ if ($CFG->glossary_casesensitive) {
$yselected = " SELECTED ";
} else {
$nselected = " SELECTED ";
@@ -168,13 +168,13 @@
</td>
</tr>
<tr valign=top>
- <td align=right><p>match_whole_words:</td>
+ <td align=right><p>glossary_fullmatch:</td>
<td>
- <SELECT size=1 name=cnffullmatch>
+ <SELECT size=1 name=glossary_fullmatch>
<?php
$yselected = "";
$nselected = "";
- if ($CFG->cnffullmatch) {
+ if ($CFG->glossary_fullmatch) {
$yselected = " SELECTED ";
} else {
$nselected = " SELECTED ";
@@ -165,6 +165,15 @@ function glossary_upgrade($oldversion) {
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='entries alias'");
}
+
+ if ( $oldversion < 2003111500 ) {
+ execute_sql( "ALTER TABLE `{$CFG->prefix}glossary_categories`
+ ADD `usedynalink` TINYINT(2) UNSIGNED NOT NULL DEFAULT '1' AFTER `name`" );
+
+ execute_sql( "ALTER TABLE `{$CFG->prefix}glossary`
+ ADD `entbypage` TINYINT(3) UNSIGNED NOT NULL DEFAULT '10' AFTER `globalglossary`" );
+
+ }
return true;
}
@@ -24,6 +24,7 @@ CREATE TABLE prefix_glossary (
usedynalink tinyint(2) unsigned NOT NULL default '1',
defaultapproval tinyint(2) unsigned NOT NULL default '1',
globalglossary tinyint(2) unsigned NOT NULL default '0',
+ entbypage tinyint(3) unsigned NOT NULL default '10',
timecreated int(10) unsigned NOT NULL default '0',
timemodified int(10) unsigned NOT NULL default '0',
PRIMARY KEY (id)
@@ -71,6 +72,7 @@ CREATE TABLE prefix_glossary_categories (
id int(10) unsigned NOT NULL auto_increment,
glossaryid int(10) unsigned NOT NULL default '0',
name varchar(255) NOT NULL default '',
+ usedynalink tinyint(2) unsigned NOT NULL default '1',
PRIMARY KEY (id)
) TYPE=MyISAM COMMENT='all categories for glossary entries';
@@ -23,6 +23,7 @@ CREATE TABLE prefix_glossary (
allowcomments int2 NOT NULL default '0',
usedynalink int2 NOT NULL default '1',
globalglossary int2 NOT NULL default '0',
+ entbypage int NOT NULL default '10',
timecreated int4 NOT NULL default '0',
timemodified int4 NOT NULL default '0',
PRIMARY KEY (id)
@@ -58,6 +59,7 @@ CREATE TABLE prefix_glossary_categories (
id SERIAL,
glossaryid int4 NOT NULL default '0',
name varchar(255) NOT NULL default '',
+ usedynalink int2 NOT NULL default '1',
PRIMARY KEY (id)
);
@@ -4,8 +4,8 @@
<input type="hidden" name=mode value="delete">
<input type="hidden" name=go value="1">
<input type="hidden" name=entry value="<?php echo $entry ?>">
-<input type="hidden" name=currentview value="<?=$currentview ?>">
-<input type="hidden" name=cat value="<?=$cat ?>">
+<input type="hidden" name=mode value="<?=$mode ?>">
+<input type="hidden" name=hook value="<?=$hook ?>">
<input type="submit" value=" <?php print_string("yes")?> ">
<input type=button value=" <?php print_string("no")?> " onclick="javascript:history.go(-1);">
Oops, something went wrong.

0 comments on commit 1ac87c7

Please sign in to comment.