Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
tool

Classes

class  admin_uploadpicture_form
 
class  admin_uploaduser_form1
 Upload a file CVS file with user information. More...
 
class  admin_uploaduser_form2
 Specify user upload details. More...
 
class  tool_customlang_filter_form
 Form for filtering the strings to customize. More...
 
class  tool_customlang_menu
 Represents the action menu of the tool. More...
 
class  tool_customlang_translator
 Represents the translation tool. More...
 
class  tool_customlang_utils
 Provides various utilities to be used by the plugin. More...
 
class  uu_progress_tracker
 Tracking of processed users. More...
 

Functions

 tool_langimport_preupgrade_update ($lang)
 Called during upgrade, we need up-to-date lang pack because it may be used during upgrade...
 
 uu_allowed_roles ()
 Returns list of roles that are assignable in courses.
 
 uu_allowed_roles_cache (?int $categoryid=null, ?int $courseid=null)
 Returns assignable roles for current user using short role name and role ID as index.
 
 uu_allowed_sysroles_cache ()
 Returns mapping of all system roles using short role name as index.
 
 uu_check_custom_profile_data (&$data, array &$profilefieldvalues=[])
 Checks if data provided for custom fields is correct Currently checking for custom profile field or type menu.
 
 uu_increment_username ($username)
 Increments username - increments trailing number or adds it if not present.
 
 uu_pre_process_custom_profile_data ($data)
 Pre process custom profile data, and update it with corrected value.
 
 uu_process_template ($template, $user)
 Check if default field contains templates and apply them.
 
 uu_process_template_callback ($username, $firstname, $lastname, $block)
 Internal callback function.
 
 uu_supported_auths ()
 Returns list of auth plugins that are enabled and known to work.
 
 uu_validate_user_upload_columns (csv_import_reader $cir, $stdfields, $profilefields, moodle_url $returnurl)
 Validation callback function - verified the column line of csv file.
 
 xmldb_tool_customlang_install ()
 
 xmldb_tool_customlang_upgrade ($oldversion)
 
 xmldb_tool_unsuproles_install ()
 

Variables

 $hasextension = extension_loaded('tideways_xhprof')
 
 $isenabled = !empty($CFG->profilingenabled) || !empty($CFG->earlyprofilingenabled)
 
 $plugin = 2023041800
 
 $plugin = 2023041800
 
 $plugin = 2023041800
 
 $plugin = 2023041800
 
 $plugin = 2023041800
 
 $plugin = 2023041800
 
 $plugin = 2023041800
 
 $plugin = 2023041800
 
$plugin component = 'tool_customlang'
 
$plugin component = 'tool_innodb'
 
$plugin component = 'tool_langimport'
 
$plugin component = 'tool_multilangupgrade'
 
$plugin component = 'tool_replace'
 
$plugin component = 'tool_spamcleaner'
 
$plugin component = 'tool_unsuproles'
 
$plugin component = 'tool_uploaduser'
 
const UU_BULK_ALL 3
 
const UU_BULK_NEW 1
 
const UU_BULK_NONE 0
 
const UU_BULK_UPDATED 2
 
const UU_PWRESET_ALL 2
 
const UU_PWRESET_NONE 0
 
const UU_PWRESET_WEAK 1
 
const UU_UPDATE_ALLOVERRIDE 2
 
const UU_UPDATE_FILEOVERRIDE 1
 
const UU_UPDATE_MISSING 3
 
const UU_UPDATE_NOCHANGES 0
 
const UU_USER_ADD_UPDATE 2
 
const UU_USER_ADDINC 1
 
const UU_USER_ADDNEW 0
 
const UU_USER_UPDATE 3
 
$plugin version = 2023042400
 
$plugin version = 2023042400
 
$plugin version = 2023042400
 
$plugin version = 2023042400
 
$plugin version = 2023042400
 
$plugin version = 2023042400
 
$plugin version = 2023042400
 
$plugin version = 2023042400
 

Detailed Description

Function Documentation

◆ tool_langimport_preupgrade_update()

tool_langimport_preupgrade_update ( $lang)

Called during upgrade, we need up-to-date lang pack because it may be used during upgrade...

Parameters
string$lang
Return values
void

◆ uu_allowed_roles()

uu_allowed_roles ( )

Returns list of roles that are assignable in courses.

Return values
array

◆ uu_allowed_roles_cache()

uu_allowed_roles_cache ( ?int $categoryid = null,
?int $courseid = null )

Returns assignable roles for current user using short role name and role ID as index.

This function is no longer called without parameters.

Parameters
int | null$categoryidId of the category to get roles for.
int | null$courseidId of the course to get roles for.
Return values
array

◆ uu_allowed_sysroles_cache()

uu_allowed_sysroles_cache ( )

Returns mapping of all system roles using short role name as index.

Return values
array

◆ uu_check_custom_profile_data()

uu_check_custom_profile_data ( & $data,
array & $profilefieldvalues = [] )

Checks if data provided for custom fields is correct Currently checking for custom profile field or type menu.

Parameters
array$datauser profile data
array$profilefieldvaluesUsed to track previous profile field values to ensure uniqueness is observed
Return values
booltrue if no error else false

◆ uu_increment_username()

uu_increment_username ( $username)

Increments username - increments trailing number or adds it if not present.

Varifies that the new username does not exist yet

Parameters
string$username
Return values
incrementedusername which does not exist yet

◆ uu_pre_process_custom_profile_data()

uu_pre_process_custom_profile_data ( $data)

Pre process custom profile data, and update it with corrected value.

Parameters
stdClass$datauser profile data
Return values
stdClasspre-processed custom profile data

◆ uu_process_template()

uu_process_template ( $template,
$user )

Check if default field contains templates and apply them.

Parameters
stringtemplate - potential tempalte string
objectuser object- we need username, firstname and lastname
Return values
stringfield value

◆ uu_supported_auths()

uu_supported_auths ( )

Returns list of auth plugins that are enabled and known to work.

If ppl want to use some other auth type they have to include it in the CSV file next on each line.

Return values
arraytype=>name

◆ uu_validate_user_upload_columns()

uu_validate_user_upload_columns ( csv_import_reader $cir,
$stdfields,
$profilefields,
moodle_url $returnurl )

Validation callback function - verified the column line of csv file.

Converts standard column names to lowercase.

Parameters
csv_import_reader$cir
array$stdfieldsstandard user fields
array$profilefieldscustom profile fields
moodle_url$returnurlreturn url in case of any error
Return values
arraylist of fields