GauthSettingsForm.php in Google Auth 8
File
src/Form/GauthSettingsForm.php
View source
<?php
namespace Drupal\gauth\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
class GauthSettingsForm extends FormBase {
public function getFormId() {
return 'gauth_settings';
}
public function submitForm(array &$form, FormStateInterface $form_state) {
_gauth_read_scope_info();
}
public function buildForm(array $form, FormStateInterface $form_state) {
$form['gauth_settings']['#markup'] = 'Settings form for Gauth. Manage field settings here.<br/><br/>';
$form['gauth_intro']['#markup'] = "Gauth tries to detect all supported services and scopes from the library installed. <br/> If you don't find your desired class/service listed or you have updated library you need to flush cache or hit 'Scan library' button, to see them here.<br/>";
$form['submit'] = [
'#type' => 'submit',
'#value' => t('Scan Library'),
];
$names = \Drupal::config('gauth.google_api_services')
->get('gauth_google_api_services');
$form['gauth_services'] = [
'#theme' => 'item_list',
'#list_type' => 'ol',
'#title' => 'The supported services are:',
'#items' => $names,
];
return $form;
}
}