function google_qr_code_admin_settings_form in Google QR Code Generator 7
Creation of admin settings form for callback.
1 string reference to 'google_qr_code_admin_settings_form'
- google_qr_code_menu in ./
google_qr_code.module - Google_qr_code Implements hook_menu().
File
- ./
google_qr_code.module, line 88 - Provides block using Google Charts to render QR code.
Code
function google_qr_code_admin_settings_form($form, &$form_state) {
$form['google_qr_code_settings'] = array(
'#type' => 'fieldset',
'#title' => t('Google QR Code Configuration'),
'#description' => t('Configure the Google QR Code Generator Here:'),
);
$form['google_qr_code_settings']['google_qr_code_when_show'] = array(
'#type' => 'select',
'#title' => t('When to render QR COde'),
'#options' => array(
"on_pageload" => t('On Page Load'),
"on_click" => t('On Click'),
),
'#default_value' => variable_get('google_qr_code_when_show', "on_pageload"),
'#required' => FALSE,
'#description' => t('Choose whether you want the QR code to load
everytime the page loads (jQuery code) or only get the QR code when
generate text in block is clicked.'),
);
$form['google_qr_code_image_settings'] = array(
'#type' => 'fieldset',
'#title' => t('Google QR Code Image Settings'),
'#description' => t('Configure QR code width and height here. There is a
maximum size of 1000 pixels for any single dimension, and a total size
of 300,000 pixels'),
);
$form['google_qr_code_image_settings']['google_qr_code_height'] = array(
'#type' => 'textfield',
'#title' => t('QR Code Height'),
'#default_value' => variable_get('google_qr_code_height', '250'),
'#size' => 40,
'#maxlength' => 255,
'#required' => TRUE,
'#description' => t('Enter the QR Code Height'),
'#element_validate' => array(
'_google_qr_code_max_single_dimension',
),
);
$form['google_qr_code_image_settings']['google_qr_code_width'] = array(
'#type' => 'textfield',
'#title' => t('QR Code Width'),
'#default_value' => variable_get('google_qr_code_width', '250'),
'#size' => 40,
'#maxlength' => 255,
'#required' => TRUE,
'#description' => t('Enter the QR Code Width'),
'#element_validate' => array(
'_google_qr_code_max_single_dimension',
),
);
$form['#validate'][] = 'google_qr_code_max_total_px';
return system_settings_form($form);
}