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 117: Line 117:
*Fill "Bibliography Fullname"
*Fill "Bibliography Fullname"
*Describe you bibliography on "Bibliography Intro"
*Describe you bibliography on "Bibliography Intro"
*Choose options (see below)
*Choose general options (see below)
*Press "Save..." button.  
*Press "Save..." button.  
====General options====
*"Entries shown per page" choose the number of items you want to display per page
*"Allow comments" choose if you want to allow comments about your bibliography entries
*"Allow students to insert entries" choose if you want to let students contribute to bibliography with their own entries




[[Category:Contributed code]]
[[Category:Contributed code]]

Revision as of 17:11, 25 October 2010

Introduction

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
  • Reference to bibliography entries from your resources and automatically add them as a footnote
  • You can also add the HTML editor bib icon and easily choose the bibliographic reference you want to add to your webpage.

Installation

Package installation

  • Select the "bibliography_package.zip"
  • Unzip the .zip file into the /moodle folder of your Moodle site
    • The package contains:
      • The activity module - which is the the core of the module
      • The filter - enabling the inclusion of references from your course bibliographies in your web pages
      • A patch to install the html editor bib icon
  • Login to the Moodle site as administrator and
  • In site administration block click on notifications
  • Moodle will install the Bibliography activity
  • Activate Bibliography filter on Modules>Filters administration

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

  • Optionally you may install the HTML editor bib icon - which will allow you to easily select the bibliographic reference you want to include on your webpage - by:
    • Running the patch on mod/bibliography/bibliography.patch
    • Installing it manually as described bellow

Optional 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 opt_bibicon.zip file into the /moodle folder
  • It will create:
    • 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. You may also change moodle/lib/editor/htmlarea/dialog.js to custom the popup window size.

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;


Changes dialog.js

Add the popup size:

       case "dlg_ins_smile": x = 330; y = 320; break;
       case "dlg_ins_bib": x = 540; y = 320; break; 

And that's all...

User Manual

Add Bibliography activity

To add a bibliography:

  • Press "Turn editing on"
  • Select Bibliography on "Add an activity"
  • Fill "Bibliography Fullname"
  • Describe you bibliography on "Bibliography Intro"
  • Choose general options (see below)
  • Press "Save..." button.

General options

  • "Entries shown per page" choose the number of items you want to display per page
  • "Allow comments" choose if you want to allow comments about your bibliography entries
  • "Allow students to insert entries" choose if you want to let students contribute to bibliography with their own entries