GoogleApiClientSettingsForm.php in Google API PHP Client 8.2
File
src/Form/GoogleApiClientSettingsForm.php
View source
<?php
namespace Drupal\google_api_client\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
class GoogleApiClientSettingsForm extends FormBase {
public function getFormId() {
return 'google_api_client_settings';
}
public function submitForm(array &$form, FormStateInterface $form_state) {
_google_api_client_read_scope_info();
}
public function buildForm(array $form, FormStateInterface $form_state) {
$form['google_api_client_settings']['#markup'] = 'Settings form for GoogleApiClient. Manage field settings here.<br/><br/>';
$form['google_api_client_intro']['#markup'] = "GoogleApiClient 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('google_api_client.google_api_services')
->get('google_api_client_google_api_services');
$form['google_api_client_services'] = [
'#theme' => 'item_list',
'#list_type' => 'ol',
'#title' => 'The supported services are:',
'#items' => $names,
];
return $form;
}
}