示例#1
0
 /**
  * Return an XHTML string for the setting
  * @return string Returns an XHTML string
  */
 public function output_html($data, $query = '')
 {
     global $CFG;
     $a = new \stdClass();
     $a->callbackurl = \local_msaccount\client::callback_url()->out(false);
     $settinghtml = get_string('settingredirect', 'local_msaccount', $a);
     $settinghtml .= '<input type="hidden" id="' . $this->get_id() . '" name="' . $this->get_full_name() . '" value="0" />';
     return format_admin_setting($this, $this->visiblename, $settinghtml, $this->description);
 }
示例#2
0
 /**
  * Check whether we have API access.
  *
  * @return bool Whether API access is active.
  */
 public function check_api()
 {
     if (!empty($this->onenoteapi)) {
         if (class_exists('\\local_onenote\\api\\o365') && $this->onenoteapi instanceof \local_onenote\api\o365) {
             if (\local_o365\utils::is_configured() === true) {
                 return true;
             }
         }
         if (class_exists('\\local_onenote\\api\\msaccount') && $this->onenoteapi instanceof \local_onenote\api\msaccount) {
             if (\local_msaccount\client::is_configured() === true) {
                 return true;
             }
         }
     }
     return false;
 }