Difference between revisions of "Libraries Organization"

Jump to: navigation, search
(New user/lib.php)
(New user/locallib.php)
Line 153: Line 153:
 
=== New user/locallib.php ===
 
=== New user/locallib.php ===
 
authenticate_user_login($username, $password)<br/>
 
authenticate_user_login($username, $password)<br/>
calculate_user_dst_table($from_year = NULL, $to_year = NULL, $strtimezone = NULL)<br/>
 
 
check_user_preferences_loaded($time = null)<br/>
 
check_user_preferences_loaded($time = null)<br/>
 
complete_user_login($user, $setcookie=true)<br/>
 
complete_user_login($user, $setcookie=true)<br/>
 
create_user_key($script, $userid, $instance=null, $iprestriction=null, $validuntil=null)<br/>
 
create_user_key($script, $userid, $instance=null, $iprestriction=null, $validuntil=null)<br/>
email_welcome_message_to_user($course, $user=NULL)<br/>
 
 
get_user_directories($only_non_empty=true, $legacy=false)<br/>
 
get_user_directories($only_non_empty=true, $legacy=false)<br/>
 
get_user_fieldnames()<br/>
 
get_user_fieldnames()<br/>
get_user_timezone($tz = 99)<br/>
 
get_user_timezone_offset($tz = 99)<br/>
 
 
get_users_from_config($value, $capability)<br/>
 
get_users_from_config($value, $capability)<br/>
guest_user()<br/>
 
 
hash_internal_user_password($password)<br/>
 
hash_internal_user_password($password)<br/>
is_restored_user($username)<br/>
 
isguestuser($user=NULL)<br/>
 
isloggedin()<br/>
 
 
make_user_directory($userid, $test=false)<br/>
 
make_user_directory($userid, $test=false)<br/>
 
mark_user_preferences_changed($userid)<br/>
 
mark_user_preferences_changed($userid)<br/>
Line 175: Line 167:
 
user_not_fully_set_up($user)<br/>
 
user_not_fully_set_up($user)<br/>
 
user_preference_allow_ajax_update($name, $paramtype)<br/>
 
user_preference_allow_ajax_update($name, $paramtype)<br/>
 +
validate_internal_user_password(&$user, $password)<br/>
 +
 +
 +
=== New lib/timelib.php ===
 +
 
userdate($date, $format = '', $timezone = 99, $fixday = true)<br/>
 
userdate($date, $format = '', $timezone = 99, $fixday = true)<br/>
 
usergetdate($time, $timezone=99)<br/>
 
usergetdate($time, $timezone=99)<br/>
Line 180: Line 177:
 
usertime($date, $timezone=99)<br/>
 
usertime($date, $timezone=99)<br/>
 
usertimezone($timezone=99)<br/>
 
usertimezone($timezone=99)<br/>
validate_internal_user_password(&$user, $password)<br/>
+
calculate_user_dst_table($from_year = NULL, $to_year = NULL, $strtimezone = NULL)<br/>
 +
get_user_timezone($tz = 99)<br/>
 +
get_user_timezone_offset($tz = 99)<br/>

Revision as of 03:54, 2 February 2010

Moodle 2.0


This document has for goal to defined a libraries structure to avoid to end up with a mess of functions everywhere into Moodle.

We suggest that we split library functions into two files, one lib.php that contains all library functions that can be called by external applications and one locallib.php that contains all functions that are internal to Moodle core.

Groups

currently in group/lib.php

