public static function get_user_administration_options($courseids) {
        global $CFG;
        require_once($CFG->dirroot . '/course/lib.php');

        // Parameter validation.
        $params = self::validate_parameters(self::get_user_administration_options_parameters(), array('courseids' => $courseids));
        $courseoptions = array();

        list($courses, $warnings) = external_util::validate_courses($params['courseids'], array(), true);

        if (!empty($courses)) {
            foreach ($courses as $course) {
                $adminoptions = course_get_user_administration_options($course, $course->context);
                $options = array();
                foreach ($adminoptions as $name => $available) {
                    $options[] = array(
                        'name' => $name,
                        'available' => $available,
                    );
                }

                $courseoptions[] = array(
                    'id' => $course->id,
                    'options' => $options
                );
            }
        }

        $result = array(
            'courses' => $courseoptions,
            'warnings' => $warnings
        );
        return $result;
    }
public static function get_user_administration_options($courseids) {
        global $CFG;
        require_once($CFG->dirroot . '/course/lib.php');

        // Parameter validation.
        $params = self::validate_parameters(self::get_user_administration_options_parameters(), array('courseids' => $courseids));
        $courseoptions = array();

        list($courses, $warnings) = external_util::validate_courses($params['courseids'], array(), true);

        if (!empty($courses)) {
            foreach ($courses as $course) {
                $adminoptions = course_get_user_administration_options($course, $course->context);
                $options = array();
                foreach ($adminoptions as $name => $available) {
                    $options[] = array(
                        'name' => $name,
                        'available' => $available,
                    );
                }

                $courseoptions[] = array(
                    'id' => $course->id,
                    'options' => $options
                );
            }
        }

        $result = array(
            'courses' => $courseoptions,
            'warnings' => $warnings
        );
        return $result;
    }
public static function get_user_administration_options ( $ courseids ) { global $ CFG ; require_once ( $ CFG -> dirroot . '/course/lib.php' ) ; // Parameter validation. $ params = self :: validate_parameters ( self :: get_user_administration_options_parameters ( ) , array ( 'courseids' => $ courseids ) ) ; $ courseoptions = array ( ) ; list ( $ courses , $ warnings ) = external_util :: validate_courses ( $ params [ 'courseids' ] , array ( ) , true ) ; if ( ! empty ( $ courses ) ) { foreach ( $ courses as $ course ) { $ adminoptions = course_get_user_administration_options ( $ course , $ course -> context ) ; $ options = array ( ) ; foreach ( $ adminoptions as $ name => $ available ) { $ options [ ] = array ( 'name' => $ name , 'available' => $ available , ) ; } $ courseoptions [ ] = array ( 'id' => $ course -> id , 'options' => $ options ) ; } } $ result = array ( 'courses' => $ courseoptions , 'warnings' => $ warnings ) ; return $ result ; }
Return a list of administration options in a set of courses that are available or not for the current user.

@param array $courseids a list of course ids
@return array of warnings and the options availability
@since Moodle 3.2
@throws moodle_exception
Return a list of administration options in a set of courses that are available or not for the current user .