idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
34,100 | public static function get_stats_summary ( $ siteinfo ) { $ fieldsneedconfirm = self :: get_new_registration_fields ( ) ; $ summary = html_writer :: tag ( 'p' , get_string ( 'sendfollowinginfo_help' , 'hub' ) ) . html_writer :: start_tag ( 'ul' ) ; $ mobileservicesenabled = $ siteinfo [ 'mobileservicesenabled' ] ? get_... | Human - readable summary of data that will be sent to moodle . net |
34,101 | public static function save_site_info ( $ formdata ) { $ cleanhuburl = clean_param ( HUB_MOODLEORGHUBURL , PARAM_ALPHANUMEXT ) ; foreach ( self :: FORM_FIELDS as $ field ) { set_config ( 'site_' . $ field . '_' . $ cleanhuburl , $ formdata -> $ field , 'hub' ) ; } set_config ( 'site_regupdateversion_' . $ cleanhuburl ,... | Save registration info locally so it can be retrieved when registration needs to be updated |
34,102 | public static function update_manual ( ) { global $ DB ; if ( ! $ registration = self :: get_registration ( ) ) { return false ; } $ siteinfo = self :: get_site_info ( ) ; try { api :: update_registration ( $ siteinfo ) ; } catch ( moodle_exception $ e ) { if ( ! self :: is_registered ( ) ) { self :: register ( '' ) ; ... | Updates site registration when Update reigstration button is clicked by admin |
34,103 | public static function update_cron ( ) { global $ DB ; if ( ! $ registration = self :: get_registration ( ) ) { mtrace ( get_string ( 'registrationwarning' , 'admin' ) ) ; return ; } if ( self :: get_new_registration_fields ( ) ) { mtrace ( get_string ( 'pleaserefreshregistrationnewdata' , 'admin' ) ) ; return ; } $ si... | Updates site registration via cron |
34,104 | public static function confirm_registration ( $ token , $ newtoken , $ hubname ) { global $ DB ; $ registration = self :: get_registration ( false ) ; if ( ! $ registration || $ registration -> token !== $ token ) { throw new moodle_exception ( 'wrongtoken' , 'hub' , new moodle_url ( '/admin/registration/index.php' ) )... | Confirms registration by moodle . net |
34,105 | public static function site_privacy_options ( ) { return [ self :: HUB_SITENOTPUBLISHED => get_string ( 'siteprivacynotpublished' , 'hub' ) , self :: HUB_SITENAMEPUBLISHED => get_string ( 'siteprivacypublished' , 'hub' ) , self :: HUB_SITELINKPUBLISHED => get_string ( 'siteprivacylinked' , 'hub' ) ] ; } | Retrieve the options for site privacy form element to use in registration form |
34,106 | public static function register ( $ returnurl ) { global $ DB , $ SESSION ; if ( self :: is_registered ( ) ) { throw new \ coding_exception ( 'Site already registered' ) ; } $ hub = self :: get_registration ( false ) ; if ( empty ( $ hub ) ) { $ hub = new stdClass ( ) ; $ hub -> token = get_site_identifier ( ) ; $ hub ... | Registers a site |
34,107 | public static function reset_token ( ) { global $ DB ; if ( ! $ hub = self :: get_registration ( ) ) { return true ; } $ DB -> delete_records ( 'registration_hubs' , array ( 'id' => $ hub -> id ) ) ; self :: $ registration = null ; } | Resets the registration token without changing site identifier so site can be re - registered |
34,108 | public static function reset_site_identifier ( $ token ) { global $ DB , $ CFG ; $ registration = self :: get_registration ( false ) ; if ( ! $ registration || $ registration -> token != $ token ) { throw new moodle_exception ( 'wrongtoken' , 'hub' , new moodle_url ( '/admin/registration/index.php' ) ) ; } $ DB -> dele... | Generate a new token for the site that is not registered |
34,109 | public static function show_after_install ( $ markasviewed = null ) { global $ CFG ; if ( self :: is_registered ( ) ) { $ showregistration = false ; $ markasviewed = true ; } else { $ showregistration = ! empty ( $ CFG -> registrationpending ) ; if ( $ showregistration && ! site_is_public ( ) ) { $ showregistration = f... | Does admin need to be redirected to the registration page after install? |
34,110 | public static function get_new_registration_fields ( ) { $ fieldsneedconfirm = [ ] ; if ( ! self :: is_registered ( ) ) { return $ fieldsneedconfirm ; } $ cleanhuburl = clean_param ( HUB_MOODLEORGHUBURL , PARAM_ALPHANUMEXT ) ; $ lastupdated = ( int ) get_config ( 'hub' , 'site_regupdateversion_' . $ cleanhuburl ) ; for... | Returns the list of the fields in the registration form that were added since registration or last manual update |
34,111 | public static function registration_reminder ( $ url ) { if ( defined ( 'BEHAT_SITE_RUNNING' ) && BEHAT_SITE_RUNNING ) { return ; } if ( ! has_capability ( 'moodle/site:config' , context_system :: instance ( ) ) ) { return ; } if ( self :: show_after_install ( ) || self :: get_new_registration_fields ( ) ) { $ returnur... | Redirect to the site registration form if it s a new install or registration needs updating |
34,112 | function exportValue ( & $ submitValues , $ assoc = false ) { $ value = $ this -> _findValue ( $ submitValues ) ; if ( null === $ value ) { $ value = $ this -> getChecked ( ) ? $ this -> getValue ( ) : null ; } elseif ( $ value != $ this -> getValue ( ) ) { $ value = null ; } return $ this -> _prepareValue ( $ value , ... | Returns the value attribute if the radio is checked null if it is not |
34,113 | public function get_data ( ) { $ data = parent :: get_data ( ) ; if ( $ data && ! empty ( $ this -> _customdata -> istool ) ) { unset ( $ data -> lti_contentitem ) ; } return $ data ; } | Retrieves the data of the submitted form . |
34,114 | public function get_lti_advantage_services ( & $ mform ) { $ services = lti_get_services ( ) ; $ mform -> addElement ( 'header' , 'services' , get_string ( 'services' , 'lti' ) ) ; foreach ( $ services as $ service ) { $ service -> get_configuration_options ( $ mform ) ; } } | Generates the lti advantage extra configuration adding it to the mform |
34,115 | public static function get_relevant_users ( $ query , $ courseid ) { global $ CFG , $ PAGE ; self :: validate_parameters ( self :: get_relevant_users_parameters ( ) , [ 'query' => $ query , 'courseid' => $ courseid ] ) ; $ systemcontext = \ context_system :: instance ( ) ; self :: validate_context ( $ systemcontext ) ;... | Searches for users given a query taking into account the current user s permissions and possibly a course to check within . |
34,116 | public function action_executed ( $ actionname , \ core_analytics \ local \ target \ base $ target ) { global $ USER , $ DB ; $ context = \ context :: instance_by_id ( $ this -> get_prediction_data ( ) -> contextid , IGNORE_MISSING ) ; if ( ! $ context ) { throw new \ moodle_exception ( 'errorpredictioncontextnotavaila... | Stores the executed action . |
34,117 | public function get_selected_users ( ) { if ( is_null ( $ this -> selected ) ) { $ this -> selected = $ this -> load_selected_users ( ) ; } return $ this -> selected ; } | The users that were selected . |
34,118 | public function display ( $ return = false ) { global $ PAGE ; $ search = optional_param ( $ this -> name . '_searchtext' , '' , PARAM_RAW ) ; if ( optional_param ( $ this -> name . '_clearbutton' , false , PARAM_BOOL ) ) { $ search = '' ; } $ groupedusers = $ this -> find_users ( $ search ) ; $ name = $ this -> name ;... | Output this user_selector as HTML . |
34,119 | protected function load_selected_users ( ) { if ( $ this -> multiselect ) { $ userids = optional_param_array ( $ this -> name , array ( ) , PARAM_INT ) ; } else if ( $ userid = optional_param ( $ this -> name , 0 , PARAM_INT ) ) { $ userids = array ( $ userid ) ; } if ( empty ( $ userids ) ) { return array ( ) ; } $ th... | Get the list of users that were selected by doing optional_param then validating the result . |
34,120 | protected function required_fields_sql ( $ u ) { $ fields = array ( 'id' ) ; $ fields = array_merge ( $ fields , get_all_user_name_fields ( ) , $ this -> extrafields ) ; if ( $ u ) { foreach ( $ fields as & $ field ) { $ field = $ u . '.' . $ field ; } } return implode ( ',' , $ fields ) ; } | Returns SQL to select required fields . |
34,121 | protected function search_sql ( $ search , $ u ) { return users_search_sql ( $ search , $ u , $ this -> searchanywhere , $ this -> extrafields , $ this -> exclude , $ this -> validatinguserids ) ; } | Returns an array with SQL to perform a search and the params that go into it . |
34,122 | protected function too_many_results ( $ search , $ count ) { if ( $ search ) { $ a = new stdClass ; $ a -> count = $ count ; $ a -> search = $ search ; return array ( get_string ( 'toomanyusersmatchsearch' , '' , $ a ) => array ( ) , get_string ( 'pleasesearchmore' ) => array ( ) ) ; } else { return array ( get_string ... | Used to generate a nice message when there are too many users to show . |
34,123 | protected function output_optgroup ( $ groupname , $ users , $ select ) { if ( ! empty ( $ users ) ) { $ output = ' <optgroup label="' . htmlspecialchars ( $ groupname ) . ' (' . count ( $ users ) . ')">' . "\n" ; foreach ( $ users as $ user ) { $ attributes = '' ; if ( ! empty ( $ user -> disabled ) ) { $ attributes ... | Output one particular optgroup . Used by the preceding function output_options . |
34,124 | public function output_user ( $ user ) { $ out = fullname ( $ user , $ this -> viewfullnames ) ; if ( $ this -> extrafields ) { $ displayfields = array ( ) ; foreach ( $ this -> extrafields as $ field ) { $ displayfields [ ] = $ user -> { $ field } ; } $ out .= ' (' . implode ( ', ' , $ displayfields ) . ')' ; } return... | Convert a user object to a string suitable for displaying as an option in the list box . |
34,125 | private function initialise_option ( $ name , $ default ) { $ param = optional_param ( $ name , null , PARAM_BOOL ) ; if ( is_null ( $ param ) ) { return get_user_preferences ( $ name , $ default ) ; } else { set_user_preference ( $ name , $ param ) ; return $ param ; } } | Initialise one of the option checkboxes either from the request or failing that from the user_preferences table or finally from the given default . |
34,126 | private function option_checkbox ( $ name , $ on , $ label ) { if ( $ on ) { $ checked = ' checked="checked"' ; } else { $ checked = '' ; } $ name = 'userselector_' . $ name ; $ output = '<div class="form-check"><input type="hidden" name="' . $ name . '" value="0" />' . '<label class="form-check-label" for="' . $ name ... | Output one of the options checkboxes . |
34,127 | protected function initialise_javascript ( $ search ) { global $ USER , $ PAGE , $ OUTPUT ; $ output = '' ; $ options = $ this -> get_options ( ) ; $ hash = md5 ( serialize ( $ options ) ) ; $ USER -> userselectors [ $ hash ] = $ options ; $ PAGE -> requires -> js_init_call ( 'M.core_user.init_user_selector' , array ( ... | Initialises JS for this control . |
34,128 | protected function get_options ( ) { $ options = parent :: get_options ( ) ; $ options [ 'groupid' ] = $ this -> groupid ; $ options [ 'courseid' ] = $ this -> courseid ; return $ options ; } | Returns options for this selector . |
34,129 | protected function convert_array_format ( $ roles , $ search ) { if ( empty ( $ roles ) ) { $ roles = array ( ) ; } $ groupedusers = array ( ) ; foreach ( $ roles as $ role ) { if ( $ search ) { $ a = new stdClass ; $ a -> role = $ role -> name ; $ a -> search = $ search ; $ groupname = get_string ( 'matchingsearchandr... | Creates an organised array from given data . |
34,130 | public function get_user_summaries ( $ courseid ) { global $ DB ; $ usersummaries = array ( ) ; $ usergroups = array ( ) ; $ potentialmembersids = $ this -> potentialmembersids ; if ( empty ( $ potentialmembersids ) == false ) { list ( $ membersidsclause , $ params ) = $ DB -> get_in_or_equal ( $ potentialmembersids , ... | Construct HTML lists of group - memberships of the current set of users . |
34,131 | public function deleteFileAndChunksById ( $ id ) { $ this -> filesCollection -> deleteOne ( [ '_id' => $ id ] ) ; $ this -> chunksCollection -> deleteMany ( [ 'files_id' => $ id ] ) ; } | Deletes a GridFS file and related chunks by ID . |
34,132 | public function findFileByFilenameAndRevision ( $ filename , $ revision ) { $ filename = ( string ) $ filename ; $ revision = ( integer ) $ revision ; if ( $ revision < 0 ) { $ skip = abs ( $ revision ) - 1 ; $ sortOrder = - 1 ; } else { $ skip = $ revision ; $ sortOrder = 1 ; } return $ this -> filesCollection -> find... | Finds a GridFS file document for a given filename and revision . |
34,133 | public function insertChunk ( $ chunk ) { if ( ! $ this -> checkedIndexes ) { $ this -> ensureIndexes ( ) ; } $ this -> chunksCollection -> insertOne ( $ chunk ) ; } | Inserts a document into the chunks collection . |
34,134 | public function insertFile ( $ file ) { if ( ! $ this -> checkedIndexes ) { $ this -> ensureIndexes ( ) ; } $ this -> filesCollection -> insertOne ( $ file ) ; } | Inserts a document into the files collection . |
34,135 | private function ensureChunksIndex ( ) { foreach ( $ this -> chunksCollection -> listIndexes ( ) as $ index ) { if ( $ index -> isUnique ( ) && $ index -> getKey ( ) === [ 'files_id' => 1 , 'n' => 1 ] ) { return ; } } $ this -> chunksCollection -> createIndex ( [ 'files_id' => 1 , 'n' => 1 ] , [ 'unique' => true ] ) ; ... | Create an index on the chunks collection if it does not already exist . |
34,136 | private function ensureFilesIndex ( ) { foreach ( $ this -> filesCollection -> listIndexes ( ) as $ index ) { if ( $ index -> getKey ( ) === [ 'filename' => 1 , 'uploadDate' => 1 ] ) { return ; } } $ this -> filesCollection -> createIndex ( [ 'filename' => 1 , 'uploadDate' => 1 ] ) ; } | Create an index on the files collection if it does not already exist . |
34,137 | private function ensureIndexes ( ) { if ( $ this -> checkedIndexes ) { return ; } $ this -> checkedIndexes = true ; if ( ! $ this -> isFilesCollectionEmpty ( ) ) { return ; } $ this -> ensureFilesIndex ( ) ; $ this -> ensureChunksIndex ( ) ; } | Ensure indexes on the files and chunks collections exist . |
34,138 | public function get_badges_option ( $ badge ) { global $ DB ; $ sql = "SELECT b.id, b.name, b.version, b.language, b.type FROM {badge} b WHERE b.id <> :badgeid AND b.id NOT IN ( SELECT DISTINCT b.id FROM {badg... | Return list badge of a course or list badge site . |
34,139 | public function exportValue ( & $ submitvalues , $ notused = false ) { global $ COURSE ; $ vals = array ( ) ; foreach ( $ this -> _elements as $ element ) { $ thisexport = $ element -> exportValue ( $ submitvalues [ $ this -> getName ( ) ] , true ) ; if ( ! is_null ( $ thisexport ) ) { $ vals += $ thisexport ; } } $ ty... | Calculate the output value for the element as a whole . |
34,140 | protected function process_value ( $ type = 'none' , $ scale = null , $ point = null , $ rescalegrades = null ) { global $ COURSE ; $ val = 0 ; if ( $ this -> isupdate && $ this -> hasgrades && $ this -> canrescale && $ this -> currentgradetype == 'point' && empty ( $ rescalegrades ) ) { return ( string ) unformat_floa... | Process the value for the group based on the selected grade type and the input for the scale and point elements . |
34,141 | protected function validate_scale ( $ val ) { global $ COURSE ; $ scales = get_scales_menu ( $ COURSE -> id ) ; return ( ! empty ( $ val ) && isset ( $ scales [ ( int ) $ val ] ) ) ? true : false ; } | Determines whether a given value is a valid scale selection . |
34,142 | protected function validate_point ( $ val ) { if ( empty ( $ val ) ) { return false ; } $ maxgrade = ( int ) get_config ( 'core' , 'gradepointmax' ) ; $ isintlike = ( ( string ) ( int ) $ val === $ val ) ? true : false ; return ( $ isintlike === true && $ val > 0 && $ val <= $ maxgrade ) ? true : false ; } | Determines whether a given value is a valid point selection . |
34,143 | protected function generate_modgrade_subelement_id ( $ subname ) { $ gid = str_replace ( array ( '[' , ']' ) , array ( '_' , '' ) , $ this -> getName ( ) ) ; return clean_param ( 'id_' . $ gid . '_' . $ subname , PARAM_ALPHANUMEXT ) ; } | Generates the id attribute for the subelement of the modgrade group . |
34,144 | public function management_heading ( $ heading , $ viewmode = null , $ categoryid = null ) { $ html = html_writer :: start_div ( 'coursecat-management-header clearfix' ) ; if ( ! empty ( $ heading ) ) { $ html .= $ this -> heading ( $ heading ) ; } if ( $ viewmode !== null ) { $ html .= html_writer :: start_div ( ) ; $... | Displays a heading for the management pages . |
34,145 | public function management_form_start ( ) { $ form = array ( 'action' => $ this -> page -> url -> out ( ) , 'method' => 'POST' , 'id' => 'coursecat-management' ) ; $ html = html_writer :: start_tag ( 'form' , $ form ) ; $ html .= html_writer :: empty_tag ( 'input' , array ( 'type' => 'hidden' , 'name' => 'sesskey' , 'v... | Prepares the form element for the course category listing bulk actions . |
34,146 | public function category_listing ( core_course_category $ category = null ) { if ( $ category === null ) { $ selectedparents = array ( ) ; $ selectedcategory = null ; } else { $ selectedparents = $ category -> get_parents ( ) ; $ selectedparents [ ] = $ category -> id ; $ selectedcategory = $ category -> id ; } $ catat... | Presents a course category listing . |
34,147 | public function category_listing_actions ( core_course_category $ category = null ) { $ actions = array ( ) ; $ cancreatecategory = $ category && $ category -> can_create_subcategory ( ) ; $ cancreatecategory = $ cancreatecategory || core_course_category :: can_create_top_level_category ( ) ; if ( $ category === null )... | Renderers the actions that are possible for the course category listing . |
34,148 | public function category_listitem_actions ( core_course_category $ category , array $ actions = null ) { if ( $ actions === null ) { $ actions = \ core_course \ management \ helper :: get_category_listitem_actions ( $ category ) ; } $ menu = new action_menu ( ) ; $ menu -> attributes [ 'class' ] .= ' category-item-acti... | Renderers the actions for individual category list items . |
34,149 | public function course_listing ( core_course_category $ category = null , core_course_list_element $ course = null , $ page = 0 , $ perpage = 20 , $ viewmode = 'default' ) { if ( $ category === null ) { $ html = html_writer :: start_div ( 'select-a-category' ) ; $ html .= html_writer :: tag ( 'h3' , get_string ( 'cours... | Renders a course listing . |
34,150 | protected function listing_pagination ( core_course_category $ category , $ page , $ perpage , $ showtotals = false , $ viewmode = 'default' ) { $ html = '' ; $ totalcourses = $ category -> get_courses_count ( ) ; $ totalpages = ceil ( $ totalcourses / $ perpage ) ; if ( $ showtotals ) { if ( $ totalpages == 0 ) { $ st... | Renders pagination for a course listing . |
34,151 | public function course_listitem ( core_course_category $ category , core_course_list_element $ course , $ selectedcourse ) { $ text = $ course -> get_formatted_name ( ) ; $ attributes = array ( 'class' => 'listitem listitem-course list-group-item list-group-item-action' , 'data-id' => $ course -> id , 'data-selected' =... | Renderers a course list item . |
34,152 | public function course_bulk_actions ( core_course_category $ category ) { $ html = html_writer :: start_div ( 'course-bulk-actions bulk-actions' ) ; if ( $ category -> can_move_courses_out_of ( ) ) { $ html .= html_writer :: div ( get_string ( 'coursebulkaction' ) , 'accesshide' , array ( 'tabindex' => '0' ) ) ; $ opti... | Renderers bulk actions that can be performed on courses . |
34,153 | public function course_search_bulk_actions ( ) { $ html = html_writer :: start_div ( 'course-bulk-actions bulk-actions' ) ; $ html .= html_writer :: div ( get_string ( 'coursebulkaction' ) , 'accesshide' , array ( 'tabindex' => '0' ) ) ; $ options = core_course_category :: make_categories_list ( 'moodle/category:manage... | Renderers bulk actions that can be performed on courses in search returns |
34,154 | public function course_detail ( core_course_list_element $ course ) { $ details = \ core_course \ management \ helper :: get_course_detail_array ( $ course ) ; $ fullname = $ details [ 'fullname' ] [ 'value' ] ; $ html = html_writer :: start_div ( 'course-detail card' ) ; $ html .= html_writer :: start_div ( 'card-head... | Renderers detailed course information . |
34,155 | protected function detail_pair ( $ key , $ value , $ class = '' ) { $ html = html_writer :: start_div ( 'detail-pair row yui3-g ' . preg_replace ( '#[^a-zA-Z0-9_\-]#' , '-' , $ class ) ) ; $ html .= html_writer :: div ( html_writer :: span ( $ key ) , 'pair-key col-md-3 yui3-u-1-4 font-weight-bold' ) ; $ html .= html_w... | Renderers a key value pair of information for display . |
34,156 | public function course_detail_actions ( core_course_list_element $ course ) { $ actions = \ core_course \ management \ helper :: get_course_detail_actions ( $ course ) ; if ( empty ( $ actions ) ) { return '' ; } $ options = array ( ) ; foreach ( $ actions as $ action ) { $ options [ ] = $ this -> action_link ( $ actio... | A collection of actions for a course . |
34,157 | public function grid_start ( $ id = null , $ class = null ) { $ gridclass = 'grid-start grid-row-r d-flex flex-wrap row' ; if ( is_null ( $ class ) ) { $ class = $ gridclass ; } else { $ class .= ' ' . $ gridclass ; } $ attributes = array ( ) ; if ( ! is_null ( $ id ) ) { $ attributes [ 'id' ] = $ id ; } return html_wr... | Opens a grid . |
34,158 | public function grid_column_start ( $ size , $ id = null , $ class = null ) { if ( $ id == 'course-detail' ) { $ size = 12 ; $ bootstrapclass = 'col-md-' . $ size ; } else { $ bootstrapclass = 'd-flex flex-wrap px-3 mb-3' ; } $ yuigridclass = "col-sm" ; if ( is_null ( $ class ) ) { $ class = $ yuigridclass . ' ' . $ bo... | Opens a grid column |
34,159 | public function action_icon ( $ url , pix_icon $ pixicon , component_action $ action = null , array $ attributes = null , $ linktext = false ) { if ( ! ( $ url instanceof moodle_url ) ) { $ url = new moodle_url ( $ url ) ; } $ attributes = ( array ) $ attributes ; if ( empty ( $ attributes [ 'class' ] ) ) { $ attribute... | Renders an action_icon . |
34,160 | public function view_mode_selector ( array $ modes , $ currentmode , moodle_url $ url = null , $ param = 'view' ) { if ( $ url === null ) { $ url = $ this -> page -> url ; } $ menu = new action_menu ; $ menu -> attributes [ 'class' ] .= ' view-mode-selector vms ml-1' ; $ selected = null ; foreach ( $ modes as $ mode =>... | Displays a view mode selector . |
34,161 | public function search_listing ( array $ courses , $ totalcourses , core_course_list_element $ course = null , $ page = 0 , $ perpage = 20 , $ search = '' ) { $ page = max ( $ page , 0 ) ; $ perpage = max ( $ perpage , 2 ) ; $ totalpages = ceil ( $ totalcourses / $ perpage ) ; if ( $ page > $ totalpages - 1 ) { $ page ... | Displays a search result listing . |
34,162 | public function search_listitem ( core_course_list_element $ course , $ selectedcourse ) { $ text = $ course -> get_formatted_name ( ) ; $ attributes = array ( 'class' => 'listitem listitem-course list-group-item list-group-item-action' , 'data-id' => $ course -> id , 'data-selected' => ( $ selectedcourse == $ course -... | Renderers a search result course list item . |
34,163 | public function course_search_form ( $ value = '' , $ format = 'plain' ) { static $ count = 0 ; $ formid = 'coursesearch' ; if ( ( ++ $ count ) > 1 ) { $ formid .= $ count ; } switch ( $ format ) { case 'navbar' : $ formid = 'coursesearchnavbar' ; $ inputid = 'navsearchbox' ; $ inputsize = 20 ; break ; case 'short' : $... | Renders html to display a course search form |
34,164 | public function accessible_skipto_links ( $ displaycategorylisting , $ displaycourselisting , $ displaycoursedetail ) { $ html = html_writer :: start_div ( 'skiplinks accesshide' ) ; $ url = new moodle_url ( $ this -> page -> url ) ; if ( $ displaycategorylisting ) { $ url -> set_anchor ( 'category-listing' ) ; $ html ... | Creates access hidden skip to links for the displayed sections . |
34,165 | public function getTableElementStartAsString ( ) { $ escapedSheetName = $ this -> stringsEscaper -> escape ( $ this -> externalSheet -> getName ( ) ) ; $ tableStyleName = 'ta' . ( $ this -> externalSheet -> getIndex ( ) + 1 ) ; $ tableElement = '<table:table table:style-name="' . $ tableStyleName . '" table:name="' . $... | Returns the table XML root node as string . |
34,166 | protected function getCellXML ( $ cellValue , $ styleIndex , $ numTimesValueRepeated ) { $ data = '<table:table-cell table:style-name="ce' . $ styleIndex . '"' ; if ( $ numTimesValueRepeated !== 1 ) { $ data .= ' table:number-columns-repeated="' . $ numTimesValueRepeated . '"' ; } if ( CellHelper :: isNonEmptyString ( ... | Returns the cell XML content given its value . |
34,167 | public function render_my_data_requests_page ( my_data_requests_page $ page ) { $ data = $ page -> export_for_template ( $ this ) ; return parent :: render_from_template ( 'tool_dataprivacy/my_data_requests' , $ data ) ; } | Render the user s data requests page . |
34,168 | public function render_data_requests_page ( data_requests_page $ page ) { $ data = $ page -> export_for_template ( $ this ) ; return parent :: render_from_template ( 'tool_dataprivacy/data_requests' , $ data ) ; } | Render the data requests page for the DPO . |
34,169 | public function render_data_registry_page ( data_registry_page $ page ) { $ data = $ page -> export_for_template ( $ this ) ; return parent :: render_from_template ( 'tool_dataprivacy/data_registry' , $ data ) ; } | Render the data registry . |
34,170 | public function render_data_registry_compliance_page ( data_registry_compliance_page $ page ) { $ data = $ page -> export_for_template ( $ this ) ; return parent :: render_from_template ( 'tool_dataprivacy/data_registry_compliance' , $ data ) ; } | Render the data compliance registry . |
34,171 | public function render_purposes ( purposes $ page ) { $ data = $ page -> export_for_template ( $ this ) ; return parent :: render_from_template ( 'tool_dataprivacy/purposes' , $ data ) ; } | Render the purposes management page . |
34,172 | public function render_categories ( categories $ page ) { $ data = $ page -> export_for_template ( $ this ) ; return parent :: render_from_template ( 'tool_dataprivacy/categories' , $ data ) ; } | Render the categories management page . |
34,173 | public function render_data_deletion_page ( data_deletion_page $ page ) { $ data = $ page -> export_for_template ( $ this ) ; return parent :: render_from_template ( 'tool_dataprivacy/data_deletion' , $ data ) ; } | Render the review page for the deletion of expired contexts . |
34,174 | public function render_summary_page ( summary_page $ page ) { $ data = $ page -> export_for_template ( $ this ) ; return parent :: render_from_template ( 'tool_dataprivacy/summary' , $ data ) ; } | Render the user data retention summary page . |
34,175 | public static function getSpotColor ( $ name , & $ spotc ) { if ( isset ( $ spotc [ $ name ] ) ) { return $ spotc [ $ name ] ; } $ color = preg_replace ( '/[\s]*/' , '' , $ name ) ; $ color = strtolower ( $ color ) ; if ( isset ( self :: $ spotcolor [ $ color ] ) ) { if ( ! isset ( $ spotc [ $ name ] ) ) { $ i = ( 1 + ... | Return the Spot color array . |
34,176 | public function startTls ( ) { if ( $ this -> connected && ! $ this -> secure ) { if ( defined ( 'STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT' ) ) { $ mode = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT ; } else { $ mode = STREAM_CRYPTO_METHOD_TLS_CLIENT ; } if... | Start a TLS connection . |
34,177 | public function close ( ) { if ( $ this -> connected ) { @ fclose ( $ this -> _stream ) ; $ this -> _connected = $ this -> _secure = false ; $ this -> _stream = null ; } } | Close the connection . |
34,178 | public function gets ( $ size ) { $ this -> _checkStream ( ) ; $ data = @ fgets ( $ this -> _stream , $ size ) ; if ( $ data === false ) { throw new Client \ Exception ( 'Error reading data from socket' ) ; } return $ data ; } | Returns a line of data . |
34,179 | public function read ( $ size ) { $ this -> _checkStream ( ) ; $ data = @ fread ( $ this -> _stream , $ size ) ; if ( $ data === false ) { throw new Client \ Exception ( 'Error reading data from socket' ) ; } return $ data ; } | Returns a specified amount of data . |
34,180 | protected function _connect ( $ host , $ port , $ timeout , $ secure , $ context , $ retries = 0 ) { $ conn = '' ; if ( ! strpos ( $ host , '://' ) ) { switch ( strval ( $ secure ) ) { case 'ssl' : case 'sslv2' : case 'sslv3' : $ conn = $ secure . '://' ; $ this -> _secure = true ; break ; case 'tlsv1' : $ conn = 'tls:... | Connect to the remote server . |
34,181 | public function render ( stdClass $ user , post_entity $ firstpost , array $ replies ) : string { global $ CFG ; $ displaymode = $ this -> displaymode ; $ capabilitymanager = $ this -> capabilitymanager ; if ( ! $ capabilitymanager -> can_view_discussions ( $ user ) ) { throw new moodle_exception ( 'noviewdiscussionspe... | Render the discussion for the given user in the specified display mode . |
34,182 | private function get_groups_available_in_forum ( ) : array { $ course = $ this -> forum -> get_course_record ( ) ; $ coursemodule = $ this -> forum -> get_course_module_record ( ) ; return groups_get_all_groups ( $ course -> id , 0 , $ coursemodule -> groupingid ) ; } | Get the groups details for all groups available to the forum . |
34,183 | private function get_exported_discussion ( stdClass $ user ) : array { $ discussionexporter = $ this -> exporterfactory -> get_discussion_exporter ( $ user , $ this -> forum , $ this -> discussion , $ this -> get_groups_available_in_forum ( ) ) ; return ( array ) $ discussionexporter -> export ( $ this -> renderer ) ; ... | Get the exported discussion . |
34,184 | private function get_display_mode_selector_html ( int $ displaymode ) : string { $ baseurl = $ this -> baseurl ; $ select = new single_select ( $ baseurl , 'mode' , forum_get_layout_modes ( ) , $ displaymode , null , 'mode' ) ; $ select -> set_label ( get_string ( 'displaymode' , 'forum' ) , [ 'class' => 'accesshide' ]... | Get the HTML for the display mode selector . |
34,185 | private function get_subscription_button_html ( ) : string { global $ PAGE ; $ forumrecord = $ this -> forumrecord ; $ discussion = $ this -> discussion ; $ html = html_writer :: div ( forum_get_discussion_subscription_icon ( $ forumrecord , $ discussion -> get_id ( ) , null , true ) , 'discussionsubscription' ) ; $ ht... | Get the HTML to render the subscription button . |
34,186 | private function get_move_discussion_html ( ) : ? string { global $ DB ; $ forum = $ this -> forum ; $ discussion = $ this -> discussion ; $ courseid = $ forum -> get_course_id ( ) ; $ modinfo = get_fast_modinfo ( $ courseid ) ; if ( isset ( $ modinfo -> instances [ 'forum' ] ) ) { $ forummenu = [ ] ; $ forumcheck = $ ... | Get the HTML to render the move discussion selector and button . |
34,187 | private function get_export_discussion_html ( ) : ? string { global $ CFG ; require_once ( $ CFG -> libdir . '/portfoliolib.php' ) ; $ discussion = $ this -> discussion ; $ button = new \ portfolio_add_button ( ) ; $ button -> set_callback_options ( 'forum_portfolio_caller' , [ 'discussionid' => $ discussion -> get_id ... | Get the HTML to render the export discussion button . |
34,188 | private function get_notifications ( $ user ) : array { $ notifications = $ this -> notifications ; $ discussion = $ this -> discussion ; $ forum = $ this -> forum ; $ renderer = $ this -> renderer ; if ( $ forum -> is_cutoff_date_reached ( ) ) { $ notifications [ ] = ( new notification ( get_string ( 'cutoffdatereache... | Get a list of notification HTML to render in the page . |
34,189 | private function get_neighbour_links_html ( ) : string { $ forum = $ this -> forum ; $ coursemodule = $ forum -> get_course_module_record ( ) ; $ neighbours = forum_get_discussion_neighbours ( $ coursemodule , $ this -> discussionrecord , $ this -> forumrecord ) ; return $ this -> renderer -> neighbouring_discussion_na... | Get HTML to display the neighbour links . |
34,190 | protected function get_imap_client ( ) { global $ CFG ; if ( ! \ core \ message \ inbound \ manager :: is_enabled ( ) ) { mtrace ( "Inbound Message not fully configured - exiting early." ) ; return false ; } mtrace ( "Connecting to {$CFG->messageinbound_host} as {$CFG->messageinbound_hostuser}..." ) ; $ configuration =... | Retrieve the connection to the IMAP client . |
34,191 | protected function get_confirmation_folder ( ) { if ( $ this -> imapnamespace === null ) { if ( $ this -> client -> queryCapability ( 'NAMESPACE' ) ) { $ namespaces = $ this -> client -> getNamespaces ( array ( ) , array ( 'ob_return' => true ) ) ; $ this -> imapnamespace = $ namespaces -> getNamespace ( 'INBOX' ) ; } ... | Get the confirmation folder imap name |
34,192 | protected function get_mailbox ( ) { $ mailbox = $ this -> client -> currentMailbox ( ) ; if ( isset ( $ mailbox [ 'mailbox' ] ) ) { return $ mailbox [ 'mailbox' ] ; } else { throw new \ core \ message \ inbound \ processing_failed_exception ( 'couldnotopenmailbox' , 'tool_messageinbound' ) ; } } | Get the current mailbox information . |
34,193 | public function pickup_messages ( ) { if ( ! $ this -> get_imap_client ( ) ) { return false ; } $ search = new \ Horde_Imap_Client_Search_Query ( ) ; $ search -> flag ( self :: MESSAGE_SEEN , false ) ; $ search -> flag ( self :: MESSAGE_FLAGGED , false ) ; mtrace ( "Searching for Unseen, Unflagged email in the folder '... | Execute the main Inbound Message pickup task . |
34,194 | public function tidy_old_messages ( ) { if ( ! $ this -> get_imap_client ( ) ) { return false ; } mtrace ( "Searching for messages older than 24 hours in the '" . $ this -> get_confirmation_folder ( ) . "' folder." ) ; $ this -> client -> openMailbox ( $ this -> get_confirmation_folder ( ) ) ; $ mailbox = $ this -> get... | Tidy up old messages in the confirmation folder . |
34,195 | private function process_message_data ( \ Horde_Imap_Client_Data_Envelope $ envelope , \ Horde_Imap_Client_Data_Fetch $ basemessagedata , $ messageid ) { $ mailbox = $ this -> get_mailbox ( ) ; $ structure = $ basemessagedata -> getStructure ( ) ; $ query = new \ Horde_Imap_Client_Fetch_Query ( ) ; $ query -> imapDate ... | Process a message to retrieve it s header data without body and attachemnts . |
34,196 | private function process_message_part_body ( $ messagedata , $ partdata , $ part ) { $ content = $ messagedata -> getBodyPart ( $ part ) ; if ( ! $ messagedata -> getBodyPartDecode ( $ part ) ) { $ partdata -> setContents ( $ content ) ; $ content = $ partdata -> getContents ( ) ; } $ content = \ core_text :: convert (... | Process the messagedata and part data to extract the content of this part . |
34,197 | private function passes_key_validation ( $ status , $ messageid ) { if ( ( $ status & ~ \ core \ message \ inbound \ address_manager :: VALIDATION_SUCCESS & ~ \ core \ message \ inbound \ address_manager :: VALIDATION_UNKNOWN_DATAKEY & ~ \ core \ message \ inbound \ address_manager :: VALIDATION_EXPIRED_DATAKEY & ~ \ c... | Check whether the key provided is valid . |
34,198 | private function add_flag_to_message ( $ messageid , $ flag ) { $ mailbox = $ this -> get_mailbox ( ) ; $ this -> client -> store ( $ mailbox , array ( 'ids' => new \ Horde_Imap_Client_Ids ( $ messageid ) , 'add' => $ flag , ) ) ; } | Add the specified flag to the message . |
34,199 | private function remove_flag_from_message ( $ messageid , $ flag ) { $ mailbox = $ this -> get_mailbox ( ) ; $ this -> client -> store ( $ mailbox , array ( 'ids' => $ messageid , 'delete' => $ flag , ) ) ; } | Remove the specified flag from the message . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.