You are here

public function SocialContentYoutube::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/youtube/social_content_youtube.class.inc, line 105
Social Content Youtube class.

Class

SocialContentYoutube
@file Social Content Youtube class.

Code

public function instanceSettingsForm() {
  $settings = $this->settings['instance'];
  $form = parent::instanceSettingsForm($settings);
  $form['youtube_username'] = array(
    '#type' => 'textfield',
    '#title' => t('Youtube User Name'),
    '#description' => t("E.g. 'NationalGeographic' for http://youtube.com/user/NationalGeographic"),
    '#default_value' => isset($settings['youtube_username']) ? $settings['youtube_username'] : NULL,
    '#required' => TRUE,
  );
  $form['youtube_id'] = array(
    '#type' => 'textfield',
    '#title' => t('Youtube Channel ID'),
    '#description' => t('This field is generated automatically if you enter the Youtube User Name.<br>You can also capture it, see <a href="@url" target="_blank">@url</a> to find the channel ID.', array(
      '@url' => 'https://stackoverflow.com/a/16326307/872050',
    )),
    '#default_value' => isset($settings['youtube_id']) ? $settings['youtube_id'] : NULL,
  );
  return $form;
}