$string['addcomment'] = "Add comment";
$string['addentry'] = "Add a new entry";
$string['approve'] = "Approve";
+$string['aliases'] = "Aliases";
$string['allentries'] = "ALL";
$string['allcategories'] = "All Categories";
$string['allowcomments'] = "Allow comments on entries";
$string['displayformat5'] = "Full without author";
$string['duplicateentry'] = "Duplicate entry";
$string['editcategories'] = "Edit categories";
-$string['editalias'] = "Edit alias";
$string['editentry'] = "Edit entry";
$string['editingcomment'] = "Editing comment";
$string['entries'] = "Entries";
$string['nocomments'] = "(No comments found on this entry)";
$string['noentries'] = "No entries found in this section";
$string['noentry'] = "No entry found.";
+$string['onebyline'] = "(one by line)";
$string['printerfriendly'] = "Printer-friendly version";
$string['question'] = "Question";
$string['rejectedentries'] = "Rejected entries";
--- /dev/null
+<P ALIGN=CENTER><B>Aliases</B></P>
+
+<p>The glossary allows to maintain a list of aliases for every entry.
+
+<p>Aliases are used as alternative terms to refer concepts so wherever the concept OR any alias is found, it will be automatically linked with the concept.</p>
==================================
-- Allow to export/import entries (Working on it)
+- Allow to export/import entries (in beta now)
IMPORTING OPTIONS:
* New glossary o just append entries to the current one?
* With or withot categories?
-- Add Alias to concepts in order to use dynalinks on them.
+
+- Add Alias to concepts in order to use dynalinks on them. (in beta now)
+
- Allow to set default values for glossaries and entries settings (done)
+
- Allow grading of entries
* Evaluation
* Self-evaluation?
* Co-evaluation?
-- Add printer friendly version of glossaries (Working on it)
+
+- Add printer friendly version of glossaries (in beta)
}
}
}
+
+ if ( $oldversion < 2003110400 ) {
+ execute_sql("CREATE TABLE `{$CFG->prefix}glossary_alias` (
+ `id` INT(10) unsigned NOT NULL auto_increment,
+ `entryid` INT(10) UNSIGNED NOT NULL default '0',
+ `alias` TEXT NOT NULL default '',
+ PRIMARY KEY (`id`)
+ ) TYPE=MyISAM COMMENT='entries alias'");
+ }
return true;
}
PRIMARY KEY (id)
) TYPE=MyISAM COMMENT='all glossary entries';
+#
+# Table structure for table `glossary_alias`
+#
+
+CREATE TABLE prefix_glossary_alias (
+ id int(10) unsigned NOT NULL auto_increment,
+ entryid int(10) unsigned NOT NULL default '0',
+ alias text NOT NULL,
+ PRIMARY KEY (id)
+) TYPE=MyISAM COMMENT='entries alias';
+
#
# Table structure for table `glossary_cageories`
#
PRIMARY KEY (id)
);
+#
+# Table structure for table `glossary_alias`
+#
+
+CREATE TABLE prefix_glossary_alias (
+ id SERIAL,
+ entryid int4 NOT NULL default '0',
+ alias TEXT NOT NULL,
+ PRIMARY KEY (id)
+);
+
#
# Table structure for table `glossary_entries_category`
#
<td>
<?php
$categories = get_records("glossary_categories","glossaryid",$glossary->id);
- echo "<select size=\"6\" name=\"categories[]\" multiple=\"yes\">";
+ echo "<select size=\"8\" name=\"categories[]\" multiple=\"yes\">";
echo "<option value=\"0\">" . get_string("notcategorised","glossary") . "</optioon>";
if ( $categories ) {
</select>
<td>
<td width=100%>
+ <table border=0>
+ <tr>
+ <td align=center width=58%>
+
<table border=0 width=100%>
<tr><td align=right width=80%><small><?php echo get_string("entryusedynalink","glossary") ?>:</small></td><td width=20%>
<script>
$selected = "checked";
}
?>
- <input type="checkbox" name="usedynalink" value=1 <?php p($selected) ?> onclick="return lockoptions('form','usedynalink', items)"> <?php helpbutton("usedynalink", strip_tags(get_string("usedynalink"), "glossary"), "glossary") ?>
+ <input type="checkbox" name="usedynalink" value=1 <?php p($selected) ?> onclick="return lockoptions('form','usedynalink', items)"> <?php helpbutton("usedynalink", strip_tags(get_string("usedynalink", "glossary")), "glossary") ?>
</td></tr>
<tr><td align=right width=80%><small><?php echo get_string("casesensitive","glossary") ?>:</small></td><td width=20%>
<?php
<input type="checkbox" name="fullmatch" value=1 <?php p($selected) ?>> <?php helpbutton("fullmatch", strip_tags(get_string("fullmatch", "glossary")), "glossary") ?>
</td></tr>
</table>
+
+ </td>
+ <td align=center width=42% valign=top>
+ <small><strong><?PHP p(get_string("aliases","glossary")) ?> <?php helpbutton("aliases", strip_tags(get_string("aliases", "glossary")), "glossary") ?></strong><small><br>
+ <font size=1><?PHP p(get_string("onebyline","glossary")) ?></font><br>
+ <textarea rows="5" name="aliases" cols="20"><?PHP p($newentry->aliases) ?></textarea>
+ </td>
+ </tr>
+ </table>
+
</td>
</tr>
</table>
print_textarea($usehtmleditor, 20, 60, 680, 400, "text", $newentry->definition);
echo "<p align=right>";
- helpbutton("textformat", get_string("helpformatting"));
+ helpbutton("textformat", get_string("helpformatting"));
print_string("formattexttype");
echo ": ";
if (!isset($newentry->format)) {
}
delete_records("glossary_entries_categories","entryid",$e);
+ delete_records("glossary_alias","entryid",$e);
if ( isset($form->categories) ) {
$newcategory->entryid = $newentry->id;
}
}
}
+ if ( isset($form->aliases) ) {
+ if ( $aliases = explode("\n",$form->aliases) ) {
+ foreach ($aliases as $alias) {
+ if ($alias) {
+ unset($newalias);
+ $newalias->entryid = $e;
+ $newalias->alias = $alias;
+ insert_record("glossary_alias",$newalias);
+ }
+ }
+ }
+ }
+
redirect("view.php?id=$cm->id&eid=$newentry->id&tab=$tab&cat=$cat");
die;
} else {
$newentry->usedynalink = $form->usedynalink;
$newentry->casesensitive = $form->casesensitive;
$newentry->fullmatch = $form->fullmatch;
+ $newentry->aliases = "";
+
+ if ( $aliases = get_records("glossary_alias","entryid",$e) ) {
+ foreach ($aliases as $alias) {
+ $newentry->aliases .= $alias->alias . "\n";
+ }
+ }
}
}
/// Otherwise fill and print the form.
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
-$module->version = 2003103100; // The current module version (Date: YYYYMMDDXX)
+$module->version = 2003110400; // The current module version (Date: YYYYMMDDXX)
$module->cron = 0; // Period for cron to check this module (secs)
$release = "0.5 development"; // User-friendly version number