You are here

function vkxp_admin_main_settings in VK CrossPoster 7

Same name and namespace in other branches
  1. 6.3 vkxp.admin.inc \vkxp_admin_main_settings()
  2. 6 vkxp.admin.inc \vkxp_admin_main_settings()
  3. 6.2 vkxp.admin.inc \vkxp_admin_main_settings()
  4. 7.2 vkxp.admin.inc \vkxp_admin_main_settings()

Page callback. Return form with VKXP main settings.

1 string reference to 'vkxp_admin_main_settings'
vkxp_menu in ./vkxp.module
Implements hook_menu().

File

./vkxp.admin.inc, line 12
Contains vkxp settings forms.

Code

function vkxp_admin_main_settings($form, &$form_state) {

  // Application settings.
  $form['vkxp_application'] = array(
    '#type' => 'fieldset',
    '#title' => t('Application settings'),
    '#collapsible' => TRUE,
    '#description' => t('Note: You have to !create standalone vkontakte application to make this module work.', array(
      '!create' => l(t('create'), 'http://vk.com/editapp?act=create', array(
        'attributes' => array(
          'target' => '_blank',
        ),
      )),
    )),
  );
  $form['vkxp_application']['vkxp_app_id'] = array(
    '#type' => 'textfield',
    '#title' => t('Application ID'),
    '#required' => TRUE,
    '#default_value' => variable_get('vkxp_app_id', ''),
    '#description' => t('ID of vk application.'),
  );
  $form['vkxp_application']['vkxp_app_secret'] = array(
    '#type' => 'textfield',
    '#title' => t('Application secret code'),
    '#required' => TRUE,
    '#default_value' => variable_get('vkxp_app_secret', ''),
    '#description' => t('Secret code of vk application.'),
  );

  // Owner settings.
  $form['vkxp_owner'] = array(
    '#type' => 'fieldset',
    '#title' => t('Owner settings'),
    '#description' => t('Set user or group to which data will be transferred.'),
    '#collapsible' => TRUE,
  );
  $form['vkxp_owner']['vkxp_group_id'] = array(
    '#type' => 'textfield',
    '#title' => t('Owner ID'),
    '#required' => TRUE,
    '#default_value' => variable_get('vkxp_group_id', ''),
    '#description' => t('User ID or Group ID.'),
  );
  $form['vkxp_owner']['vkxp_wall_owner'] = array(
    '#type' => 'select',
    '#title' => t('Select owner type'),
    '#options' => array(
      'group' => t('Group'),
      'user' => t('User'),
    ),
    '#default_value' => variable_get('vkxp_wall_owner', 'group'),
    '#description' => t('Who owns the above ID.'),
  );

  // Additional settings.
  $form['vkxp_additional'] = array(
    '#type' => 'fieldset',
    '#title' => t('Additional settings'),
    '#collapsible' => TRUE,
  );
  $form['vkxp_additional']['vkxp_enabled_default'] = array(
    '#type' => 'checkbox',
    '#title' => t('Checkbox "Post this node to vk.com" are checked by default'),
    '#default_value' => variable_get('vkxp_enabled_default', 0),
    '#description' => t('Check this if you want checkbox "Post this node to vk.com" in node forms was checked by default.'),
  );
  $form['vkxp_additional']['vkxp_official'] = array(
    '#type' => 'checkbox',
    '#title' => t('Write from group name'),
    '#default_value' => variable_get('vkxp_official', 1),
    '#description' => t('Check this if you want to post messages from group name.'),
  );
  $form['vkxp_additional']['vkxp_add_link'] = array(
    '#type' => 'checkbox',
    '#title' => t('Add link on wall to posted page'),
    '#default_value' => variable_get('vkxp_add_link', 0),
    '#description' => t('Check this if you want to post node url on vk wall.'),
  );

  // Submitters.
  $form['actions'] = array(
    '#type' => 'action',
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save settings'),
  );
  $form['actions']['reset'] = array(
    '#type' => 'submit',
    '#value' => t('Recieve new access token'),
  );
  return $form;
}