original_string: public static function is_defined($forguests = false) {
          global $CFG;
          if (!empty($CFG->sitepolicyhandler)) {
              // This handler can also be used as a fallback in case of invalid $CFG->sitepolicyhandler,
              // in this case assume that no site policy is set.
              return false;
          }
          if (!$forguests) {
              return !empty($CFG->sitepolicy);
          } else {
              return !empty($CFG->sitepolicyguest);
          }
      }
code: public static function is_defined($forguests = false) {
          global $CFG;
          if (!empty($CFG->sitepolicyhandler)) {
              // This handler can also be used as a fallback in case of invalid $CFG->sitepolicyhandler,
              // in this case assume that no site policy is set.
              return false;
          }
          if (!$forguests) {
              return !empty($CFG->sitepolicy);
          } else {
              return !empty($CFG->sitepolicyguest);
          }
      }
code_tokens: public static function is_defined ( $ forguests = false ) { global $ CFG ; if ( ! empty ( $ CFG -> sitepolicyhandler ) ) { // This handler can also be used as a fallback in case of invalid $CFG->sitepolicyhandler, // in this case assume that no site policy is set. return false ; } if ( ! $ forguests ) { return ! empty ( $ CFG -> sitepolicy ) ; } else { return ! empty ( $ CFG -> sitepolicyguest ) ; } }
docstring: Checks if the site has site policy defined
  
  @param bool $forguests
  @return bool
docstring_tokens: Checks if the site has site policy defined