initial version of fulcrm_apiv2
This commit is contained in:
46
fulcrm_apiv2.admin.inc
Normal file
46
fulcrm_apiv2.admin.inc
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
function fulcrm_apiv2_admin_form_submit( $form, &$form_state ) {
|
||||
variable_set( 'fulcrm_apiv2_user', $form_state[ 'values' ][ 'apiuser' ] );
|
||||
variable_set( 'fulcrm_apiv2_key', $form_state[ 'values' ][ 'apikey' ] );
|
||||
variable_set( 'fulcrm_apiv2_client_id', $form_state[ 'values' ][ 'clientid' ] );
|
||||
}
|
||||
|
||||
function fulcrm_apiv2_admin_form( $form, &$form_state ) {
|
||||
$form[ 'title' ] = array( '#type' => 'item',
|
||||
'#title' => 'fulcrm APIv2 Settings',
|
||||
'#description' => '',
|
||||
);
|
||||
|
||||
$form[ 'api' ] = array( '#type' => 'fieldset',
|
||||
'#title' => 'fulcrm.org APIv2 Credentials',
|
||||
);
|
||||
|
||||
$form[ 'api' ][ 'apiuser' ] = array( '#type' => 'textfield',
|
||||
'#title' => 'API Username',
|
||||
'#description' => 'fulcrm.org APIv2 username',
|
||||
'#default_value' => variable_get( 'fulcrm_apiv2_user', '' ),
|
||||
);
|
||||
|
||||
$form[ 'api' ][ 'apikey' ] = array( '#type' => 'textfield',
|
||||
'#title' => 'API Key',
|
||||
'#description' => 'fulcrm.org APIv2 key',
|
||||
'#default_value' => variable_get( 'fulcrm_apiv2_key', '' ),
|
||||
);
|
||||
$form[ 'api' ][ 'clientid' ] = array( '#type' => 'textfield',
|
||||
'#title' => 'Client ID',
|
||||
'#description' => 'fulcrm.org APIv2 client ID',
|
||||
'#default_value' => variable_get( 'fulcrm_apiv2_client_id', '' ),
|
||||
);
|
||||
|
||||
$form[ 'actions' ] = array( '#type' => 'actions' );
|
||||
$form[ 'actions' ][ 'save' ] = array( '#type' => 'submit',
|
||||
'#value' => t('Save'),
|
||||
'#submit' => array( 'fulcrm_apiv2_admin_form_submit' ),
|
||||
);
|
||||
return $form;
|
||||
}
|
||||
|
||||
function fulcrm_apiv2_admin() {
|
||||
return drupal_get_form( 'fulcrm_apiv2_admin_form' );
|
||||
}
|
Reference in New Issue
Block a user