You are here

function og_access_settings in Organic groups 6

Same name and namespace in other branches
  1. 5.8 og_access.module \og_access_settings()
  2. 5 og_access.module \og_access_settings()
  3. 5.3 og_access.module \og_access_settings()
  4. 5.7 og_access.module \og_access_settings()
  5. 6.2 modules/og_access/og_access.module \og_access_settings()
1 string reference to 'og_access_settings'
og_access_menu in modules/og_access/og_access.module

File

modules/og_access/og_access.module, line 26

Code

function og_access_settings() {
  drupal_add_js(drupal_get_path('module', 'og_access') . '/og_access.js');

  // load the form javascript to handle private groups / node visibility conflicts in the og access settings form.
  $options = array(
    t('Visible only within the targeted groups.'),
    t('Visible within the targeted groups and on other pages.'),
    t('Visibility chosen by author/editor using a checkbox on the posting form. Checkbox defaults to <em>public</em>.'),
    t('Visibility chosen by author/editor using a checkbox on the posting form. Checkbox defaults to <em>private</em>.'),
  );
  $form['og_visibility'] = array(
    '#type' => 'radios',
    '#title' => t('Visibility of posts'),
    '#default_value' => variable_get('og_visibility', 0),
    '#description' => t('Determine how broadly available a given post should be when it is affiliated with a group. OG admins always see the checkbox for making a post public. Note that changing this setting has no effect on existing posts. Re-save those posts to acquire this new setting. If the setting you want is disabled here, check the settings under <em>Private Groups</em> setting below. You cannot set node visibility to always be public if private groups are set to always on and vice versa.'),
    '#options' => $options,
  );

  // private groups control
  $options = array(
    t('New group home pages and default audience are always public.'),
    t('New group home pages and default audience are always private.'),
    t('Group administrator chooses whether her group homepage and audience are private or not. Defaults to <em>private</em>.'),
    t('Group administrator chooses whether her group homepage and audience are private or not. Defaults to <em>public</em>.'),
  );
  $form['og_private_groups'] = array(
    '#type' => 'radios',
    '#title' => t('Private groups'),
    '#options' => $options,
    '#default_value' => variable_get('og_private_groups', OG_PRIVATE_GROUPS_CHOOSE_FALSE),
    '#description' => '<p>' . t("A private group's group home page cannot be seen by non-members, and new posts created in the group will default to being private. This setting controls what private groups options can be used when creating a new group or editing an existing group. If you select one of the <em>group administrator chooses</em> options then it will be up to group admins whether their new groups are private or not, with the default you specify here.") . '</p><p>' . t('Note that the privacy of all <em>content</em> in the group is determined as each node is created or edited, according to the <em>Visibility of Posts</em> setting on this page. Note also that changing this setting only affects the default for new groups being created, not the privacy of any existing groups! To change those you must edit the groups and their individual content nodes directly. If the setting you want is disabled here, check <em>Visibility of Posts</em> above. You cannot choose to only have private groups if node visibility is set to be always public, and vice versa.') . '</p>',
  );
  return system_settings_form($form);
}