コード例 #1
0
ファイル: Block.php プロジェクト: Wylbur/gj
 /**
  * {@inheritdoc}
  */
 public function optionsSummary(&$categories, &$options)
 {
     parent::optionsSummary($categories, $options);
     $filtered_allow = array_filter($this->getOption('allow'));
     $filter_options = ['items_per_page' => $this->t('Items per page'), 'offset' => $this->t('Pager offset'), 'pager' => $this->t('Pager type'), 'hide_fields' => $this->t('Hide fields'), 'sort_fields' => $this->t('Reorder fields'), 'disable_filters' => $this->t('Disable filters'), 'configure_sorts' => $this->t('Configure sorts')];
     $filter_intersect = array_intersect_key($filter_options, $filtered_allow);
     $options['allow'] = array('category' => 'block', 'title' => $this->t('Allow settings'), 'value' => empty($filtered_allow) ? $this->t('None') : implode(', ', $filter_intersect));
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function optionsSummary(&$categories, &$options)
 {
     parent::optionsSummary($categories, $options);
     $options['linked_path'] = array('category' => 'block', 'title' => $this->t('Search page path'), 'value' => $this->getOption('linked_path') ? $this->getOption('linked_path') : $this->t('Use current path'));
     $field_options = $this->getFieldOptions();
     $options['facet_field'] = array('category' => 'block', 'title' => $this->t('Facet field'), 'value' => $this->getOption('facet_field') ? $field_options[$this->getOption('facet_field')] : $this->t('None'));
     $options['hide_block'] = array('category' => 'block', 'title' => $this->t('Hide block'), 'value' => $this->getOption('hide_block') ? $this->t('Yes') : $this->t('No'));
 }