getHelperPluginManager(); $status = $plugins->get('status'); $translate = $plugins->get('translate'); $hyperlink = $plugins->get('hyperlink'); $siteSetting = $plugins->get('siteSetting'); $itemSetSelect = $plugins->get('itemSetSelect'); $isSiteRequest = $status->isSiteRequest(); // Prepare the item set queries $inIds = $query['item_set_id'] ?? []; if (!is_array($inIds)) { $inIds = [$inIds]; } $inIds = array_filter($inIds); $notInIds = $query['not_item_set_id'] ?? []; if (!is_array($notInIds)) { $notInIds = [$notInIds]; } $notInIds = array_filter($notInIds); $itemSets = []; foreach ($inIds as $inId) { $itemSets[] = ['id' => $inId, 'type' => 'in']; } foreach ($notInIds as $notInId) { $itemSets[] = ['id' => $notInId, 'type' => 'not_in']; } if (!$itemSets) { $itemSets[] = ['id' => null, 'type' => 'in']; } if ($isSiteRequest) { $site = $this->layout()->site; if (!$site->siteItemSets()) { return; } $filterLocale = (bool) $siteSetting('filter_locale_values'); $lang = $this->lang(); $selectOptions = [ 'disable_group_by_owner' => true, 'query' => ['site_id' => $site->id()], 'lang' => $filterLocale ? [$lang, ''] : null, 'prepend_value_options' => [ '0' => '[none]', // @translate ], ]; } else { $selectOptions = [ 'prepend_value_options' => [ '0' => '[none]', // @translate ], ]; } ?>
'expand', 'title' => $translate('Expand')]) ?>
'not_in' === $itemSet['type'] ? 'not_item_set_id[]' : 'item_set_id[]', 'attributes' => [ 'value' => $itemSet['id'], 'class' => 'item-set-select chosen-select', 'aria-labelledby' => 'by-item-set-label', ], 'options' => $selectOptions, ]); ?>