Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Files | Namespaces | Classes | Functions | Variables
mod_label

Files

file  access.php
 Capability definitions for the label module.
 
file  activity.php
 Search area for mod_label activities.
 
file  activity_base.php
 Activity base class.
 
file  backup_label_activity_task.class.php
 Defines backup_label_activity_task class.
 
file  backup_label_stepslib.php
 
file  cognitive_depth.php
 Cognitive depth indicator - label.
 
file  external.php
 Label external API.
 
file  lib.php
 Provides support for the conversion of moodle1 backup to the moodle2 format Based off of a template @ http://docs.moodle.org/dev/Backup_1.9_conversion_for_developers.
 
file  lib.php
 Library of functions and constants for module label.
 
file  lib.php
 mod_label data generator
 
file  log.php
 Definition of log events.
 
file  mod_form.php
 Add label form.
 
file  provider.php
 Privacy Subsystem implementation for mod_label.
 
file  restore_label_activity_task.class.php
 @subpackage backup-moodle2
 
file  restore_label_stepslib.php
 @subpackage backup-moodle2
 
file  services.php
 Label external functions and service definitions.
 
file  settings.php
 Resource module admin settings and defaults.
 
file  social_breadth.php
 Social breadth indicator - label.
 
file  upgrade.php
 Label module upgrade.
 
file  version.php
 Label module version info.
 

Namespaces

namespace  mod_label\analytics\indicator
  
 
namespace  mod_label\privacy
  
 
namespace  mod_label\search
  
 

Classes

class  backup_label_activity_structure_step
 Define all the backup steps that will be used by the backup_label_activity_task. More...
 
class  backup_label_activity_task
 Provides the steps to perform one complete backup of the Label instance. More...
 
class  mod_label\analytics\indicator\activity_base
 Activity base class. More...
 
class  mod_label\analytics\indicator\cognitive_depth
 Cognitive depth indicator - label. More...
 
class  mod_label\analytics\indicator\social_breadth
 Social breadth indicator - label. More...
 
class  mod_label\privacy\provider
 The mod_label module does not store any data. More...
 
class  mod_label\search\activity
 Search area for mod_label activities. More...
 
class  mod_label_external
 
class  mod_label_generator
 
class  mod_label_mod_form
 
class  moodle1_mod_label_handler
 Label conversion handler. More...
 
class  restore_label_activity_structure_step
 Define all the restore steps that will be used by the restore_url_activity_task. More...
 
class  restore_label_activity_task
 label restore task that provides all the settings and steps to perform one complete restore of the activity More...
 

Functions

 get_label_name ($label)
 @uses LABEL_MAX_NAME_LENGTH More...
 
object label_add_instance ($label)
 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. More...
 
 label_check_updates_since (cm_info $cm, $from, $filter=array())
 Check if the module has any update that affects the current user since a given time. More...
 
object label_delete_instance ($id)
 Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it. More...
 
 label_dndupload_handle ($uploadinfo)
 Handle a file that has been uploaded. More...
 
 label_dndupload_register ()
 Register the ability to handle drag and drop file uploads. More...
 
 label_generate_resized_image (stored_file $file, $maxwidth, $maxheight)
 Resize the image, if required, then generate an img tag and, if required, a link to the full-size image. More...
 
object label_get_coursemodule_info ($coursemodule)
 Given a course_module object, this function returns any "extra" information that may be needed when printing this activity in a course listing. More...
 
 label_reset_userdata ($data)
 This function is used by the reset_course_userdata function in moodlelib. More...
 
 label_supports ($feature)
 @uses FEATURE_IDNUMBER @uses FEATURE_GROUPS @uses FEATURE_GROUPINGS @uses FEATURE_MOD_INTRO @uses FEATURE_COMPLETION_TRACKS_VIEWS @uses FEATURE_GRADE_HAS_GRADE @uses FEATURE_GRADE_OUTCOMES More...
 
object label_update_instance ($label)
 Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will update an existing instance with new data. More...
 
 mod_label_core_calendar_provide_event_action (calendar_event $event, core_calendar\action_factory $factory, int $userid=0)
 This function receives a calendar event and returns the action associated with it, or null if there is none. More...
 
 xmldb_label_upgrade ($oldversion)
 

Variables

 $capabilities
 
 $functions
 
 $logs
 
 $plugin = 2020060900
 
$plugin component = 'mod_label'
 
$plugin cron = 0
 
const LABEL_MAX_NAME_LENGTH 50
 LABEL_MAX_NAME_LENGTH = 50.
 
$plugin version = 2020061500
 

Detailed Description

Function Documentation

◆ get_label_name()

get_label_name (   $label)

@uses LABEL_MAX_NAME_LENGTH

