You are here

function commons_create_first_group in Drupal Commons 7.3

Let the admin user create the first group as part of the installation process.

File

./commons.install, line 362
Install, update and uninstall functions for the Commons install profile.

Code

function commons_create_first_group() {
  $form['commons_first_group_explanation'] = array(
    '#markup' => '<h2>' . st('Create the first group in your new community.') . '</h2>' . st("Commons uses groups to collect community members and content related to a particular interest, working goal or geographic area."),
    '#weight' => -1,
  );
  $form['commons_fist_group_example'] = array(
    '#markup' => theme('image', array(
      'path' => 'profiles/commons/images/commons_group_description_sample.png',
      'alt' => 'Group description page example',
      'alt' => 'Group description example',
    )),
    '#weight' => 0,
  );
  $form['commons_first_group_title'] = array(
    '#type' => 'textfield',
    '#title' => st("Group name"),
    '#description' => st('For example: "Boston food lovers" or "Engineering team."'),
    '#required' => TRUE,
    '#default_value' => st('Engineering team'),
  );
  $form['commons_first_group_body'] = array(
    '#type' => 'textarea',
    '#title' => st('Group description'),
    '#description' => st("This text will appear on the group's homepage and helps new contributors to become familiar with the purpose of the group. You can always change this text or add another group later."),
    '#required' => TRUE,
    '#default_value' => st('The online home for our Engineering team'),
  );
  $form['commons_first_group_submit'] = array(
    '#type' => 'submit',
    '#value' => st('Save and continue'),
  );
  return $form;
}