[ Index ] |
PHP Cross Reference of Unnamed Project |
[Source view] [Print] [Project Stats]
deprecatedlib.php - Old functions retained only for backward compatibility Old functions retained only for backward compatibility. New code should not use any of these functions.
Copyright: | 1999 onwards Martin Dougiamas {@link http://moodle.com} |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 4631 lines (169 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user=0) X-Ref |
Add an entry to the legacy log table. param: int $courseid The course id param: string $module The module name e.g. forum, journal, resource, course, user etc param: string $action 'view', 'update', 'add' or 'delete', possibly followed by another word to clarify. param: string $url The file and parameters used to see the results of the action param: string $info Additional description information param: int $cm The course_module->id if there is one param: int|stdClass $user If log regards $user other than $USER return: void |
events_trigger($eventname, $eventdata) X-Ref |
Function to call all event handlers when triggering an event param: string $eventname name of the event param: mixed $eventdata event data object return: int number of failed events |
get_core_subsystems($fullpaths = false) X-Ref |
List all core subsystems and their location This is a whitelist of components that are part of the core and their language strings are defined in /lang/en/<<subsystem>>.php. If a given plugin is not listed here and it does not have proper plugintype prefix, then it is considered as course activity module. The location is optionally dirroot relative path. NULL means there is no special directory for this subsystem. If the location is set, the subsystem's renderer.php is expected to be there. param: bool $fullpaths false means relative paths from dirroot, use true for performance reasons return: array of (string)name => (string|null)location |
get_plugin_types($fullpaths = true) X-Ref |
Lists all plugin types. param: bool $fullpaths false means relative paths from dirroot return: array Array of strings - name=>location |
get_plugin_list($plugintype) X-Ref |
Use when listing real plugins of one type. param: string $plugintype type of plugin return: array name=>fulllocation pairs of plugins of given type |
get_plugin_list_with_class($plugintype, $class, $file) X-Ref |
Get a list of all the plugins of a given type that define a certain class in a certain file. The plugin component names and class names are returned. param: string $plugintype the type of plugin, e.g. 'mod' or 'report'. param: string $class the part of the name of the class after the param: string $file the name of file within the plugin that defines the class. return: array with frankenstyle plugin names as keys (e.g. 'report_courselist', 'mod_forum') |
get_plugin_directory($plugintype, $name) X-Ref |
Returns the exact absolute path to plugin directory. param: string $plugintype type of plugin param: string $name name of the plugin return: string full path to plugin directory; NULL if not found |
normalize_component($component) X-Ref |
Normalize the component name using the "frankenstyle" names. param: string $component return: array as (string)$type => (string)$plugin |
get_component_directory($component) X-Ref |
Return exact absolute path to a plugin directory. param: string $component name such as 'moodle', 'mod_forum' return: string full path to component directory; NULL if not found |
get_context_instance($contextlevel, $instance = 0, $strictness = IGNORE_MISSING) X-Ref |
Get the context instance as an object. This function will create the context instance if it does not exist yet. param: integer $contextlevel The context level, for example CONTEXT_COURSE, or CONTEXT_MODULE. param: integer $instance The instance id. For $level = CONTEXT_COURSE, this would be $course->id, param: int $strictness IGNORE_MISSING means compatible mode, false returned if record not found, debug message if more found; return: context The context object. |
clam_log_upload($newfilepath, $course=null, $nourl=false) X-Ref |
Adds a file upload to the log table so that clam can resolve the filename to the user later if necessary |
clam_log_infected($oldfilepath='', $newfilepath='', $userid=0) X-Ref |
This function logs to error_log and to the log table that an infected file has been found and what's happened to it. |
clam_change_log($oldpath, $newpath, $update=true) X-Ref |
Some of the modules allow moving attachments (glossary), in which case we need to hunt down an original log and change the path. |
clam_replace_infected_file($file) X-Ref |
Replaces the given file with a string. |
clam_handle_infected_file($file, $userid=0, $basiconly=false) X-Ref |
Deals with an infected file - either moves it to a quarantinedir (specified in CFG->quarantinedir) or deletes it. If moving it fails, it deletes it. |
clam_scan_moodle_file(&$file, $course) X-Ref |
If $CFG->runclamonupload is set, we scan a given file. (called from {@link preprocess_files()}) |
password_compat_not_supported() X-Ref |
Checks whether the password compatibility library will work with the current version of PHP. This cannot be done using PHP version numbers since the fix has been backported to earlier versions in some distributions. See https://github.com/ircmaxell/password_compat/issues/10 for more details. |
session_get_instance() X-Ref |
Factory method that was returning moodle_session object. |
session_is_legacy() X-Ref |
Returns true if legacy session used. |
session_kill_all() X-Ref |
Terminates all sessions, auth hooks are not executed. |
session_touch($sid) X-Ref |
Mark session as accessed, prevents timeouts. |
session_kill($sid) X-Ref |
Terminates one sessions, auth hooks are not executed. |
session_kill_user($userid) X-Ref |
Terminates all sessions of one user, auth hooks are not executed. |
session_set_user($user) X-Ref |
Setup $USER object - called during login, loginas, etc. Call sync_user_enrolments() manually after log-in, or log-in-as. |
session_is_loggedinas() X-Ref |
Is current $USER logged-in-as somebody else? |
session_get_realuser() X-Ref |
Returns the $USER object ignoring current login-as session |
session_loginas($userid, $context) X-Ref |
Login as another user - no security checks here. |
js_minify($files) X-Ref |
Minify JavaScript files. |
css_minify_css($files) X-Ref |
Minify CSS files. |
check_gd_version() X-Ref |
Hack to find out the GD version by parsing phpinfo output |
update_login_count() X-Ref |
Not used any more, the account lockout handling is now part of authenticate_user_login(). |
reset_login_count() X-Ref |
Not used any more, replaced by proper account lockout. |
update_log_display_entry($module, $action, $mtable, $field) X-Ref |
filter_text($text, $courseid = NULL) X-Ref |
httpsrequired() X-Ref |
get_file_url($path, $options=null, $type='coursefile') X-Ref |
Given a physical path to a file, returns the URL through which it can be reached in Moodle. param: string $path Physical path to a file param: array $options associative array of GET variables to append to the URL param: string $type (questionfile|rssfile|httpscoursefile|coursefile) return: string URL to file |
get_course_participants($courseid) X-Ref |
is_course_participant($userid, $courseid) X-Ref |
get_recent_enrolments($courseid, $timestart) X-Ref |
detect_munged_arguments($string, $allowdots=1) X-Ref |
unzip_file($zipfile, $destination = '', $showstatus_ignored = true) X-Ref |
Unzip one zip file to a destination dir Both parameters must be FULL paths If destination isn't specified, it will be the SAME directory where the zip file resides. param: string $zipfile The zip file to unzip param: string $destination The location to unzip to param: bool $showstatus_ignored Unused |
zip_files($originalfiles, $destination) X-Ref |
Zip an array of files/dirs to a destination zip file Both parameters must be FULL paths to the files/dirs param: array $originalfiles Files to zip param: string $destination The destination path return: bool Outcome |
mygroupid($courseid) X-Ref |
groupmode($course, $cm=null) X-Ref |
Returns the current group mode for a given course or activity module Could be false, SEPARATEGROUPS or VISIBLEGROUPS (<-- Martin) param: object $course Course Object param: object $cm Course Manager Object return: mixed $course->groupmode |
set_current_group($courseid, $groupid) X-Ref |
Sets the current group in the session variable When $SESSION->currentgroup[$courseid] is set to 0 it means, show all groups. Sets currentgroup[$courseid] in the session variable appropriately. Does not do any permission checking. param: int $courseid The course being examined - relates to id field in param: int $groupid The group being examined. return: int Current group id which was set by this function |
get_current_group($courseid, $full = false) X-Ref |
Gets the current group - either from the session variable or from the database. param: int $courseid The course being examined - relates to id field in param: bool $full If true, the return value is a full record object. return: int|bool |
groups_filter_users_by_course_module_visible($cm, $users) X-Ref |
groups_course_module_visible($cm, $userid=null) X-Ref |
error($message, $link='') X-Ref |
current_theme() X-Ref |
formerr($error) X-Ref |
skip_main_destination() X-Ref |
print_container($message, $clearfix=false, $classes='', $idbase='', $return=false) X-Ref |
print_container_start($clearfix=false, $classes='', $idbase='', $return=false) X-Ref |
print_container_end($return=false) X-Ref |
notify($message, $classes = 'error', $align = 'center', $return = false) X-Ref |
Print a bold message in an optional color. param: string $message The message to print out param: string $classes Optional style to display message text in param: string $align Alignment option param: bool $return whether to return an output string or echo now return: string|bool Depending on $result |
print_continue($link, $return = false) X-Ref |
print_header($title='', $heading='', $navigation='', $focus='',$meta='', $cache=true, $button=' ', $menu=null,$usexml=false, $bodytags='', $return=false) X-Ref |
print_header_simple($title='', $heading='', $navigation='', $focus='', $meta='',$cache=true, $button=' ', $menu='', $usexml=false, $bodytags='', $return=false) X-Ref |
print_side_block($heading='', $content='', $list=NULL, $icons=NULL, $footer='', $attributes = array() X-Ref |
print_textarea($unused, $rows, $cols, $width, $height, $name, $value='', $obsolete=0, $return=false, $id='') X-Ref |
Prints a basic textarea field. param: bool $unused No longer used. param: int $rows Number of rows to display (minimum of 10 when $height is non-null) param: int $cols Number of columns to display (minimum of 65 when $width is non-null) param: null $width (Deprecated) Width of the element; if a value is passed, the minimum value for $cols will be 65. Value is otherwise ignored. param: null $height (Deprecated) Height of the element; if a value is passe, the minimum value for $rows will be 10. Value is otherwise ignored. param: string $name Name to use for the textarea element. param: string $value Initial content to display in the textarea. param: int $obsolete deprecated param: bool $return If false, will output string. If true, will return string value. param: string $id CSS ID to add to the textarea element. return: string|void depending on the value of $return |
print_arrow($direction='up', $strsort=null, $return=false) X-Ref |
Returns an image of an up or down arrow, used for column sorting. To avoid unnecessary DB accesses, please provide this function with the language strings for sortasc and sortdesc. param: string $direction 'up' or 'down' param: string $strsort The language string used for the alt attribute of this image param: bool $return Whether to print directly or return the html string return: string|void depending on $return |
choose_from_menu($options, $name, $selected='', $nothing='choose', $script='',$nothingvalue='0', $return=false, $disabled=false, $tabindex=0,$id='', $listbox=false, $multiple=false, $class='') X-Ref |
print_scale_menu_helpbutton($courseid, $scale, $return=false) X-Ref |
print_checkbox($name, $value, $checked = true, $label = '', $alt = '', $script='', $return=false) X-Ref |
update_module_button($cmid, $ignored, $string) X-Ref |
Prints the 'update this xxx' button that appears on module pages. param: string $cmid the course_module id. param: string $ignored not used any more. (Used to be courseid.) param: string $string the module name - get_string('modulename', 'xxx') return: string the HTML for the button, if this user has permission to edit it, else an empty string. |
print_navigation($navigation, $separator=0, $return=false) X-Ref |
build_navigation($extranavlinks, $cm = null) X-Ref |
navmenu($course, $cm=NULL, $targetwindow='self') X-Ref |
add_event($event) X-Ref |
update_event($event) X-Ref |
delete_event($id) X-Ref |
hide_event($event) X-Ref |
show_event($event) X-Ref |
textlib_get_instance() X-Ref |
get_generic_section_name($format, stdClass $section) X-Ref |
get_all_sections($courseid) X-Ref |
Returns an array of sections for the requested course id It is usually not recommended to display the list of sections used in course because the course format may have it's own way to do it. If you need to just display the name of the section please call: get_section_name($course, $section) {@link get_section_name()} from 2.4 $section may also be just the field course_sections.section If you need the list of all sections it is more efficient to get this data by calling $modinfo = get_fast_modinfo($courseorid); $sections = $modinfo->get_section_info_all() {@link get_fast_modinfo()} {@link course_modinfo::get_section_info_all()} Information about one section (instance of section_info): get_fast_modinfo($courseorid)->get_sections_info($section) {@link course_modinfo::get_section_info()} |
add_mod_to_section($mod, $beforemod = null) X-Ref |
This function is deprecated, please use {@link course_add_cm_to_section()} Note that course_add_cm_to_section() also updates field course_modules.section and calls rebuild_course_cache() |
get_all_mods($courseid, &$mods, &$modnames, &$modnamesplural, &$modnamesused) X-Ref |
Returns a number of useful structures for course displays Function get_all_mods() is deprecated in 2.4 Instead of: <code> get_all_mods($courseid, $mods, $modnames, $modnamesplural, $modnamesused); </code> please use: <code> $mods = get_fast_modinfo($courseorid)->get_cms(); $modnames = get_module_types_names(); $modnamesplural = get_module_types_names(true); $modnamesused = get_fast_modinfo($courseorid)->get_used_module_names(); </code> |
get_course_section($section, $courseid) X-Ref |
Returns course section - creates new if does not exist yet This function is deprecated. To create a course section call: course_create_sections_if_missing($courseorid, $sections); to get the section call: get_fast_modinfo($courseorid)->get_section_info($sectionnum); |
format_weeks_get_section_dates($section, $course) X-Ref |
get_print_section_cm_text(cm_info $cm, $course) X-Ref |
Deprecated. Instead of: list($content, $name) = get_print_section_cm_text($cm, $course); use: $content = $cm->get_formatted_content(array('overflowdiv' => true, 'noclean' => true)); $name = $cm->get_formatted_name(); |
print_section_add_menus($course, $section, $modnames = null, $vertical=false, $return=false, $sectionreturn=null) X-Ref |
Deprecated. Please use: $courserenderer = $PAGE->get_renderer('core', 'course'); $output = $courserenderer->course_section_add_cm_control($course, $section, $sectionreturn, array('inblock' => $vertical)); echo $output; |
make_editing_buttons(stdClass $mod, $absolute_ignored = true, $moveselect = true, $indent=-1, $section=null) X-Ref |
Deprecated. Please use: $courserenderer = $PAGE->get_renderer('core', 'course'); $actions = course_get_cm_edit_actions($mod, $indent, $section); return ' ' . $courserenderer->course_section_cm_edit_actions($actions); |
print_section($course, $section, $mods, $modnamesused, $absolute=false, $width="100%", $hidecompletion=false, $sectionreturn=null) X-Ref |
Deprecated. Please use: $courserenderer = $PAGE->get_renderer('core', 'course'); echo $courserenderer->course_section_cm_list($course, $section, $sectionreturn, array('hidecompletion' => $hidecompletion)); |
print_overview($courses, array $remote_courses=array() X-Ref |
print_recent_activity($course) X-Ref |
delete_course_module($id) X-Ref |
update_category_button($categoryid = 0) X-Ref |
make_categories_list(&$list, &$parents, $requiredcapability = '',$excludeid = 0, $category = NULL, $path = "") X-Ref |
This function is deprecated! For list of categories use coursecat::make_all_categories($requiredcapability, $excludeid, $separator) For parents of one particular category use coursecat::get($id)->get_parents() |
category_delete_move($category, $newparentid, $showfeedback=true) X-Ref |
category_delete_full($category, $showfeedback=true) X-Ref |
move_category($category, $newparentcat) X-Ref |
This function is deprecated. Please use $coursecat = coursecat::get($category->id); if ($coursecat->can_change_parent($newparentcat->id)) { $coursecat->change_parent($newparentcat->id); } Alternatively you can use $coursecat->update(array('parent' => $newparentcat->id)); |
course_category_hide($category) X-Ref |
This function is deprecated. Please use coursecat::get($category->id)->hide(); |
course_category_show($category) X-Ref |
This function is deprecated. Please use coursecat::get($category->id)->show(); |
get_course_category($catid=0) X-Ref |
This function is deprecated. To get the category with the specified it please use: coursecat::get($catid, IGNORE_MISSING); or coursecat::get($catid, MUST_EXIST); To get the first available category please use coursecat::get_default(); |
create_course_category($category) X-Ref |
This function is deprecated. It is replaced with the method create() in class coursecat. {@link coursecat::create()} also verifies the data, fixes sortorder and logs the action |
get_all_subcategories($catid) X-Ref |
This function is deprecated. To get visible children categories of the given category use: coursecat::get($categoryid)->get_children(); This function will return the array or coursecat objects, on each of them you can call get_children() again |
get_child_categories($parentid) X-Ref |
This function is deprecated. Please use functions in class coursecat: - coursecat::get($parentid)->has_children() tells if the category has children (visible or not to the current user) - coursecat::get($parentid)->get_children() returns an array of coursecat objects, each of them represents a children category visible to the current user (i.e. visible=1 or user has capability to view hidden categories) - coursecat::get($parentid)->get_children_count() returns number of children categories visible to the current user - coursecat::count_all() returns total count of all categories in the system (both visible and not) - coursecat::get_default() returns the first category (usually to be used if count_all() == 1) |
get_categories($parent='none', $sort=NULL, $shallow=true) X-Ref |
print_course_search($value="", $return=false, $format="plain") X-Ref |
This function is deprecated, please use course renderer: $renderer = $PAGE->get_renderer('core', 'course'); echo $renderer->course_search_form($value, $format); |
print_my_moodle() X-Ref |
This function is deprecated, please use: $renderer = $PAGE->get_renderer('core', 'course'); echo $renderer->frontpage_my_courses() |
print_remote_course($course, $width="100%") X-Ref |
This function is deprecated, it is replaced with protected function {@link core_course_renderer::frontpage_remote_course()} It is only used from function {@link core_course_renderer::frontpage_my_courses()} |
print_remote_host($host, $width="100%") X-Ref |
This function is deprecated, it is replaced with protected function {@link core_course_renderer::frontpage_remote_host()} It is only used from function {@link core_course_renderer::frontpage_my_courses()} |
print_whole_category_list($category=NULL, $displaylist=NULL, $parentslist=NULL, $depth=-1, $showcourses = true, $categorycourses=NULL) X-Ref |
print_category_info($category, $depth = 0, $showcourses = false, array $courses = null) X-Ref |
get_course_category_tree($id = 0, $depth = 0) X-Ref |
print_courses($category) X-Ref |
print_course($course, $highlightterms = '') X-Ref |
get_category_courses_array($categoryid = 0) X-Ref |
get_category_courses_array_recursively(array &$flattened, $category) X-Ref |
blog_get_context_url($context=null) X-Ref |
get_courses_wmanagers($categoryid=0, $sort="c.sortorder ASC", $fields=array() X-Ref |
convert_tree_to_html($tree, $row=0) X-Ref |
convert_tabrows_to_tree($tabrows, $selected, $inactive, $activated) X-Ref |
can_use_rotated_text() X-Ref |
get_context_instance_by_id($id, $strictness = IGNORE_MISSING) X-Ref |
get_system_context($cache = true) X-Ref |
Returns system context or null if can not be created yet. param: bool $cache use caching return: context system context (null if context table not created yet) |
get_parent_contexts(context $context, $includeself = false) X-Ref |
get_parent_contextid(context $context) X-Ref |
get_child_contexts(context $context) X-Ref |
create_contexts($contextlevel = null, $buildpaths = true) X-Ref |
cleanup_contexts() X-Ref |
build_context_path($force = false) X-Ref |
Populate context.path and context.depth where missing. |
rebuild_contexts(array $fixcontexts) X-Ref |
preload_course_contexts($courseid) X-Ref |
context_moved(context $context, context $newparent) X-Ref |
fetch_context_capabilities(context $context) X-Ref |
context_instance_preload(stdClass $rec) X-Ref |
get_contextlevel_name($contextlevel) X-Ref |
Returns context level name |
print_context_name(context $context, $withprefix = true, $short = false) X-Ref |
mark_context_dirty($path) X-Ref |
delete_context($contextlevel, $instanceid, $deleterecord = true) X-Ref |
get_context_url(context $context) X-Ref |
get_course_context(context $context) X-Ref |
get_user_courses_bycap($userid, $cap, $accessdata_ignored, $doanything_ignored, $sort = 'c.sortorder ASC', $fields = null, $limit_ignored = 0) X-Ref |
get_role_context_caps($roleid, context $context) X-Ref |
get_courseid_from_context(context $context) X-Ref |
context_instance_preload_sql($joinon, $contextlevel, $tablealias) X-Ref |
If you are using this methid, you should have something like this: list($ctxselect, $ctxjoin) = context_instance_preload_sql('c.id', CONTEXT_COURSE, 'ctx'); To prevent the use of this deprecated function, replace the line above with something similar to this: $ctxselect = ', ' . context_helper::get_preload_record_columns_sql('ctx'); ^ $ctxjoin = "LEFT JOIN {context} ctx ON (ctx.instanceid = c.id AND ctx.contextlevel = :contextlevel)"; ^ ^ ^ ^ $params = array('contextlevel' => CONTEXT_COURSE); ^ |
get_related_contexts_string(context $context) X-Ref |
get_plugin_list_with_file($plugintype, $file, $include = false) X-Ref |
check_browser_operating_system($brand) X-Ref |
check_browser_version($brand, $version = null) X-Ref |
get_device_type() X-Ref |
get_device_type_list($incusertypes = true) X-Ref |
get_selected_theme_for_device_type($devicetype = null) X-Ref |
get_device_cfg_var_name($devicetype = null) X-Ref |
set_user_device_type($newdevice) X-Ref |
get_user_device_type() X-Ref |
get_browser_version_classes() X-Ref |
generate_email_supportuser() X-Ref |
badges_get_issued_badge_info($hash) X-Ref |
can_use_html_editor() X-Ref |
count_login_failures($mode, $username, $lastlogin) X-Ref |
ajaxenabled(array $browsers = null) X-Ref |
coursemodule_visible_for_user($cm, $userid=0) X-Ref |
enrol_cohort_get_cohorts(course_enrolment_manager $manager) X-Ref |
enrol_cohort_can_view_cohort($cohortid) X-Ref |
This function is deprecated, use {@link cohort_can_view_cohort()} instead since it also takes into account current context |
cohort_get_visible_list($course, $onlyenrolled=true) X-Ref |
It is advisable to use {@link cohort_get_available_cohorts()} instead. |
enrol_cohort_enrol_all_users(course_enrolment_manager $manager, $cohortid, $roleid) X-Ref |
enrol_cohort_search_cohorts(course_enrolment_manager $manager, $offset = 0, $limit = 25, $search = '') X-Ref |
message_current_user_is_involved($user1, $user2) X-Ref |
Is $USER one of the supplied users? $user2 will be null if viewing a user's recent conversations |
profile_display_badges($userid, $courseid = 0) X-Ref |
Print badges on user profile page. |
useredit_shared_definition_preferences($user, &$mform, $editoroptions = null, $filemanageroptions = null) X-Ref |
Adds user preferences elements to user edit form. |
calendar_normalize_tz($tz) X-Ref |
Convert region timezone to php supported timezone |
get_user_timezone_offset($tz = 99) X-Ref |
Returns a float which represents the user's timezone difference from GMT in hours Checks various settings and picks the most dominant of those which have a value |
get_timezone_offset($tz) X-Ref |
Returns an int which represents the systems's timezone difference from GMT in seconds |
get_list_of_timezones() X-Ref |
Returns a list of timezones in the current language. |
update_timezone_records($timezones) X-Ref |
Previous internal API, it was not supposed to be used anywhere. |
calculate_user_dst_table($fromyear = null, $toyear = null, $strtimezone = null) X-Ref |
Previous internal API, it was not supposed to be used anywhere. |
dst_changes_for_year($year, $timezone) X-Ref |
Previous internal API, it was not supposed to be used anywhere. |
get_timezone_record($timezonename) X-Ref |
Previous internal API, it was not supposed to be used anywhere. |
get_referer($stripquery = true) X-Ref |
Returns the URL of the HTTP_REFERER, less the querystring portion if required. param: boolean $stripquery if true, also removes the query part of the url. return: string The resulting referer or empty string. |
is_web_crawler() X-Ref |
Checks if current user is a web crawler. This list can not be made complete, this is not a security restriction, we make the list only to help these sites especially when automatic guest login is disabled. If admin needs security they should enable forcelogin and disable guest access!! return: bool |
completion_cron() X-Ref |
Update user's course completion statuses First update all criteria completions, then aggregate all criteria completions and update overall course completions. |
coursetag_get_tags($courseid, $userid=0, $tagtype='', $numtags=0, $unused = '') X-Ref |
Returns an ordered array of tags associated with visible courses (boosted replacement of get_all_tags() allowing association with user and tagtype). param: int $courseid A course id. Passing 0 will return all distinct tags for all visible courses param: int $userid (optional) the user id, a default of 0 will return all users tags for the course param: string $tagtype (optional) The type of tag, empty string returns all types. Currently (Moodle 2.2) there are two param: int $numtags (optional) number of tags to display, default of 80 is set in the block, 0 returns all param: string $unused (optional) was selected sorting, moved to tag_print_cloud() return: array |
coursetag_get_all_tags($unused='', $numtags=0) X-Ref |
Returns an ordered array of tags (replaces popular_tags_count() allowing sorting). param: string $unused (optional) was selected sorting - moved to tag_print_cloud() param: int $numtags (optional) number of tags to display, default of 20 is set in the block, 0 returns all return: array |
coursetag_get_jscript() X-Ref |
Returns javascript for use in tags block and supporting pages return: null |
coursetag_get_jscript_links($elementid, $coursetagslinks) X-Ref |
Returns javascript to create the links in the tag block footer. param: string $elementid the element to attach the footer to param: array $coursetagslinks links arrays each consisting of 'title', 'onclick' and 'text' elements return: string always returns a blank string |
coursetag_get_records($courseid, $userid) X-Ref |
Returns all tags created by a user for a course param: int $courseid tags are returned for the course that has this courseid param: int $userid return tags which were created by this user |
coursetag_store_keywords($tags, $courseid, $userid=0, $tagtype='official', $myurl='') X-Ref |
Stores a tag for a course for a user param: array $tags simple array of keywords to be stored param: int $courseid the id of the course we wish to store a tag for param: int $userid the id of the user we wish to store a tag for param: string $tagtype official or default only param: string $myurl (optional) for logging creation of course tags |
coursetag_delete_keyword($tagid, $userid, $courseid) X-Ref |
Deletes a personal tag for a user for a course. param: int $tagid the tag we wish to delete param: int $userid the user that the tag is associated with param: int $courseid the course that the tag is associated with |
coursetag_get_tagged_courses($tagid) X-Ref |
Get courses tagged with a tag param: int $tagid return: array of course objects |
coursetag_delete_course_tags($courseid, $showfeedback=false) X-Ref |
Course tagging function used only during the deletion of a course (called by lib/moodlelib.php) to clean up associated tags param: int $courseid the course we wish to delete tag instances from param: bool $showfeedback if we should output a notification of the delete to the end user |
tag_type_set($tagid, $type) X-Ref |
Set the type of a tag. At this time (version 2.2) the possible values are 'default' or 'official'. Official tags will be displayed separately "at tagging time" (while selecting the tags to apply to a record). param: string $tagid tagid to modify param: string $type either 'default' or 'official' return: bool true on success, false otherwise |
tag_description_set($tagid, $description, $descriptionformat) X-Ref |
Set the description of a tag param: int $tagid the id of the tag param: string $description the tag's description string to be set param: int $descriptionformat the moodle text format of the description return: bool true on success, false otherwise |
tag_get_tags($record_type, $record_id, $type=null, $userid=0) X-Ref |
Get the array of db record of tags associated to a record (instances). param: string $record_type the record type for which we want to get the tags param: int $record_id the record id for which we want to get the tags param: string $type the tag type (either 'default' or 'official'). By default, all tags are returned. param: int $userid (optional) only required for course tagging return: array the array of tags |
tag_get_tags_array($record_type, $record_id, $type=null) X-Ref |
Get the array of tags display names, indexed by id. param: string $record_type the record type for which we want to get the tags param: int $record_id the record id for which we want to get the tags param: string $type the tag type (either 'default' or 'official'). By default, all tags are returned. return: array the array of tags (with the value returned by core_tag_tag::make_display_name), indexed by id |
tag_get_tags_csv($record_type, $record_id, $html=null, $type=null) X-Ref |
Get a comma-separated string of tags associated to a record. Use {@link tag_get_tags()} to get the same information in an array. param: string $record_type the record type for which we want to get the tags param: int $record_id the record id for which we want to get the tags param: int $html either TAG_RETURN_HTML or TAG_RETURN_TEXT, depending on the type of output desired param: string $type either 'official' or 'default', if null, all tags are returned return: string the comma-separated list of tags. |
tag_get_tags_ids($record_type, $record_id) X-Ref |
Get an array of tag ids associated to a record. param: string $record_type the record type for which we want to get the tags param: int $record_id the record id for which we want to get the tags return: array tag ids, indexed and sorted by 'ordering' |
tag_get_id($tags, $return_value = null) X-Ref |
Returns the database ID of a set of tags. param: mixed $tags one tag, or array of tags, to look for. param: bool $return_value specify the type of the returned value. Either TAG_RETURN_OBJECT, or TAG_RETURN_ARRAY (default). return: mixed tag-indexed array of ids (or objects, if second parameter is TAG_RETURN_OBJECT), or only an int, if only one tag |
tag_rename($tagid, $newrawname) X-Ref |
Change the "value" of a tag, and update the associated 'name'. param: int $tagid the id of the tag to modify param: string $newrawname the new rawname return: bool true on success, false otherwise |
tag_delete_instance($record_type, $record_id, $tagid, $userid = null) X-Ref |
Delete one instance of a tag. If the last instance was deleted, it will also delete the tag, unless its type is 'official'. param: string $record_type the type of the record for which to remove the instance param: int $record_id the id of the record for which to remove the instance param: int $tagid the tagid that needs to be removed param: int $userid (optional) the userid return: bool true on success, false otherwise |
tag_find_records($tag, $type, $limitfrom='', $limitnum='') X-Ref |
Find all records tagged with a tag of a given type ('post', 'user', etc.) param: string $tag tag to look for param: string $type type to restrict search to. If null, every matching record will be returned param: int $limitfrom (optional, required if $limitnum is set) return a subset of records, starting at this point. param: int $limitnum (optional, required if $limitfrom is set) return a subset comprising this many records. return: array of matching objects, indexed by record id, from the table containing the type requested |
tag_add($tags, $type="default") X-Ref |
Adds one or more tag in the database. This function should not be called directly : you should use tag_set. param: mixed $tags one tag, or an array of tags, to be created param: string $type type of tag to be created ("default" is the default value and "official" is the only other supported return: array $tags ids indexed by their lowercase normalized names. Any boolean false in the array indicates an error while |
tag_assign($record_type, $record_id, $tagid, $ordering, $userid = 0, $component = null, $contextid = null) X-Ref |
Assigns a tag to a record; if the record already exists, the time and ordering will be updated. param: string $record_type the type of the record that will be tagged param: int $record_id the id of the record that will be tagged param: string $tagid the tag id to set on the record. param: int $ordering the order of the instance for this record param: int $userid (optional) only required for course tagging param: string|null $component the component that was tagged param: int|null $contextid the context id of where this tag was assigned return: bool true on success, false otherwise |
tag_record_count($record_type, $tagid) X-Ref |
Count how many records are tagged with a specific tag. param: string $record_type record to look for ('post', 'user', etc.) param: int $tagid is a single tag id return: int number of mathing tags. |
tag_record_tagged_with($record_type, $record_id, $tag) X-Ref |
Determine if a record is tagged with a specific tag param: string $record_type the record type to look for param: int $record_id the record id to look for param: string $tag a tag name return: bool/int true if it is tagged, 0 (false) otherwise |
tag_set_flag($tagids) X-Ref |
Flag a tag as inappropriate. param: int|array $tagids a single tagid, or an array of tagids |
tag_unset_flag($tagids) X-Ref |
Remove the inappropriate flag on a tag. param: int|array $tagids a single tagid, or an array of tagids |
tag_print_cloud($tagset=null, $nr_of_tags=150, $return=false, $sort='') X-Ref |
Prints or returns a HTML tag cloud with varying classes styles depending on the popularity and type of each tag. param: array $tagset Array of tags to display param: int $nr_of_tags Limit for the number of tags to return/display, used if $tagset is null param: bool $return if true the function will return the generated tag cloud instead of displaying it. param: string $sort (optional) selected sorting, default is alpha sort (name) also timemodified or popularity return: string|null a HTML string or null if this function does the output |
tag_autocomplete($text) X-Ref |
Function that returns tags that start with some text, for use by the autocomplete feature param: string $text string that the tag names will be matched against return: mixed an array of objects, or false if no records were found or an error occured. |
tag_print_description_box($tag_object, $return=false) X-Ref |
Prints a box with the description of a tag and its related tags param: stdClass $tag_object param: bool $return if true the function will return the generated tag cloud instead of displaying it. return: string/null a HTML box showing a description of the tag object and it's relationsips or null if output is done directly |
tag_print_management_box($tag_object, $return=false) X-Ref |
Prints a box that contains the management links of a tag param: core_tag_tag|stdClass $tag_object param: bool $return if true the function will return the generated tag cloud instead of displaying it. return: string|null a HTML string or null if this function does the output |
tag_print_search_box($return=false) X-Ref |
Prints the tag search box param: bool $return if true return html string return: string|null a HTML string or null if this function does the output |
tag_print_search_results($query, $page, $perpage, $return=false) X-Ref |
Prints the tag search results param: string $query text that tag names will be matched against param: int $page current page param: int $perpage nr of users displayed per page param: bool $return if true return html string return: string|null a HTML string or null if this function does the output |
tag_print_tagged_users_table($tagobject, $limitfrom='', $limitnum='', $return=false) X-Ref |
Prints a table of the users tagged with the tag passed as argument param: stdClass $tagobject the tag we wish to return data for param: int $limitfrom (optional, required if $limitnum is set) prints users starting at this point. param: int $limitnum (optional, required if $limitfrom is set) prints this many users. param: bool $return if true return html string return: string|null a HTML string or null if this function does the output |
tag_print_user_box($user, $return=false) X-Ref |
Prints an individual user box param: user_object $user (contains the following fields: id, firstname, lastname and picture) param: bool $return if true return html string return: string|null a HTML string or null if this function does the output |
tag_print_user_list($userlist, $return=false) X-Ref |
Prints a list of users param: array $userlist an array of user objects param: bool $return if true return html string, otherwise output the result return: string|null a HTML string or null if this function does the output |
tag_display_name($tagobject, $html=TAG_RETURN_HTML) X-Ref |
Function that returns the name that should be displayed for a specific tag param: stdClass|core_tag_tag $tagobject a line out of tag table, as returned by the adobd functions param: int $html TAG_RETURN_HTML (default) will return htmlspecialchars encoded string, TAG_RETURN_TEXT will not encode. return: string |
tag_normalize($rawtags, $case = TAG_CASE_LOWER) X-Ref |
Function that normalizes a list of tag names. param: array/string $rawtags array of tags, or a single tag. param: int $case case to use for returned value (default: lower case). Either TAG_CASE_LOWER (default) or TAG_CASE_ORIGINAL return: array lowercased normalized tags, indexed by the normalized tag, in the same order as the original array. |
tag_get_related_tags_csv($related_tags, $html=TAG_RETURN_HTML) X-Ref |
Get a comma-separated list of tags related to another tag. param: array $related_tags the array returned by tag_get_related_tags param: int $html either TAG_RETURN_HTML (default) or TAG_RETURN_TEXT : return html links, or just text. return: string comma-separated list |
tag_set($itemtype, $itemid, $tags, $component = null, $contextid = null) X-Ref |
Set the tags assigned to a record. This overwrites the current tags. This function is meant to be fed the string coming up from the user interface, which contains all tags assigned to a record. Due to API change $component and $contextid are now required. Instead of calling this function you can use {@link core_tag_tag::set_item_tags()} or {@link core_tag_tag::set_related_tags()} param: string $itemtype the type of record to tag ('post' for blogs, 'user' for users, 'tag' for tags, etc.) param: int $itemid the id of the record to tag param: array $tags the array of tags to set on the record. If given an empty array, all tags will be removed. param: string|null $component the component that was tagged param: int|null $contextid the context id of where this tag was assigned return: bool|null |
tag_set_add($itemtype, $itemid, $tag, $component = null, $contextid = null) X-Ref |
Adds a tag to a record, without overwriting the current tags. This function remains here for backward compatiblity. It is recommended to use {@link core_tag_tag::add_item_tag()} or {@link core_tag_tag::add_related_tags()} instead param: string $itemtype the type of record to tag ('post' for blogs, 'user' for users, etc.) param: int $itemid the id of the record to tag param: string $tag the tag to add param: string|null $component the component that was tagged param: int|null $contextid the context id of where this tag was assigned return: bool|null |
tag_set_delete($itemtype, $itemid, $tag, $component = null, $contextid = null) X-Ref |
Removes a tag from a record, without overwriting other current tags. This function remains here for backward compatiblity. It is recommended to use {@link core_tag_tag::remove_item_tag()} instead param: string $itemtype the type of record to tag ('post' for blogs, 'user' for users, etc.) param: int $itemid the id of the record to tag param: string $tag the tag to delete param: string|null $component the component that was tagged param: int|null $contextid the context id of where this tag was assigned return: bool|null |
tag_get($field, $value, $returnfields='id, name, rawname, tagcollid') X-Ref |
Simple function to just return a single tag object when you know the name or something See also {@link core_tag_tag::get()} and {@link core_tag_tag::get_by_name()} param: string $field which field do we use to identify the tag: id, name or rawname param: string $value the required value of the aforementioned field param: string $returnfields which fields do we want returned. This is a comma seperated string containing any combination of return: mixed tag object |
tag_get_related_tags($tagid, $type=TAG_RELATED_ALL, $limitnum=10) X-Ref |
Returns tags related to a tag Related tags of a tag come from two sources: - manually added related tags, which are tag_instance entries for that tag - correlated tags, which are calculated param: string $tagid is a single **normalized** tag name or the id of a tag param: int $type the function will return either manually (TAG_RELATED_MANUAL) related tags or correlated param: int $limitnum (optional) return a subset comprising this many records, the default is 10 return: array an array of tag objects |
tag_delete($tagids) X-Ref |
Delete one or more tag, and all their instances if there are any left. param: mixed $tagids one tagid (int), or one array of tagids to delete return: bool true on success, false otherwise |
tag_delete_instances($component, $contextid = null) X-Ref |
Deletes all the tag instances given a component and an optional contextid. param: string $component param: int $contextid if null, then we delete all tag instances for the $component |
tag_cleanup() X-Ref |
Clean up the tag tables, making sure all tagged object still exists. This should normally not be necessary, but in case related tags are not deleted when the tagged record is removed, this should be done once in a while, perhaps on an occasional cron run. On a site with lots of tags, this could become an expensive function to call: don't run at peak time. |
tag_bulk_delete_instances($instances) X-Ref |
This function will delete numerous tag instances efficiently. This removes tag instances only. It doesn't check to see if it is the last use of a tag. param: array $instances An array of tag instance objects with the addition of the tagname and tagrawname |
tag_compute_correlations($mincorrelation = 2) X-Ref |
Calculates and stores the correlated tags of all tags. The correlations are stored in the 'tag_correlation' table. Two tags are correlated if they appear together a lot. Ex.: Users tagged with "computers" will probably also be tagged with "algorithms". The rationale for the 'tag_correlation' table is performance. It works as a cache for a potentially heavy load query done at the 'tag_instance' table. So, the 'tag_correlation' table stores redundant information derived from the 'tag_instance' table. param: int $mincorrelation Only tags with more than $mincorrelation correlations will be identified. |
tag_process_computed_correlation(stdClass $tagcorrelation) X-Ref |
This function processes a tag correlation and makes changes in the database as required. The tag correlation object needs have both a tagid property and a correlatedtags property that is an array. param: stdClass $tagcorrelation return: int/bool The id of the tag correlation that was just processed or false. |
tag_cron() X-Ref |
Tasks that should be performed at cron time |
tag_find_tags($text, $ordered=true, $limitfrom='', $limitnum='', $tagcollid = null) X-Ref |
Search for tags with names that match some text param: string $text escaped string that the tag names will be matched against param: bool $ordered If true, tags are ordered by their popularity. If false, no ordering. param: int/string $limitfrom (optional, required if $limitnum is set) return a subset of records, starting at this point. param: int/string $limitnum (optional, required if $limitfrom is set) return a subset comprising this many records. param: int $tagcollid return: array/boolean an array of objects, or false if no records were found or an error occured. |
tag_get_name($tagids) X-Ref |
Get the name of a tag param: mixed $tagids the id of the tag, or an array of ids return: mixed string name of one tag, or id-indexed array of strings |
tag_get_correlated($tagid, $notused = null) X-Ref |
Returns the correlated tags of a tag, retrieved from the tag_correlation table. Make sure cron runs, otherwise the table will be empty and this function won't return anything. Correlated tags are calculated in cron based on existing tag instances. param: int $tagid is a single tag id param: int $notused this argument is no longer used return: array an array of tag objects or an empty if no correlated tags are found |
tag_cloud_sort($a, $b) X-Ref |
This function is used by print_tag_cloud, to usort() the tags in the cloud. See php.net/usort for the parameters documentation. This was originally in blocks/blog_tags/block_blog_tags.php, named blog_tags_sort(). param: string $a Tag name to compare against $b param: string $b Tag name to compare against $a return: int The result of the comparison/validation 1, 0 or -1 |
events_load_def($component) X-Ref |
Loads the events definitions for the component (from file). If no events are defined for the component, we simply return an empty array. param: string $component examples: 'moodle', 'mod_forum', 'block_quiz_results' return: array Array of capabilities or empty array if not exists |
events_queue_handler($handler, $event, $errormessage) X-Ref |
Puts a handler on queue param: stdClass $handler event handler object from db param: stdClass $event event data object param: string $errormessage The error message indicating the problem return: int id number of new queue handler |
events_dispatch($handler, $eventdata, &$errormessage) X-Ref |
trigger a single event with a specified handler param: stdClass $handler This shoudl be a row from the events_handlers table. param: stdClass $eventdata An object containing information about the event param: string $errormessage error message indicating problem return: bool|null True means event processed, false means retry event later; may throw exception, NULL means internal error |
events_process_queued_handler($qhandler) X-Ref |
given a queued handler, call the respective event handler to process the event param: stdClass $qhandler events_queued_handler row from db return: boolean true means event processed, false means retry later, NULL means fatal failure |
events_update_definition($component='moodle') X-Ref |
Updates all of the event definitions within the database. Unfortunately this isn't as simple as removing them all and then readding the updated event definitions. Chances are queued items are referencing the existing definitions. Note that the absence of the db/events.php event definition file will cause any queued events for the component to be removed from the database. param: string $component examples: 'moodle', 'mod_forum', 'block_quiz_results' return: boolean always returns true |
events_cron($eventname='') X-Ref |
Events cron will try to empty the events queue by processing all the queued events handlers param: string $eventname empty means all return: int number of dispatched events |
events_trigger_legacy($eventname, $eventdata) X-Ref |
Do not call directly, this is intended to be used from new event base only. param: string $eventname name of the event param: mixed $eventdata event data object return: int number of failed events |
events_is_registered($eventname, $component) X-Ref |
checks if an event is registered for this component param: string $eventname name of the event param: string $component component name, can be mod/data or moodle return: bool |
events_pending_count($eventname) X-Ref |
checks if an event is queued for processing - either cron handlers attached or failed instant handlers param: string $eventname name of the event return: int number of queued events |
clam_message_admins($notice) X-Ref |
Emails admins about a clam outcome param: string $notice The body of the email to be sent. return: void |
get_clam_error_code($returncode) X-Ref |
Returns the string equivalent of a numeric clam error code param: int $returncode The numeric error code in question. return: string The definition of the error code |
course_get_cm_rename_action(cm_info $mod, $sr = null) X-Ref |
Returns the rename action. param: cm_info $mod The module to produce editing buttons for param: int $sr The section to link back to (used for creating the links) return: The markup for the rename action, or an empty string if not available. |
course_scale_used($courseid, $scaleid) X-Ref |
No description |
site_scale_used($scaleid, &$courses) X-Ref |
This function returns the number of activities using scaleid in the entire site param: int $scaleid param: array $courses return: int |
external_function_info($function, $strictness=MUST_EXIST) X-Ref |
Returns detailed function information param: string|object $function name of external function or record from external_function param: int $strictness IGNORE_MISSING means compatible mode, false returned if record not found, debug message if more found; return: stdClass description or false if not found or exception thrown |
get_records_csv($file, $table) X-Ref |
Retrieves an array of records from a CSV file and places them into a given table structure This function is deprecated. Please use csv_import_reader() instead. param: string $file The path to a CSV file param: string $table The table to retrieve columns from return: bool|array Returns an array of CSV records or false |
put_records_csv($file, $records, $table = NULL) X-Ref |
Create a file with CSV contents This function is deprecated. Please use download_as_dataformat() instead. param: string $file The file to put the CSV content into param: array $records An array of records to write to a CSV file param: string $table The table to get columns from return: bool success |
Generated: Thu Aug 11 10:00:09 2016 | Cross-referenced by PHPXref 0.7.1 |