idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
31,000 | protected function convertToTerLocales ( array $ locales ) { $ terLocales = array ( ) ; foreach ( $ locales as $ locale ) { $ terLocales [ ] = isset ( $ this -> isoReverseMapping [ $ locale ] ) ? $ this -> isoReverseMapping [ $ locale ] : $ locale ; } return $ terLocales ; } | Converts an array of ISO locale codes into their TER equivalent . |
31,001 | public function process_workshopform_numerrors_map ( $ data ) { global $ DB ; $ data = ( object ) $ data ; $ data -> workshopid = $ this -> get_new_parentid ( 'workshop' ) ; $ DB -> insert_record ( 'workshopform_numerrors_map' , $ data ) ; } | Processes the workshopform_numerrors_map element |
31,002 | private function process_dimension_grades_structure ( $ elementname , $ data ) { global $ DB ; $ data = ( object ) $ data ; $ oldid = $ data -> id ; $ data -> assessmentid = $ this -> get_new_parentid ( $ elementname ) ; $ data -> strategy = 'numerrors' ; $ data -> dimensionid = $ this -> get_mappingid ( $ this -> get_... | Process the dimension grades linked with the given type of assessment |
31,003 | public static function decodeFilter ( $ filter , $ data ) { switch ( $ filter ) { case 'ASCIIHexDecode' : { return self :: decodeFilterASCIIHexDecode ( $ data ) ; break ; } case 'ASCII85Decode' : { return self :: decodeFilterASCII85Decode ( $ data ) ; break ; } case 'LZWDecode' : { return self :: decodeFilterLZWDecode ... | Decode data using the specified filter type . |
31,004 | public static function decodeFilterASCII85Decode ( $ data ) { $ decoded = '' ; $ data = preg_replace ( '/[\s]/' , '' , $ data ) ; if ( strpos ( $ data , '<~' ) !== false ) { $ data = substr ( $ data , 2 ) ; } $ eod = strpos ( $ data , '~>' ) ; if ( $ eod !== false ) { $ data = substr ( $ data , 0 , $ eod ) ; } $ data_l... | ASCII85Decode Decodes data encoded in an ASCII base - 85 representation reproducing the original binary data . |
31,005 | public function execute ( ) { global $ CFG ; require_once ( $ CFG -> dirroot . '/course/lib.php' ) ; if ( $ this -> get_custom_data ( ) -> userid !== $ this -> get_custom_data ( ) -> realuserid ) { $ realuser = \ core_user :: get_user ( $ this -> get_custom_data ( ) -> realuserid , '*' , MUST_EXIST ) ; cron_setup_user ... | Run the deletion task . |
31,006 | public function to_html ( $ indent = 0 , $ extraargs = array ( ) ) { if ( count ( $ this -> items ) ) { $ tabs = str_repeat ( "\t" , $ indent ) ; $ first = true ; $ itemiter = 1 ; $ lastitem = '' ; $ html = '' ; foreach ( $ this -> items as $ item ) { $ last = ( count ( $ this -> items ) == $ itemiter ) ; if ( $ this -... | Returns html string . |
31,007 | public function find_item ( $ id , $ suppresserror = false ) { if ( isset ( $ this -> items ) ) { foreach ( $ this -> items as $ key => $ child ) { if ( $ child -> id == $ id ) { return $ this -> items [ $ key ] ; } } foreach ( array_keys ( $ this -> items ) as $ key ) { $ thischild = $ this -> items [ $ key ] ; $ ref ... | Recurse down the tree and find an item by it s id . |
31,008 | public function list_from_records ( $ paged = false , $ offset = 0 ) { $ this -> paged = $ paged ; $ this -> offset = $ offset ; $ this -> get_records ( ) ; $ records = $ this -> records ; $ page = $ this -> page ; if ( ! empty ( $ page ) ) { $ this -> firstitem = ( $ page - 1 ) * $ this -> itemsperpage ; $ this -> las... | Produces a hierarchical tree of list items from a flat array of records . parent field is expected to point to a parent record . records are already sorted . If the parent field doesn t point to another record in the array then this is a top level list |
31,009 | public function display_page_numbers ( ) { $ html = '' ; $ topcount = count ( $ this -> items ) ; $ this -> pagecount = ( integer ) ceil ( ( $ topcount + $ this -> offset ) / QUESTION_PAGE_LENGTH ) ; if ( ! empty ( $ this -> page ) && ( $ this -> paged ) ) { $ html = "<div class=\"paging\">" . get_string ( 'page' ) . "... | display list of page numbers for navigation |
31,010 | public function get_items_peers ( $ itemid ) { $ itemref = $ this -> find_item ( $ itemid ) ; $ peerids = $ itemref -> parentlist -> get_child_ids ( ) ; return $ peerids ; } | Returns an array of ids of peers of an item . |
31,011 | public function get_child_ids ( ) { $ childids = array ( ) ; foreach ( $ this -> items as $ child ) { $ childids [ ] = $ child -> id ; } return $ childids ; } | Returns an array of ids of child items . |
31,012 | public function move_item_up_down ( $ direction , $ id ) { $ peers = $ this -> get_items_peers ( $ id ) ; $ itemkey = array_search ( $ id , $ peers ) ; switch ( $ direction ) { case 'down' : if ( isset ( $ peers [ $ itemkey + 1 ] ) ) { $ olditem = $ peers [ $ itemkey + 1 ] ; $ peers [ $ itemkey + 1 ] = $ id ; $ peers [... | Move a record up or down |
31,013 | public function move_item_left ( $ id ) { global $ DB ; $ item = $ this -> find_item ( $ id ) ; if ( ! isset ( $ item -> parentlist -> parentitem -> parentlist ) ) { print_error ( 'listcantmoveleft' ) ; } else { $ newpeers = $ this -> get_items_peers ( $ item -> parentlist -> parentitem -> id ) ; if ( isset ( $ item ->... | Moves the item one step up in the tree . |
31,014 | public function item_html ( $ extraargs = array ( ) ) { if ( is_string ( $ this -> item ) ) { $ html = $ this -> item ; } elseif ( is_object ( $ this -> item ) ) { $ html = join ( ', ' , ( array ) $ this -> item ) ; } return $ html ; } | Output the html just for this item . Called by to_html which adds html for children . |
31,015 | public static function group_member_removed ( $ event ) { if ( ! empty ( self :: $ resetinprogress ) ) { return ; } quiz_update_open_attempts ( array ( 'userid' => $ event -> relateduserid , 'groupid' => $ event -> objectid ) ) ; } | A group member was deleted . |
31,016 | public final function remap_icon_name ( $ iconname , $ component ) { if ( $ this -> map === null ) { $ this -> map = $ this -> get_icon_name_map ( ) ; } if ( $ component == null || $ component == 'moodle' ) { $ component = 'core' ; } else if ( $ component != 'theme' ) { $ component = \ core_component :: normalize_compo... | Overridable function to map the icon name to something else . Default is to do no mapping . Map is cached in the singleton . |
31,017 | public static function getStream ( $ data ) { if ( ! self :: $ _id ) { stream_wrapper_register ( self :: WRAPPER_NAME , __CLASS__ ) ; } return fopen ( self :: WRAPPER_NAME . '://' . ++ self :: $ _id , 'wb' , false , stream_context_create ( array ( self :: WRAPPER_NAME => array ( 'data' => $ data ) ) ) ) ; } | Create a stream from multiple data sources . |
31,018 | protected function _parseChallenge ( $ challenge ) { $ tokens = array ( 'maxbuf' => 65536 , 'realm' => '' ) ; preg_match_all ( '/([a-z-]+)=("[^"]+(?<!\\\)"|[^,]+)/i' , $ challenge , $ matches , PREG_SET_ORDER ) ; foreach ( $ matches as $ val ) { $ tokens [ $ val [ 1 ] ] = trim ( $ val [ 2 ] , '"' ) ; } if ( ! isset ( $... | Parses and verifies the digest challenge . |
31,019 | protected static function delete_user_data ( $ userid ) { global $ DB ; $ DB -> delete_records ( 'badge_manual_award' , [ 'recipientid' => $ userid ] ) ; $ DB -> delete_records ( 'badge_criteria_met' , [ 'userid' => $ userid ] ) ; $ DB -> delete_records ( 'badge_issued' , [ 'userid' => $ userid ] ) ; $ backpackids = $ ... | Delete all the data for a user . |
31,020 | protected function add_purpose_category ( $ contextlevel = false ) { $ mform = $ this -> _form ; $ addcategorytext = $ this -> get_add_element_content ( get_string ( 'addcategory' , 'tool_dataprivacy' ) ) ; $ categoryselect = $ mform -> createElement ( 'select' , 'categoryid' , null , $ this -> _customdata [ 'categorie... | Adds purpose and category selectors . |
31,021 | private function get_add_element_content ( $ label ) { global $ PAGE , $ OUTPUT ; $ bs4 = false ; $ theme = $ PAGE -> theme ; if ( $ theme -> name === 'boost' ) { $ bs4 = true ; } else { foreach ( $ theme -> parents as $ basetheme ) { if ( $ basetheme === 'boost' ) { $ bs4 = true ; } } } if ( ! $ bs4 ) { return $ label... | Returns the add label . |
31,022 | public static function get_context_instance_customdata ( \ context $ context ) { $ persistent = \ tool_dataprivacy \ context_instance :: get_record_by_contextid ( $ context -> id , false ) ; if ( ! $ persistent ) { $ persistent = new \ tool_dataprivacy \ context_instance ( ) ; $ persistent -> set ( 'contextid' , $ cont... | Returns the customdata array for the provided context instance . |
31,023 | protected static function get_retention_display_text ( purpose $ effectivepurpose , $ retentioncontextlevel , \ context $ context ) { global $ PAGE ; $ renderer = $ PAGE -> get_renderer ( 'tool_dataprivacy' ) ; $ exporter = new \ tool_dataprivacy \ external \ purpose_exporter ( $ effectivepurpose , [ 'context' => $ con... | Returns the purpose display text . |
31,024 | public function supports_ajax ( ) { $ ajaxsupport = parent :: supports_ajax ( ) ; $ featurefunction = 'callback_' . $ this -> format . '_ajax_support' ; if ( function_exists ( $ featurefunction ) ) { $ formatsupport = $ featurefunction ( ) ; if ( isset ( $ formatsupport -> capable ) ) { $ ajaxsupport -> capable = $ for... | Returns the information about the ajax support in the given source format |
31,025 | public static function send_messages_to_conversation ( int $ conversationid , array $ messages = [ ] ) { global $ CFG , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ context = context_system :: instance ( ) ; self :: validate_context ( $ context ) ; $ params ... | Send messages from the current USER to a conversation . |
31,026 | public static function create_contacts ( $ userids , $ userid = 0 ) { global $ CFG , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } if ( empty ( $ userid ) ) { $ userid = $ USER -> id ; } $ context = context_system :: instance ( ) ; self :: validate_context ( $ ... | Create contacts . |
31,027 | public static function delete_contacts ( $ userids , $ userid = 0 ) { global $ CFG , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } if ( empty ( $ userid ) ) { $ userid = $ USER -> id ; } $ context = context_system :: instance ( ) ; self :: validate_context ( $ ... | Delete contacts . |
31,028 | public static function mute_conversations ( int $ userid , array $ conversationids ) { global $ CFG , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ context = context_system :: instance ( ) ; self :: validate_context ( $ context ) ; $ params = [ 'userid' => $ ... | Mutes conversations . |
31,029 | public static function unmute_conversations ( int $ userid , array $ conversationids ) { global $ CFG , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ context = context_system :: instance ( ) ; self :: validate_context ( $ context ) ; $ params = [ 'userid' => ... | Unmute conversations . |
31,030 | public static function block_contacts ( $ userids , $ userid = 0 ) { global $ CFG , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } if ( empty ( $ userid ) ) { $ userid = $ USER -> id ; } $ context = context_system :: instance ( ) ; self :: validate_context ( $ c... | Block contacts . |
31,031 | public static function unblock_contacts ( $ userids , $ userid = 0 ) { global $ CFG , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } if ( empty ( $ userid ) ) { $ userid = $ USER -> id ; } $ context = context_system :: instance ( ) ; self :: validate_context ( $... | Unblock contacts . |
31,032 | public static function get_contact_requests_parameters ( ) { return new external_function_parameters ( [ 'userid' => new external_value ( PARAM_INT , 'The id of the user we want the requests for' ) , 'limitfrom' => new external_value ( PARAM_INT , 'Limit from' , VALUE_DEFAULT , 0 ) , 'limitnum' => new external_value ( ... | Returns contact requests parameters description . |
31,033 | public static function get_conversation_members_parameters ( ) { return new external_function_parameters ( [ 'userid' => new external_value ( PARAM_INT , 'The id of the user we are performing this action on behalf of' ) , 'conversationid' => new external_value ( PARAM_INT , 'The id of the conversation' ) , 'includecont... | Returns get conversation members parameters description . |
31,034 | public static function create_contact_request ( int $ userid , int $ requesteduserid ) { global $ CFG , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ context = context_system :: instance ( ) ; self :: validate_context ( $ context ) ; $ params = [ 'userid' => ... | Creates a contact request . |
31,035 | public static function create_contact_request_returns ( ) { return new external_single_structure ( array ( 'request' => new external_single_structure ( array ( 'id' => new external_value ( PARAM_INT , 'Message id' ) , 'userid' => new external_value ( PARAM_INT , 'User from id' ) , 'requesteduserid' => new external_valu... | Creates a contact request return description . |
31,036 | private static function get_messagearea_contact_structure ( ) { return new external_single_structure ( array ( 'userid' => new external_value ( PARAM_INT , 'The user\'s id' ) , 'fullname' => new external_value ( PARAM_NOTAGS , 'The user\'s name' ) , 'profileimageurl' => new external_value ( PARAM_URL , 'User picture UR... | Return the structure of a message area contact . |
31,037 | private static function get_conversation_structure ( ) { return new external_single_structure ( array ( 'id' => new external_value ( PARAM_INT , 'The conversation id' ) , 'name' => new external_value ( PARAM_TEXT , 'The conversation name, if set' , VALUE_DEFAULT , null ) , 'subname' => new external_value ( PARAM_TEXT ,... | Return the structure of a conversation . |
31,038 | private static function get_conversation_member_structure ( ) { $ result = [ 'id' => new external_value ( PARAM_INT , 'The user id' ) , 'fullname' => new external_value ( PARAM_NOTAGS , 'The user\'s name' ) , 'profileurl' => new external_value ( PARAM_URL , 'The link to the user\'s profile page' ) , 'profileimageurl' =... | Return the structure of a conversation member . |
31,039 | public static function data_for_messagearea_search_users_in_course_parameters ( ) { return new external_function_parameters ( array ( 'userid' => new external_value ( PARAM_INT , 'The id of the user who is performing the search' ) , 'courseid' => new external_value ( PARAM_INT , 'The id of the course' ) , 'search' => n... | Get messagearea search users in course parameters . |
31,040 | public static function data_for_messagearea_search_users_in_course ( $ userid , $ courseid , $ search , $ limitfrom = 0 , $ limitnum = 0 ) { global $ CFG , $ PAGE , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ systemcontext = context_system :: instance ( ) ;... | Get messagearea search users in course results . |
31,041 | public static function data_for_messagearea_search_users ( $ userid , $ search , $ limitnum = 0 ) { global $ CFG , $ PAGE , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ systemcontext = context_system :: instance ( ) ; $ params = array ( 'userid' => $ userid ... | Get messagearea search users results . |
31,042 | public static function data_for_messagearea_search_users_returns ( ) { return new external_single_structure ( array ( 'contacts' => new external_multiple_structure ( self :: get_messagearea_contact_structure ( ) ) , 'courses' => new external_multiple_structure ( new external_single_structure ( array ( 'id' => new exter... | Get messagearea search users returns . |
31,043 | public static function message_search_users_parameters ( ) { return new external_function_parameters ( array ( 'userid' => new external_value ( PARAM_INT , 'The id of the user who is performing the search' ) , 'search' => new external_value ( PARAM_RAW , 'The string being searched' ) , 'limitfrom' => new external_value... | Get messagearea message search users parameters . |
31,044 | public static function message_search_users ( $ userid , $ search , $ limitfrom = 0 , $ limitnum = 0 ) { global $ USER ; $ systemcontext = context_system :: instance ( ) ; $ params = array ( 'userid' => $ userid , 'search' => $ search , 'limitfrom' => $ limitfrom , 'limitnum' => $ limitnum ) ; $ params = self :: valida... | Get search users results . |
31,045 | public static function data_for_messagearea_search_messages_parameters ( ) { return new external_function_parameters ( array ( 'userid' => new external_value ( PARAM_INT , 'The id of the user who is performing the search' ) , 'search' => new external_value ( PARAM_RAW , 'The string being searched' ) , 'limitfrom' => ne... | Get messagearea search messages parameters . |
31,046 | public static function data_for_messagearea_search_messages ( $ userid , $ search , $ limitfrom = 0 , $ limitnum = 0 ) { global $ CFG , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ systemcontext = context_system :: instance ( ) ; $ params = array ( 'userid' ... | Get messagearea search messages results . |
31,047 | public static function get_conversations_parameters ( ) { return new external_function_parameters ( array ( 'userid' => new external_value ( PARAM_INT , 'The id of the user who we are viewing conversations for' ) , 'limitfrom' => new external_value ( PARAM_INT , 'The offset to start at' , VALUE_DEFAULT , 0 ) , 'limitnu... | Get conversations parameters . |
31,048 | public static function get_conversations ( $ userid , $ limitfrom = 0 , $ limitnum = 0 , int $ type = null , bool $ favourites = null , bool $ mergeself = false ) { global $ CFG , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ params = array ( 'userid' => $ us... | Get the list of conversations for the user . |
31,049 | public static function get_conversation_between_users ( int $ userid , int $ otheruserid , bool $ includecontactrequests = false , bool $ includeprivacyinfo = false , int $ memberlimit = 0 , int $ memberoffset = 0 , int $ messagelimit = 0 , int $ messageoffset = 0 , bool $ newestmessagesfirst = true ) { global $ CFG , ... | Get a single conversation between users . |
31,050 | public static function get_self_conversation_parameters ( ) { return new external_function_parameters ( array ( 'userid' => new external_value ( PARAM_INT , 'The id of the user who we are viewing self-conversations for' ) , 'messagelimit' => new external_value ( PARAM_INT , 'Limit for number of messages' , VALUE_DEFAUL... | Get self - conversation parameters . |
31,051 | public static function get_self_conversation ( int $ userid , int $ messagelimit = 0 , int $ messageoffset = 0 , bool $ newestmessagesfirst = true ) { global $ CFG ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ params = [ 'userid' => $ userid , 'messagelimit' => $ me... | Get a single self - conversation . |
31,052 | public static function data_for_messagearea_conversations_parameters ( ) { return new external_function_parameters ( array ( 'userid' => new external_value ( PARAM_INT , 'The id of the user who we are viewing conversations for' ) , 'limitfrom' => new external_value ( PARAM_INT , 'Limit from' , VALUE_DEFAULT , 0 ) , 'li... | The messagearea conversations parameters . |
31,053 | public static function data_for_messagearea_conversations ( $ userid , $ limitfrom = 0 , $ limitnum = 0 ) { global $ CFG , $ PAGE , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ systemcontext = context_system :: instance ( ) ; $ params = array ( 'userid' => $... | Get messagearea conversations . |
31,054 | public static function data_for_messagearea_contacts ( $ userid , $ limitfrom = 0 , $ limitnum = 0 ) { global $ CFG , $ PAGE , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ systemcontext = context_system :: instance ( ) ; $ params = array ( 'userid' => $ user... | Get messagearea contacts parameters . |
31,055 | public static function data_for_messagearea_messages_parameters ( ) { return new external_function_parameters ( array ( 'currentuserid' => new external_value ( PARAM_INT , 'The current user\'s id' ) , 'otheruserid' => new external_value ( PARAM_INT , 'The other user\'s id' ) , 'limitfrom' => new external_value ( PARAM_... | The messagearea messages parameters . |
31,056 | public static function data_for_messagearea_messages ( $ currentuserid , $ otheruserid , $ limitfrom = 0 , $ limitnum = 0 , $ newest = false , $ timefrom = 0 ) { global $ CFG , $ PAGE , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ systemcontext = context_sys... | Get messagearea messages . |
31,057 | public static function get_conversation_messages_parameters ( ) { return new external_function_parameters ( array ( 'currentuserid' => new external_value ( PARAM_INT , 'The current user\'s id' ) , 'convid' => new external_value ( PARAM_INT , 'The conversation id' ) , 'limitfrom' => new external_value ( PARAM_INT , 'Lim... | The conversation messages parameters . |
31,058 | public static function get_conversation_messages ( int $ currentuserid , int $ convid , int $ limitfrom = 0 , int $ limitnum = 0 , bool $ newest = false , int $ timefrom = 0 ) { global $ CFG , $ PAGE , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ systemconte... | Get conversation messages . |
31,059 | public static function get_user_contacts_parameters ( ) { return new external_function_parameters ( array ( 'userid' => new external_value ( PARAM_INT , 'The id of the user who we retrieving the contacts for' ) , 'limitfrom' => new external_value ( PARAM_INT , 'Limit from' , VALUE_DEFAULT , 0 ) , 'limitnum' => new exte... | The user contacts return parameters . |
31,060 | public static function get_user_contacts ( int $ userid , int $ limitfrom = 0 , int $ limitnum = 0 ) { global $ CFG , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ systemcontext = context_system :: instance ( ) ; $ params = array ( 'userid' => $ userid , 'lim... | Get user contacts . |
31,061 | public static function data_for_messagearea_get_most_recent_message ( $ currentuserid , $ otheruserid ) { global $ CFG , $ PAGE , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ systemcontext = context_system :: instance ( ) ; $ params = array ( 'currentuserid'... | Get the most recent message in a conversation . |
31,062 | public static function data_for_messagearea_get_profile ( $ currentuserid , $ otheruserid ) { global $ CFG , $ PAGE , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ systemcontext = context_system :: instance ( ) ; $ params = array ( 'currentuserid' => $ curren... | Get the profile information for a contact . |
31,063 | public static function data_for_messagearea_get_profile_returns ( ) { return new external_single_structure ( array ( 'userid' => new external_value ( PARAM_INT , 'The id of the user whose profile we are viewing' ) , 'email' => new external_value ( core_user :: get_property_type ( 'email' ) , 'An email address' ) , 'cou... | The get profile return structure . |
31,064 | public static function get_contacts_returns ( ) { return new external_single_structure ( array ( 'online' => new external_multiple_structure ( new external_single_structure ( array ( 'id' => new external_value ( PARAM_INT , 'User ID' ) , 'fullname' => new external_value ( PARAM_NOTAGS , 'User full name' ) , 'profileima... | Get contacts return description . |
31,065 | public static function search_contacts ( $ searchtext , $ onlymycourses = false ) { global $ CFG , $ USER , $ PAGE ; require_once ( $ CFG -> dirroot . '/user/lib.php' ) ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } require_once ( $ CFG -> libdir . '/enrollib.php' ) ; ... | Search contacts . |
31,066 | public static function search_contacts_returns ( ) { return new external_multiple_structure ( new external_single_structure ( array ( 'id' => new external_value ( PARAM_INT , 'User ID' ) , 'fullname' => new external_value ( PARAM_NOTAGS , 'User full name' ) , 'profileimageurl' => new external_value ( PARAM_URL , 'User ... | Search contacts return description . |
31,067 | public static function get_messages_parameters ( ) { return new external_function_parameters ( array ( 'useridto' => new external_value ( PARAM_INT , 'the user id who received the message, 0 for any user' , VALUE_REQUIRED ) , 'useridfrom' => new external_value ( PARAM_INT , 'the user id who send the message, 0 for any ... | Get messages parameters description . |
31,068 | public static function get_messages_returns ( ) { return new external_single_structure ( array ( 'messages' => new external_multiple_structure ( new external_single_structure ( array ( 'id' => new external_value ( PARAM_INT , 'Message id' ) , 'useridfrom' => new external_value ( PARAM_INT , 'User from id' ) , 'useridto... | Get messages return description . |
31,069 | public static function mark_all_notifications_as_read ( $ useridto , $ useridfrom ) { global $ USER ; $ params = self :: validate_parameters ( self :: mark_all_notifications_as_read_parameters ( ) , array ( 'useridto' => $ useridto , 'useridfrom' => $ useridfrom , ) ) ; $ context = context_system :: instance ( ) ; self... | Mark all notifications as read function . |
31,070 | public static function get_unread_conversations_count ( $ useridto ) { global $ USER , $ CFG ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ params = self :: validate_parameters ( self :: get_unread_conversations_count_parameters ( ) , array ( 'useridto' => $ useridto... | Get unread messages count function . |
31,071 | public static function get_blocked_users ( $ userid ) { global $ CFG , $ USER , $ PAGE ; $ warnings = array ( ) ; $ params = array ( 'userid' => $ userid ) ; $ params = self :: validate_parameters ( self :: get_blocked_users_parameters ( ) , $ params ) ; $ userid = $ params [ 'userid' ] ; $ context = context_system :: ... | Retrieve a list of users blocked |
31,072 | public static function get_blocked_users_returns ( ) { return new external_single_structure ( array ( 'users' => new external_multiple_structure ( new external_single_structure ( array ( 'id' => new external_value ( PARAM_INT , 'User ID' ) , 'fullname' => new external_value ( PARAM_NOTAGS , 'User full name' ) , 'profil... | Get blocked users return description . |
31,073 | public static function mark_message_read ( $ messageid , $ timeread ) { global $ CFG , $ DB , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ warnings = array ( ) ; $ params = array ( 'messageid' => $ messageid , 'timeread' => $ timeread ) ; $ params = self :: ... | Mark a single message as read trigger message_viewed event |
31,074 | public static function mark_all_messages_as_read ( $ useridto , $ useridfrom ) { global $ USER , $ CFG ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ params = self :: validate_parameters ( self :: mark_all_messages_as_read_parameters ( ) , array ( 'useridto' => $ use... | Mark all messages as read function . |
31,075 | public static function mark_all_conversation_messages_as_read ( int $ userid , int $ conversationid ) { global $ CFG ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ params = array ( 'userid' => $ userid , 'conversationid' => $ conversationid , ) ; $ params = self :: v... | Mark all conversation messages as read function . |
31,076 | public static function delete_message ( $ messageid , $ userid , $ read = true ) { global $ CFG ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ warnings = array ( ) ; $ params = array ( 'messageid' => $ messageid , 'userid' => $ userid , 'read' => $ read ) ; $ params ... | Deletes a message |
31,077 | public static function message_processor_config_form ( $ userid , $ name , $ formvalues ) { global $ USER , $ CFG ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ params = self :: validate_parameters ( self :: message_processor_config_form_parameters ( ) , array ( 'use... | Processes a message processor config form . |
31,078 | public static function get_message_processor ( $ userid = 0 , $ name ) { global $ USER , $ PAGE , $ CFG ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ params = self :: validate_parameters ( self :: get_message_processor_parameters ( ) , array ( 'userid' => $ userid ,... | Get a message processor . |
31,079 | protected static function validate_preferences_permissions ( $ userid ) { global $ USER ; if ( empty ( $ userid ) ) { $ user = $ USER ; } else { $ user = core_user :: get_user ( $ userid , '*' , MUST_EXIST ) ; core_user :: require_active_user ( $ user ) ; } $ systemcontext = context_system :: instance ( ) ; self :: val... | Check that the user has enough permission to retrieve message or notifications preferences . |
31,080 | protected static function get_preferences_structure ( ) { return new external_single_structure ( array ( 'userid' => new external_value ( PARAM_INT , 'User id' ) , 'disableall' => new external_value ( PARAM_INT , 'Whether all the preferences are disabled' ) , 'processors' => new external_multiple_structure ( new extern... | Returns a notification or message preference structure . |
31,081 | public static function set_favourite_conversations ( int $ userid , array $ conversationids ) { global $ CFG , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ params = [ 'userid' => $ userid , 'conversations' => $ conversationids ] ; $ params = self :: validate... | Favourite a conversation or list of conversations for a user . |
31,082 | public static function unset_favourite_conversations ( int $ userid , array $ conversationids ) { global $ CFG , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ params = [ 'userid' => $ userid , 'conversations' => $ conversationids ] ; $ params = self :: valida... | Unfavourite a conversation or list of conversations for a user . |
31,083 | public static function get_conversation_counts ( int $ userid ) { global $ CFG , $ USER ; if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } if ( empty ( $ userid ) ) { $ userid = $ USER -> id ; } $ params = [ 'userid' => $ userid ] ; $ params = self :: validate_parameters (... | Returns an array of conversation counts for the various types of conversations including favourites . |
31,084 | public static function get_conversation_counts_returns ( ) { return new external_single_structure ( [ 'favourites' => new external_value ( PARAM_INT , 'Total number of favourite conversations' ) , 'types' => new external_single_structure ( [ \ core_message \ api :: MESSAGE_CONVERSATION_TYPE_INDIVIDUAL => new external_v... | Get conversation counts return description . |
31,085 | public function flatten_children ( array $ items ) : array { $ result = [ ] ; foreach ( $ items as [ $ item , $ children ] ) { $ result [ ] = $ item ; $ result = array_merge ( $ result , $ this -> flatten_children ( $ children ) ) ; } return $ result ; } | Take the data structure returned from sort_into_children and flatten it back into an array . It does a depth first flatten which maintains the reply ordering . |
31,086 | public function is_file_modified ( $ assignment , $ user , $ plugin , $ filename , $ fileinfo ) { $ sg = null ; if ( $ plugin -> get_subtype ( ) == 'assignsubmission' ) { $ sg = $ assignment -> get_user_submission ( $ user -> id , false ) ; } else if ( $ plugin -> get_subtype ( ) == 'assignfeedback' ) { $ sg = $ assign... | Does this file exist in any of the current files supported by this plugin for this user? |
31,087 | public function delete_import_files ( $ contextid ) { global $ USER ; $ fs = get_file_storage ( ) ; return $ fs -> delete_area_files ( $ contextid , 'assignfeedback_file' , ASSIGNFEEDBACK_FILE_IMPORT_FILEAREA , $ USER -> id ) ; } | Delete all temp files used when importing a zip |
31,088 | public function extract_files_from_zip ( $ zipfile , $ contextid ) { global $ USER ; $ feedbackfilesupdated = 0 ; $ feedbackfilesadded = 0 ; $ userswithnewfeedback = array ( ) ; raise_memory_limit ( MEMORY_EXTRA ) ; $ packer = get_file_packer ( 'application/zip' ) ; core_php_time_limit :: raise ( ASSIGNFEEDBACK_FILE_MA... | Extract the uploaded zip to a temporary import area for this user |
31,089 | public function get_import_files ( $ contextid ) { global $ USER ; $ fs = get_file_storage ( ) ; $ files = $ fs -> get_directory_files ( $ contextid , 'assignfeedback_file' , ASSIGNFEEDBACK_FILE_IMPORT_FILEAREA , $ USER -> id , '/import/' , true ) ; $ keys = array_keys ( $ files ) ; return $ files ; } | Get the list of files extracted from the uploaded zip |
31,090 | public static function get_attribute ( $ tag , $ attrname , $ type = PARAM_RAW ) { if ( preg_match ( '/^<[^>]*\b' . $ attrname . '="(.*?)"/is' , $ tag , $ matches ) ) { return clean_param ( htmlspecialchars_decode ( $ matches [ 1 ] ) , $ type ) ; } else if ( preg_match ( '~^<[^>]*\b' . $ attrname . '[ />]"~is' , $ tag ... | Extracts a value for an attribute |
31,091 | public static function remove_attributes ( $ tag , $ attrname ) { if ( is_array ( $ attrname ) ) { $ attrname = join ( '|' , $ attrname ) ; } while ( preg_match ( '/^(<[^>]*\b)(' . $ attrname . ')=".*?"(.*)$/is' , $ tag , $ matches ) ) { $ tag = $ matches [ 1 ] . $ matches [ 3 ] ; } while ( preg_match ( '~^(<[^>]*\b)('... | Removes an attribute from the media tags |
31,092 | public static function add_attributes ( $ tag , $ attributes ) { $ tag = self :: remove_attributes ( $ tag , array_keys ( $ attributes ) ) ; if ( ! preg_match ( '/^(<.*?)(>.*)$/s' , $ tag , $ matches ) ) { return $ tag ; } $ rv = $ matches [ 1 ] ; foreach ( $ attributes as $ name => $ value ) { $ rv .= " $name=\"" . s ... | Adds attributes to the media tags |
31,093 | public static function get_enabled_tourdata ( ) { global $ DB ; $ cache = \ cache :: make ( 'tool_usertours' , self :: CACHENAME_TOUR ) ; $ data = $ cache -> get ( self :: CACHEKEY_TOUR ) ; if ( $ data === false ) { $ sql = <<<EOF SELECT t.* FROM {tool_usertours_tours} t ... | Fetch all enabled tours . |
31,094 | public static function get_matching_tourdata ( \ moodle_url $ targetmatch ) { $ tours = self :: get_enabled_tourdata ( ) ; $ isfrontpage = $ targetmatch -> compare ( new \ moodle_url ( '/' ) , URL_MATCH_BASE ) ; $ target = $ targetmatch -> out_as_local_url ( ) ; return array_filter ( $ tours , function ( $ tour ) use (... | Fetch all enabled tours matching the specified target . |
31,095 | public static function notify_tour_change ( ) { $ cache = \ cache :: make ( 'tool_usertours' , self :: CACHENAME_TOUR ) ; $ cache -> delete ( self :: CACHEKEY_TOUR ) ; } | Notify of changes to any tour to clear the tour cache . |
31,096 | public static function get_stepdata ( $ tourid ) { global $ DB ; $ cache = \ cache :: make ( 'tool_usertours' , self :: CACHENAME_STEP ) ; $ data = $ cache -> get ( $ tourid ) ; if ( $ data === false ) { $ sql = <<<EOF SELECT s.* FROM {tool_usertours_steps} s WHERE s.tou... | Fetch the tour data for the specified tour . |
31,097 | public static function notify_step_change ( $ tourid ) { $ cache = \ cache :: make ( 'tool_usertours' , self :: CACHENAME_STEP ) ; $ cache -> delete ( $ tourid ) ; } | Notify of changes to any step to clear the step cache for that tour . |
31,098 | public static function create_from_completion ( \ stdClass $ completion ) { $ event = self :: create ( array ( 'objectid' => $ completion -> id , 'relateduserid' => $ completion -> userid , 'context' => \ context_course :: instance ( $ completion -> course ) , 'courseid' => $ completion -> course , 'other' => array ( '... | Create event from course_completion record . |
31,099 | public static function dayStringToNumber ( $ day ) { $ strippedDayValue = ( str_replace ( self :: $ numberSuffixes , '' , $ day ) ) ; if ( is_numeric ( $ strippedDayValue ) ) { return ( integer ) $ strippedDayValue ; } return $ day ; } | Strips an ordinal froma numeric value |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.