groups_add_member($grouporid, $userorid)
groups_remove_member($grouporid, $userorid)
groups_create_group($data, $editform=false, $editoroptions=null)
groups_create_grouping($data, $editoroptions=null)
groups_update_group($data, $editform=false)
groups_update_grouping($data, $editoroptions=null)
groups_delete_group($grouporid)
groups_delete_grouping($groupingorid)
groups_delete_group_members($courseid, $userid=0, $showfeedback=false)
groups_delete_groupings_groups($courseid, $showfeedback=false)
groups_delete_groups($courseid, $showfeedback=false)
groups_delete_groupings($courseid, $showfeedback=false)
groups_get_possible_roles($context)
groups_get_potential_members($courseid, $roleid = null, $orderby = 'lastname,firstname')
groups_parse_name($format, $groupnumber)
groups_assign_grouping($groupingid, $groupid)
groups_unassign_grouping($groupingid, $groupid)
groups_get_members_by_role($groupid, $courseid, $fields='u.*', $sort='u.lastname ASC', $extrawheretest=, $whereparams=array())
groups_calculate_role_people($rs, $context)

currently in lib/grouplib.php

groups_group_exists($groupid)
groups_get_group_name($groupid)
groups_get_grouping_name($groupingid)
groups_get_group_by_name($courseid, $name)
groups_get_grouping_by_name($courseid, $name)
groups_get_group($groupid, $fields='*', $strictness=IGNORE_MISSING)
groups_get_grouping($groupingid, $fields='*', $strictness=IGNORE_MISSING)
groups_get_all_groups($courseid, $userid=0, $groupingid=0, $fields='g.*')
groups_get_user_groups($courseid, $userid=0)
groups_get_all_groupings($courseid)
groups_is_member($groupid, $userid=null)
groups_has_membership($cm, $userid=null)
groups_get_members($groupid, $fields='u.*', $sort='lastname ASC')
groups_get_grouping_members($groupingid, $fields='u.*', $sort='lastname ASC')
groups_get_course_groupmode($course)
groups_get_activity_groupmode($cm, $course=null)
groups_print_course_menu($course, $urlroot, $return=false)
groups_print_activity_menu($cm, $urlroot, $return=false, $hideallparticipants=false)
groups_get_course_group($course, $update=false)
groups_get_activity_group($cm, $update=false)
groups_get_activity_allowed_groups($cm,$userid=0)
groups_course_module_visible($cm, $userid=null)

New group/lib.php

groups_add_member($grouporid, $userorid)
groups_remove_member($grouporid, $userorid)
groups_create_group($data, $editform=false, $editoroptions=null)
groups_create_grouping($data, $editoroptions=null)
groups_update_group($data, $editform=false)
groups_update_grouping($data, $editoroptions=null)
groups_delete_group($grouporid)
groups_delete_grouping($groupingorid)
groups_delete_group_members($courseid, $userid=0, $showfeedback=false)
groups_delete_groupings_groups($courseid, $showfeedback=false)
groups_delete_groups($courseid, $showfeedback=false)
groups_delete_groupings($courseid, $showfeedback=false)
groups_assign_grouping($groupingid, $groupid)
groups_unassign_grouping($groupingid, $groupid)
groups_get_members_by_role($groupid, $courseid, $fields='u.*', $sort='u.lastname ASC', $extrawheretest=, $whereparams=array())
groups_group_exists($groupid)
groups_get_group_name($groupid)
groups_get_grouping_name($groupingid)
groups_get_group_by_name($courseid, $name)
groups_get_grouping_by_name($courseid, $name)
groups_get_group($groupid, $fields='*', $strictness=IGNORE_MISSING)
groups_get_grouping($groupingid, $fields='*', $strictness=IGNORE_MISSING)
groups_get_all_groups($courseid, $userid=0, $groupingid=0, $fields='g.*')
groups_get_user_groups($courseid, $userid=0)
groups_get_all_groupings($courseid)
groups_is_member($groupid, $userid=null)
groups_has_membership($cm, $userid=null)
groups_get_members($groupid, $fields='u.*', $sort='lastname ASC')
groups_get_grouping_members($groupingid, $fields='u.*', $sort='lastname ASC')
groups_get_course_groupmode($course)
groups_get_activity_groupmode($cm, $course=null)
groups_get_course_group($course, $update=false)
groups_get_activity_group($cm, $update=false)
groups_get_activity_allowed_groups($cm,$userid=0)
groups_print_course_menu($course, $urlroot, $return=false)
groups_print_activity_menu($cm, $urlroot, $return=false, $hideallparticipants=false)
groups_course_module_visible($cm, $userid=null)

