You are here

function node_sexybookmarks_form_alter_alter in Share Buttons, Related Posts, Content Analytics - Shareaholic 7.2

Same name and namespace in other branches
  1. 7 includes/node.inc \node_sexybookmarks_form_alter_alter()

Implements hook_sexybookmarks_form_alter_alter() on behalf of node.module.

File

includes/node.inc, line 10
Node module integration.

Code

function node_sexybookmarks_form_alter_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'node_type_form') {
    $form['sexybookmarks'] = array(
      '#type' => 'fieldset',
      '#title' => t('SexyBookmarks settings'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#group' => 'additional_settings',
      '#attached' => array(
        'js' => array(
          drupal_get_path('module', 'sexybookmarks') . '/scripts/node.js',
        ),
      ),
    );
    $options = array();
    ctools_include('export');
    foreach (ctools_export_crud_load_all('sexybookmarks_profiles') as $profile) {
      if (empty($profile->disabled)) {
        $options[$profile->name] = $profile->name;
      }
    }
    $form['sexybookmarks']['node_sexybookmarks_profile'] = array(
      '#type' => 'select',
      '#title' => t('Profile'),
      '#empty_value' => '',
      '#options' => $options,
      '#default_value' => variable_get("node_sexybookmarks_profile_{$form['#node_type']->type}", 'default'),
    );
    $form['#submit'][] = 'sexybookmarks_node_type_form_submit';
  }
}