'fieldset', '#title' => t('CSW client settings'), '#collapsible' => TRUE, ); $form['settings']['csw_url'] = array( '#type' => 'textfield', '#title' => t('CSW service URL'), '#required'=>true, '#default_value' => (isset($configurations['csw_url'])?$configurations['csw_url']:''), '#description' => t('URL of the csw service without, the language argument and the name of the service like "csw", "csw-publication" or "xml.user.login"), eg: http://localhost/geonetwork/srv/ for http://localhost/geonetwork/srv/en/csw ') ); $form['settings']['GetRecordById_outputSchema'] = array( '#type' => 'textfield', '#title' => t('GetRecordById outputSchema'), '#required'=>false, '#default_value' => (isset($configurations['GetRecordById_outputSchema'])?$configurations['GetRecordById_outputSchema']:''), '#description' => t('Enter the output schema for the GetRecordById method (csw:IsoRecord, fra:IsoRecord, http://www.isotc211.org/2005/gmd ...)') ); $form['settings']['maxRecords'] = array( '#type' => 'textfield', '#title' => t('default maxRecords parameter'), '#required'=>false, '#default_value' => (isset($configurations['maxRecords'])?$configurations['maxRecords']:50), '#description' => t('Enter the default value for the maxRecords parameter)') ); $form['settings']['login'] = array( '#type' => 'textfield', '#title' => t('Service login'), '#required'=>false, '#default_value' => (isset($configurations['login'])?$configurations['login']:'admin'), '#description' => t('Only for csw transactional use (insert/update/delete)') ); $form['settings']['pwd'] = array( '#type' => 'textfield', '#title' => t('Service password'), '#required'=>false, '#default_value' => (isset($configurations['pwd'])?$configurations['pwd']:'admin'), '#description' => t('Only for csw transactional use (insert/update/delete)') ); $form['indicator'] = array( '#type' => 'fieldset', '#title' => t('Indicator'), '#collapsible' => TRUE, ); $form['indicator']['max_popularity'] = array( '#type' => 'textfield', '#title' => t('Max item number for popularity'), '#required'=>false, '#default_value' => (isset($configurations['max_popularity'])?$configurations['max_popularity']:''), '#description' => t('Enter the max number of result for a popularity request. Let blank for use the default value of CSW server.') ); $form['indicator']['max_latest'] = array( '#type' => 'textfield', '#title' => t('Max item number for latest'), '#required'=>false, '#default_value' => (isset($configurations['max_latest'])?$configurations['max_latest']:''), '#description' => t('Enter the max number of result for a latest issued sheet request. Let blank for use the default value of CSW server.') ); $form['indicator']['rss_latest'] = array( '#type' => 'textfield', '#title' => t('RSS service for latest'), '#required'=>false, '#default_value' => (isset($configurations['rss_latest'])?$configurations['rss_latest']:''), '#description' => t('URL of the RSS service') ); $form['buttons']['submit'] = array('#type' => 'submit', '#value' => t('Save configuration') ); $form['#validate'][] = 'csw_client_admin_settings_validate'; $form['#submit'][] = 'csw_client_admin_settings_submit'; $form['#theme'] = 'csw_client_settings_form'; return $form; } //fonction de validation du formulaire de configuration du module glossaire_auto function csw_client_admin_settings_validate($form, &$form_state) { //DO nothing... } //fonction de validation du formulaire de configuration du module glossaire_auto function csw_client_admin_settings_submit($form, &$form_state) { $configurations = csw_client_get_conf(); $configurations = array( 'csw_url' => $form_state['values']['csw_url'], 'GetRecordById_outputSchema' => $form_state['values']['GetRecordById_outputSchema'], 'maxRecords' => $form_state['values']['maxRecords'], 'max_popularity' => $form_state['values']['max_popularity'], 'rss_latest' => $form_state['values']['rss_latest'], 'max_latest' => $form_state['values']['max_latest'], 'login' => $form_state['values']['login'], 'pwd' => $form_state['values']['pwd'], ); csw_client_set_conf($configurations); }