idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
33,900 | protected function add_subplugin_structure ( $ subplugintype , $ element , $ multiple , $ plugintype = null , $ pluginname = null ) { global $ CFG ; if ( $ plugintype === null and $ pluginname === null ) { $ plugintype = 'mod' ; $ pluginname = $ this -> task -> get_modulename ( ) ; } if ( ! array_key_exists ( $ plugint... | Add subplugin structure for a given plugin to any element in the structure backup tree . |
33,901 | public function get_training_ranges ( ) { $ trainingranges = $ this -> ranges ; foreach ( $ trainingranges as $ rangeindex => $ range ) { if ( ! $ this -> ready_to_train ( $ range ) ) { unset ( $ trainingranges [ $ rangeindex ] ) ; } } return $ trainingranges ; } | Overwritting as the last range may be for prediction . |
33,902 | protected function get_next_range ( \ DateTimeImmutable $ next ) { $ end = $ next -> getTimestamp ( ) ; $ start = $ next -> sub ( $ this -> periodicity ( ) ) -> getTimestamp ( ) ; if ( $ start < $ this -> analysable -> get_start ( ) ) { return false ; } return [ 'start' => $ start , 'end' => $ end , 'time' => $ end ] ;... | The next range is based on the past period . |
33,903 | private function createAggregate ( ) { $ pipeline = $ this -> pipeline ; array_unshift ( $ pipeline , [ '$changeStream' => ( object ) $ this -> changeStreamOptions ] ) ; return new Aggregate ( $ this -> databaseName , $ this -> collectionName , $ pipeline , $ this -> aggregateOptions ) ; } | Create the aggregate command for creating a change stream . |
33,904 | private function executeAggregate ( Server $ server ) { if ( $ this -> operationTime !== null || ! \ MongoDB \ server_supports_feature ( $ server , self :: $ wireVersionForOperationTime ) ) { return $ this -> aggregate -> execute ( $ server ) ; } \ MongoDB \ Driver \ Monitoring \ addSubscriber ( $ this ) ; try { return... | Execute the aggregate command and optionally capture its operation time . |
33,905 | public static function autodiscover_feed_url ( $ url ) { $ rss = new moodle_simplepie ( ) ; $ rss -> set_feed_url ( $ url ) ; $ rss -> set_autodiscovery_level ( SIMPLEPIE_LOCATOR_ALL ) ; $ rss -> set_timeout ( 20 ) ; $ rss -> init ( ) ; if ( $ rss -> error ( ) ) { return $ url ; } $ discoveredurl = new moodle_url ( $ r... | Autodiscovers a feed url from a given url to be used by the formslibs filter function |
33,906 | public static function get_urls_by_courses ( $ courseids = array ( ) ) { $ warnings = array ( ) ; $ returnedurls = array ( ) ; $ params = array ( 'courseids' => $ courseids , ) ; $ params = self :: validate_parameters ( self :: get_urls_by_courses_parameters ( ) , $ params ) ; $ mycourses = array ( ) ; if ( empty ( $ p... | Returns a list of urls in a provided list of courses . If no list is provided all urls that the user can view will be returned . |
33,907 | public static function get_urls_by_courses_returns ( ) { return new external_single_structure ( array ( 'urls' => new external_multiple_structure ( new external_single_structure ( array ( 'id' => new external_value ( PARAM_INT , 'Module id' ) , 'coursemodule' => new external_value ( PARAM_INT , 'Course module id' ) , '... | Describes the get_urls_by_courses return value . |
33,908 | public static function save_controller ( $ controller , $ checksum , $ includeobj = true , $ cleanobj = false ) { global $ DB ; if ( ! $ controller instanceof restore_controller ) { throw new backup_controller_exception ( 'restore_controller_expected' ) ; } if ( $ includeobj and ! $ controller -> is_checksum_correct ( ... | Send one restore controller to DB |
33,909 | public static function apply_config_defaults ( restore_controller $ controller ) { $ settings = array ( 'restore_general_users' => 'users' , 'restore_general_enrolments' => 'enrolments' , 'restore_general_role_assignments' => 'role_assignments' , 'restore_general_activities' => 'activities' , 'restore_general_blocks' =... | Sets the default values for the settings in a restore operation |
33,910 | private static function get_setting_default ( $ config , $ setting ) { $ value = get_config ( 'restore' , $ config ) ; if ( in_array ( $ setting -> get_name ( ) , [ 'course_fullname' , 'course_shortname' , 'course_startdate' ] ) && $ setting -> get_ui ( ) instanceof backup_setting_ui_defaultcustom ) { $ value = ( bool ... | Returns the default value to be used for a setting from the admin restore config |
33,911 | private static function force_enable_settings ( restore_controller $ controller , array $ settings ) { $ plan = $ controller -> get_plan ( ) ; foreach ( $ settings as $ config => $ settingname ) { $ value = true ; if ( $ plan -> setting_exists ( $ settingname ) ) { $ setting = $ plan -> get_setting ( $ settingname ) ; ... | Turn these settings on . No defaults from admin settings . |
33,912 | public static function load_from_record ( $ record , $ clean = false ) { $ step = new self ( ) ; return $ step -> reload_from_record ( $ record , $ clean ) ; } | Load the step instance . |
33,913 | protected function reload_from_record ( $ record , $ clean = false ) { $ this -> id = $ record -> id ; $ this -> tourid = $ record -> tourid ; if ( $ clean ) { $ this -> title = clean_param ( $ record -> title , PARAM_TEXT ) ; $ this -> content = clean_text ( $ record -> content ) ; } else { $ this -> title = $ record ... | Reload the current step from the supplied record . |
33,914 | public function get_tour ( ) { if ( $ this -> tour === null ) { $ this -> tour = tour :: instance ( $ this -> tourid ) ; } return $ this -> tour ; } | Get the Tour instance that this step belongs to . |
33,915 | public function set_tourid ( $ value ) { $ this -> tourid = $ value ; $ this -> tour = null ; $ this -> dirty = true ; return $ this ; } | Set the id of the tour . |
33,916 | public function set_title ( $ value ) { $ this -> title = clean_text ( $ value ) ; $ this -> dirty = true ; return $ this ; } | Set the title for this step . |
33,917 | public function set_content ( $ value ) { $ this -> content = clean_text ( $ value ) ; $ this -> dirty = true ; return $ this ; } | Set the content value for this step . |
33,918 | public function to_record ( ) { return ( object ) array ( 'id' => $ this -> id , 'tourid' => $ this -> tourid , 'title' => $ this -> title , 'content' => $ this -> content , 'targettype' => $ this -> targettype , 'targetvalue' => $ this -> targetvalue , 'sortorder' => $ this -> sortorder , 'configdata' => json_encode (... | Prepare this step for saving to the database . |
33,919 | public function handle_form_submission ( local \ forms \ editstep & $ mform , \ stdClass $ data ) { $ this -> set_title ( $ data -> title ) ; $ this -> set_content ( $ data -> content ) ; $ this -> set_targettype ( $ data -> targettype ) ; $ this -> set_targetvalue ( $ this -> get_target ( ) -> get_value_from_form ( $ ... | Handle submission of the step editing form . |
33,920 | public static function get_string_from_input ( $ string ) { $ string = trim ( $ string ) ; if ( preg_match ( '|^([a-zA-Z][a-zA-Z0-9\.:/_-]*),([a-zA-Z][a-zA-Z0-9\.:/_-]*)$|' , $ string , $ matches ) ) { if ( $ matches [ 2 ] === 'moodle' ) { $ matches [ 2 ] = 'core' ; } if ( get_string_manager ( ) -> string_exists ( $ ma... | Attempt to fetch any matching langstring if the string is in the format identifier component . |
33,921 | function setValue ( $ value ) { $ this -> _createElementsIfNotExist ( ) ; foreach ( array_keys ( $ this -> _elements ) as $ key ) { if ( ! $ this -> _appendName ) { $ v = $ this -> _elements [ $ key ] -> _findValue ( $ value ) ; if ( null !== $ v ) { $ this -> _elements [ $ key ] -> onQuickFormEvent ( 'setGroupValue' ,... | Sets values for group s elements |
33,922 | function getValue ( ) { $ value = null ; foreach ( array_keys ( $ this -> _elements ) as $ key ) { $ element = & $ this -> _elements [ $ key ] ; switch ( $ element -> getType ( ) ) { case 'radio' : $ v = $ element -> getChecked ( ) ? $ element -> getValue ( ) : null ; break ; case 'checkbox' : $ v = $ element -> getChe... | Returns the value of the group |
33,923 | function setElements ( $ elements ) { $ this -> _elements = array_values ( $ elements ) ; if ( $ this -> _flagFrozen ) { $ this -> freeze ( ) ; } } | Sets the grouped elements |
33,924 | function getGroupType ( ) { $ this -> _createElementsIfNotExist ( ) ; $ prevType = '' ; foreach ( array_keys ( $ this -> _elements ) as $ key ) { $ type = $ this -> _elements [ $ key ] -> getType ( ) ; if ( $ type != $ prevType && $ prevType != '' ) { return 'mixed' ; } $ prevType = $ type ; } return $ type ; } | Gets the group type based on its elements Will return mixed if elements contained in the group are of different types . |
33,925 | function toHtml ( ) { include_once ( 'HTML/QuickForm/Renderer/Default.php' ) ; $ renderer = new HTML_QuickForm_Renderer_Default ( ) ; $ renderer -> setElementTemplate ( '{element}' ) ; $ this -> accept ( $ renderer ) ; return $ renderer -> toHtml ( ) ; } | Returns Html for the group |
33,926 | function getElementName ( $ index ) { $ this -> _createElementsIfNotExist ( ) ; $ elementName = false ; if ( is_int ( $ index ) && isset ( $ this -> _elements [ $ index ] ) ) { $ elementName = $ this -> _elements [ $ index ] -> getName ( ) ; if ( isset ( $ elementName ) && $ elementName == '' ) { $ elementName = $ inde... | Returns the element name inside the group such as found in the html form |
33,927 | public static function get_record_by_contextid ( $ contextid , $ exception = true ) { global $ DB ; if ( ! $ record = $ DB -> get_record ( self :: TABLE , array ( 'contextid' => $ contextid ) ) ) { if ( ! $ exception ) { return false ; } else { throw new \ dml_missing_record_exception ( self :: TABLE ) ; } } return new... | Returns an instance by contextid . |
33,928 | public function add_action_buttons ( $ cancel = true , $ submitlabel = null ) { $ mform = & $ this -> _form ; $ buttonarray = array ( ) ; $ buttonarray [ ] = & $ mform -> createElement ( 'submit' , 'showpreview' , get_string ( 'preview' , 'tool_uploadcourse' ) ) ; $ buttonarray [ ] = & $ mform -> createElement ( 'submi... | Add actopm buttons . |
33,929 | public function definition_after_data ( ) { $ mform = $ this -> _form ; $ format = course_get_format ( ( object ) array ( 'format' => get_config ( 'moodlecourse' , 'format' ) ) ) ; if ( get_config ( 'moodlecourse' , 'courseenddateenabled' ) ) { $ enddate = $ format -> get_default_course_enddate ( $ mform , array ( 'sta... | Sets the enddate default after set_data is called . |
33,930 | public static function delete_modules ( $ cmids ) { global $ CFG , $ DB ; require_once ( $ CFG -> dirroot . "/course/lib.php" ) ; $ params = self :: validate_parameters ( self :: delete_modules_parameters ( ) , array ( 'cmids' => $ cmids ) ) ; $ arrcourseschecked = array ( ) ; foreach ( $ params [ 'cmids' ] as $ cmid )... | Deletes a list of provided module instances . |
33,931 | public static function view_course ( $ courseid , $ sectionnumber = 0 ) { global $ CFG ; require_once ( $ CFG -> dirroot . "/course/lib.php" ) ; $ params = self :: validate_parameters ( self :: view_course_parameters ( ) , array ( 'courseid' => $ courseid , 'sectionnumber' => $ sectionnumber ) ) ; $ warnings = array ( ... | Trigger the course viewed event . |
33,932 | public static function get_activities_overview ( $ courseids ) { global $ USER ; $ params = self :: validate_parameters ( self :: get_activities_overview_parameters ( ) , array ( 'courseids' => $ courseids ) ) ; $ courseoverviews = array ( ) ; list ( $ courses , $ warnings ) = external_util :: validate_courses ( $ para... | Return activities overview for the given courses . |
33,933 | public static function get_user_navigation_options ( $ courseids ) { global $ CFG ; require_once ( $ CFG -> dirroot . '/course/lib.php' ) ; $ params = self :: validate_parameters ( self :: get_user_navigation_options_parameters ( ) , array ( 'courseids' => $ courseids ) ) ; $ courseoptions = array ( ) ; list ( $ course... | Return a list of navigation options in a set of courses that are avaialable or not for the current user . |
33,934 | public static function get_user_administration_options ( $ courseids ) { global $ CFG ; require_once ( $ CFG -> dirroot . '/course/lib.php' ) ; $ params = self :: validate_parameters ( self :: get_user_administration_options_parameters ( ) , array ( 'courseids' => $ courseids ) ) ; $ courseoptions = array ( ) ; list ( ... | Return a list of administration options in a set of courses that are available or not for the current user . |
33,935 | public static function check_updates ( $ courseid , $ tocheck , $ filter = array ( ) ) { global $ CFG , $ DB ; require_once ( $ CFG -> dirroot . "/course/lib.php" ) ; $ params = self :: validate_parameters ( self :: check_updates_parameters ( ) , array ( 'courseid' => $ courseid , 'tocheck' => $ tocheck , 'filter' => $... | Check if there is updates affecting the user for the given course and contexts . Right now only modules are supported . This WS calls mod_check_updates_since for each module to check if there is any update the user should we aware of . |
33,936 | public static function get_updates_since ( $ courseid , $ since , $ filter = array ( ) ) { global $ CFG , $ DB ; $ params = self :: validate_parameters ( self :: get_updates_since_parameters ( ) , array ( 'courseid' => $ courseid , 'since' => $ since , 'filter' => $ filter , ) ) ; $ course = get_course ( $ params [ 'co... | Check if there are updates affecting the user for the given course since the given time stamp . |
33,937 | public static function get_module ( $ id , $ sectionreturn = null ) { global $ PAGE ; $ params = self :: validate_parameters ( self :: get_module_parameters ( ) , array ( 'id' => $ id , 'sectionreturn' => $ sectionreturn ) ) ; $ id = $ params [ 'id' ] ; $ sectionreturn = $ params [ 'sectionreturn' ] ; $ contextarray = ... | Returns html for displaying one activity module on course page |
33,938 | public static function edit_section ( $ action , $ id , $ sectionreturn ) { global $ DB ; $ params = self :: validate_parameters ( self :: edit_section_parameters ( ) , array ( 'action' => $ action , 'id' => $ id , 'sectionreturn' => $ sectionreturn ) ) ; $ action = $ params [ 'action' ] ; $ id = $ params [ 'id' ] ; $ ... | Performs one of the edit section actions |
33,939 | public static function set_favourite_courses ( array $ courses ) { global $ USER ; $ params = self :: validate_parameters ( self :: set_favourite_courses_parameters ( ) , array ( 'courses' => $ courses ) ) ; $ warnings = [ ] ; $ ufservice = \ core_favourites \ service_factory :: get_service_for_user_context ( \ context... | Set the course favourite status for an array of courses . |
33,940 | public static function get_recent_courses ( int $ userid = 0 , int $ limit = 0 , int $ offset = 0 , string $ sort = null ) { global $ USER , $ PAGE ; if ( empty ( $ userid ) ) { $ userid = $ USER -> id ; } $ params = self :: validate_parameters ( self :: get_recent_courses_parameters ( ) , array ( 'userid' => $ userid ... | Get last accessed courses adding additional course information like images . |
33,941 | public function recode_legacy_state_answer ( $ state ) { $ answer = $ state -> answer ; $ result = '' ; if ( $ answer ) { $ result = $ this -> get_mappingid ( 'question_answer' , $ answer ) ; } return $ result ; } | Given one question_states record return the answer recoded pointing to all the restored stuff for truefalse questions |
33,942 | public static function get_definitions_parameters ( ) { return new external_function_parameters ( array ( 'cmids' => new external_multiple_structure ( new external_value ( PARAM_INT , 'course module id' ) , '1 or more course module ids' ) , 'areaname' => new external_value ( PARAM_AREA , 'area name' ) , 'activeonly' =>... | Describes the parameters for get_definitions |
33,943 | private static function grading_area ( ) { return new external_single_structure ( array ( 'cmid' => new external_value ( PARAM_INT , 'course module id' ) , 'contextid' => new external_value ( PARAM_INT , 'context id' ) , 'component' => new external_value ( PARAM_TEXT , 'component name' ) , 'areaname' => new external_va... | Creates a grading area |
33,944 | private static function definition ( ) { global $ CFG ; $ definition = array ( ) ; $ definition [ 'id' ] = new external_value ( PARAM_INT , 'definition id' , VALUE_OPTIONAL ) ; $ definition [ 'method' ] = new external_value ( PARAM_TEXT , 'method' ) ; $ definition [ 'name' ] = new external_value ( PARAM_TEXT , 'name' )... | creates a grading form definition |
33,945 | private static function grading_instance ( ) { global $ CFG ; $ instance = array ( ) ; $ instance [ 'id' ] = new external_value ( PARAM_INT , 'instance id' ) ; $ instance [ 'raterid' ] = new external_value ( PARAM_INT , 'rater id' ) ; $ instance [ 'itemid' ] = new external_value ( PARAM_INT , 'item id' ) ; $ instance [... | Creates a grading instance |
33,946 | public static function save_definitions ( $ areas ) { $ params = self :: validate_parameters ( self :: save_definitions_parameters ( ) , array ( 'areas' => $ areas ) ) ; foreach ( $ params [ 'areas' ] as $ area ) { $ context = context :: instance_by_id ( $ area [ 'contextid' ] ) ; require_capability ( 'moodle/grade:man... | Saves the areas and definitions |
33,947 | private static function create_definition_object ( $ definition ) { global $ CFG ; $ method = $ definition [ 'method' ] ; $ definitionobject = new stdClass ( ) ; foreach ( $ definition as $ key => $ value ) { if ( ! is_array ( $ value ) ) { $ definitionobject -> $ key = $ value ; } } $ text = '' ; $ format = FORMAT_MOO... | Creates a definition stdClass object using the values from the definition array that is passed in as a parameter |
33,948 | public function enableGzip ( ) { $ this -> setRequestHeaders ( array ( "Accept-Encoding" => "gzip" ) ) ; $ this -> canGzip = true ; $ this -> setUserAgent ( $ this -> userAgent ) ; } | Enable support for gzipped responses with this request . |
33,949 | public function disableGzip ( ) { if ( isset ( $ this -> requestHeaders [ 'accept-encoding' ] ) && $ this -> requestHeaders [ 'accept-encoding' ] == "gzip" ) { unset ( $ this -> requestHeaders [ 'accept-encoding' ] ) ; } $ this -> canGzip = false ; $ this -> userAgent = str_replace ( self :: GZIP_UA , "" , $ this -> us... | Disable support for gzip responses with this request . |
33,950 | public function setUserAgent ( $ userAgent ) { $ this -> userAgent = $ userAgent ; if ( $ this -> canGzip ) { $ this -> userAgent = $ userAgent . self :: GZIP_UA ; } } | Set the User - Agent Header . |
33,951 | public function getCacheKey ( ) { $ key = $ this -> getUrl ( ) ; if ( isset ( $ this -> accessKey ) ) { $ key .= $ this -> accessKey ; } if ( isset ( $ this -> requestHeaders [ 'authorization' ] ) ) { $ key .= $ this -> requestHeaders [ 'authorization' ] ; } return md5 ( $ key ) ; } | Returns a cache key depending on if this was an OAuth signed request in which case it will use the non - signed url and access key to make this cache key unique per authenticated user else use the plain request url |
33,952 | public function maybeMoveParametersToBody ( ) { if ( $ this -> getRequestMethod ( ) == "POST" && empty ( $ this -> postBody ) ) { $ this -> setRequestHeaders ( array ( "content-type" => "application/x-www-form-urlencoded; charset=UTF-8" ) ) ; $ this -> setPostBody ( $ this -> buildQuery ( $ this -> queryParams ) ) ; $ ... | If we re POSTing and have no body to send we can send the query parameters in there which avoids length issues with longer query params . |
33,953 | protected function italic_tag_rule ( $ match ) { $ text = $ match [ 1 ] ; if ( strlen ( $ match [ 2 ] ) == 5 ) { $ text .= "''" ; } $ this -> rules ( $ text , array ( 'only' => array ( 'bold' ) ) ) ; if ( strpos ( $ text , "''" ) !== false ) { $ text = str_replace ( "''" , $ this -> protect ( "''" ) , $ text ) ; } retu... | Bold and italic similar to creole ... |
33,954 | public function get_profile_fields ( ) { global $ DB ; if ( ! $ fields = $ DB -> get_records ( 'user_info_field' , null , 'shortname' , 'id,shortname' ) ) { return null ; } $ res = array ( 0 => get_string ( 'anyfield' , 'filters' ) ) ; foreach ( $ fields as $ k => $ v ) { $ res [ $ k ] = $ v -> shortname ; } return $ r... | Returns an array of custom profile fields |
33,955 | public function compute_average_row ( $ label , \ core \ dml \ sql_join $ usersjoins ) { global $ DB ; list ( $ fields , $ from , $ where , $ params ) = $ this -> base_sql ( $ usersjoins ) ; $ record = $ DB -> get_record_sql ( " SELECT AVG(quizaouter.sumgrades) AS grade, COUNT(quizaouter.sumgrades) AS nu... | Calculate the average overall and question scores for a set of attempts at the quiz . |
33,956 | protected function add_average_row ( $ label , \ core \ dml \ sql_join $ usersjoins ) { $ averagerow = $ this -> compute_average_row ( $ label , $ usersjoins ) ; $ this -> add_data_keyed ( $ averagerow ) ; } | Add an average grade row for a set of users . |
33,957 | protected function format_average ( $ record , $ question = false ) { if ( is_null ( $ record -> grade ) ) { $ average = '-' ; } else if ( $ question ) { $ average = quiz_format_question_grade ( $ this -> quiz , $ record -> grade ) ; } else { $ average = quiz_format_grade ( $ this -> quiz , $ record -> grade ) ; } if (... | Format an entry in an average row . |
33,958 | protected function get_regraded_questions ( ) { global $ DB ; $ qubaids = $ this -> get_qubaids_condition ( ) ; $ regradedqs = $ DB -> get_records_select ( 'quiz_overview_regrades' , 'questionusageid ' . $ qubaids -> usage_id_in ( ) , $ qubaids -> usage_id_in_params ( ) ) ; return quiz_report_index_by_keys ( $ regraded... | Get all the questions in all the attempts being displayed that need regrading . |
33,959 | public function get_icon_name_map ( ) { if ( $ this -> map === [ ] ) { $ cache = \ cache :: make ( 'core' , 'fontawesomeiconmapping' ) ; $ this -> map = $ cache -> get ( 'mapping' ) ; if ( empty ( $ this -> map ) ) { $ this -> map = $ this -> get_core_icon_map ( ) ; $ callback = 'get_fontawesome_icon_map' ; if ( $ plug... | Overridable function to get a mapping of all icons . Default is to do no mapping . |
33,960 | public function openFileInZip ( $ zipFilePath , $ fileInsideZipPath ) { $ wasOpenSuccessful = false ; $ realPathURI = $ this -> getRealPathURIForFileInZip ( $ zipFilePath , $ fileInsideZipPath ) ; if ( $ this -> fileExistsWithinZip ( $ realPathURI ) ) { $ wasOpenSuccessful = $ this -> open ( $ realPathURI , null , LIBX... | Opens the XML Reader to read a file located inside a ZIP file . |
33,961 | protected function fileExistsWithinZip ( $ zipStreamURI ) { $ doesFileExists = false ; $ pattern = '/zip:\/\/([^#]+)#(.*)/' ; if ( preg_match ( $ pattern , $ zipStreamURI , $ matches ) ) { $ zipFilePath = $ matches [ 1 ] ; $ innerFilePath = $ matches [ 2 ] ; $ zip = new \ ZipArchive ( ) ; if ( $ zip -> open ( $ zipFile... | Returns whether the file at the given location exists |
33,962 | public function readUntilNodeFound ( $ nodeName ) { do { $ wasReadSuccessful = $ this -> read ( ) ; $ isNotPositionedOnStartingNode = ! $ this -> isPositionedOnStartingNode ( $ nodeName ) ; } while ( $ wasReadSuccessful && $ isNotPositionedOnStartingNode ) ; return $ wasReadSuccessful ; } | Read until the element with the given name is found or the end of the file . |
33,963 | protected function _pad ( $ text , $ ignore = false ) { $ blocksize = Horde_Crypt_Blowfish :: BLOCKSIZE ; $ padding = $ blocksize - ( strlen ( $ text ) % $ blocksize ) ; return ( $ ignore && ( $ padding == $ blocksize ) ) ? $ text : $ text . str_repeat ( chr ( $ padding ) , $ padding ) ; } | Pad text to match blocksize length . |
33,964 | public function registerStyle ( $ style ) { $ registeredStyle = parent :: registerStyle ( $ style ) ; $ this -> registerFill ( $ registeredStyle ) ; $ this -> registerBorder ( $ registeredStyle ) ; return $ registeredStyle ; } | XLSX specific operations on the registered styles |
33,965 | protected function registerFill ( $ style ) { $ styleId = $ style -> getId ( ) ; $ backgroundColor = $ style -> getBackgroundColor ( ) ; if ( $ backgroundColor ) { $ isBackgroundColorRegistered = isset ( $ this -> registeredFills [ $ backgroundColor ] ) ; if ( $ isBackgroundColorRegistered ) { $ registeredStyleId = $ t... | Register a fill definition |
33,966 | protected function registerBorder ( $ style ) { $ styleId = $ style -> getId ( ) ; if ( $ style -> shouldApplyBorder ( ) ) { $ border = $ style -> getBorder ( ) ; $ serializedBorder = serialize ( $ border ) ; $ isBorderAlreadyRegistered = isset ( $ this -> registeredBorders [ $ serializedBorder ] ) ; if ( $ isBorderAlr... | Register a border definition |
33,967 | public function install_licence_page ( ) { global $ CFG ; $ output = '' ; $ copyrightnotice = text_to_html ( get_string ( 'gpl3' ) ) ; $ copyrightnotice = str_replace ( 'target="_blank"' , 'onclick="this.target=\'_blank\'"' , $ copyrightnotice ) ; $ continue = new single_button ( new moodle_url ( $ this -> page -> url ... | Display the Do you acknowledge the terms of the GPL page . The first page during install . |
33,968 | public function upgrade_stale_php_files_page ( ) { $ output = '' ; $ output .= $ this -> header ( ) ; $ output .= $ this -> heading ( get_string ( 'upgradestalefiles' , 'admin' ) ) ; $ output .= $ this -> box_start ( 'generalbox' , 'notice' ) ; $ output .= format_text ( get_string ( 'upgradestalefilesinfo' , 'admin' , ... | Display page explaining proper upgrade process there can not be any PHP file leftovers ... |
33,969 | public function install_environment_page ( $ maturity , $ envstatus , $ environment_results , $ release ) { global $ CFG ; $ output = '' ; $ output .= $ this -> header ( ) ; $ output .= $ this -> maturity_warning ( $ maturity ) ; $ output .= $ this -> heading ( "Moodle $release" ) ; $ output .= $ this -> release_notes_... | Display the environment check page that is displayed during install . |
33,970 | public function unsatisfied_dependencies_page ( $ version , array $ failed , moodle_url $ reloadurl ) { $ output = '' ; $ output .= $ this -> header ( ) ; $ output .= $ this -> heading ( get_string ( 'pluginscheck' , 'admin' ) ) ; $ output .= $ this -> warning ( get_string ( 'pluginscheckfailed' , 'admin' , array ( 'pl... | Displays the list of plugins with unsatisfied dependencies |
33,971 | public function upgrade_confirm_page ( $ strnewversion , $ maturity , $ testsite ) { $ output = '' ; $ continueurl = new moodle_url ( $ this -> page -> url , array ( 'confirmupgrade' => 1 , 'cache' => 0 ) ) ; $ continue = new single_button ( $ continueurl , get_string ( 'continue' ) , 'get' ) ; $ cancelurl = new moodle... | Display the You are about to upgrade Moodle page . The first page during upgrade . |
33,972 | public function upgrade_environment_page ( $ release , $ envstatus , $ environment_results ) { global $ CFG ; $ output = '' ; $ output .= $ this -> header ( ) ; $ output .= $ this -> heading ( "Moodle $release" ) ; $ output .= $ this -> release_notes_link ( ) ; $ output .= $ this -> environment_check_table ( $ envstatu... | Display the environment page during the upgrade process . |
33,973 | public function upgrade_plugin_check_page ( core_plugin_manager $ pluginman , \ core \ update \ checker $ checker , $ version , $ showallplugins , $ reloadurl , $ continueurl ) { $ output = '' ; $ output .= $ this -> header ( ) ; $ output .= $ this -> box_start ( 'generalbox' , 'plugins-check-page' ) ; $ output .= html... | Display the upgrade page that lists all the plugins that require attention . |
33,974 | public function upgrade_confirm_abort_install_page ( array $ abortable , moodle_url $ continue ) { $ pluginman = core_plugin_manager :: instance ( ) ; if ( empty ( $ abortable ) ) { throw new moodle_exception ( 'err_no_plugin_install_abortable' , 'core_plugin' ) ; } $ out = $ this -> output -> header ( ) ; $ out .= $ t... | Display a page to confirm plugin installation cancelation . |
33,975 | public function check_for_updates_button ( \ core \ update \ checker $ checker , $ reloadurl ) { $ output = '' ; if ( $ checker -> enabled ( ) ) { $ output .= $ this -> container_start ( 'checkforupdates' ) ; $ output .= $ this -> single_button ( new moodle_url ( $ reloadurl , array ( 'fetchupdates' => 1 ) ) , get_stri... | Renders a button to fetch for available updates . |
33,976 | public function plugin_uninstall_confirm_page ( core_plugin_manager $ pluginman , \ core \ plugininfo \ base $ pluginfo , moodle_url $ continueurl , moodle_url $ cancelurl ) { $ output = '' ; $ pluginname = $ pluginman -> plugin_name ( $ pluginfo -> component ) ; $ confirm = '<p>' . get_string ( 'uninstallconfirm' , 'c... | Display a page to confirm the plugin uninstallation . |
33,977 | public function plugin_uninstall_results_removable_page ( core_plugin_manager $ pluginman , \ core \ plugininfo \ base $ pluginfo , progress_trace_buffer $ progress , moodle_url $ continueurl ) { $ output = '' ; $ pluginname = $ pluginman -> plugin_name ( $ pluginfo -> component ) ; $ this -> page -> set_pagelayout ( '... | Display a page with results of plugin uninstallation and offer removal of plugin files . |
33,978 | public function plugin_uninstall_results_page ( core_plugin_manager $ pluginman , \ core \ plugininfo \ base $ pluginfo , progress_trace_buffer $ progress ) { $ output = '' ; $ pluginname = $ pluginfo -> component ; $ output .= $ this -> output -> header ( ) ; $ output .= $ this -> output -> heading ( get_string ( 'uni... | Display a page with results of plugin uninstallation and inform about the need to remove plugin files manually . |
33,979 | protected function insecure_dataroot_warning ( $ insecuredataroot ) { global $ CFG ; if ( $ insecuredataroot == INSECURE_DATAROOT_WARNING ) { return $ this -> warning ( get_string ( 'datarootsecuritywarning' , 'admin' , $ CFG -> dataroot ) ) ; } else if ( $ insecuredataroot == INSECURE_DATAROOT_ERROR ) { return $ this ... | Render an appropriate message if dataroot is insecure . |
33,980 | protected function development_libs_directories_warning ( $ devlibdir ) { if ( $ devlibdir ) { $ moreinfo = new moodle_url ( '/report/security/index.php' ) ; $ warning = get_string ( 'devlibdirpresent' , 'core_admin' , [ 'moreinfourl' => $ moreinfo -> out ( ) ] ) ; return $ this -> warning ( $ warning , 'error' ) ; } e... | Render a warning that a directory with development libs is present . |
33,981 | public function cron_overdue_warning ( $ cronoverdue ) { global $ CFG ; if ( ! $ cronoverdue ) { return '' ; } if ( empty ( $ CFG -> cronclionly ) ) { $ url = new moodle_url ( '/admin/cron.php' ) ; if ( ! empty ( $ CFG -> cronremotepassword ) ) { $ url = new moodle_url ( '/admin/cron.php' , array ( 'password' => $ CFG ... | Render an appropriate message if cron has not been run recently . |
33,982 | public function events_handlers ( $ eventshandlers ) { if ( $ eventshandlers ) { $ components = '' ; foreach ( $ eventshandlers as $ eventhandler ) { $ components .= $ eventhandler -> component . ', ' ; } $ components = rtrim ( $ components , ', ' ) ; return $ this -> warning ( get_string ( 'eventshandlersinuse' , 'adm... | Renders events 1 API handlers warning . |
33,983 | public function maintenance_mode_warning ( $ maintenancemode ) { if ( ! $ maintenancemode ) { return '' ; } $ url = new moodle_url ( '/admin/settings.php' , array ( 'section' => 'maintenancemode' ) ) ; $ url = $ url -> out ( ) ; return $ this -> warning ( get_string ( 'sitemaintenancewarning2' , 'admin' , $ url ) ) ; } | Render an appropriate message if the site in in maintenance mode . |
33,984 | protected function moodle_copyright ( ) { global $ CFG ; $ copyrighttext = '<a href="http://moodle.org/">Moodle</a> ' . '<a href="http://docs.moodle.org/dev/Releases" title="' . $ CFG -> version . '">' . $ CFG -> release . '</a><br />' . 'Copyright © 1999 onwards, Martin Dougiamas<br />' . 'and <a href="http://moo... | Output the copyright notice . |
33,985 | protected function available_updates ( $ updates , $ fetch ) { $ updateinfo = '' ; $ someupdateavailable = false ; if ( is_array ( $ updates ) ) { if ( is_array ( $ updates [ 'core' ] ) ) { $ someupdateavailable = true ; $ updateinfo .= $ this -> heading ( get_string ( 'updateavailable' , 'core_admin' ) , 3 ) ; foreach... | Displays the info about available Moodle core and plugin updates |
33,986 | protected function registration_warning ( $ registered ) { if ( ! $ registered && site_is_public ( ) ) { if ( has_capability ( 'moodle/site:config' , context_system :: instance ( ) ) ) { $ registerbutton = $ this -> single_button ( new moodle_url ( '/admin/registration/index.php' ) , get_string ( 'register' , 'admin' )... | Display a warning about not being registered on Moodle . org if necesary . |
33,987 | protected function mobile_configuration_warning ( $ mobileconfigured ) { $ output = '' ; if ( ! $ mobileconfigured ) { $ settingslink = new moodle_url ( '/admin/settings.php' , [ 'section' => 'mobilesettings' ] ) ; $ configurebutton = $ this -> single_button ( $ settingslink , get_string ( 'enablemobilewebservice' , 'a... | Display a warning about the Mobile Web Services being disabled . |
33,988 | protected function forgotten_password_url_warning ( $ invalidforgottenpasswordurl ) { $ output = '' ; if ( $ invalidforgottenpasswordurl ) { $ settingslink = new moodle_url ( '/admin/settings.php' , [ 'section' => 'manageauths' ] ) ; $ configurebutton = $ this -> single_button ( $ settingslink , get_string ( 'check' , ... | Display a warning about the forgotten password URL not linking to a valid URL . |
33,989 | protected function moodle_available_update_info ( \ core \ update \ info $ updateinfo ) { $ boxclasses = 'moodleupdateinfo' ; $ info = array ( ) ; if ( isset ( $ updateinfo -> release ) ) { $ info [ ] = html_writer :: tag ( 'span' , get_string ( 'updateavailable_release' , 'core_admin' , $ updateinfo -> release ) , arr... | Helper method to render the information about the available Moodle update |
33,990 | protected function plugin_available_update_info ( core_plugin_manager $ pluginman , \ core \ update \ info $ updateinfo ) { $ boxclasses = 'pluginupdateinfo' ; $ info = array ( ) ; if ( isset ( $ updateinfo -> release ) ) { $ info [ ] = html_writer :: div ( get_string ( 'updateavailable_release' , 'core_plugin' , $ upd... | Helper method to render the information about the available plugin update |
33,991 | public function upgradekey_form_page ( $ url ) { $ output = '' ; $ output .= $ this -> header ( ) ; $ output .= $ this -> container_start ( 'upgradekeyreq' ) ; $ output .= $ this -> heading ( get_string ( 'upgradekeyreq' , 'core_admin' ) ) ; $ output .= html_writer :: start_tag ( 'form' , array ( 'method' => 'POST' , '... | Render a simple page for providing the upgrade key . |
33,992 | protected function legacy_log_store_writing_error ( ) { $ enabled = get_config ( 'logstore_legacy' , 'loglegacy' ) ; $ plugins = explode ( ',' , get_config ( 'tool_log' , 'enabled_stores' ) ) ; $ enabled = $ enabled && in_array ( 'logstore_legacy' , $ plugins ) ; if ( $ enabled ) { return $ this -> warning ( get_string... | Check to see if writing to the deprecated legacy log store is enabled . |
33,993 | public function col_select ( \ tool_monitor \ rule $ rule ) { global $ OUTPUT ; $ options = $ rule -> get_subscribe_options ( $ this -> courseid ) ; $ text = get_string ( 'subscribeto' , 'tool_monitor' , $ rule -> get_name ( $ this -> context ) ) ; if ( $ options instanceof \ single_select ) { $ options -> set_label ( ... | Generate content for select column . |
33,994 | public function get_user_courses_select ( $ choose = false ) { $ options = tool_monitor_get_user_courses ( ) ; if ( ! $ options ) { return false ; } $ selected = $ this -> courseid ; $ nothing = array ( ) ; if ( $ choose ) { $ selected = null ; $ nothing = array ( 'choosedots' ) ; } $ url = new \ moodle_url ( '/admin/t... | Gets a list of courses where the current user can subscribe to rules as a dropdown . |
33,995 | public static function get_placement_options ( $ default = null ) { $ values = [ 'top' => get_string ( 'above' , 'tool_usertours' ) , 'bottom' => get_string ( 'below' , 'tool_usertours' ) , 'left' => get_string ( 'left' , 'tool_usertours' ) , 'right' => get_string ( 'right' , 'tool_usertours' ) , ] ; if ( $ default ===... | Get the list of possible placement options . |
33,996 | function _generateId ( ) { if ( $ this -> getAttribute ( 'id' ) ) { return ; } $ id = $ this -> getName ( ) ; $ id = 'id_' . str_replace ( array ( 'qf_' , '[' , ']' ) , array ( '' , '_' , '' ) , $ id ) ; $ id = clean_param ( $ id , PARAM_ALPHANUMEXT ) ; $ this -> updateAttributes ( array ( 'id' => $ id ) ) ; } | Automatically generates and assigns an id attribute for the element . |
33,997 | public function begin_database_export ( $ version , $ release , $ timestamp , $ description ) { $ this -> feedback -> output ( get_string ( 'copyingtables' , 'core_dbtransfer' ) ) ; $ this -> importer -> begin_database_import ( $ version , $ timestamp , $ description ) ; } | Callback function . Calls importer s begin_database_import callback method . |
33,998 | public function begin_table_export ( xmldb_table $ table ) { $ this -> feedback -> output ( get_string ( 'copyingtable' , 'core_dbtransfer' , $ table -> getName ( ) ) , 1 ) ; $ this -> importer -> begin_table_import ( $ table -> getName ( ) , $ table -> getHash ( ) ) ; } | Callback function . Calls importer s begin_table_import callback method . |
33,999 | public function export_table_data ( xmldb_table $ table , $ data ) { $ this -> importer -> import_table_data ( $ table -> getName ( ) , $ data ) ; } | Callback function . Calls importer s import_table_data callback method . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.