Parameters
object$label
Return values
string

◆ label_add_instance()

object label_add_instance (   $label)

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.

Parameters
object$label
Return values
bool|int

◆ label_check_updates_since()

label_check_updates_since ( cm_info  $cm,
  $from,
  $filter = array() 
)

Check if the module has any update that affects the current user since a given time.

Parameters
cm_info$cmcourse module data
int$fromthe time to check updates from
array$filterif we need to check only specific updates
Return values
stdClassan object with the different type of areas indicating if they were updated or not
Since
Moodle 3.2

◆ label_delete_instance()

object label_delete_instance (   $id)

Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it.

Parameters
int$id
Return values
bool

◆ label_dndupload_handle()

label_dndupload_handle (   $uploadinfo)

Handle a file that has been uploaded.

Parameters
object$uploadinfodetails of the file / content that has been uploaded
Return values
intinstance id of the newly created mod

◆ label_dndupload_register()

label_dndupload_register ( )

Register the ability to handle drag and drop file uploads.

Return values
arraycontaining details of the files / types the mod can handle

◆ label_generate_resized_image()

label_generate_resized_image ( stored_file  $file,
  $maxwidth,
  $maxheight 
)

Resize the image, if required, then generate an img tag and, if required, a link to the full-size image.

Parameters
stored_file$filethe image file to process
int$maxwidththe maximum width allowed for the image
int$maxheightthe maximum height allowed for the image
Return values
stringHTML fragment to add to the label

◆ label_get_coursemodule_info()

object label_get_coursemodule_info (   $coursemodule)

Given a course_module object, this function returns any "extra" information that may be needed when printing this activity in a course listing.

See get_array_of_activities() in course/lib.php

Parameters
object$coursemodule
Return values
cached_cm_info|null

◆ label_reset_userdata()

label_reset_userdata (   $data)

This function is used by the reset_course_userdata function in moodlelib.

Parameters
object$datathe data submitted from the reset course.
Return values
arraystatus array

◆ label_supports()

label_supports (   $feature)

@uses FEATURE_IDNUMBER @uses FEATURE_GROUPS @uses FEATURE_GROUPINGS @uses FEATURE_MOD_INTRO @uses FEATURE_COMPLETION_TRACKS_VIEWS @uses FEATURE_GRADE_HAS_GRADE @uses FEATURE_GRADE_OUTCOMES

Parameters
string$featureFEATURE_xx constant for requested feature
Return values
bool|nullTrue if module supports feature, false if not, null if doesn't know

◆ label_update_instance()

object label_update_instance (   $label)

Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will update an existing instance with new data.

Parameters
object$label
Return values
bool

◆ mod_label_core_calendar_provide_event_action()

mod_label_core_calendar_provide_event_action ( calendar_event  $event,
core_calendar\action_factory  $factory,
int  $userid = 0 
)

This function receives a calendar event and returns the action associated with it, or null if there is none.

This is used by block_myoverview in order to display the event appropriately. If null is returned then the event is not displayed on the block.

Parameters
calendar_event$event
core_calendar::action_factory$factory
int$useridUser id to use for all capability checks, etc. Set to 0 for current user (default).
Return values
core_calendar::local::event::entities::action_interface|null

Variable Documentation

◆ $capabilities

$capabilities
Initial value:
= array(
'mod/label:addinstance' => array(
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:manageactivities'
),
'mod/label:view' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'user' => CAP_ALLOW,
'guest' => CAP_ALLOW
)
),
)
const CONTEXT_COURSE
Course context level - one instances for each course.
Definition: accesslib.php:128
const CAP_ALLOW
Allow permission, overrides CAP_PREVENT defined in parent contexts.
Definition: accesslib.php:115
const RISK_XSS
Capability allows user to add scripted content - see
Definition: accesslib.php:143
const CONTEXT_MODULE
Course module context level - one instance for each course module.
Definition: accesslib.php:130

◆ $functions

$functions
Initial value:
= array(
'mod_label_get_labels_by_courses' => array(
'classname' => 'mod_label_external',
'methodname' => 'get_labels_by_courses',
'description' => 'Returns a list of labels in a provided list of courses, if no list is provided all labels that the user
can view will be returned.',
'type' => 'read',
'capabilities' => 'mod/label:view',
'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
),
)
const MOODLE_OFFICIAL_MOBILE_SERVICE
Moodle mobile app service name.
Definition: moodlelib.php:501

◆ $logs

$logs
Initial value:
= array(
array('module'=>'label', 'action'=>'add', 'mtable'=>'label', 'field'=>'name'),
array('module'=>'label', 'action'=>'update', 'mtable'=>'label', 'field'=>'name'),
)