Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,3 @@ bin/releaser tag

[auto-install]: https://img.shields.io/badge/CI-install-green?style=flat-square&labelColor=black&logo=github-actions
[auto-test]: https://img.shields.io/badge/CI-tests-green?style=flat-square&labelColor=black&logo=github-actions

















18 changes: 18 additions & 0 deletions components/RssFeedBundle/src/bundle/Entity/RssFeedItems.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ class RssFeedItems
*/
private $subtreePath;

/**
* @var bool
*
* @ORM\Column(name="only_visible", type="boolean")
*/
private $onlyVisible;

/**
* @var string
*
Expand Down Expand Up @@ -149,6 +156,7 @@ public function toArray(): array
return [
'locationId' => $this->getSubtreePath(),
'includeSubtreePath' => $this->getIncludeSubtree(),
'onlyVisible' => $this->getOnlyVisible(),
'contentTypeId' => $this->getContentTypeId(),
'fieldTypesIdentifier' => [
'title' => $this->getTitle(),
Expand Down Expand Up @@ -242,4 +250,14 @@ public function setMedia($media = null): self

return $this;
}

public function getOnlyVisible(): bool
{
return $this->onlyVisible;
}

public function setOnlyVisible(bool $onlyVisible): void
{
$this->onlyVisible = $onlyVisible;
}
}
10 changes: 9 additions & 1 deletion components/RssFeedBundle/src/bundle/Form/RssFeedItemsType.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
'required' => false,
]
)
->add(
'only_visible',
CheckboxType::class,
[
'label' => 'ez_rss_feed.form.only_visible',
'required' => false,
]
)
->add(
'contenttype_id',
ChoiceType::class,
Expand Down Expand Up @@ -226,7 +234,7 @@ public function getContentTypeList(): array
$contentTypesMap[ucfirst($contentType->getName())] = $contentType->id;
}
ksort($contentTypesMap);
if (\count($contentTypesMap)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let \

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we leave the '' here?
Why don't we put it for the ksort function right on top?
How about an import?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seb shared an article that using \ was quicker to resolve by the PHP

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is and PHP Storm EAD Inspections (that you should have) is supposed to show it too ;-)

if (count($contentTypesMap)) {
$defaultContentType = $this->contentTypeService
->loadContentType(array_values($contentTypesMap)[0]);
$this->fieldTypeMap = $this->getFieldTypeByContentType($defaultContentType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ez_rss_feed.form.url_slug: URL
ez_rss_feed.form.sources: Sources
ez_rss_feed.form.subtree_path: Select location path
ez_rss_feed.form.include_subtree: Include sub node
ez_rss_feed.form.only_visible: Only visible node
ez_rss_feed.form.number_of_object: Number of objects
ez_rss_feed.form.contenttype: Select content type
ez_rss_feed.form.field.title: Title field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ez_rss_feed.form.url_slug: URL
ez_rss_feed.form.sources: Sources
ez_rss_feed.form.subtree_path: Sélectionner un emplacement
ez_rss_feed.form.include_subtree: Inclure les sous noeuds
ez_rss_feed.form.only_visible: Afficher uniquement les noeuds visibles
ez_rss_feed.form.number_of_object: Nombre d'objet
ez_rss_feed.form.contenttype: Sélectionner le type de contenu
ez_rss_feed.form.field.title: Champ Titre
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@
</div>
</div>
{% endblock _rss_feeds_feed_items_entry_include_subtree_row %}
{% block _rss_feeds_feed_items_entry_only_visible_row %}
<div class="form-group col-md-12 col-sm-12 col-xs-12 pull-left">
<label class="form-label">
{{- form_label(form) -}}
</label>
<div class="controls">
{{- form_errors(form) -}}
{{- form_widget(form) -}}
</div>
</div>
{% endblock _rss_feeds_feed_items_entry_only_visible_row %}
{% block _rss_feeds_feed_items_entry_contenttype_id_row %}
<div class="form-group col-md-12 col-sm-12 col-xs-12 pull-left">
<label class="form-label">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ public function fetchContent(RssFeeds $rssFeed): array
);
}

if ($filter['onlyVisible']) {
$criterion[] = new Query\Criterion\Visibility(Query\Criterion\Visibility::VISIBLE);
}

$criterion[] = new Query\Criterion\ContentTypeId($filter['contentTypeId']);

$queryFilter[] = new Query\Criterion\LogicalAnd($criterion);
Expand Down