id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
212,100
moodle/moodle
lib/spout/src/Spout/Writer/XLSX/Internal/Worksheet.php
Worksheet.startSheet
protected function startSheet() { $this->sheetFilePointer = fopen($this->worksheetFilePath, 'w'); $this->throwIfSheetFilePointerIsNotAvailable(); fwrite($this->sheetFilePointer, self::SHEET_XML_FILE_HEADER); fwrite($this->sheetFilePointer, '<sheetData>'); }
php
protected function startSheet() { $this->sheetFilePointer = fopen($this->worksheetFilePath, 'w'); $this->throwIfSheetFilePointerIsNotAvailable(); fwrite($this->sheetFilePointer, self::SHEET_XML_FILE_HEADER); fwrite($this->sheetFilePointer, '<sheetData>'); }
[ "protected", "function", "startSheet", "(", ")", "{", "$", "this", "->", "sheetFilePointer", "=", "fopen", "(", "$", "this", "->", "worksheetFilePath", ",", "'w'", ")", ";", "$", "this", "->", "throwIfSheetFilePointerIsNotAvailable", "(", ")", ";", "fwrite", ...
Prepares the worksheet to accept data @return void @throws \Box\Spout\Common\Exception\IOException If the sheet data file cannot be opened for writing
[ "Prepares", "the", "worksheet", "to", "accept", "data" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Writer/XLSX/Internal/Worksheet.php#L89-L96
212,101
moodle/moodle
lib/spout/src/Spout/Writer/XLSX/Internal/Worksheet.php
Worksheet.isEmptyRow
protected function isEmptyRow($dataRow) { $numCells = count($dataRow); // using "reset()" instead of "$dataRow[0]" because $dataRow can be an associative array return ($numCells === 1 && CellHelper::isEmpty(reset($dataRow))); }
php
protected function isEmptyRow($dataRow) { $numCells = count($dataRow); // using "reset()" instead of "$dataRow[0]" because $dataRow can be an associative array return ($numCells === 1 && CellHelper::isEmpty(reset($dataRow))); }
[ "protected", "function", "isEmptyRow", "(", "$", "dataRow", ")", "{", "$", "numCells", "=", "count", "(", "$", "dataRow", ")", ";", "// using \"reset()\" instead of \"$dataRow[0]\" because $dataRow can be an associative array", "return", "(", "$", "numCells", "===", "1"...
Returns whether the given row is empty @param array $dataRow Array containing data to be written. Cannot be empty. Example $dataRow = ['data1', 1234, null, '', 'data5']; @return bool Whether the given row is empty
[ "Returns", "whether", "the", "given", "row", "is", "empty" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Writer/XLSX/Internal/Worksheet.php#L162-L167
212,102
moodle/moodle
lib/spout/src/Spout/Writer/XLSX/Internal/Worksheet.php
Worksheet.addNonEmptyRow
protected function addNonEmptyRow($dataRow, $style) { $cellNumber = 0; $rowIndex = $this->lastWrittenRowIndex + 1; $numCells = count($dataRow); $rowXML = '<row r="' . $rowIndex . '" spans="1:' . $numCells . '">'; foreach($dataRow as $cellValue) { $rowXML .= $thi...
php
protected function addNonEmptyRow($dataRow, $style) { $cellNumber = 0; $rowIndex = $this->lastWrittenRowIndex + 1; $numCells = count($dataRow); $rowXML = '<row r="' . $rowIndex . '" spans="1:' . $numCells . '">'; foreach($dataRow as $cellValue) { $rowXML .= $thi...
[ "protected", "function", "addNonEmptyRow", "(", "$", "dataRow", ",", "$", "style", ")", "{", "$", "cellNumber", "=", "0", ";", "$", "rowIndex", "=", "$", "this", "->", "lastWrittenRowIndex", "+", "1", ";", "$", "numCells", "=", "count", "(", "$", "data...
Adds non empty row to the worksheet. @param array $dataRow Array containing data to be written. Cannot be empty. Example $dataRow = ['data1', 1234, null, '', 'data5']; @param \Box\Spout\Writer\Style\Style $style Style to be applied to the row. NULL means use default style. @return void @throws \Box\Spout\Common\Except...
[ "Adds", "non", "empty", "row", "to", "the", "worksheet", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Writer/XLSX/Internal/Worksheet.php#L179-L198
212,103
moodle/moodle
lib/spout/src/Spout/Writer/XLSX/Internal/Worksheet.php
Worksheet.getCellXML
protected function getCellXML($rowIndex, $cellNumber, $cellValue, $styleId) { $columnIndex = CellHelper::getCellIndexFromColumnIndex($cellNumber); $cellXML = '<c r="' . $columnIndex . $rowIndex . '"'; $cellXML .= ' s="' . $styleId . '"'; if (CellHelper::isNonEmptyString($cellValue))...
php
protected function getCellXML($rowIndex, $cellNumber, $cellValue, $styleId) { $columnIndex = CellHelper::getCellIndexFromColumnIndex($cellNumber); $cellXML = '<c r="' . $columnIndex . $rowIndex . '"'; $cellXML .= ' s="' . $styleId . '"'; if (CellHelper::isNonEmptyString($cellValue))...
[ "protected", "function", "getCellXML", "(", "$", "rowIndex", ",", "$", "cellNumber", ",", "$", "cellValue", ",", "$", "styleId", ")", "{", "$", "columnIndex", "=", "CellHelper", "::", "getCellIndexFromColumnIndex", "(", "$", "cellNumber", ")", ";", "$", "cel...
Build and return xml for a single cell. @param int $rowIndex @param int $cellNumber @param mixed $cellValue @param int $styleId @return string @throws InvalidArgumentException If the given value cannot be processed
[ "Build", "and", "return", "xml", "for", "a", "single", "cell", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Writer/XLSX/Internal/Worksheet.php#L210-L235
212,104
moodle/moodle
lib/spout/src/Spout/Writer/XLSX/Internal/Worksheet.php
Worksheet.getCellXMLFragmentForNonEmptyString
protected function getCellXMLFragmentForNonEmptyString($cellValue) { if ($this->stringHelper->getStringLength($cellValue) > self::MAX_CHARACTERS_PER_CELL) { throw new InvalidArgumentException('Trying to add a value that exceeds the maximum number of characters allowed in a cell (32,767)'); ...
php
protected function getCellXMLFragmentForNonEmptyString($cellValue) { if ($this->stringHelper->getStringLength($cellValue) > self::MAX_CHARACTERS_PER_CELL) { throw new InvalidArgumentException('Trying to add a value that exceeds the maximum number of characters allowed in a cell (32,767)'); ...
[ "protected", "function", "getCellXMLFragmentForNonEmptyString", "(", "$", "cellValue", ")", "{", "if", "(", "$", "this", "->", "stringHelper", "->", "getStringLength", "(", "$", "cellValue", ")", ">", "self", "::", "MAX_CHARACTERS_PER_CELL", ")", "{", "throw", "...
Returns the XML fragment for a cell containing a non empty string @param string $cellValue The cell value @return string The XML fragment representing the cell @throws InvalidArgumentException If the string exceeds the maximum number of characters allowed per cell
[ "Returns", "the", "XML", "fragment", "for", "a", "cell", "containing", "a", "non", "empty", "string" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Writer/XLSX/Internal/Worksheet.php#L244-L258
212,105
moodle/moodle
lib/spout/src/Spout/Writer/XLSX/Internal/Worksheet.php
Worksheet.close
public function close() { if (!is_resource($this->sheetFilePointer)) { return; } fwrite($this->sheetFilePointer, '</sheetData>'); fwrite($this->sheetFilePointer, '</worksheet>'); fclose($this->sheetFilePointer); }
php
public function close() { if (!is_resource($this->sheetFilePointer)) { return; } fwrite($this->sheetFilePointer, '</sheetData>'); fwrite($this->sheetFilePointer, '</worksheet>'); fclose($this->sheetFilePointer); }
[ "public", "function", "close", "(", ")", "{", "if", "(", "!", "is_resource", "(", "$", "this", "->", "sheetFilePointer", ")", ")", "{", "return", ";", "}", "fwrite", "(", "$", "this", "->", "sheetFilePointer", ",", "'</sheetData>'", ")", ";", "fwrite", ...
Closes the worksheet @return void
[ "Closes", "the", "worksheet" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Writer/XLSX/Internal/Worksheet.php#L265-L274
212,106
moodle/moodle
lib/classes/event/user_deleted.php
user_deleted.get_legacy_eventdata
protected function get_legacy_eventdata() { $user = $this->get_record_snapshot('user', $this->objectid); $user->deleted = 0; $user->username = $this->other['username']; $user->email = $this->other['email']; $user->idnumber = $this->other['idnumber']; $user->picture = $thi...
php
protected function get_legacy_eventdata() { $user = $this->get_record_snapshot('user', $this->objectid); $user->deleted = 0; $user->username = $this->other['username']; $user->email = $this->other['email']; $user->idnumber = $this->other['idnumber']; $user->picture = $thi...
[ "protected", "function", "get_legacy_eventdata", "(", ")", "{", "$", "user", "=", "$", "this", "->", "get_record_snapshot", "(", "'user'", ",", "$", "this", "->", "objectid", ")", ";", "$", "user", "->", "deleted", "=", "0", ";", "$", "user", "->", "us...
Return user_deleted legacy event data. @return \stdClass user data.
[ "Return", "user_deleted", "legacy", "event", "data", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/event/user_deleted.php#L89-L98
212,107
moodle/moodle
cache/stores/mongodb/MongoDB/Database.php
Database.command
public function command($command, array $options = []) { if ( ! isset($options['readPreference'])) { $options['readPreference'] = $this->readPreference; } if ( ! isset($options['typeMap'])) { $options['typeMap'] = $this->typeMap; } $operation = new D...
php
public function command($command, array $options = []) { if ( ! isset($options['readPreference'])) { $options['readPreference'] = $this->readPreference; } if ( ! isset($options['typeMap'])) { $options['typeMap'] = $this->typeMap; } $operation = new D...
[ "public", "function", "command", "(", "$", "command", ",", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "!", "isset", "(", "$", "options", "[", "'readPreference'", "]", ")", ")", "{", "$", "options", "[", "'readPreference'", "]", "=",...
Execute a command on this database. @see DatabaseCommand::__construct() for supported options @param array|object $command Command document @param array $options Options for command execution @return Cursor @throws InvalidArgumentException for parameter/option parsing errors @throws DriverRuntimeException for o...
[ "Execute", "a", "command", "on", "this", "database", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Database.php#L168-L182
212,108
moodle/moodle
cache/stores/mongodb/MongoDB/Database.php
Database.createCollection
public function createCollection($collectionName, array $options = []) { if ( ! isset($options['typeMap'])) { $options['typeMap'] = $this->typeMap; } $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); if ( ! isset($options['writeConc...
php
public function createCollection($collectionName, array $options = []) { if ( ! isset($options['typeMap'])) { $options['typeMap'] = $this->typeMap; } $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); if ( ! isset($options['writeConc...
[ "public", "function", "createCollection", "(", "$", "collectionName", ",", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "!", "isset", "(", "$", "options", "[", "'typeMap'", "]", ")", ")", "{", "$", "options", "[", "'typeMap'", "]", "=...
Create a new collection explicitly. @see CreateCollection::__construct() for supported options @param string $collectionName @param array $options @return array|object Command result document @throws UnsupportedException if options are not supported by the selected server @throws InvalidArgumentException for paramete...
[ "Create", "a", "new", "collection", "explicitly", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Database.php#L195-L210
212,109
moodle/moodle
cache/stores/mongodb/MongoDB/Database.php
Database.listCollections
public function listCollections(array $options = []) { $operation = new ListCollections($this->databaseName, $options); $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); return $operation->execute($server); }
php
public function listCollections(array $options = []) { $operation = new ListCollections($this->databaseName, $options); $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); return $operation->execute($server); }
[ "public", "function", "listCollections", "(", "array", "$", "options", "=", "[", "]", ")", "{", "$", "operation", "=", "new", "ListCollections", "(", "$", "this", "->", "databaseName", ",", "$", "options", ")", ";", "$", "server", "=", "$", "this", "->...
Returns information for all collections in this database. @see ListCollections::__construct() for supported options @param array $options @return CollectionInfoIterator @throws InvalidArgumentException for parameter/option parsing errors @throws DriverRuntimeException for other driver errors (e.g. connection errors)
[ "Returns", "information", "for", "all", "collections", "in", "this", "database", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Database.php#L338-L344
212,110
moodle/moodle
cache/stores/mongodb/MongoDB/Database.php
Database.modifyCollection
public function modifyCollection($collectionName, array $collectionOptions, array $options = []) { if ( ! isset($options['typeMap'])) { $options['typeMap'] = $this->typeMap; } $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); if ( !...
php
public function modifyCollection($collectionName, array $collectionOptions, array $options = []) { if ( ! isset($options['typeMap'])) { $options['typeMap'] = $this->typeMap; } $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); if ( !...
[ "public", "function", "modifyCollection", "(", "$", "collectionName", ",", "array", "$", "collectionOptions", ",", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "!", "isset", "(", "$", "options", "[", "'typeMap'", "]", ")", ")", "{", "$"...
Modifies a collection or view. @see ModifyCollection::__construct() for supported options @param string $collectionName Collection or view to modify @param array $collectionOptions Collection or view options to assign @param array $options Command options @throws InvalidArgumentException for parameter/o...
[ "Modifies", "a", "collection", "or", "view", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Database.php#L356-L371
212,111
moodle/moodle
cache/stores/mongodb/MongoDB/Database.php
Database.selectGridFSBucket
public function selectGridFSBucket(array $options = []) { $options += [ 'readConcern' => $this->readConcern, 'readPreference' => $this->readPreference, 'typeMap' => $this->typeMap, 'writeConcern' => $this->writeConcern, ]; return new Bucket($t...
php
public function selectGridFSBucket(array $options = []) { $options += [ 'readConcern' => $this->readConcern, 'readPreference' => $this->readPreference, 'typeMap' => $this->typeMap, 'writeConcern' => $this->writeConcern, ]; return new Bucket($t...
[ "public", "function", "selectGridFSBucket", "(", "array", "$", "options", "=", "[", "]", ")", "{", "$", "options", "+=", "[", "'readConcern'", "=>", "$", "this", "->", "readConcern", ",", "'readPreference'", "=>", "$", "this", "->", "readPreference", ",", ...
Select a GridFS bucket within this database. @see Bucket::__construct() for supported options @param array $options Bucket constructor options @return Bucket @throws InvalidArgumentException for parameter/option parsing errors
[ "Select", "a", "GridFS", "bucket", "within", "this", "database", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Database.php#L402-L412
212,112
moodle/moodle
cache/stores/mongodb/MongoDB/Database.php
Database.withOptions
public function withOptions(array $options = []) { $options += [ 'readConcern' => $this->readConcern, 'readPreference' => $this->readPreference, 'typeMap' => $this->typeMap, 'writeConcern' => $this->writeConcern, ]; return new Database($this->...
php
public function withOptions(array $options = []) { $options += [ 'readConcern' => $this->readConcern, 'readPreference' => $this->readPreference, 'typeMap' => $this->typeMap, 'writeConcern' => $this->writeConcern, ]; return new Database($this->...
[ "public", "function", "withOptions", "(", "array", "$", "options", "=", "[", "]", ")", "{", "$", "options", "+=", "[", "'readConcern'", "=>", "$", "this", "->", "readConcern", ",", "'readPreference'", "=>", "$", "this", "->", "readPreference", ",", "'typeM...
Get a clone of this database with different options. @see Database::__construct() for supported options @param array $options Database constructor options @return Database @throws InvalidArgumentException for parameter/option parsing errors
[ "Get", "a", "clone", "of", "this", "database", "with", "different", "options", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Database.php#L452-L462
212,113
moodle/moodle
lib/phpexcel/PHPExcel/Exception.php
PHPExcel_Exception.errorHandlerCallback
public static function errorHandlerCallback($code, $string, $file, $line, $context) { $e = new self($string, $code); $e->line = $line; $e->file = $file; throw $e; }
php
public static function errorHandlerCallback($code, $string, $file, $line, $context) { $e = new self($string, $code); $e->line = $line; $e->file = $file; throw $e; }
[ "public", "static", "function", "errorHandlerCallback", "(", "$", "code", ",", "$", "string", ",", "$", "file", ",", "$", "line", ",", "$", "context", ")", "{", "$", "e", "=", "new", "self", "(", "$", "string", ",", "$", "code", ")", ";", "$", "e...
Error handler callback @param mixed $code @param mixed $string @param mixed $file @param mixed $line @param mixed $context
[ "Error", "handler", "callback" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Exception.php#L47-L53
212,114
moodle/moodle
backup/util/settings/base_setting.class.php
base_setting.get_my_dependency_properties
public function get_my_dependency_properties($settingname=null) { if ($settingname == null) { $settingname = $this->get_ui_name(); } $dependencies = array(); foreach ($this->dependenton as $dependenton) { $properties = $dependenton->get_moodleform_properties(); ...
php
public function get_my_dependency_properties($settingname=null) { if ($settingname == null) { $settingname = $this->get_ui_name(); } $dependencies = array(); foreach ($this->dependenton as $dependenton) { $properties = $dependenton->get_moodleform_properties(); ...
[ "public", "function", "get_my_dependency_properties", "(", "$", "settingname", "=", "null", ")", "{", "if", "(", "$", "settingname", "==", "null", ")", "{", "$", "settingname", "=", "$", "this", "->", "get_ui_name", "(", ")", ";", "}", "$", "dependencies",...
Gets an array of properties for all of the dependencies that will affect this setting. This method returns an array rather than the dependencies in order to minimise the memory footprint of for the potentially huge recursive dependency structure that we may be dealing with. This method also ensures that all dependenc...
[ "Gets", "an", "array", "of", "properties", "for", "all", "of", "the", "dependencies", "that", "will", "affect", "this", "setting", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/settings/base_setting.class.php#L252-L264
212,115
moodle/moodle
backup/util/settings/base_setting.class.php
base_setting.register_dependency
public function register_dependency(setting_dependency $dependency) { if ($this->is_circular_reference($dependency->get_dependent_setting())) { $a = new stdclass(); $a->alreadydependent = $this->name; $a->main = $dependency->get_dependent_setting()->get_name(); th...
php
public function register_dependency(setting_dependency $dependency) { if ($this->is_circular_reference($dependency->get_dependent_setting())) { $a = new stdclass(); $a->alreadydependent = $this->name; $a->main = $dependency->get_dependent_setting()->get_name(); th...
[ "public", "function", "register_dependency", "(", "setting_dependency", "$", "dependency", ")", "{", "if", "(", "$", "this", "->", "is_circular_reference", "(", "$", "dependency", "->", "get_dependent_setting", "(", ")", ")", ")", "{", "$", "a", "=", "new", ...
Adds a dependency where another setting depends on this setting. @param setting_dependency $dependency
[ "Adds", "a", "dependency", "where", "another", "setting", "depends", "on", "this", "setting", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/settings/base_setting.class.php#L316-L325
212,116
moodle/moodle
backup/util/settings/base_setting.class.php
base_setting.add_dependency
public function add_dependency(base_setting $dependentsetting, $type=null, $options=array()) { if ($this->is_circular_reference($dependentsetting)) { $a = new stdclass(); $a->alreadydependent = $this->name; $a->main = $dependentsetting->get_name(); throw new base_...
php
public function add_dependency(base_setting $dependentsetting, $type=null, $options=array()) { if ($this->is_circular_reference($dependentsetting)) { $a = new stdclass(); $a->alreadydependent = $this->name; $a->main = $dependentsetting->get_name(); throw new base_...
[ "public", "function", "add_dependency", "(", "base_setting", "$", "dependentsetting", ",", "$", "type", "=", "null", ",", "$", "options", "=", "array", "(", ")", ")", "{", "if", "(", "$", "this", "->", "is_circular_reference", "(", "$", "dependentsetting", ...
Quick method to add a dependency to this setting. The dependency created is done so by inspecting this setting and the setting that is passed in as the dependent setting. @param base_setting $dependentsetting @param int $type One of setting_dependency::* @param array $options
[ "Quick", "method", "to", "add", "a", "dependency", "to", "this", "setting", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/settings/base_setting.class.php#L347-L419
212,117
moodle/moodle
backup/util/settings/base_setting.class.php
base_setting.get_param_validation
public function get_param_validation() { switch ($this->vtype) { case self::IS_BOOLEAN: return PARAM_BOOL; case self::IS_INTEGER: return PARAM_INT; case self::IS_FILENAME: return PARAM_FILE; case self::IS_PATH: ...
php
public function get_param_validation() { switch ($this->vtype) { case self::IS_BOOLEAN: return PARAM_BOOL; case self::IS_INTEGER: return PARAM_INT; case self::IS_FILENAME: return PARAM_FILE; case self::IS_PATH: ...
[ "public", "function", "get_param_validation", "(", ")", "{", "switch", "(", "$", "this", "->", "vtype", ")", "{", "case", "self", "::", "IS_BOOLEAN", ":", "return", "PARAM_BOOL", ";", "case", "self", "::", "IS_INTEGER", ":", "return", "PARAM_INT", ";", "ca...
Get the PARAM_XXXX validation to be applied to the setting @return string The PARAM_XXXX constant of null if the setting type is not defined
[ "Get", "the", "PARAM_XXXX", "validation", "to", "be", "applied", "to", "the", "setting" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/settings/base_setting.class.php#L426-L440
212,118
moodle/moodle
question/type/gapselect/questiontypebase.php
qtype_gapselect_base.get_correct_answers
protected function get_correct_answers($question) { $arrayofchoices = $this->get_array_of_choices($question); $arrayofplaceholdeers = $this->get_array_of_placeholders($question); $correctplayers = array(); foreach ($arrayofplaceholdeers as $ph) { foreach ($arrayofchoices as ...
php
protected function get_correct_answers($question) { $arrayofchoices = $this->get_array_of_choices($question); $arrayofplaceholdeers = $this->get_array_of_placeholders($question); $correctplayers = array(); foreach ($arrayofplaceholdeers as $ph) { foreach ($arrayofchoices as ...
[ "protected", "function", "get_correct_answers", "(", "$", "question", ")", "{", "$", "arrayofchoices", "=", "$", "this", "->", "get_array_of_choices", "(", "$", "question", ")", ";", "$", "arrayofplaceholdeers", "=", "$", "this", "->", "get_array_of_placeholders",...
This method gets the correct answers in a 2 dimentional array. @param object $question @return array of groups
[ "This", "method", "gets", "the", "correct", "answers", "in", "a", "2", "dimentional", "array", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/type/gapselect/questiontypebase.php#L238-L251
212,119
moodle/moodle
question/type/gapselect/questiontypebase.php
qtype_gapselect_base.get_array_of_placeholders
protected function get_array_of_placeholders($question) { $qtext = $question->questiontext; $error = '<b> ERROR</b>: Please check the form for this question. '; if (!$qtext) { echo $error . 'The question text is empty!'; return false; } // Get the slots. ...
php
protected function get_array_of_placeholders($question) { $qtext = $question->questiontext; $error = '<b> ERROR</b>: Please check the form for this question. '; if (!$qtext) { echo $error . 'The question text is empty!'; return false; } // Get the slots. ...
[ "protected", "function", "get_array_of_placeholders", "(", "$", "question", ")", "{", "$", "qtext", "=", "$", "question", "->", "questiontext", ";", "$", "error", "=", "'<b> ERROR</b>: Please check the form for this question. '", ";", "if", "(", "!", "$", "qtext", ...
Return the list of groups used in a question. @param stdClass $question the question data. @return array the groups used, or false if an error occurs.
[ "Return", "the", "list", "of", "groups", "used", "in", "a", "question", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/type/gapselect/questiontypebase.php#L258-L279
212,120
moodle/moodle
lib/completionlib.php
completion_info.is_enabled
public function is_enabled($cm = null) { global $CFG, $DB; // First check global completion if (!isset($CFG->enablecompletion) || $CFG->enablecompletion == COMPLETION_DISABLED) { return COMPLETION_DISABLED; } // Load data if we do not have enough if (!isset(...
php
public function is_enabled($cm = null) { global $CFG, $DB; // First check global completion if (!isset($CFG->enablecompletion) || $CFG->enablecompletion == COMPLETION_DISABLED) { return COMPLETION_DISABLED; } // Load data if we do not have enough if (!isset(...
[ "public", "function", "is_enabled", "(", "$", "cm", "=", "null", ")", "{", "global", "$", "CFG", ",", "$", "DB", ";", "// First check global completion", "if", "(", "!", "isset", "(", "$", "CFG", "->", "enablecompletion", ")", "||", "$", "CFG", "->", "...
Checks whether completion is enabled in a particular course and possibly activity. @param stdClass|cm_info $cm Course-module object. If not specified, returns the course completion enable state. @return mixed COMPLETION_ENABLED or COMPLETION_DISABLED (==0) in the case of site and course; COMPLETION_TRACKING_MANUAL, _A...
[ "Checks", "whether", "completion", "is", "enabled", "in", "a", "particular", "course", "and", "possibly", "activity", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L279-L304
212,121
moodle/moodle
lib/completionlib.php
completion_info.display_help_icon
public function display_help_icon() { global $PAGE, $OUTPUT, $USER; $result = ''; if ($this->is_enabled() && !$PAGE->user_is_editing() && $this->is_tracked_user($USER->id) && isloggedin() && !isguestuser()) { $result .= html_writer::tag('div', get_string('yourprogress...
php
public function display_help_icon() { global $PAGE, $OUTPUT, $USER; $result = ''; if ($this->is_enabled() && !$PAGE->user_is_editing() && $this->is_tracked_user($USER->id) && isloggedin() && !isguestuser()) { $result .= html_writer::tag('div', get_string('yourprogress...
[ "public", "function", "display_help_icon", "(", ")", "{", "global", "$", "PAGE", ",", "$", "OUTPUT", ",", "$", "USER", ";", "$", "result", "=", "''", ";", "if", "(", "$", "this", "->", "is_enabled", "(", ")", "&&", "!", "$", "PAGE", "->", "user_is_...
Returns the 'Your progress' help icon, if completion tracking is enabled. @return string HTML code for help icon, or blank if not needed
[ "Returns", "the", "Your", "progress", "help", "icon", "if", "completion", "tracking", "is", "enabled", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L321-L331
212,122
moodle/moodle
lib/completionlib.php
completion_info.get_completion
public function get_completion($user_id, $criteriatype) { $completions = $this->get_completions($user_id, $criteriatype); if (empty($completions)) { return false; } elseif (count($completions) > 1) { print_error('multipleselfcompletioncriteria', 'completion'); } ...
php
public function get_completion($user_id, $criteriatype) { $completions = $this->get_completions($user_id, $criteriatype); if (empty($completions)) { return false; } elseif (count($completions) > 1) { print_error('multipleselfcompletioncriteria', 'completion'); } ...
[ "public", "function", "get_completion", "(", "$", "user_id", ",", "$", "criteriatype", ")", "{", "$", "completions", "=", "$", "this", "->", "get_completions", "(", "$", "user_id", ",", "$", "criteriatype", ")", ";", "if", "(", "empty", "(", "$", "comple...
Get a course completion for a user @param int $user_id User id @param int $criteriatype Specific criteria type to return @return bool|completion_criteria_completion returns false on fail
[ "Get", "a", "course", "completion", "for", "a", "user" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L340-L350
212,123
moodle/moodle
lib/completionlib.php
completion_info.get_completions
public function get_completions($user_id, $criteriatype = null) { $criteria = $this->get_criteria($criteriatype); $completions = array(); foreach ($criteria as $criterion) { $params = array( 'course' => $this->course_id, 'userid' => $us...
php
public function get_completions($user_id, $criteriatype = null) { $criteria = $this->get_criteria($criteriatype); $completions = array(); foreach ($criteria as $criterion) { $params = array( 'course' => $this->course_id, 'userid' => $us...
[ "public", "function", "get_completions", "(", "$", "user_id", ",", "$", "criteriatype", "=", "null", ")", "{", "$", "criteria", "=", "$", "this", "->", "get_criteria", "(", "$", "criteriatype", ")", ";", "$", "completions", "=", "array", "(", ")", ";", ...
Get all course criteria's completion objects for a user @param int $user_id User id @param int $criteriatype Specific criteria type to return (optional) @return array
[ "Get", "all", "course", "criteria", "s", "completion", "objects", "for", "a", "user" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L359-L378
212,124
moodle/moodle
lib/completionlib.php
completion_info.get_user_completion
public function get_user_completion($user_id, $criteria) { $params = array( 'course' => $this->course_id, 'userid' => $user_id, 'criteriaid' => $criteria->id, ); $completion = new completion_criteria_completion($params); return $compl...
php
public function get_user_completion($user_id, $criteria) { $params = array( 'course' => $this->course_id, 'userid' => $user_id, 'criteriaid' => $criteria->id, ); $completion = new completion_criteria_completion($params); return $compl...
[ "public", "function", "get_user_completion", "(", "$", "user_id", ",", "$", "criteria", ")", "{", "$", "params", "=", "array", "(", "'course'", "=>", "$", "this", "->", "course_id", ",", "'userid'", "=>", "$", "user_id", ",", "'criteriaid'", "=>", "$", "...
Get completion object for a user and a criteria @param int $user_id User id @param completion_criteria $criteria Criteria object @return completion_criteria_completion
[ "Get", "completion", "object", "for", "a", "user", "and", "a", "criteria" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L387-L396
212,125
moodle/moodle
lib/completionlib.php
completion_info.get_criteria
public function get_criteria($criteriatype = null) { // Fill cache if empty if (!is_array($this->criteria)) { global $DB; $params = array( 'course' => $this->course->id ); // Load criteria from database $records = (array)$...
php
public function get_criteria($criteriatype = null) { // Fill cache if empty if (!is_array($this->criteria)) { global $DB; $params = array( 'course' => $this->course->id ); // Load criteria from database $records = (array)$...
[ "public", "function", "get_criteria", "(", "$", "criteriatype", "=", "null", ")", "{", "// Fill cache if empty", "if", "(", "!", "is_array", "(", "$", "this", "->", "criteria", ")", ")", "{", "global", "$", "DB", ";", "$", "params", "=", "array", "(", ...
Get course completion criteria @param int $criteriatype Specific criteria type to return (optional)
[ "Get", "course", "completion", "criteria" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L414-L466
212,126
moodle/moodle
lib/completionlib.php
completion_info.get_aggregation_method
public function get_aggregation_method($criteriatype = null) { $params = array( 'course' => $this->course_id, 'criteriatype' => $criteriatype ); $aggregation = new completion_aggregation($params); if (!$aggregation->id) { $aggregation->method...
php
public function get_aggregation_method($criteriatype = null) { $params = array( 'course' => $this->course_id, 'criteriatype' => $criteriatype ); $aggregation = new completion_aggregation($params); if (!$aggregation->id) { $aggregation->method...
[ "public", "function", "get_aggregation_method", "(", "$", "criteriatype", "=", "null", ")", "{", "$", "params", "=", "array", "(", "'course'", "=>", "$", "this", "->", "course_id", ",", "'criteriatype'", "=>", "$", "criteriatype", ")", ";", "$", "aggregation...
Get aggregation method @param int $criteriatype If none supplied, get overall aggregation method (optional) @return int One of COMPLETION_AGGREGATION_ALL or COMPLETION_AGGREGATION_ANY
[ "Get", "aggregation", "method" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L474-L487
212,127
moodle/moodle
lib/completionlib.php
completion_info.clear_criteria
public function clear_criteria() { global $DB; $DB->delete_records('course_completion_criteria', array('course' => $this->course_id)); $DB->delete_records('course_completion_aggr_methd', array('course' => $this->course_id)); $this->delete_course_completion_data(); }
php
public function clear_criteria() { global $DB; $DB->delete_records('course_completion_criteria', array('course' => $this->course_id)); $DB->delete_records('course_completion_aggr_methd', array('course' => $this->course_id)); $this->delete_course_completion_data(); }
[ "public", "function", "clear_criteria", "(", ")", "{", "global", "$", "DB", ";", "$", "DB", "->", "delete_records", "(", "'course_completion_criteria'", ",", "array", "(", "'course'", "=>", "$", "this", "->", "course_id", ")", ")", ";", "$", "DB", "->", ...
Clear old course completion criteria
[ "Clear", "old", "course", "completion", "criteria" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L499-L505
212,128
moodle/moodle
lib/completionlib.php
completion_info.is_course_complete
public function is_course_complete($user_id) { $params = array( 'userid' => $user_id, 'course' => $this->course_id ); $ccompletion = new completion_completion($params); return $ccompletion->is_complete(); }
php
public function is_course_complete($user_id) { $params = array( 'userid' => $user_id, 'course' => $this->course_id ); $ccompletion = new completion_completion($params); return $ccompletion->is_complete(); }
[ "public", "function", "is_course_complete", "(", "$", "user_id", ")", "{", "$", "params", "=", "array", "(", "'userid'", "=>", "$", "user_id", ",", "'course'", "=>", "$", "this", "->", "course_id", ")", ";", "$", "ccompletion", "=", "new", "completion_comp...
Has the supplied user completed this course @param int $user_id User's id @return boolean
[ "Has", "the", "supplied", "user", "completed", "this", "course" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L513-L521
212,129
moodle/moodle
lib/completionlib.php
completion_info.internal_get_state
public function internal_get_state($cm, $userid, $current) { global $USER, $DB, $CFG; // Get user ID if (!$userid) { $userid = $USER->id; } // Check viewed if ($cm->completionview == COMPLETION_VIEW_REQUIRED && $current->viewed == COMPLETION_NOT_...
php
public function internal_get_state($cm, $userid, $current) { global $USER, $DB, $CFG; // Get user ID if (!$userid) { $userid = $USER->id; } // Check viewed if ($cm->completionview == COMPLETION_VIEW_REQUIRED && $current->viewed == COMPLETION_NOT_...
[ "public", "function", "internal_get_state", "(", "$", "cm", ",", "$", "userid", ",", "$", "current", ")", "{", "global", "$", "USER", ",", "$", "DB", ",", "$", "CFG", ";", "// Get user ID", "if", "(", "!", "$", "userid", ")", "{", "$", "userid", "=...
Calculates the completion state for an activity and user. Internal function. Not private, so we can unit-test it. @param stdClass|cm_info $cm Activity @param int $userid ID of user @param stdClass $current Previous completion information from database @return mixed
[ "Calculates", "the", "completion", "state", "for", "an", "activity", "and", "user", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L636-L700
212,130
moodle/moodle
lib/completionlib.php
completion_info.set_module_viewed
public function set_module_viewed($cm, $userid=0) { global $PAGE; if ($PAGE->headerprinted) { debugging('set_module_viewed must be called before header is printed', DEBUG_DEVELOPER); } // Don't do anything if view condition is not turned on if ($c...
php
public function set_module_viewed($cm, $userid=0) { global $PAGE; if ($PAGE->headerprinted) { debugging('set_module_viewed must be called before header is printed', DEBUG_DEVELOPER); } // Don't do anything if view condition is not turned on if ($c...
[ "public", "function", "set_module_viewed", "(", "$", "cm", ",", "$", "userid", "=", "0", ")", "{", "global", "$", "PAGE", ";", "if", "(", "$", "PAGE", "->", "headerprinted", ")", "{", "debugging", "(", "'set_module_viewed must be called before header is printed'...
Marks a module as viewed. Should be called whenever a module is 'viewed' (it is up to the module how to determine that). Has no effect if viewing is not set as a completion condition. Note that this function must be called before you print the page header because it is possible that the navigation block may depend on...
[ "Marks", "a", "module", "as", "viewed", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L716-L741
212,131
moodle/moodle
lib/completionlib.php
completion_info.count_course_user_data
public function count_course_user_data($user_id = null) { global $DB; $sql = ' SELECT COUNT(1) FROM {course_completion_crit_compl} WHERE course = ? '; $params = array($this->course_id); // Limit data to a single user if an ID is supplied ...
php
public function count_course_user_data($user_id = null) { global $DB; $sql = ' SELECT COUNT(1) FROM {course_completion_crit_compl} WHERE course = ? '; $params = array($this->course_id); // Limit data to a single user if an ID is supplied ...
[ "public", "function", "count_course_user_data", "(", "$", "user_id", "=", "null", ")", "{", "global", "$", "DB", ";", "$", "sql", "=", "'\n SELECT\n COUNT(1)\n FROM\n {course_completion_crit_compl}\n WHERE\n course = ?\n '", ";", "$", "par...
Determines how much course completion data exists for a course. This is used when deciding whether completion information should be 'locked' in the completion settings form and activity completion settings. @param int $user_id Optionally only get course completion data for a single user @return int The number of users...
[ "Determines", "how", "much", "course", "completion", "data", "exists", "for", "a", "course", ".", "This", "is", "used", "when", "deciding", "whether", "completion", "information", "should", "be", "locked", "in", "the", "completion", "settings", "form", "and", ...
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L773-L794
212,132
moodle/moodle
lib/completionlib.php
completion_info.delete_course_completion_data
public function delete_course_completion_data() { global $DB; $DB->delete_records('course_completions', array('course' => $this->course_id)); $DB->delete_records('course_completion_crit_compl', array('course' => $this->course_id)); // Difficult to find affected users, just purge all co...
php
public function delete_course_completion_data() { global $DB; $DB->delete_records('course_completions', array('course' => $this->course_id)); $DB->delete_records('course_completion_crit_compl', array('course' => $this->course_id)); // Difficult to find affected users, just purge all co...
[ "public", "function", "delete_course_completion_data", "(", ")", "{", "global", "$", "DB", ";", "$", "DB", "->", "delete_records", "(", "'course_completions'", ",", "array", "(", "'course'", "=>", "$", "this", "->", "course_id", ")", ")", ";", "$", "DB", "...
Deletes all course completion completion data. Intended to be used when unlocking completion criteria settings.
[ "Deletes", "all", "course", "completion", "completion", "data", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L810-L819
212,133
moodle/moodle
lib/completionlib.php
completion_info.delete_all_state
public function delete_all_state($cm) { global $DB; // Delete from database $DB->delete_records('course_modules_completion', array('coursemoduleid'=>$cm->id)); // Check if there is an associated course completion criteria $criteria = $this->get_criteria(COMPLETION_CRITERIA_TYPE...
php
public function delete_all_state($cm) { global $DB; // Delete from database $DB->delete_records('course_modules_completion', array('coursemoduleid'=>$cm->id)); // Check if there is an associated course completion criteria $criteria = $this->get_criteria(COMPLETION_CRITERIA_TYPE...
[ "public", "function", "delete_all_state", "(", "$", "cm", ")", "{", "global", "$", "DB", ";", "// Delete from database", "$", "DB", "->", "delete_records", "(", "'course_modules_completion'", ",", "array", "(", "'coursemoduleid'", "=>", "$", "cm", "->", "id", ...
Deletes completion state related to an activity for all users. Intended for use only when the activity itself is deleted. @param stdClass|cm_info $cm Activity
[ "Deletes", "completion", "state", "related", "to", "an", "activity", "for", "all", "users", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L846-L871
212,134
moodle/moodle
lib/completionlib.php
completion_info.reset_all_state
public function reset_all_state($cm) { global $DB; if ($cm->completion == COMPLETION_TRACKING_MANUAL) { $this->delete_all_state($cm); return; } // Get current list of users with completion state $rs = $DB->get_recordset('course_modules_completion', array(...
php
public function reset_all_state($cm) { global $DB; if ($cm->completion == COMPLETION_TRACKING_MANUAL) { $this->delete_all_state($cm); return; } // Get current list of users with completion state $rs = $DB->get_recordset('course_modules_completion', array(...
[ "public", "function", "reset_all_state", "(", "$", "cm", ")", "{", "global", "$", "DB", ";", "if", "(", "$", "cm", "->", "completion", "==", "COMPLETION_TRACKING_MANUAL", ")", "{", "$", "this", "->", "delete_all_state", "(", "$", "cm", ")", ";", "return"...
Recalculates completion state related to an activity for all users. Intended for use if completion conditions change. (This should be avoided as it may cause some things to become incomplete when they were previously complete, with the effect - for example - of hiding a later activity that was previously available.) ...
[ "Recalculates", "completion", "state", "related", "to", "an", "activity", "for", "all", "users", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L886-L915
212,135
moodle/moodle
lib/completionlib.php
completion_info.has_activities
public function has_activities() { $modinfo = get_fast_modinfo($this->course); foreach ($modinfo->get_cms() as $cm) { if ($cm->completion != COMPLETION_TRACKING_NONE) { return true; } } return false; }
php
public function has_activities() { $modinfo = get_fast_modinfo($this->course); foreach ($modinfo->get_cms() as $cm) { if ($cm->completion != COMPLETION_TRACKING_NONE) { return true; } } return false; }
[ "public", "function", "has_activities", "(", ")", "{", "$", "modinfo", "=", "get_fast_modinfo", "(", "$", "this", "->", "course", ")", ";", "foreach", "(", "$", "modinfo", "->", "get_cms", "(", ")", "as", "$", "cm", ")", "{", "if", "(", "$", "cm", ...
Return whether or not the course has activities with completion enabled. @return boolean true when there is at least one activity with completion enabled.
[ "Return", "whether", "or", "not", "the", "course", "has", "activities", "with", "completion", "enabled", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L1097-L1105
212,136
moodle/moodle
lib/completionlib.php
completion_info.get_activities
public function get_activities() { $modinfo = get_fast_modinfo($this->course); $result = array(); foreach ($modinfo->get_cms() as $cm) { if ($cm->completion != COMPLETION_TRACKING_NONE && !$cm->deletioninprogress) { $result[$cm->id] = $cm; } } ...
php
public function get_activities() { $modinfo = get_fast_modinfo($this->course); $result = array(); foreach ($modinfo->get_cms() as $cm) { if ($cm->completion != COMPLETION_TRACKING_NONE && !$cm->deletioninprogress) { $result[$cm->id] = $cm; } } ...
[ "public", "function", "get_activities", "(", ")", "{", "$", "modinfo", "=", "get_fast_modinfo", "(", "$", "this", "->", "course", ")", ";", "$", "result", "=", "array", "(", ")", ";", "foreach", "(", "$", "modinfo", "->", "get_cms", "(", ")", "as", "...
Obtains a list of activities for which completion is enabled on the course. The list is ordered by the section order of those activities. @return cm_info[] Array from $cmid => $cm of all activities with completion enabled, empty array if none
[ "Obtains", "a", "list", "of", "activities", "for", "which", "completion", "is", "enabled", "on", "the", "course", ".", "The", "list", "is", "ordered", "by", "the", "section", "order", "of", "those", "activities", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L1114-L1123
212,137
moodle/moodle
lib/completionlib.php
completion_info.is_tracked_user
public function is_tracked_user($userid) { return is_enrolled(context_course::instance($this->course->id), $userid, 'moodle/course:isincompletionreports', true); }
php
public function is_tracked_user($userid) { return is_enrolled(context_course::instance($this->course->id), $userid, 'moodle/course:isincompletionreports', true); }
[ "public", "function", "is_tracked_user", "(", "$", "userid", ")", "{", "return", "is_enrolled", "(", "context_course", "::", "instance", "(", "$", "this", "->", "course", "->", "id", ")", ",", "$", "userid", ",", "'moodle/course:isincompletionreports'", ",", "...
Checks to see if the userid supplied has a tracked role in this course @param int $userid User id @return bool
[ "Checks", "to", "see", "if", "the", "userid", "supplied", "has", "a", "tracked", "role", "in", "this", "course" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L1132-L1134
212,138
moodle/moodle
lib/completionlib.php
completion_info.get_num_tracked_users
public function get_num_tracked_users($where = '', $whereparams = array(), $groupid = 0) { global $DB; list($enrolledsql, $enrolledparams) = get_enrolled_sql( context_course::instance($this->course->id), 'moodle/course:isincompletionreports', $groupid, true); $sql = 'SELECT COU...
php
public function get_num_tracked_users($where = '', $whereparams = array(), $groupid = 0) { global $DB; list($enrolledsql, $enrolledparams) = get_enrolled_sql( context_course::instance($this->course->id), 'moodle/course:isincompletionreports', $groupid, true); $sql = 'SELECT COU...
[ "public", "function", "get_num_tracked_users", "(", "$", "where", "=", "''", ",", "$", "whereparams", "=", "array", "(", ")", ",", "$", "groupid", "=", "0", ")", "{", "global", "$", "DB", ";", "list", "(", "$", "enrolledsql", ",", "$", "enrolledparams"...
Returns the number of users whose progress is tracked in this course. Optionally supply a search's where clause, or a group id. @param string $where Where clause sql (use 'u.whatever' for user table fields) @param array $whereparams Where clause params @param int $groupid Group id @return int Number of tracked users
[ "Returns", "the", "number", "of", "users", "whose", "progress", "is", "tracked", "in", "this", "course", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L1146-L1158
212,139
moodle/moodle
lib/completionlib.php
completion_info.get_tracked_users
public function get_tracked_users($where = '', $whereparams = array(), $groupid = 0, $sort = '', $limitfrom = '', $limitnum = '', context $extracontext = null) { global $DB; list($enrolledsql, $params) = get_enrolled_sql( context_course::instance($this->course->id), ...
php
public function get_tracked_users($where = '', $whereparams = array(), $groupid = 0, $sort = '', $limitfrom = '', $limitnum = '', context $extracontext = null) { global $DB; list($enrolledsql, $params) = get_enrolled_sql( context_course::instance($this->course->id), ...
[ "public", "function", "get_tracked_users", "(", "$", "where", "=", "''", ",", "$", "whereparams", "=", "array", "(", ")", ",", "$", "groupid", "=", "0", ",", "$", "sort", "=", "''", ",", "$", "limitfrom", "=", "''", ",", "$", "limitnum", "=", "''",...
Return array of users whose progress is tracked in this course. Optionally supply a search's where clause, group id, sorting, paging. @param string $where Where clause sql, referring to 'u.' fields (optional) @param array $whereparams Where clause params (optional) @param int $groupid Group ID to restrict to (optiona...
[ "Return", "array", "of", "users", "whose", "progress", "is", "tracked", "in", "this", "course", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L1175-L1201
212,140
moodle/moodle
lib/completionlib.php
completion_info.get_progress_all
public function get_progress_all($where = '', $where_params = array(), $groupid = 0, $sort = '', $pagesize = '', $start = '', context $extracontext = null) { global $CFG, $DB; // Get list of applicable users $users = $this->get_tracked_users($where, $where_params, $groupid, $sort, ...
php
public function get_progress_all($where = '', $where_params = array(), $groupid = 0, $sort = '', $pagesize = '', $start = '', context $extracontext = null) { global $CFG, $DB; // Get list of applicable users $users = $this->get_tracked_users($where, $where_params, $groupid, $sort, ...
[ "public", "function", "get_progress_all", "(", "$", "where", "=", "''", ",", "$", "where_params", "=", "array", "(", ")", ",", "$", "groupid", "=", "0", ",", "$", "sort", "=", "''", ",", "$", "pagesize", "=", "''", ",", "$", "start", "=", "''", "...
Obtains progress information across a course for all users on that course, or for all users in a specific group. Intended for use when displaying progress. This includes only users who, in course context, have one of the roles for which progress is tracked (the gradebookroles admin option) and are enrolled in course. ...
[ "Obtains", "progress", "information", "across", "a", "course", "for", "all", "users", "on", "that", "course", "or", "for", "all", "users", "in", "a", "specific", "group", ".", "Intended", "for", "use", "when", "displaying", "progress", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L1226-L1265
212,141
moodle/moodle
lib/completionlib.php
completion_info.inform_grade_changed
public function inform_grade_changed($cm, $item, $grade, $deleted) { // Bail out now if completion is not enabled for course-module, it is enabled // but is set to manual, grade is not used to compute completion, or this // is a different numbered grade if (!$this->is_enabled($cm) || ...
php
public function inform_grade_changed($cm, $item, $grade, $deleted) { // Bail out now if completion is not enabled for course-module, it is enabled // but is set to manual, grade is not used to compute completion, or this // is a different numbered grade if (!$this->is_enabled($cm) || ...
[ "public", "function", "inform_grade_changed", "(", "$", "cm", ",", "$", "item", ",", "$", "grade", ",", "$", "deleted", ")", "{", "// Bail out now if completion is not enabled for course-module, it is enabled", "// but is set to manual, grade is not used to compute completion, or...
Called by grade code to inform the completion system when a grade has been changed. If the changed grade is used to determine completion for the course-module, then the completion status will be updated. @param stdClass|cm_info $cm Course-module for item that owns grade @param grade_item $item Grade item @param stdCla...
[ "Called", "by", "grade", "code", "to", "inform", "the", "completion", "system", "when", "a", "grade", "has", "been", "changed", ".", "If", "the", "changed", "grade", "is", "used", "to", "determine", "completion", "for", "the", "course", "-", "module", "the...
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/completionlib.php#L1277-L1298
212,142
moodle/moodle
enrol/cohort/locallib.php
enrol_cohort_handler.member_added
public static function member_added(\core\event\cohort_member_added $event) { global $DB, $CFG; require_once("$CFG->dirroot/group/lib.php"); if (!enrol_is_enabled('cohort')) { return true; } // Does any enabled cohort instance want to sync with this cohort? ...
php
public static function member_added(\core\event\cohort_member_added $event) { global $DB, $CFG; require_once("$CFG->dirroot/group/lib.php"); if (!enrol_is_enabled('cohort')) { return true; } // Does any enabled cohort instance want to sync with this cohort? ...
[ "public", "static", "function", "member_added", "(", "\\", "core", "\\", "event", "\\", "cohort_member_added", "$", "event", ")", "{", "global", "$", "DB", ",", "$", "CFG", ";", "require_once", "(", "\"$CFG->dirroot/group/lib.php\"", ")", ";", "if", "(", "!"...
Event processor - cohort member added. @param \core\event\cohort_member_added $event @return bool
[ "Event", "processor", "-", "cohort", "member", "added", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/cohort/locallib.php#L43-L87
212,143
moodle/moodle
enrol/cohort/locallib.php
enrol_cohort_handler.member_removed
public static function member_removed(\core\event\cohort_member_removed $event) { global $DB; // Does anything want to sync with this cohort? if (!$instances = $DB->get_records('enrol', array('customint1'=>$event->objectid, 'enrol'=>'cohort'), 'id ASC')) { return true; } ...
php
public static function member_removed(\core\event\cohort_member_removed $event) { global $DB; // Does anything want to sync with this cohort? if (!$instances = $DB->get_records('enrol', array('customint1'=>$event->objectid, 'enrol'=>'cohort'), 'id ASC')) { return true; } ...
[ "public", "static", "function", "member_removed", "(", "\\", "core", "\\", "event", "\\", "cohort_member_removed", "$", "event", ")", "{", "global", "$", "DB", ";", "// Does anything want to sync with this cohort?", "if", "(", "!", "$", "instances", "=", "$", "D...
Event processor - cohort member removed. @param \core\event\cohort_member_removed $event @return bool
[ "Event", "processor", "-", "cohort", "member", "removed", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/cohort/locallib.php#L94-L122
212,144
moodle/moodle
enrol/cohort/locallib.php
enrol_cohort_handler.deleted
public static function deleted(\core\event\cohort_deleted $event) { global $DB; // Does anything want to sync with this cohort? if (!$instances = $DB->get_records('enrol', array('customint1'=>$event->objectid, 'enrol'=>'cohort'), 'id ASC')) { return true; } $plugin ...
php
public static function deleted(\core\event\cohort_deleted $event) { global $DB; // Does anything want to sync with this cohort? if (!$instances = $DB->get_records('enrol', array('customint1'=>$event->objectid, 'enrol'=>'cohort'), 'id ASC')) { return true; } $plugin ...
[ "public", "static", "function", "deleted", "(", "\\", "core", "\\", "event", "\\", "cohort_deleted", "$", "event", ")", "{", "global", "$", "DB", ";", "// Does anything want to sync with this cohort?", "if", "(", "!", "$", "instances", "=", "$", "DB", "->", ...
Event processor - cohort deleted. @param \core\event\cohort_deleted $event @return bool
[ "Event", "processor", "-", "cohort", "deleted", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/cohort/locallib.php#L129-L151
212,145
moodle/moodle
mod/workshop/eval/best/backup/moodle2/backup_workshopeval_best_subplugin.class.php
backup_workshopeval_best_subplugin.define_workshop_subplugin_structure
protected function define_workshop_subplugin_structure() { // create XML elements $subplugin = $this->get_subplugin_element(); // virtual optigroup element $subplugin_wrapper = new backup_nested_element($this->get_recommended_name()); $subplugin_table_settings = new backup_nested_elemen...
php
protected function define_workshop_subplugin_structure() { // create XML elements $subplugin = $this->get_subplugin_element(); // virtual optigroup element $subplugin_wrapper = new backup_nested_element($this->get_recommended_name()); $subplugin_table_settings = new backup_nested_elemen...
[ "protected", "function", "define_workshop_subplugin_structure", "(", ")", "{", "// create XML elements", "$", "subplugin", "=", "$", "this", "->", "get_subplugin_element", "(", ")", ";", "// virtual optigroup element", "$", "subplugin_wrapper", "=", "new", "backup_nested_...
Returns the subplugin information to attach to workshop element
[ "Returns", "the", "subplugin", "information", "to", "attach", "to", "workshop", "element" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/eval/best/backup/moodle2/backup_workshopeval_best_subplugin.class.php#L37-L52
212,146
moodle/moodle
lib/classes/output/mustache_user_date_helper.php
mustache_user_date_helper.transform
public function transform($args, Mustache_LambdaHelper $helper) { // Split the text into an array of variables. list($timestamp, $format) = explode(',', $args, 2); $timestamp = trim($timestamp); $format = trim($format); $timestamp = $helper->render($timestamp); $format =...
php
public function transform($args, Mustache_LambdaHelper $helper) { // Split the text into an array of variables. list($timestamp, $format) = explode(',', $args, 2); $timestamp = trim($timestamp); $format = trim($format); $timestamp = $helper->render($timestamp); $format =...
[ "public", "function", "transform", "(", "$", "args", ",", "Mustache_LambdaHelper", "$", "helper", ")", "{", "// Split the text into an array of variables.", "list", "(", "$", "timestamp", ",", "$", "format", ")", "=", "explode", "(", "','", ",", "$", "args", "...
Read a timestamp and format from the string. {{#userdate}}1487655635, %Y %m %d{{/userdate}} There is a list of formats in lang/en/langconfig.php that can be used as the date format. Both args are required. The timestamp must come first. @param string $args The text to parse for arguments. @param Mustache_LambdaHelp...
[ "Read", "a", "timestamp", "and", "format", "from", "the", "string", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/output/mustache_user_date_helper.php#L53-L63
212,147
moodle/moodle
cache/stores/mongodb/MongoDB/GridFS/Exception/FileNotFoundException.php
FileNotFoundException.byId
public static function byId($id, $namespace) { $json = \MongoDB\BSON\toJSON(\MongoDB\BSON\fromPHP(['_id' => $id])); return new static(sprintf('File "%s" not found in "%s"', $json, $namespace)); }
php
public static function byId($id, $namespace) { $json = \MongoDB\BSON\toJSON(\MongoDB\BSON\fromPHP(['_id' => $id])); return new static(sprintf('File "%s" not found in "%s"', $json, $namespace)); }
[ "public", "static", "function", "byId", "(", "$", "id", ",", "$", "namespace", ")", "{", "$", "json", "=", "\\", "MongoDB", "\\", "BSON", "\\", "toJSON", "(", "\\", "MongoDB", "\\", "BSON", "\\", "fromPHP", "(", "[", "'_id'", "=>", "$", "id", "]", ...
Thrown when a file cannot be found by its ID. @param mixed $id File ID @param string $namespace Namespace for the files collection @return self
[ "Thrown", "when", "a", "file", "cannot", "be", "found", "by", "its", "ID", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/GridFS/Exception/FileNotFoundException.php#L44-L49
212,148
moodle/moodle
admin/tool/monitor/classes/output/managerules/renderable.php
renderable.col_manage
public function col_manage(\tool_monitor\rule $rule) { global $OUTPUT, $CFG; $manage = ''; // Do not allow the user to edit the rule unless they have the system capability, or we are viewing the rules // for a course, and not the site. Note - we don't need to check for the capability a...
php
public function col_manage(\tool_monitor\rule $rule) { global $OUTPUT, $CFG; $manage = ''; // Do not allow the user to edit the rule unless they have the system capability, or we are viewing the rules // for a course, and not the site. Note - we don't need to check for the capability a...
[ "public", "function", "col_manage", "(", "\\", "tool_monitor", "\\", "rule", "$", "rule", ")", "{", "global", "$", "OUTPUT", ",", "$", "CFG", ";", "$", "manage", "=", "''", ";", "// Do not allow the user to edit the rule unless they have the system capability, or we a...
Generate content for manage column. @param \tool_monitor\rule $rule rule object @return string html used to display the manage column field.
[ "Generate", "content", "for", "manage", "column", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/output/managerules/renderable.php#L165-L194
212,149
moodle/moodle
mnet/peer.php
mnet_peer.set_wwwroot
function set_wwwroot($wwwroot) { global $CFG, $DB; $hostinfo = $DB->get_record('mnet_host', array('wwwroot'=>$wwwroot)); if ($hostinfo != false) { $this->populate($hostinfo); return true; } return false; }
php
function set_wwwroot($wwwroot) { global $CFG, $DB; $hostinfo = $DB->get_record('mnet_host', array('wwwroot'=>$wwwroot)); if ($hostinfo != false) { $this->populate($hostinfo); return true; } return false; }
[ "function", "set_wwwroot", "(", "$", "wwwroot", ")", "{", "global", "$", "CFG", ",", "$", "DB", ";", "$", "hostinfo", "=", "$", "DB", "->", "get_record", "(", "'mnet_host'", ",", "array", "(", "'wwwroot'", "=>", "$", "wwwroot", ")", ")", ";", "if", ...
Load information from db about an mnet peer into this object's properties @param string $wwwroot - address of peer whose details we want to load @return bool - indication of success or failure
[ "Load", "information", "from", "db", "about", "an", "mnet", "peer", "into", "this", "object", "s", "properties" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mnet/peer.php#L241-L251
212,150
moodle/moodle
mnet/peer.php
mnet_peer.populate
function populate($hostinfo) { global $DB; $this->id = $hostinfo->id; $this->wwwroot = $hostinfo->wwwroot; $this->ip_address = $hostinfo->ip_address; $this->name = $hostinfo->name; $this->deleted = $hos...
php
function populate($hostinfo) { global $DB; $this->id = $hostinfo->id; $this->wwwroot = $hostinfo->wwwroot; $this->ip_address = $hostinfo->ip_address; $this->name = $hostinfo->name; $this->deleted = $hos...
[ "function", "populate", "(", "$", "hostinfo", ")", "{", "global", "$", "DB", ";", "$", "this", "->", "id", "=", "$", "hostinfo", "->", "id", ";", "$", "this", "->", "wwwroot", "=", "$", "hostinfo", "->", "wwwroot", ";", "$", "this", "->", "ip_addre...
Several methods can be used to get an 'mnet_host' record. They all then send it to this private method to populate this object's attributes. @param object $hostinfo A database record from the mnet_host table @return void
[ "Several", "methods", "can", "be", "used", "to", "get", "an", "mnet_host", "record", ".", "They", "all", "then", "send", "it", "to", "this", "private", "method", "to", "populate", "this", "object", "s", "attributes", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mnet/peer.php#L284-L301
212,151
moodle/moodle
mod/lesson/backup/moodle2/restore_lesson_activity_task.class.php
restore_lesson_activity_task.define_decode_rules
static public function define_decode_rules() { $rules = array(); $rules[] = new restore_decode_rule('LESSONEDIT', '/mod/lesson/edit.php?id=$1', 'course_module'); $rules[] = new restore_decode_rule('LESSONESAY', '/mod/lesson/essay.php?id=$1', 'course_module'); $rules[] = new restore_deco...
php
static public function define_decode_rules() { $rules = array(); $rules[] = new restore_decode_rule('LESSONEDIT', '/mod/lesson/edit.php?id=$1', 'course_module'); $rules[] = new restore_decode_rule('LESSONESAY', '/mod/lesson/essay.php?id=$1', 'course_module'); $rules[] = new restore_deco...
[ "static", "public", "function", "define_decode_rules", "(", ")", "{", "$", "rules", "=", "array", "(", ")", ";", "$", "rules", "[", "]", "=", "new", "restore_decode_rule", "(", "'LESSONEDIT'", ",", "'/mod/lesson/edit.php?id=$1'", ",", "'course_module'", ")", "...
Define the decoding rules for links belonging to the activity to be executed by the link decoder
[ "Define", "the", "decoding", "rules", "for", "links", "belonging", "to", "the", "activity", "to", "be", "executed", "by", "the", "link", "decoder" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/lesson/backup/moodle2/restore_lesson_activity_task.class.php#L68-L82
212,152
moodle/moodle
lib/classes/analytics/analyser/student_enrolments.php
student_enrolments.get_all_samples
public function get_all_samples(\core_analytics\analysable $course) { $enrolments = enrol_get_course_users($course->get_id()); // We fetch all enrolments, but we are only interested in students. $studentids = $course->get_students(); $samplesdata = array(); foreach ($enrolment...
php
public function get_all_samples(\core_analytics\analysable $course) { $enrolments = enrol_get_course_users($course->get_id()); // We fetch all enrolments, but we are only interested in students. $studentids = $course->get_students(); $samplesdata = array(); foreach ($enrolment...
[ "public", "function", "get_all_samples", "(", "\\", "core_analytics", "\\", "analysable", "$", "course", ")", "{", "$", "enrolments", "=", "enrol_get_course_users", "(", "$", "course", "->", "get_id", "(", ")", ")", ";", "// We fetch all enrolments, but we are only ...
All course student enrolments. It does return all student enrolments including the suspended ones. @param \core_analytics\analysable $course @return array
[ "All", "course", "student", "enrolments", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/analytics/analyser/student_enrolments.php#L114-L160
212,153
moodle/moodle
lib/classes/analytics/analyser/student_enrolments.php
student_enrolments.get_samples
public function get_samples($sampleids) { global $DB; $enrolments = enrol_get_course_users(false, false, array(), $sampleids); // Some course enrolments. list($enrolsql, $params) = $DB->get_in_or_equal($sampleids, SQL_PARAMS_NAMED); $samplesdata = array(); foreach ($en...
php
public function get_samples($sampleids) { global $DB; $enrolments = enrol_get_course_users(false, false, array(), $sampleids); // Some course enrolments. list($enrolsql, $params) = $DB->get_in_or_equal($sampleids, SQL_PARAMS_NAMED); $samplesdata = array(); foreach ($en...
[ "public", "function", "get_samples", "(", "$", "sampleids", ")", "{", "global", "$", "DB", ";", "$", "enrolments", "=", "enrol_get_course_users", "(", "false", ",", "false", ",", "array", "(", ")", ",", "$", "sampleids", ")", ";", "// Some course enrolments....
Returns all samples from the samples ids. @param int[] $sampleids @return array
[ "Returns", "all", "samples", "from", "the", "samples", "ids", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/analytics/analyser/student_enrolments.php#L168-L216
212,154
moodle/moodle
lib/classes/analytics/analyser/student_enrolments.php
student_enrolments.get_sample_courseid
protected function get_sample_courseid($sampleid) { global $DB; if (empty($this->samplecourses[$sampleid])) { $course = enrol_get_course_by_user_enrolment_id($sampleid); $this->samplecourses[$sampleid] = $course->id; } return $this->samplecourses[$sampleid]; ...
php
protected function get_sample_courseid($sampleid) { global $DB; if (empty($this->samplecourses[$sampleid])) { $course = enrol_get_course_by_user_enrolment_id($sampleid); $this->samplecourses[$sampleid] = $course->id; } return $this->samplecourses[$sampleid]; ...
[ "protected", "function", "get_sample_courseid", "(", "$", "sampleid", ")", "{", "global", "$", "DB", ";", "if", "(", "empty", "(", "$", "this", "->", "samplecourses", "[", "$", "sampleid", "]", ")", ")", "{", "$", "course", "=", "enrol_get_course_by_user_e...
Returns the student enrolment course id. @param int $sampleid @return int
[ "Returns", "the", "student", "enrolment", "course", "id", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/analytics/analyser/student_enrolments.php#L224-L233
212,155
moodle/moodle
lib/google/src/Google/Service/MapsEngine.php
Google_Service_MapsEngine_LayersPermissions_Resource.batchUpdate
public function batchUpdate($id, Google_Service_MapsEngine_PermissionsBatchUpdateRequest $postBody, $optParams = array()) { $params = array('id' => $id, 'postBody' => $postBody); $params = array_merge($params, $optParams); return $this->call('batchUpdate', array($params), "Google_Service_MapsEngine_Permis...
php
public function batchUpdate($id, Google_Service_MapsEngine_PermissionsBatchUpdateRequest $postBody, $optParams = array()) { $params = array('id' => $id, 'postBody' => $postBody); $params = array_merge($params, $optParams); return $this->call('batchUpdate', array($params), "Google_Service_MapsEngine_Permis...
[ "public", "function", "batchUpdate", "(", "$", "id", ",", "Google_Service_MapsEngine_PermissionsBatchUpdateRequest", "$", "postBody", ",", "$", "optParams", "=", "array", "(", ")", ")", "{", "$", "params", "=", "array", "(", "'id'", "=>", "$", "id", ",", "'p...
Add or update permission entries to an already existing asset. An asset can hold up to 20 different permission entries. Each batchInsert request is atomic. (permissions.batchUpdate) @param string $id The ID of the asset to which permissions will be added. @param Google_PermissionsBatchUpdateRequest $postBody @param a...
[ "Add", "or", "update", "permission", "entries", "to", "an", "already", "existing", "asset", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/google/src/Google/Service/MapsEngine.php#L1943-L1948
212,156
moodle/moodle
lib/google/src/Google/Service/MapsEngine.php
Google_Service_MapsEngine_TablesFeatures_Resource.batchInsert
public function batchInsert($id, Google_Service_MapsEngine_FeaturesBatchInsertRequest $postBody, $optParams = array()) { $params = array('id' => $id, 'postBody' => $postBody); $params = array_merge($params, $optParams); return $this->call('batchInsert', array($params)); }
php
public function batchInsert($id, Google_Service_MapsEngine_FeaturesBatchInsertRequest $postBody, $optParams = array()) { $params = array('id' => $id, 'postBody' => $postBody); $params = array_merge($params, $optParams); return $this->call('batchInsert', array($params)); }
[ "public", "function", "batchInsert", "(", "$", "id", ",", "Google_Service_MapsEngine_FeaturesBatchInsertRequest", "$", "postBody", ",", "$", "optParams", "=", "array", "(", ")", ")", "{", "$", "params", "=", "array", "(", "'id'", "=>", "$", "id", ",", "'post...
Append features to an existing table. A single batchInsert request can create: - Up to 50 features. - A combined total of 10 000 vertices. Feature limits are documented in the Supported data formats and limits article of the Google Maps Engine help center. Note that free and paid accounts have different limits. For ...
[ "Append", "features", "to", "an", "existing", "table", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/google/src/Google/Service/MapsEngine.php#L3080-L3085
212,157
moodle/moodle
lib/google/src/Google/Service/MapsEngine.php
Google_Service_MapsEngine_TablesFeatures_Resource.batchPatch
public function batchPatch($id, Google_Service_MapsEngine_FeaturesBatchPatchRequest $postBody, $optParams = array()) { $params = array('id' => $id, 'postBody' => $postBody); $params = array_merge($params, $optParams); return $this->call('batchPatch', array($params)); }
php
public function batchPatch($id, Google_Service_MapsEngine_FeaturesBatchPatchRequest $postBody, $optParams = array()) { $params = array('id' => $id, 'postBody' => $postBody); $params = array_merge($params, $optParams); return $this->call('batchPatch', array($params)); }
[ "public", "function", "batchPatch", "(", "$", "id", ",", "Google_Service_MapsEngine_FeaturesBatchPatchRequest", "$", "postBody", ",", "$", "optParams", "=", "array", "(", ")", ")", "{", "$", "params", "=", "array", "(", "'id'", "=>", "$", "id", ",", "'postBo...
Update the supplied features. A single batchPatch request can update: - Up to 50 features. - A combined total of 10 000 vertices. Feature limits are documented in the Supported data formats and limits article of the Google Maps Engine help center. Note that free and paid accounts have different limits. Feature updat...
[ "Update", "the", "supplied", "features", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/google/src/Google/Service/MapsEngine.php#L3111-L3116
212,158
moodle/moodle
lib/classes/event/tag_added.php
tag_added.create_from_tag_instance
public static function create_from_tag_instance($taginstance, $tagname, $tagrawname, $addsnapshot = false) { $event = self::create(array( 'objectid' => $taginstance->id, 'contextid' => $taginstance->contextid, 'other' => array( 'tagid' => $taginstance->tagid, ...
php
public static function create_from_tag_instance($taginstance, $tagname, $tagrawname, $addsnapshot = false) { $event = self::create(array( 'objectid' => $taginstance->id, 'contextid' => $taginstance->contextid, 'other' => array( 'tagid' => $taginstance->tagid, ...
[ "public", "static", "function", "create_from_tag_instance", "(", "$", "taginstance", ",", "$", "tagname", ",", "$", "tagrawname", ",", "$", "addsnapshot", "=", "false", ")", "{", "$", "event", "=", "self", "::", "create", "(", "array", "(", "'objectid'", "...
Creates an event from taginstance object @since Moodle 3.1 @param stdClass $taginstance @param string $tagname @param string $tagrawname @param bool $addsnapshot trust that $taginstance has all necessary fields and add it as a record snapshot @return tag_added
[ "Creates", "an", "event", "from", "taginstance", "object" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/event/tag_added.php#L87-L103
212,159
moodle/moodle
admin/tool/dataprivacy/classes/output/crud_element.php
crud_element.action_menu
protected final function action_menu($elementname, $exported, $persistent) { // Just in case, we are doing funny stuff below. $elementname = clean_param($elementname, PARAM_ALPHA); // Actions. $actionmenu = new \action_menu(); $actionmenu->set_menu_trigger(get_string('actions')...
php
protected final function action_menu($elementname, $exported, $persistent) { // Just in case, we are doing funny stuff below. $elementname = clean_param($elementname, PARAM_ALPHA); // Actions. $actionmenu = new \action_menu(); $actionmenu->set_menu_trigger(get_string('actions')...
[ "protected", "final", "function", "action_menu", "(", "$", "elementname", ",", "$", "exported", ",", "$", "persistent", ")", "{", "// Just in case, we are doing funny stuff below.", "$", "elementname", "=", "clean_param", "(", "$", "elementname", ",", "PARAM_ALPHA", ...
Adds an action menu for the provided element @param string $elementname 'purpose' or 'category'. @param \stdClass $exported @param \core\persistent $persistent @return \action_menu
[ "Adds", "an", "action", "menu", "for", "the", "provided", "element" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/output/crud_element.php#L65-L91
212,160
moodle/moodle
message/classes/helper.php
helper.get_messages
public static function get_messages($userid, $otheruserid, $timedeleted = 0, $limitfrom = 0, $limitnum = 0, $sort = 'timecreated ASC', $timefrom = 0, $timeto = 0) { global $DB; $hash = self::get_conversation_hash([$userid, $otheruserid]); $sql = "SELECT ...
php
public static function get_messages($userid, $otheruserid, $timedeleted = 0, $limitfrom = 0, $limitnum = 0, $sort = 'timecreated ASC', $timefrom = 0, $timeto = 0) { global $DB; $hash = self::get_conversation_hash([$userid, $otheruserid]); $sql = "SELECT ...
[ "public", "static", "function", "get_messages", "(", "$", "userid", ",", "$", "otheruserid", ",", "$", "timedeleted", "=", "0", ",", "$", "limitfrom", "=", "0", ",", "$", "limitnum", "=", "0", ",", "$", "sort", "=", "'timecreated ASC'", ",", "$", "time...
Helper function to retrieve the messages between two users TODO: This function should be removed once the related web services go through final deprecation. The related web services are data_for_messagearea_messages AND data_for_messagearea_get_most_recent_message. Followup: MDL-63261 @param int $userid the current u...
[ "Helper", "function", "to", "retrieve", "the", "messages", "between", "two", "users" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/classes/helper.php#L54-L114
212,161
moodle/moodle
message/classes/helper.php
helper.get_conversation_messages
public static function get_conversation_messages(int $userid, int $convid, int $timedeleted = 0, int $limitfrom = 0, int $limitnum = 0, string $sort = 'timecreated ASC', int $timefrom = 0, int $timeto = 0) : array ...
php
public static function get_conversation_messages(int $userid, int $convid, int $timedeleted = 0, int $limitfrom = 0, int $limitnum = 0, string $sort = 'timecreated ASC', int $timefrom = 0, int $timeto = 0) : array ...
[ "public", "static", "function", "get_conversation_messages", "(", "int", "$", "userid", ",", "int", "$", "convid", ",", "int", "$", "timedeleted", "=", "0", ",", "int", "$", "limitfrom", "=", "0", ",", "int", "$", "limitnum", "=", "0", ",", "string", "...
Helper function to retrieve conversation messages. @param int $userid The current user. @param int $convid The conversation identifier. @param int $timedeleted The time the message was deleted @param int $limitfrom Return a subset of records, starting at this point (optional). @param int $limitnum Return a subset...
[ "Helper", "function", "to", "retrieve", "conversation", "messages", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/classes/helper.php#L129-L185
212,162
moodle/moodle
message/classes/helper.php
helper.create_messages
public static function create_messages($userid, $messages) { // Store the messages. $arrmessages = array(); // We always view messages from oldest to newest, ensure we have it in that order. $lastmessage = end($messages); $firstmessage = reset($messages); if ($lastmessag...
php
public static function create_messages($userid, $messages) { // Store the messages. $arrmessages = array(); // We always view messages from oldest to newest, ensure we have it in that order. $lastmessage = end($messages); $firstmessage = reset($messages); if ($lastmessag...
[ "public", "static", "function", "create_messages", "(", "$", "userid", ",", "$", "messages", ")", "{", "// Store the messages.", "$", "arrmessages", "=", "array", "(", ")", ";", "// We always view messages from oldest to newest, ensure we have it in that order.", "$", "la...
Helper function to return an array of messages. TODO: This function should be removed once the related web services go through final deprecation. The related web services are data_for_messagearea_messages AND data_for_messagearea_get_most_recent_message. Followup: MDL-63261 @param int $userid @param array $messages @...
[ "Helper", "function", "to", "return", "an", "array", "of", "messages", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/classes/helper.php#L245-L284
212,163
moodle/moodle
message/classes/helper.php
helper.create_contact
public static function create_contact($contact, $prefix = '') { global $PAGE; // Create the data we are going to pass to the renderable. $userfields = \user_picture::unalias($contact, array('lastaccess'), $prefix . 'id', $prefix); $data = new \stdClass(); $data->userid = $userfi...
php
public static function create_contact($contact, $prefix = '') { global $PAGE; // Create the data we are going to pass to the renderable. $userfields = \user_picture::unalias($contact, array('lastaccess'), $prefix . 'id', $prefix); $data = new \stdClass(); $data->userid = $userfi...
[ "public", "static", "function", "create_contact", "(", "$", "contact", ",", "$", "prefix", "=", "''", ")", "{", "global", "$", "PAGE", ";", "// Create the data we are going to pass to the renderable.", "$", "userfields", "=", "\\", "user_picture", "::", "unalias", ...
Helper function for creating a contact object. @param \stdClass $contact @param string $prefix @return \stdClass
[ "Helper", "function", "for", "creating", "a", "contact", "object", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/classes/helper.php#L293-L334
212,164
moodle/moodle
message/classes/helper.php
helper.show_online_status
public static function show_online_status($user) { global $CFG; require_once($CFG->dirroot . '/user/lib.php'); if ($lastaccess = user_get_user_details($user, null, array('lastaccess'))) { if (isset($lastaccess['lastaccess'])) { return true; } } ...
php
public static function show_online_status($user) { global $CFG; require_once($CFG->dirroot . '/user/lib.php'); if ($lastaccess = user_get_user_details($user, null, array('lastaccess'))) { if (isset($lastaccess['lastaccess'])) { return true; } } ...
[ "public", "static", "function", "show_online_status", "(", "$", "user", ")", "{", "global", "$", "CFG", ";", "require_once", "(", "$", "CFG", "->", "dirroot", ".", "'/user/lib.php'", ")", ";", "if", "(", "$", "lastaccess", "=", "user_get_user_details", "(", ...
Helper function for checking if we should show the user's online status. @param \stdClass $user @return boolean
[ "Helper", "function", "for", "checking", "if", "we", "should", "show", "the", "user", "s", "online", "status", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/classes/helper.php#L342-L354
212,165
moodle/moodle
message/classes/helper.php
helper.is_online
public static function is_online($lastaccess) { global $CFG; // Variable to check if we consider this user online or not. $timetoshowusers = 300; // Seconds default. if (isset($CFG->block_online_users_timetosee)) { $timetoshowusers = $CFG->block_online_users_timetosee * 60; ...
php
public static function is_online($lastaccess) { global $CFG; // Variable to check if we consider this user online or not. $timetoshowusers = 300; // Seconds default. if (isset($CFG->block_online_users_timetosee)) { $timetoshowusers = $CFG->block_online_users_timetosee * 60; ...
[ "public", "static", "function", "is_online", "(", "$", "lastaccess", ")", "{", "global", "$", "CFG", ";", "// Variable to check if we consider this user online or not.", "$", "timetoshowusers", "=", "300", ";", "// Seconds default.", "if", "(", "isset", "(", "$", "C...
Helper function for checking the time meets the 'online' condition. @param int $lastaccess @return boolean
[ "Helper", "function", "for", "checking", "the", "time", "meets", "the", "online", "condition", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/classes/helper.php#L362-L373
212,166
moodle/moodle
message/classes/helper.php
helper.get_providers_preferences
public static function get_providers_preferences($providers, $userid) { $preferences = new \stdClass(); // Get providers preferences. foreach ($providers as $provider) { foreach (array('loggedin', 'loggedoff') as $state) { $linepref = get_user_preferences('message_pr...
php
public static function get_providers_preferences($providers, $userid) { $preferences = new \stdClass(); // Get providers preferences. foreach ($providers as $provider) { foreach (array('loggedin', 'loggedoff') as $state) { $linepref = get_user_preferences('message_pr...
[ "public", "static", "function", "get_providers_preferences", "(", "$", "providers", ",", "$", "userid", ")", "{", "$", "preferences", "=", "new", "\\", "stdClass", "(", ")", ";", "// Get providers preferences.", "foreach", "(", "$", "providers", "as", "$", "pr...
Get providers preferences. @param array $providers @param int $userid @return \stdClass
[ "Get", "providers", "preferences", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/classes/helper.php#L382-L402
212,167
moodle/moodle
message/classes/helper.php
helper.togglecontact_requirejs
public static function togglecontact_requirejs() { global $PAGE; static $done = false; if ($done) { return; } $PAGE->requires->js_call_amd('core_message/toggle_contact_button', 'enhance', array('#toggle-contact-button')); $done = true; }
php
public static function togglecontact_requirejs() { global $PAGE; static $done = false; if ($done) { return; } $PAGE->requires->js_call_amd('core_message/toggle_contact_button', 'enhance', array('#toggle-contact-button')); $done = true; }
[ "public", "static", "function", "togglecontact_requirejs", "(", ")", "{", "global", "$", "PAGE", ";", "static", "$", "done", "=", "false", ";", "if", "(", "$", "done", ")", "{", "return", ";", "}", "$", "PAGE", "->", "requires", "->", "js_call_amd", "(...
Requires the JS libraries for the toggle contact button. @return void
[ "Requires", "the", "JS", "libraries", "for", "the", "toggle", "contact", "button", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/classes/helper.php#L409-L419
212,168
moodle/moodle
message/classes/helper.php
helper.messageuser_requirejs
public static function messageuser_requirejs() { global $PAGE; static $done = false; if ($done) { return; } $PAGE->requires->js_call_amd('core_message/message_user_button', 'send', array('#message-user-button')); $done = true; }
php
public static function messageuser_requirejs() { global $PAGE; static $done = false; if ($done) { return; } $PAGE->requires->js_call_amd('core_message/message_user_button', 'send', array('#message-user-button')); $done = true; }
[ "public", "static", "function", "messageuser_requirejs", "(", ")", "{", "global", "$", "PAGE", ";", "static", "$", "done", "=", "false", ";", "if", "(", "$", "done", ")", "{", "return", ";", "}", "$", "PAGE", "->", "requires", "->", "js_call_amd", "(",...
Requires the JS libraries for the message user button. @return void
[ "Requires", "the", "JS", "libraries", "for", "the", "message", "user", "button", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/classes/helper.php#L445-L455
212,169
moodle/moodle
message/classes/helper.php
helper.messageuser_link_params
public static function messageuser_link_params(int $useridto) : array { global $USER; return [ 'id' => 'message-user-button', 'role' => 'button', 'data-conversationid' => api::get_conversation_between_users([$USER->id, $useridto]), 'data-userid' => $useri...
php
public static function messageuser_link_params(int $useridto) : array { global $USER; return [ 'id' => 'message-user-button', 'role' => 'button', 'data-conversationid' => api::get_conversation_between_users([$USER->id, $useridto]), 'data-userid' => $useri...
[ "public", "static", "function", "messageuser_link_params", "(", "int", "$", "useridto", ")", ":", "array", "{", "global", "$", "USER", ";", "return", "[", "'id'", "=>", "'message-user-button'", ",", "'role'", "=>", "'button'", ",", "'data-conversationid'", "=>",...
Returns the attributes to place on the message user button. @param int $useridto @return array
[ "Returns", "the", "attributes", "to", "place", "on", "the", "message", "user", "button", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/classes/helper.php#L463-L472
212,170
moodle/moodle
message/classes/helper.php
helper.legacy_messages_exist
public static function legacy_messages_exist($userid) { global $DB; $sql = "SELECT id FROM {message} m WHERE useridfrom = ? OR useridto = ?"; $messageexists = $DB->record_exists_sql($sql, [$userid, $userid]); $sql = "SELECT id ...
php
public static function legacy_messages_exist($userid) { global $DB; $sql = "SELECT id FROM {message} m WHERE useridfrom = ? OR useridto = ?"; $messageexists = $DB->record_exists_sql($sql, [$userid, $userid]); $sql = "SELECT id ...
[ "public", "static", "function", "legacy_messages_exist", "(", "$", "userid", ")", "{", "global", "$", "DB", ";", "$", "sql", "=", "\"SELECT id\n FROM {message} m\n WHERE useridfrom = ?\n OR useridto = ?\"", ";", "$", "messagee...
Checks if legacy messages exist for a given user. @param int $userid @return bool
[ "Checks", "if", "legacy", "messages", "exist", "for", "a", "given", "user", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/classes/helper.php#L502-L518
212,171
moodle/moodle
message/classes/helper.php
helper.render_messaging_widget
public static function render_messaging_widget(bool $isdrawer, int $sendtouser = null, int $conversationid = null) { global $USER, $CFG, $PAGE; // Early bail out conditions. if (empty($CFG->messaging) || !isloggedin() || isguestuser() || user_not_fully_set_up($USER) || get_user_pref...
php
public static function render_messaging_widget(bool $isdrawer, int $sendtouser = null, int $conversationid = null) { global $USER, $CFG, $PAGE; // Early bail out conditions. if (empty($CFG->messaging) || !isloggedin() || isguestuser() || user_not_fully_set_up($USER) || get_user_pref...
[ "public", "static", "function", "render_messaging_widget", "(", "bool", "$", "isdrawer", ",", "int", "$", "sendtouser", "=", "null", ",", "int", "$", "conversationid", "=", "null", ")", "{", "global", "$", "USER", ",", "$", "CFG", ",", "$", "PAGE", ";", ...
Renders the messaging widget. @param bool $isdrawer Are we are rendering the drawer or is this on a full page? @param int|null $sendtouser The ID of the user we want to send a message to @param int|null $conversationid The ID of the conversation we want to load @return string The HTML.
[ "Renders", "the", "messaging", "widget", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/classes/helper.php#L690-L774
212,172
moodle/moodle
message/classes/helper.php
helper.search_get_user_details
public static function search_get_user_details(\stdClass $user) : array { global $CFG, $USER; require_once($CFG->dirroot . '/user/lib.php'); if ($CFG->messagingallusers || $user->id == $USER->id) { return \user_get_user_details_courses($user) ?? []; // This checks visibility of site...
php
public static function search_get_user_details(\stdClass $user) : array { global $CFG, $USER; require_once($CFG->dirroot . '/user/lib.php'); if ($CFG->messagingallusers || $user->id == $USER->id) { return \user_get_user_details_courses($user) ?? []; // This checks visibility of site...
[ "public", "static", "function", "search_get_user_details", "(", "\\", "stdClass", "$", "user", ")", ":", "array", "{", "global", "$", "CFG", ",", "$", "USER", ";", "require_once", "(", "$", "CFG", "->", "dirroot", ".", "'/user/lib.php'", ")", ";", "if", ...
Returns user details for a user, if they are visible to the current user in the message search. This method checks the visibility of a user specifically for the purpose of inclusion in the message search results. Visibility depends on the site-wide messaging setting 'messagingallusers': If enabled, visibility depends ...
[ "Returns", "user", "details", "for", "a", "user", "if", "they", "are", "visible", "to", "the", "current", "user", "in", "the", "message", "search", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/classes/helper.php#L788-L807
212,173
moodle/moodle
lib/xmldb/xmldb_key.php
xmldb_key.set_attributes
public function set_attributes($type, $fields, $reftable=null, $reffields=null) { $this->type = $type; $this->fields = $fields; $this->reftable = $reftable; $this->reffields = empty($reffields) ? array() : $reffields; }
php
public function set_attributes($type, $fields, $reftable=null, $reffields=null) { $this->type = $type; $this->fields = $fields; $this->reftable = $reftable; $this->reffields = empty($reffields) ? array() : $reffields; }
[ "public", "function", "set_attributes", "(", "$", "type", ",", "$", "fields", ",", "$", "reftable", "=", "null", ",", "$", "reffields", "=", "null", ")", "{", "$", "this", "->", "type", "=", "$", "type", ";", "$", "this", "->", "fields", "=", "$", ...
Set all the attributes of one xmldb_key @param string $type XMLDB_KEY_[PRIMARY|UNIQUE|FOREIGN|FOREIGN_UNIQUE] @param array $fields an array of fieldnames to build the key over @param string $reftable name of the table the FK points to or null @param array $reffields an array of fieldnames in the FK table or null
[ "Set", "all", "the", "attributes", "of", "one", "xmldb_key" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/xmldb/xmldb_key.php#L68-L73
212,174
moodle/moodle
lib/xmldb/xmldb_key.php
xmldb_key.getXMLDBKeyType
public function getXMLDBKeyType($type) { $result = XMLDB_KEY_INCORRECT; switch (strtolower($type)) { case 'primary': $result = XMLDB_KEY_PRIMARY; break; case 'unique': $result = XMLDB_KEY_UNIQUE; break; ...
php
public function getXMLDBKeyType($type) { $result = XMLDB_KEY_INCORRECT; switch (strtolower($type)) { case 'primary': $result = XMLDB_KEY_PRIMARY; break; case 'unique': $result = XMLDB_KEY_UNIQUE; break; ...
[ "public", "function", "getXMLDBKeyType", "(", "$", "type", ")", "{", "$", "result", "=", "XMLDB_KEY_INCORRECT", ";", "switch", "(", "strtolower", "(", "$", "type", ")", ")", "{", "case", "'primary'", ":", "$", "result", "=", "XMLDB_KEY_PRIMARY", ";", "brea...
This function returns the correct XMLDB_KEY_XXX value for the string passed as argument @param string $type @return int
[ "This", "function", "returns", "the", "correct", "XMLDB_KEY_XXX", "value", "for", "the", "string", "passed", "as", "argument" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/xmldb/xmldb_key.php#L288-L311
212,175
moodle/moodle
lib/xmldb/xmldb_key.php
xmldb_key.getXMLDBKeyName
public function getXMLDBKeyName($type) { $result = ''; switch ($type) { case XMLDB_KEY_PRIMARY: $result = 'primary'; break; case XMLDB_KEY_UNIQUE: $result = 'unique'; break; case XMLDB_KEY_FOREIGN: ...
php
public function getXMLDBKeyName($type) { $result = ''; switch ($type) { case XMLDB_KEY_PRIMARY: $result = 'primary'; break; case XMLDB_KEY_UNIQUE: $result = 'unique'; break; case XMLDB_KEY_FOREIGN: ...
[ "public", "function", "getXMLDBKeyName", "(", "$", "type", ")", "{", "$", "result", "=", "''", ";", "switch", "(", "$", "type", ")", "{", "case", "XMLDB_KEY_PRIMARY", ":", "$", "result", "=", "'primary'", ";", "break", ";", "case", "XMLDB_KEY_UNIQUE", ":...
This function returns the correct name value for the XMLDB_KEY_XXX passed as argument @param int $type @return string
[ "This", "function", "returns", "the", "correct", "name", "value", "for", "the", "XMLDB_KEY_XXX", "passed", "as", "argument" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/xmldb/xmldb_key.php#L319-L342
212,176
moodle/moodle
lib/xmldb/xmldb_key.php
xmldb_key.calculateHash
public function calculateHash($recursive = false) { if (!$this->loaded) { $this->hash = null; } else { $key = $this->type . implode(', ', $this->fields); if ($this->type == XMLDB_KEY_FOREIGN || $this->type == XMLDB_KEY_FOREIGN_UNIQUE) { ...
php
public function calculateHash($recursive = false) { if (!$this->loaded) { $this->hash = null; } else { $key = $this->type . implode(', ', $this->fields); if ($this->type == XMLDB_KEY_FOREIGN || $this->type == XMLDB_KEY_FOREIGN_UNIQUE) { ...
[ "public", "function", "calculateHash", "(", "$", "recursive", "=", "false", ")", "{", "if", "(", "!", "$", "this", "->", "loaded", ")", "{", "$", "this", "->", "hash", "=", "null", ";", "}", "else", "{", "$", "key", "=", "$", "this", "->", "type"...
This function calculate and set the hash of one xmldb_key @param bool $recursive
[ "This", "function", "calculate", "and", "set", "the", "hash", "of", "one", "xmldb_key" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/xmldb/xmldb_key.php#L348-L360
212,177
moodle/moodle
lib/xmldb/xmldb_key.php
xmldb_key.xmlOutput
public function xmlOutput() { $o = ''; $o.= ' <KEY NAME="' . $this->name . '"'; $o.= ' TYPE="' . $this->getXMLDBKeyName($this->type) . '"'; $o.= ' FIELDS="' . implode(', ', $this->fields) . '"'; if ($this->type == XMLDB_KEY_FOREIGN || $this->type == XMLDB_KEY_F...
php
public function xmlOutput() { $o = ''; $o.= ' <KEY NAME="' . $this->name . '"'; $o.= ' TYPE="' . $this->getXMLDBKeyName($this->type) . '"'; $o.= ' FIELDS="' . implode(', ', $this->fields) . '"'; if ($this->type == XMLDB_KEY_FOREIGN || $this->type == XMLDB_KEY_F...
[ "public", "function", "xmlOutput", "(", ")", "{", "$", "o", "=", "''", ";", "$", "o", ".=", "' <KEY NAME=\"'", ".", "$", "this", "->", "name", ".", "'\"'", ";", "$", "o", ".=", "' TYPE=\"'", ".", "$", "this", "->", "getXMLDBKeyName", "(", "$",...
This function will output the XML text for one key @return string
[ "This", "function", "will", "output", "the", "XML", "text", "for", "one", "key" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/xmldb/xmldb_key.php#L366-L382
212,178
moodle/moodle
lib/xmldb/xmldb_key.php
xmldb_key.setFromADOKey
public function setFromADOKey($adokey) { // Calculate the XMLDB_KEY switch (strtolower($adokey['name'])) { case 'primary': $this->type = XMLDB_KEY_PRIMARY; break; default: $this->type = XMLDB_KEY_UNIQUE; } // Set th...
php
public function setFromADOKey($adokey) { // Calculate the XMLDB_KEY switch (strtolower($adokey['name'])) { case 'primary': $this->type = XMLDB_KEY_PRIMARY; break; default: $this->type = XMLDB_KEY_UNIQUE; } // Set th...
[ "public", "function", "setFromADOKey", "(", "$", "adokey", ")", "{", "// Calculate the XMLDB_KEY", "switch", "(", "strtolower", "(", "$", "adokey", "[", "'name'", "]", ")", ")", "{", "case", "'primary'", ":", "$", "this", "->", "type", "=", "XMLDB_KEY_PRIMAR...
This function will set all the attributes of the xmldb_key object based on information passed in one ADOkey @oaram array $adokey
[ "This", "function", "will", "set", "all", "the", "attributes", "of", "the", "xmldb_key", "object", "based", "on", "information", "passed", "in", "one", "ADOkey" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/xmldb/xmldb_key.php#L389-L405
212,179
moodle/moodle
lib/xmldb/xmldb_key.php
xmldb_key.getPHP
public function getPHP() { $result = ''; // The type switch ($this->getType()) { case XMLDB_KEY_PRIMARY: $result .= 'XMLDB_KEY_PRIMARY' . ', '; break; case XMLDB_KEY_UNIQUE: $result .= 'XMLDB_KEY_UNIQUE' . ', '; ...
php
public function getPHP() { $result = ''; // The type switch ($this->getType()) { case XMLDB_KEY_PRIMARY: $result .= 'XMLDB_KEY_PRIMARY' . ', '; break; case XMLDB_KEY_UNIQUE: $result .= 'XMLDB_KEY_UNIQUE' . ', '; ...
[ "public", "function", "getPHP", "(", ")", "{", "$", "result", "=", "''", ";", "// The type", "switch", "(", "$", "this", "->", "getType", "(", ")", ")", "{", "case", "XMLDB_KEY_PRIMARY", ":", "$", "result", ".=", "'XMLDB_KEY_PRIMARY'", ".", "', '", ";", ...
Returns the PHP code needed to define one xmldb_key @return string
[ "Returns", "the", "PHP", "code", "needed", "to", "define", "one", "xmldb_key" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/xmldb/xmldb_key.php#L411-L457
212,180
moodle/moodle
lib/horde/framework/Horde/Support/CaseInsensitiveArray.php
Horde_Support_CaseInsensitiveArray._getRealOffset
protected function _getRealOffset($offset) { /* Optimize: check for base $offset in array first. */ if (parent::offsetExists($offset)) { return $offset; } foreach (array_keys($this->getArrayCopy()) as $key) { if (strcasecmp($key, $offset) === 0) { ...
php
protected function _getRealOffset($offset) { /* Optimize: check for base $offset in array first. */ if (parent::offsetExists($offset)) { return $offset; } foreach (array_keys($this->getArrayCopy()) as $key) { if (strcasecmp($key, $offset) === 0) { ...
[ "protected", "function", "_getRealOffset", "(", "$", "offset", ")", "{", "/* Optimize: check for base $offset in array first. */", "if", "(", "parent", "::", "offsetExists", "(", "$", "offset", ")", ")", "{", "return", "$", "offset", ";", "}", "foreach", "(", "a...
Determines the actual array offset given the input offset. @param string $offset Input offset. @return string Real offset or null.
[ "Determines", "the", "actual", "array", "offset", "given", "the", "input", "offset", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Support/CaseInsensitiveArray.php#L68-L82
212,181
moodle/moodle
mod/lesson/backup/moodle2/backup_lesson_activity_task.class.php
backup_lesson_activity_task.encode_content_links
static public function encode_content_links($content) { global $CFG; $base = preg_quote($CFG->wwwroot.'/mod/lesson','#'); // Provides the interface for overall authoring of lessons $pattern = '#'.$base.'/edit\.php\?id=([0-9]+)#'; $replacement = '$@LESSONEDIT*$1@$'; $con...
php
static public function encode_content_links($content) { global $CFG; $base = preg_quote($CFG->wwwroot.'/mod/lesson','#'); // Provides the interface for overall authoring of lessons $pattern = '#'.$base.'/edit\.php\?id=([0-9]+)#'; $replacement = '$@LESSONEDIT*$1@$'; $con...
[ "static", "public", "function", "encode_content_links", "(", "$", "content", ")", "{", "global", "$", "CFG", ";", "$", "base", "=", "preg_quote", "(", "$", "CFG", "->", "wwwroot", ".", "'/mod/lesson'", ",", "'#'", ")", ";", "// Provides the interface for overa...
Encodes URLs to various Lesson scripts @param string $content some HTML text that eventually contains URLs to the activity instance scripts @return string the content with the URLs encoded
[ "Encodes", "URLs", "to", "various", "Lesson", "scripts" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/lesson/backup/moodle2/backup_lesson_activity_task.class.php#L58-L105
212,182
moodle/moodle
backup/util/helper/async_helper.class.php
async_helper.get_user
private function get_user() { $userid = $this->backuprec->userid; $user = core_user::get_user($userid, '*', MUST_EXIST); return $user; }
php
private function get_user() { $userid = $this->backuprec->userid; $user = core_user::get_user($userid, '*', MUST_EXIST); return $user; }
[ "private", "function", "get_user", "(", ")", "{", "$", "userid", "=", "$", "this", "->", "backuprec", "->", "userid", ";", "$", "user", "=", "core_user", "::", "get_user", "(", "$", "userid", ",", "'*'", ",", "MUST_EXIST", ")", ";", "return", "$", "u...
Given a user id return a user object. @return object $user The limited user record.
[ "Given", "a", "user", "id", "return", "a", "user", "object", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/helper/async_helper.class.php#L92-L97
212,183
moodle/moodle
backup/util/helper/async_helper.class.php
async_helper.lookup_message_variables
private function lookup_message_variables($matches) { $options = array( 'operation' => $this->type, 'backupid' => $this->backupid, 'user_username' => $this->user->username, 'user_email' => $this->user->email, 'user_firstname' => $th...
php
private function lookup_message_variables($matches) { $options = array( 'operation' => $this->type, 'backupid' => $this->backupid, 'user_username' => $this->user->username, 'user_email' => $this->user->email, 'user_firstname' => $th...
[ "private", "function", "lookup_message_variables", "(", "$", "matches", ")", "{", "$", "options", "=", "array", "(", "'operation'", "=>", "$", "this", "->", "type", ",", "'backupid'", "=>", "$", "this", "->", "backupid", ",", "'user_username'", "=>", "$", ...
Callback for preg_replace_callback. Replaces message placeholders with real values. @param array $matches The match array from from preg_replace_callback. @return string $match The replaced string.
[ "Callback", "for", "preg_replace_callback", ".", "Replaces", "message", "placeholders", "with", "real", "values", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/helper/async_helper.class.php#L106-L120
212,184
moodle/moodle
backup/util/helper/async_helper.class.php
async_helper.get_resource_link
private function get_resource_link() { // Get activity context only for backups. if ($this->backuprec->type == 'activity' && $this->type == 'backup') { $context = context_module::instance($this->backuprec->itemid); } else { // Course or Section which have the same context getter. ...
php
private function get_resource_link() { // Get activity context only for backups. if ($this->backuprec->type == 'activity' && $this->type == 'backup') { $context = context_module::instance($this->backuprec->itemid); } else { // Course or Section which have the same context getter. ...
[ "private", "function", "get_resource_link", "(", ")", "{", "// Get activity context only for backups.", "if", "(", "$", "this", "->", "backuprec", "->", "type", "==", "'activity'", "&&", "$", "this", "->", "type", "==", "'backup'", ")", "{", "$", "context", "=...
Get the link to the resource that is being backuped or restored. @return moodle_url $url The link to the resource.
[ "Get", "the", "link", "to", "the", "resource", "that", "is", "being", "backuped", "or", "restored", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/helper/async_helper.class.php#L127-L145
212,185
moodle/moodle
backup/util/helper/async_helper.class.php
async_helper.send_message
public function send_message() { global $USER; $subjectraw = get_config('backup', 'backup_async_message_subject'); $subjecttext = preg_replace_callback( '/\{([-_A-Za-z0-9]+)\}/u', array('async_helper', 'lookup_message_variables'), $subjectraw); ...
php
public function send_message() { global $USER; $subjectraw = get_config('backup', 'backup_async_message_subject'); $subjecttext = preg_replace_callback( '/\{([-_A-Za-z0-9]+)\}/u', array('async_helper', 'lookup_message_variables'), $subjectraw); ...
[ "public", "function", "send_message", "(", ")", "{", "global", "$", "USER", ";", "$", "subjectraw", "=", "get_config", "(", "'backup'", ",", "'backup_async_message_subject'", ")", ";", "$", "subjecttext", "=", "preg_replace_callback", "(", "'/\\{([-_A-Za-z0-9]+)\\}/...
Sends a confirmation message for an aynchronous process. @return int $messageid The id of the sent message.
[ "Sends", "a", "confirmation", "message", "for", "an", "aynchronous", "process", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/helper/async_helper.class.php#L152-L183
212,186
moodle/moodle
backup/util/helper/async_helper.class.php
async_helper.is_async_enabled
static public function is_async_enabled() { global $CFG; $async = false; if (!empty($CFG->enableasyncbackup)) { $async = true; } return $async; }
php
static public function is_async_enabled() { global $CFG; $async = false; if (!empty($CFG->enableasyncbackup)) { $async = true; } return $async; }
[ "static", "public", "function", "is_async_enabled", "(", ")", "{", "global", "$", "CFG", ";", "$", "async", "=", "false", ";", "if", "(", "!", "empty", "(", "$", "CFG", "->", "enableasyncbackup", ")", ")", "{", "$", "async", "=", "true", ";", "}", ...
Check if asynchronous backup and restore mode is enabled at system level. @return bool $async True if async mode enabled false otherwise.
[ "Check", "if", "asynchronous", "backup", "and", "restore", "mode", "is", "enabled", "at", "system", "level", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/helper/async_helper.class.php#L191-L200
212,187
moodle/moodle
backup/util/helper/async_helper.class.php
async_helper.is_async_pending
public static function is_async_pending($id, $type, $operation) { global $DB, $USER, $CFG; $asyncpending = false; // Only check for pending async operations if async mode is enabled. require_once($CFG->dirroot . '/backup/util/interfaces/checksumable.class.php'); require_once($CF...
php
public static function is_async_pending($id, $type, $operation) { global $DB, $USER, $CFG; $asyncpending = false; // Only check for pending async operations if async mode is enabled. require_once($CFG->dirroot . '/backup/util/interfaces/checksumable.class.php'); require_once($CF...
[ "public", "static", "function", "is_async_pending", "(", "$", "id", ",", "$", "type", ",", "$", "operation", ")", "{", "global", "$", "DB", ",", "$", "USER", ",", "$", "CFG", ";", "$", "asyncpending", "=", "false", ";", "// Only check for pending async ope...
Check if there is a pending async operation for given details. @param int $id The item id to check in the backup record. @param string $type The type of operation: course, activity or section. @param string $operation Operation backup or restore. @return boolean $asyncpedning Is there a pending async operation.
[ "Check", "if", "there", "is", "a", "pending", "async", "operation", "for", "given", "details", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/helper/async_helper.class.php#L210-L232
212,188
moodle/moodle
backup/util/helper/async_helper.class.php
async_helper.get_backup_file_info
public static function get_backup_file_info($filename, $filearea, $contextid) { $fs = get_file_storage(); $file = $fs->get_file($contextid, 'backup', $filearea, 0, '/', $filename); $filesize = display_size ($file->get_filesize()); $fileurl = moodle_url::make_pluginfile_url( $...
php
public static function get_backup_file_info($filename, $filearea, $contextid) { $fs = get_file_storage(); $file = $fs->get_file($contextid, 'backup', $filearea, 0, '/', $filename); $filesize = display_size ($file->get_filesize()); $fileurl = moodle_url::make_pluginfile_url( $...
[ "public", "static", "function", "get_backup_file_info", "(", "$", "filename", ",", "$", "filearea", ",", "$", "contextid", ")", "{", "$", "fs", "=", "get_file_storage", "(", ")", ";", "$", "file", "=", "$", "fs", "->", "get_file", "(", "$", "contextid", ...
Get the size, url and restore url for a backup file. @param string $filename The name of the file to get info for. @param string $filearea The file area for the file. @param int $contextid The context ID of the file. @return array $results The result array containing the size, url and restore url of the file.
[ "Get", "the", "size", "url", "and", "restore", "url", "for", "a", "backup", "file", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/helper/async_helper.class.php#L242-L274
212,189
moodle/moodle
backup/util/helper/async_helper.class.php
async_helper.get_restore_url
public static function get_restore_url($backupid) { global $DB; $backupitemid = $DB->get_field('backup_controllers', 'itemid', array('backupid' => $backupid), MUST_EXIST); $newcontext = context_course::instance($backupitemid); $restoreurl = $newcontext->get_url()->out(); $urlar...
php
public static function get_restore_url($backupid) { global $DB; $backupitemid = $DB->get_field('backup_controllers', 'itemid', array('backupid' => $backupid), MUST_EXIST); $newcontext = context_course::instance($backupitemid); $restoreurl = $newcontext->get_url()->out(); $urlar...
[ "public", "static", "function", "get_restore_url", "(", "$", "backupid", ")", "{", "global", "$", "DB", ";", "$", "backupitemid", "=", "$", "DB", "->", "get_field", "(", "'backup_controllers'", ",", "'itemid'", ",", "array", "(", "'backupid'", "=>", "$", "...
Get the url of a restored backup item based on the backup ID. @param string $backupid The backup ID to get the restore location url. @return array $urlarray The restored item URL as an array.
[ "Get", "the", "url", "of", "a", "restored", "backup", "item", "based", "on", "the", "backup", "ID", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/helper/async_helper.class.php#L282-L292
212,190
moodle/moodle
backup/util/helper/async_helper.class.php
async_helper.get_async_backups
public static function get_async_backups($renderer, $instanceid) { global $DB; $tabledata = array(); // Get relevant backup ids based on context instance id. $select = 'itemid = ? AND execution = ? AND status < ? AND status > ?'; $params = array($instanceid, backup::EXECUTION_D...
php
public static function get_async_backups($renderer, $instanceid) { global $DB; $tabledata = array(); // Get relevant backup ids based on context instance id. $select = 'itemid = ? AND execution = ? AND status < ? AND status > ?'; $params = array($instanceid, backup::EXECUTION_D...
[ "public", "static", "function", "get_async_backups", "(", "$", "renderer", ",", "$", "instanceid", ")", "{", "global", "$", "DB", ";", "$", "tabledata", "=", "array", "(", ")", ";", "// Get relevant backup ids based on context instance id.", "$", "select", "=", ...
Get markup for in progress async backups, to use in backup table UI. @param \core_backup_renderer $renderer The backup renderer object. @param integer $instanceid The context id to get backup data for. @return array $tabledata the rows of table data.
[ "Get", "markup", "for", "in", "progress", "async", "backups", "to", "use", "in", "backup", "table", "UI", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/helper/async_helper.class.php#L302-L323
212,191
moodle/moodle
backup/util/helper/async_helper.class.php
async_helper.get_restore_name
public static function get_restore_name(\context $context) { global $DB; $instanceid = $context->instanceid; if ($context->contextlevel == CONTEXT_MODULE) { // For modules get the course name and module name. $cm = get_coursemodule_from_id('', $context->instanceid, 0, fa...
php
public static function get_restore_name(\context $context) { global $DB; $instanceid = $context->instanceid; if ($context->contextlevel == CONTEXT_MODULE) { // For modules get the course name and module name. $cm = get_coursemodule_from_id('', $context->instanceid, 0, fa...
[ "public", "static", "function", "get_restore_name", "(", "\\", "context", "$", "context", ")", "{", "global", "$", "DB", ";", "$", "instanceid", "=", "$", "context", "->", "instanceid", ";", "if", "(", "$", "context", "->", "contextlevel", "==", "CONTEXT_M...
Get the course name of the resource being restored. @param \context $context The Moodle context for the restores. @return string $coursename The full name of the course.
[ "Get", "the", "course", "name", "of", "the", "resource", "being", "restored", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/helper/async_helper.class.php#L331-L346
212,192
moodle/moodle
backup/util/helper/async_helper.class.php
async_helper.get_async_restores
public static function get_async_restores($userid) { global $DB; $select = 'userid = ? AND execution = ? AND status < ? AND status > ? AND operation = ?'; $params = array($userid, backup::EXECUTION_DELAYED, backup::STATUS_FINISHED_ERR, backup::STATUS_NEED_PRECHECK, 'restore'); $restores...
php
public static function get_async_restores($userid) { global $DB; $select = 'userid = ? AND execution = ? AND status < ? AND status > ? AND operation = ?'; $params = array($userid, backup::EXECUTION_DELAYED, backup::STATUS_FINISHED_ERR, backup::STATUS_NEED_PRECHECK, 'restore'); $restores...
[ "public", "static", "function", "get_async_restores", "(", "$", "userid", ")", "{", "global", "$", "DB", ";", "$", "select", "=", "'userid = ? AND execution = ? AND status < ? AND status > ? AND operation = ?'", ";", "$", "params", "=", "array", "(", "$", "userid", ...
Get all the current in progress async restores for a user. @param int $userid Moodle user id. @return array $restores List of current restores in progress.
[ "Get", "all", "the", "current", "in", "progress", "async", "restores", "for", "a", "user", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/helper/async_helper.class.php#L354-L367
212,193
moodle/moodle
lib/phpexcel/PHPExcel/Shared/JAMA/EigenvalueDecomposition.php
EigenvalueDecomposition.cdiv
private function cdiv($xr, $xi, $yr, $yi) { if (abs($yr) > abs($yi)) { $r = $yi / $yr; $d = $yr + $r * $yi; $this->cdivr = ($xr + $r * $xi) / $d; $this->cdivi = ($xi - $r * $xr) / $d; } else { $r = $yr / $yi; $d = $yi + $r * $yr...
php
private function cdiv($xr, $xi, $yr, $yi) { if (abs($yr) > abs($yi)) { $r = $yi / $yr; $d = $yr + $r * $yi; $this->cdivr = ($xr + $r * $xi) / $d; $this->cdivi = ($xi - $r * $xr) / $d; } else { $r = $yr / $yi; $d = $yi + $r * $yr...
[ "private", "function", "cdiv", "(", "$", "xr", ",", "$", "xi", ",", "$", "yr", ",", "$", "yi", ")", "{", "if", "(", "abs", "(", "$", "yr", ")", ">", "abs", "(", "$", "yi", ")", ")", "{", "$", "r", "=", "$", "yi", "/", "$", "yr", ";", ...
Performs complex division. @access private
[ "Performs", "complex", "division", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Shared/JAMA/EigenvalueDecomposition.php#L375-L388
212,194
moodle/moodle
filter/classes/external.php
external.get_available_in_context
public static function get_available_in_context($contexts) { $params = self::validate_parameters(self::get_available_in_context_parameters(), array('contexts' => $contexts)); $filters = $warnings = array(); foreach ($params['contexts'] as $contextinfo) { try { $conte...
php
public static function get_available_in_context($contexts) { $params = self::validate_parameters(self::get_available_in_context_parameters(), array('contexts' => $contexts)); $filters = $warnings = array(); foreach ($params['contexts'] as $contextinfo) { try { $conte...
[ "public", "static", "function", "get_available_in_context", "(", "$", "contexts", ")", "{", "$", "params", "=", "self", "::", "validate_parameters", "(", "self", "::", "get_available_in_context_parameters", "(", ")", ",", "array", "(", "'contexts'", "=>", "$", "...
Returns the filters available in the given contexts. @param array $contexts the list of contexts to check @return array with the filters information and warnings @since Moodle 3.4
[ "Returns", "the", "filters", "available", "in", "the", "given", "contexts", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/filter/classes/external.php#L76-L105
212,195
moodle/moodle
admin/tool/installaddon/renderer.php
tool_installaddon_renderer.set_installer_instance
public function set_installer_instance(tool_installaddon_installer $installer) { if (is_null($this->installer)) { $this->installer = $installer; } else { throw new coding_exception('Attempting to reset the installer instance.'); } }
php
public function set_installer_instance(tool_installaddon_installer $installer) { if (is_null($this->installer)) { $this->installer = $installer; } else { throw new coding_exception('Attempting to reset the installer instance.'); } }
[ "public", "function", "set_installer_instance", "(", "tool_installaddon_installer", "$", "installer", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "installer", ")", ")", "{", "$", "this", "->", "installer", "=", "$", "installer", ";", "}", "else",...
Sets the tool_installaddon_installer instance being used. @throws coding_exception if the installer has been already set @param tool_installaddon_installer $installer
[ "Sets", "the", "tool_installaddon_installer", "instance", "being", "used", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/installaddon/renderer.php#L46-L52
212,196
moodle/moodle
admin/tool/installaddon/renderer.php
tool_installaddon_renderer.index_page
public function index_page() { if (is_null($this->installer)) { throw new coding_exception('Installer instance has not been set.'); } $permcheckurl = new moodle_url('/admin/tool/installaddon/permcheck.php'); $this->page->requires->yui_module('moodle-tool_installaddon-permch...
php
public function index_page() { if (is_null($this->installer)) { throw new coding_exception('Installer instance has not been set.'); } $permcheckurl = new moodle_url('/admin/tool/installaddon/permcheck.php'); $this->page->requires->yui_module('moodle-tool_installaddon-permch...
[ "public", "function", "index_page", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "installer", ")", ")", "{", "throw", "new", "coding_exception", "(", "'Installer instance has not been set.'", ")", ";", "}", "$", "permcheckurl", "=", "new", "m...
Defines the index page layout @return string
[ "Defines", "the", "index", "page", "layout" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/installaddon/renderer.php#L59-L79
212,197
moodle/moodle
admin/tool/installaddon/renderer.php
tool_installaddon_renderer.remote_request_invalid_page
public function remote_request_invalid_page(moodle_url $continueurl) { $out = $this->output->header(); $out .= $this->output->heading(get_string('installfromrepo', 'tool_installaddon')); $out .= $this->output->box(get_string('remoterequestinvalid', 'tool_installaddon'), 'generalbox', 'notice');...
php
public function remote_request_invalid_page(moodle_url $continueurl) { $out = $this->output->header(); $out .= $this->output->heading(get_string('installfromrepo', 'tool_installaddon')); $out .= $this->output->box(get_string('remoterequestinvalid', 'tool_installaddon'), 'generalbox', 'notice');...
[ "public", "function", "remote_request_invalid_page", "(", "moodle_url", "$", "continueurl", ")", "{", "$", "out", "=", "$", "this", "->", "output", "->", "header", "(", ")", ";", "$", "out", ".=", "$", "this", "->", "output", "->", "heading", "(", "get_s...
Inform the user about invalid remote installation request. @param moodle_url $continueurl @return string
[ "Inform", "the", "user", "about", "invalid", "remote", "installation", "request", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/installaddon/renderer.php#L104-L113
212,198
moodle/moodle
admin/tool/installaddon/renderer.php
tool_installaddon_renderer.remote_request_alreadyinstalled_page
public function remote_request_alreadyinstalled_page(stdClass $data, moodle_url $continueurl) { $out = $this->output->header(); $out .= $this->output->heading(get_string('installfromrepo', 'tool_installaddon')); $out .= $this->output->box(get_string('remoterequestalreadyinstalled', 'tool_instal...
php
public function remote_request_alreadyinstalled_page(stdClass $data, moodle_url $continueurl) { $out = $this->output->header(); $out .= $this->output->heading(get_string('installfromrepo', 'tool_installaddon')); $out .= $this->output->box(get_string('remoterequestalreadyinstalled', 'tool_instal...
[ "public", "function", "remote_request_alreadyinstalled_page", "(", "stdClass", "$", "data", ",", "moodle_url", "$", "continueurl", ")", "{", "$", "out", "=", "$", "this", "->", "output", "->", "header", "(", ")", ";", "$", "out", ".=", "$", "this", "->", ...
Inform the user that such plugin is already installed @param stdClass $data decoded request data @param moodle_url $continueurl @return string
[ "Inform", "the", "user", "that", "such", "plugin", "is", "already", "installed" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/installaddon/renderer.php#L122-L131
212,199
moodle/moodle
admin/tool/installaddon/renderer.php
tool_installaddon_renderer.remote_request_confirm_page
public function remote_request_confirm_page(stdClass $data, moodle_url $continueurl, moodle_url $cancelurl) { $out = $this->output->header(); $out .= $this->output->heading(get_string('installfromrepo', 'tool_installaddon')); $out .= $this->output->confirm(get_string('remoterequestconfirm', 'to...
php
public function remote_request_confirm_page(stdClass $data, moodle_url $continueurl, moodle_url $cancelurl) { $out = $this->output->header(); $out .= $this->output->heading(get_string('installfromrepo', 'tool_installaddon')); $out .= $this->output->confirm(get_string('remoterequestconfirm', 'to...
[ "public", "function", "remote_request_confirm_page", "(", "stdClass", "$", "data", ",", "moodle_url", "$", "continueurl", ",", "moodle_url", "$", "cancelurl", ")", "{", "$", "out", "=", "$", "this", "->", "output", "->", "header", "(", ")", ";", "$", "out"...
Let the user confirm the remote installation request. @param stdClass $data decoded request data @param moodle_url $continueurl @param moodle_url $cancelurl @return string
[ "Let", "the", "user", "confirm", "the", "remote", "installation", "request", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/installaddon/renderer.php#L141-L149