You are here

function yandex_metrics_block_configure in Yandex.Metrics 7

Implements hook_block_configure().

File

./yandex_metrics.module, line 121
The main code of Yandex.Metrics module.

Code

function yandex_metrics_block_configure($delta = '') {
  if ($delta == 'popular_content') {
    $options = array(
      'day' => t('Today'),
      'yesterday' => t('Yesterday'),
      'week' => t('Week'),
      'month' => t('Month'),
    );
    $form['yandex_metrics_popular_content_date_period'] = array(
      '#type' => 'select',
      '#title' => t('Select date period'),
      '#description' => t('This date period will be used to filter popular content.'),
      '#options' => $options,
      '#default_value' => variable_get('yandex_metrics_popular_content_date_period', 'week'),
    );
    $form['yandex_metrics_popular_content_links_count'] = array(
      '#type' => 'select',
      '#title' => t('Select count of links to show'),
      '#description' => t('The count of links that shown in the block.'),
      '#options' => drupal_map_assoc(array(
        5,
        10,
        15,
      )),
      '#default_value' => variable_get('yandex_metrics_popular_content_links_count', 10),
    );
    return $form;
  }
}