Sloodle get visible glossaries in course

From SLIS Second Life Wiki
Jump to: navigation, search

Defined in: File.gif mod/glossary/sl_glossary_lib.php

Contents

Prototype

function sloodle_get_visible_glossaries_in_course( $course_id )


Summary

This function fetches an array of available Moodle glossaries in the identified course. It will ignore any glossary that is invisible, or in an invisible course section (i.e. topic or week). It is used by the Glossary linker script.


Parameters

  • $course_id : the integer identifier of the Moodle course to query


Return

On Success

If successful, this function will return a numeric array, associating course module instance ID's with their respective database records from the "glossary" table in the database.

  • Note: the database records will contain an id field, but this is separate from the course module instance ID stored as the array key. Course module instance ID's are unique per-instance of any module type. The id field within each instance is only unique within that particular module type. See the Moodle documentation for more information on this.
  • Note: in the event that there are no glossaries available in the course, an empty array will be returned.

On Failure

If an error occurs during the query, the function will return boolean FALSE. It is vital that you do not assume the return value will be an array! You can check the type using the standard PHP functions such as "is_bool(..)" and "is_array(..)".

The following situations may lead to FALSE being returned:

  • Parameter $course_id is not an integer
  • Parameter $course_id is an invalid course identifier (i.e. <= 0)
  • Database query failed for the glossary module (i.e. the glossary module is probably no installed)
  • Database query failed for sections in the specified course (i.e. the course may not exist)


See Also


This page is part of the SLOODLE documentation
Docs: Users | Administrators | Developers
Wiki Frontpage Sloodle.org
Personal tools