You are here

function _vkxp_process_node_form in VK CrossPoster 6

Same name and namespace in other branches
  1. 6.3 vkxp.forms.inc \_vkxp_process_node_form()
  2. 6.2 vkxp.module \_vkxp_process_node_form()
  3. 7.2 vkxp.forms.inc \_vkxp_process_node_form()
  4. 7 vkxp.module \_vkxp_process_node_form()

Add vkxp fieldset to node forms

Parameters

$form: node form:

1 call to _vkxp_process_node_form()
vkxp_form_alter in ./vkxp.module
Implementation of hook_form_alter()

File

./vkxp.module, line 81

Code

function _vkxp_process_node_form(&$form) {
  if (user_access('post to vkontakte')) {
    $form['vkxp'] = array(
      '#type' => 'fieldset',
      '#title' => t('VKontakte crossposter'),
      '#collapsible' => TRUE,
      '#collapsed' => FALSE,
      '#weight' => 0,
    );
    $form['vkxp']['vkxp_post_this_node'] = array(
      '#type' => 'checkbox',
      '#title' => t('Post this node to vkontakte.ru'),
      '#default_value' => variable_get('vkxp_enabled_default', 0),
    );
    if (!function_exists('curl_init')) {
      $form['vkxp']['vkxp_post_this_node']['#disabled'] = TRUE;
      $form['vkxp']['vkxp_post_this_node']['#value'] = 0;
      $form['vkxp']['vkxp_post_this_node']['#description'] = t("You can't crosspost nodes until cURL library is not installed on your server");
    }
  }
}