Save variable in system setting form

WE HAVE MOVED!

Please visit our new Drupal Website at https://www.xenyo.com我們的新網頁設計公司網頁.

function weibo_autopost_admin_config() {
  $form['global'] = array(
    '#type' => 'fieldset',
    '#title' => t('Global settings'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
 
  $form['global']['weibo_autopost_enable'] = array(
    '#type' => 'checkbox',
    '#title' => t('Default enable Weibo AutoPost in node form.'),
    '#default_value' => variable_get('weibo_autopost_enable', 1), /* variable name must be sane as the element name, otherwise cannot save automatically.
  );
  return system_settings_form($form);
}
Help Share this Article