You are here

function mediafront_block_configure in MediaFront 7

Same name and namespace in other branches
  1. 6.2 mediafront.module \mediafront_block_configure()
  2. 6 mediafront.module \mediafront_block_configure()

Implementation of hook_block_configure

File

./mediafront.module, line 476

Code

function mediafront_block_configure($delta = '') {
  $form = array();
  if ($delta == 'mediaplayer') {
    $form['mediafront'] = array(
      '#type' => 'fieldset',
      '#title' => 'MediaFront Settings',
      '#description' => 'This is a special media player block that will allow you to place a media player preset within any block region on your website.  In addition, you can link to any view within that page to act as the playlist for this media player.',
    );
    $form['mediafront']['mediafront_block_preset'] = mediafront_preset_select_form(array(
      'mediafront_preset' => variable_get('mediafront_block_preset', ''),
    ));

    // Get a list of all views
    $views = views_get_enabled_views();
    $options = array(
      '' => 'none',
    );
    foreach ($views as $view) {
      $options[$view->name] = $view->name;
    }

    // Link this block to a view display.
    $form['mediafront']['mediafront_block_playlist'] = array(
      '#type' => 'select',
      '#multiple' => TRUE,
      '#title' => 'Link to View',
      '#description' => 'Select the view you would like to link to this media player.  This view must be on the same page as this player to be linked, and must include a visible Content Id (node Id) within the fields of the view display to work as expected.',
      '#options' => $options,
      '#default_value' => variable_get('mediafront_block_playlist', ''),
    );

    // Link this block to a view display.
    $form['mediafront']['mediafront_block_playlist_exclude'] = array(
      '#type' => 'textarea',
      '#title' => 'Exclude View Display',
      '#description' => 'Provide any displays you would like to exclude from the selected view above.',
      '#default_value' => implode("\n", variable_get('mediafront_block_playlist_exclude', array())),
    );
  }
  return $form;
}