original_string: public static function get_calendar_type() {
          global $CFG, $USER, $SESSION, $COURSE;
  
          // Course calendartype can override all other settings for this page.
          if (!empty($COURSE->id) and $COURSE->id != SITEID and !empty($COURSE->calendartype)) {
              $return = $COURSE->calendartype;
          } else if (!empty($SESSION->calendartype)) { // Session calendartype can override other settings.
              $return = $SESSION->calendartype;
          } else if (!empty($USER->calendartype)) {
              $return = $USER->calendartype;
          } else if (!empty($CFG->calendartype)) {
              $return = $CFG->calendartype;
          } else {
              $return = 'gregorian';
          }
  
          return $return;
      }
code: public static function get_calendar_type() {
          global $CFG, $USER, $SESSION, $COURSE;
  
          // Course calendartype can override all other settings for this page.
          if (!empty($COURSE->id) and $COURSE->id != SITEID and !empty($COURSE->calendartype)) {
              $return = $COURSE->calendartype;
          } else if (!empty($SESSION->calendartype)) { // Session calendartype can override other settings.
              $return = $SESSION->calendartype;
          } else if (!empty($USER->calendartype)) {
              $return = $USER->calendartype;
          } else if (!empty($CFG->calendartype)) {
              $return = $CFG->calendartype;
          } else {
              $return = 'gregorian';
          }
  
          return $return;
      }
code_tokens: public static function get_calendar_type ( ) { global $ CFG , $ USER , $ SESSION , $ COURSE ; // Course calendartype can override all other settings for this page. if ( ! empty ( $ COURSE -> id ) and $ COURSE -> id != SITEID and ! empty ( $ COURSE -> calendartype ) ) { $ return = $ COURSE -> calendartype ; } else if ( ! empty ( $ SESSION -> calendartype ) ) { // Session calendartype can override other settings. $ return = $ SESSION -> calendartype ; } else if ( ! empty ( $ USER -> calendartype ) ) { $ return = $ USER -> calendartype ; } else if ( ! empty ( $ CFG -> calendartype ) ) { $ return = $ CFG -> calendartype ; } else { $ return = 'gregorian' ; } return $ return ; }
docstring: Returns the current calendar type in use.
  
  @return string the current calendar type being used
docstring_tokens: Returns the current calendar type in use .