function easychart_admin_templates in Easychart 7.3
Returns a form with templates.
1 string reference to 'easychart_admin_templates'
File
- ./
easychart.admin.inc, line 116 - Easychart admin pages.
Code
function easychart_admin_templates($form, $form_state) {
if (!isset($form_state['storage']['confirm'])) {
$form = array();
libraries_load('highcharts');
libraries_load('easychart');
drupal_add_js(drupal_get_path('module', 'easychart') . '/js/easychart.admin.js');
drupal_add_css(drupal_get_path('module', 'easychart') . '/css/easychart.admin.css');
$form['easychart_templates'] = array(
'#type' => 'textarea',
'#title' => t('Available templates'),
'#default_value' => variable_get('easychart_templates', ''),
'#description' => t("These templates will be selectable in the Easychart interface when creating/editing a chart."),
'#attributes' => array(
'class' => array(
'easychart-templates',
),
),
'#rows' => 15,
);
// Add the reset button.
$form['actions']['reset'] = array(
'#type' => 'submit',
'#value' => t('Reset to defaults'),
'#submit' => array(
'easychart_admin_templates_submit',
),
'#limit_validation_errors' => array(),
'#weight' => 100,
);
}
else {
return confirm_form($form, t('Are you sure you want to reset the templates to their default values?'), current_path());
}
return system_settings_form($form);
}