You are here

public function SocialContentFlickr::instanceSettingsForm in Social Content 7.2

Instance settings form.

Return value

array Any instance settings that will be included on all instance forms for the current global.

Overrides SocialContent::instanceSettingsForm

File

modules/flickr/social_content_flickr.class.inc, line 104
Social Content Flickr class.

Class

SocialContentFlickr
@file Social Content Flickr class.

Code

public function instanceSettingsForm() {
  $settings = $this->settings['instance'];
  $form = parent::instanceSettingsForm($settings);
  $form['type'] = array(
    '#type' => 'select',
    '#title' => t('Import'),
    '#options' => $this
      ->getImportTypes(),
    '#description' => t('What should be imported.'),
    '#default_value' => isset($settings['type']) ? $settings['type'] : NULL,
    '#required' => TRUE,
    '#attributes' => array(
      'class' => array(
        'social-content-flickr-type',
      ),
    ),
  );
  $form['user_id'] = array(
    '#type' => 'textfield',
    '#title' => t('Flickr User ID'),
    '#description' => t("The Flickr User ID to pull photos from his photostream. E.g. '21195291@N06'. Use !link to get it.", array(
      '!link' => "<a target='_blank' href='http://idgettr.com/'>idGettr</a>",
    )),
    '#default_value' => isset($settings['user_id']) ? $settings['user_id'] : NULL,
    '#states' => array(
      'visible' => array(
        '.social-content-flickr-type' => array(
          'value' => 'user',
        ),
      ),
    ),
  );
  $form['group_id'] = array(
    '#type' => 'textfield',
    '#title' => t('Flickr Group ID'),
    '#description' => t("The Flickr Group ID to pull photos from. E.g. '20029208@N00'. Use !link to get it.", array(
      '!link' => "<a target='_blank' href='http://idgettr.com/'>idGettr</a>",
    )),
    '#default_value' => isset($settings['group_id']) ? $settings['group_id'] : NULL,
    '#states' => array(
      'visible' => array(
        '.social-content-flickr-type' => array(
          'value' => 'group',
        ),
      ),
    ),
  );
  return $form;
}