New group/locallib.php

groups_get_possible_roles($context)
groups_get_potential_members($courseid, $roleid = null, $orderby = 'lastname,firstname')
groups_parse_name($format, $groupnumber)
groups_calculate_role_people($rs, $context)

Users

Currently in lib/moodlelib.php

authenticate_user_login($username, $password)
calculate_user_dst_table($from_year = NULL, $to_year = NULL, $strtimezone = NULL)
check_user_preferences_loaded($time = null)
complete_user_login($user, $setcookie=true)
create_user_key($script, $userid, $instance=null, $iprestriction=null, $validuntil=null)
create_user_record($username, $password, $auth='manual')
delete_user($user)
get_complete_user_data($field, $value, $mnethostid=null)
get_user_directories($only_non_empty=true, $legacy=false)
get_user_fieldnames()
get_user_preferences($name=NULL, $default=NULL, $otheruserid=NULL)
get_user_timezone($tz = 99)
get_user_timezone_offset($tz = 99)
get_users_from_config($value, $capability)
guest_user()
hash_internal_user_password($password)
is_restored_user($username)
isguestuser($user=NULL)
isloggedin()
make_user_directory($userid, $test=false)
mark_user_preferences_changed($userid)
set_user_preference($name, $value, $otheruserid=NULL)
set_user_preferences($prefarray, $otheruserid=NULL)
truncate_userinfo($info)
unset_user_preference($name, $otheruserid=NULL)
update_internal_user_password(&$user, $password)
update_user_login_times()
update_user_record($username, $authplugin)
user_not_fully_set_up($user)
user_preference_allow_ajax_update($name, $paramtype)
userdate($date, $format = , $timezone = 99, $fixday = true)
usergetdate($time, $timezone=99)
usergetmidnight($date, $timezone=99)
usertime($date, $timezone=99)
usertimezone($timezone=99)
validate_internal_user_password(&$user, $password)

Move to lib/deprecatedlib.php

  • create_user_record($username, $password, $auth='manual')
  • update_user_record($username, $authplugin)
  • get_complete_user_data($field, $value, $mnethostid=null)

New user/lib.php

  • create_user($user)
  • delete_user($user)
  • update_user($user)
  • get_user($user)
  • get_user_preferences($name=NULL, $default=NULL, $otheruserid=NULL)
  • set_user_preference($name, $value, $otheruserid=NULL)
  • set_user_preferences($prefarray, $otheruserid=NULL)
  • unset_user_preference($name, $otheruserid=NULL)

New user/locallib.php

authenticate_user_login($username, $password)
check_user_preferences_loaded($time = null)
complete_user_login($user, $setcookie=true)
create_user_key($script, $userid, $instance=null, $iprestriction=null, $validuntil=null)
get_user_directories($only_non_empty=true, $legacy=false)
get_user_fieldnames()
get_users_from_config($value, $capability)
hash_internal_user_password($password)
make_user_directory($userid, $test=false)
mark_user_preferences_changed($userid)
truncate_userinfo($info)
update_internal_user_password(&$user, $password)
update_user_login_times()
user_not_fully_set_up($user)
user_preference_allow_ajax_update($name, $paramtype)
validate_internal_user_password(&$user, $password)


New lib/timelib.php

userdate($date, $format = , $timezone = 99, $fixday = true)
usergetdate($time, $timezone=99)
usergetmidnight($date, $timezone=99)
usertime($date, $timezone=99)
usertimezone($timezone=99)
calculate_user_dst_table($from_year = NULL, $to_year = NULL, $strtimezone = NULL)
get_user_timezone($tz = 99)
get_user_timezone_offset($tz = 99)