Note: You are currently viewing documentation for Moodle 2.0. Up-to-date documentation for the latest stable version is available here: Bibliography module.

Bibliography module: Difference between revisions

From MoodleDocs
No edit summary
Line 20: Line 20:
* Install the filter - enabling the inclusion of references from your course bibliographies in your web pages
* Install the filter - enabling the inclusion of references from your course bibliographies in your web pages
* Install the html editor bib icon - which will allow you to easily select the bibliographic reference you want to include on your webpage
* Install the html editor bib icon - which will allow you to easily select the bibliographic reference you want to include on your webpage
You may download the entire package: [[http://elearning.up.pt/moodle-modules/bibliography_pack.zip]] and unzip it into /moodle folder of your Moodle site.


===Bibliography activity===
===Bibliography activity===
Will let you manage and show bibliographic entries in your course
Will let you manage and show bibliographic entries in your course


* Select the "bibliography.tar" module
* Select the "bibliography.zip" module
* Untar the .tar file into the /moodle folder of your Moodle site (tar -xvf bibliography.tar)
* Unzip the .zip file into the /moodle/mod folder of your Moodle site
* Login to the Moodle site as administrator and
* Login to the Moodle site as administrator and
* In site administration block click on notifications
* In site administration block click on notifications
Line 42: Line 44:
Will let you easily choose the bibliographic reference you want to add to your webpage.  
Will let you easily choose the bibliographic reference you want to add to your webpage.  
The installation of this feature will require changing code in some Moodle files.
The installation of this feature will require changing code in some Moodle files.
* Select the "bib_editoricon.zip"
 
* Unpack the zip file into the /moodle folder
* Unpacking the bibliography_pack.zip file into the /moodle folder
* It will create:
* It will create the activity on your mod folder, the filter on your filter folder and also:
** moodle/lib/editor/htmlarea/images/icon_ins_bib.gif
** moodle/lib/editor/htmlarea/images/icon_ins_bib.gif
** moodle/lib/editor/htmlarea/popups/dialog_bib.css
** moodle/lib/editor/htmlarea/popups/dialog_bib.css

Revision as of 02:40, 10 August 2010

The Bibliography module makes it easy to show and use bibliographic references in your Moodle course. It is contributed by Universidade do Porto, Nuno Barbosa and Susana Leitão. It was built based on the glossary module, using same code design and interface patterns.

It allows you to:

  • Create different bibliography activities in a course
  • Create instances in each bibliography
  • Manually insert new entries in a bibliography activity
  • View bibliographic references by citekey, date, author, instance
  • Comment bibliography entries
  • Let students contribute to bibliography with their own entries
  • Import and export references in bibtex format


You can also install the bibliography filter and the html editor bib icon, which will let you reference to bibliography entries present in your course and automatically add them as a footnote reference list.

Installation

There are 3 major steps to install Bibliography module with all its features.

  • Install the activity - which is the the core of the module
  • Install the filter - enabling the inclusion of references from your course bibliographies in your web pages
  • Install the html editor bib icon - which will allow you to easily select the bibliographic reference you want to include on your webpage

You may download the entire package: [[1]] and unzip it into /moodle folder of your Moodle site.

Bibliography activity

Will let you manage and show bibliographic entries in your course

  • Select the "bibliography.zip" module
  • Unzip the .zip file into the /moodle/mod folder of your Moodle site
  • Login to the Moodle site as administrator and
  • In site administration block click on notifications
  • Moodle will install the Bibliography module
  • Add a Bibliography as an activity

Bibliography filter

Will let you reference to your bibliographic entries from any webpage and add them as footnotes.

  • Select the "bib_filter.zip"
  • Unpack the zip file into /moodle/filter folder of your Moodle site
  • Add $string['footerreferences'] = 'Footer references'; to your lang (or add bibliography.php with the string)
  • Activate filter on Modules>Filters administration

You may use [bib-citekey] to reference a bibliographic entry with a certain citekey.

HTML editor bib icon

Will let you easily choose the bibliographic reference you want to add to your webpage. The installation of this feature will require changing code in some Moodle files.

  • Unpacking the bibliography_pack.zip file into the /moodle folder
  • It will create the activity on your mod folder, the filter on your filter folder and also:
    • moodle/lib/editor/htmlarea/images/icon_ins_bib.gif
    • moodle/lib/editor/htmlarea/popups/dialog_bib.css
    • moodle/lib/editor/htmlarea/popups/dlg_ins_bib.php
    • moodle/lang/en_utf8/bibliography.php
  • It will also create:
    • moodle/lib/adminlib_example.php - Add bib icon in html editor
    • moodle/lib/editor/htmlarea/htmlarea_example.php - Call popup when clicking bib icon
  • Use diff command to view differences between adminlib_example.php and original adminlib.php, htmlarea_example.php and original htmlarea.php
  • Save your existing copy of moodle/lib/adminlib.php and moodle/lib/editor/htmlarea/htmlarea.php and insert the diff lines.

You can see bellow the code lines you will have to add to those 2 files.

Changes adminlib.php

To be able to add your bib icon, save your existing copy of adminlib.php and insert this line:

                    'insertbib' => 'em.icon.bib.gif',

below this line:

                    'insertsmile' => 'em.icon.smile.gif',

and save. The line can really be placed anywhere in that array, but by providing a specific location it will help when addressing requests for assistance in hiding buttons.

The array is employed by the admin GUI (Site Administration-> Appearance->HTML editor) to provide you the Administrator with the ability to hide buttons in the HTML editor via editorhidebuttons. Once you have installed Bibliography module and added the button, you can use the GUI to hide the insertbib button.

Changes htmlarea.php

Add insertbib to this.toolbar array:

                    this.toolbar = [ ... "insertbib","insertsmile", "insertchar",... ]

Add insertbib to this.btnList array:

                    this.btnList = {...insertbib: ["Insert Bibliography", "icon_ins_bib.gif", false, function(e) {e.execCommand("insertbib");} ],...

Add Moodle hack - insertbib after Moodle hack - insertSmile:

 /// Moodle hack - insertbib
 HTMLArea.prototype._insertBib = function() {
   // Make sure that editor has focus
   this.focusEditor();
   var sel = this._getSelection();
   var range = this._createRange(sel);
   var editor = this;  // for nested functions
   this._popupDialog("dlg_ins_bib.php?id=<?php echo $id; ?>", function(imgString) {
       if(!imgString) {
           return false;
       }
       if (HTMLArea.is_ie) {
           range.pasteHTML(imgString);
       } else {
           editor.insertHTML(imgString);
       }
       return true;
   }, null);
 };

Insert case "insertbib":

       case "insertsmile": this._insertSmile(); break;
       case "insertbib": this._insertBib(); break;
       case "insertchar": this._insertChar(); break;

And that's all...