Select Git revision
-
Jan Dageförde authoredJan Dageförde authored
lib.php 19.94 KiB
<?php // $Id: lib.php,v 1.9.2.1 2011/07/21 22:46:30 adelamarre Exp $
/**
* @package mod
* @subpackage adobeconnect
* @author Akinsaya Delamarre (adelamarre@remote-learner.net)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once('locallib.php');
/**
* Library of functions and constants for module adobeconnect
* This file should have two well differenced parts:
* - All the core Moodle functions, neeeded to allow
* the module to work integrated in Moodle.
* - All the adobeconnect specific functions, needed
* to implement all the module logic. Please, note
* that, if the module become complex and this lib
* grows a lot, it's HIGHLY recommended to move all
* these module specific functions to a new php file,
* called "locallib.php" (see forum, quiz...). This will
* help to save some memory when Moodle is performing
* actions across all modules.
*/
$adobeconnect_EXAMPLE_CONSTANT = 42;
/** Include calendar/lib.php */
require_once($CFG->dirroot.'/calendar/lib.php');
/**
* @uses FEATURE_GROUPS
* @uses FEATURE_GROUPINGS
* @uses FEATURE_GROUPMEMBERSONLY
* @uses FEATURE_MOD_INTRO
* @uses FEATURE_COMPLETION_TRACKS_VIEWS
* @uses FEATURE_GRADE_HAS_GRADE
* @uses FEATURE_GRADE_OUTCOMES
* @param string $feature FEATURE_xx constant for requested feature
* @return mixed True if module supports feature, false if not, null if doesn't know
*/
function adobeconnect_supports($feature) {
switch($feature) {
case FEATURE_GROUPS: return true;
case FEATURE_GROUPINGS: return true;
case FEATURE_GROUPMEMBERSONLY: return true;
case FEATURE_MOD_INTRO: return true;
case FEATURE_COMPLETION_TRACKS_VIEWS: return false;
case FEATURE_GRADE_HAS_GRADE: return false;
case FEATURE_GRADE_OUTCOMES: return false;
case FEATURE_BACKUP_MOODLE2: return true;
default: return null;
}
}
/**
* Given an object containing all the necessary data,
* (defined by the form in mod_form.php) this function
* will create a new instance and return the id number
* of the new instance.
*
* @param object $adobeconnect An object from the form in mod_form.php
* @return int The id of the newly inserted adobeconnect record
*/
function adobeconnect_add_instance($adobeconnect) {
global $COURSE, $USER, $DB;
$adobeconnect->timecreated = time();