19declare(strict_types=1);
31 protected int $obj_id,
35 protected bool $include_inactive =
true
50 if ($keyword !==
"") {
54 $max = $this->
settings->getOverviewPostings();
55 if ($month ===
"" && $max > 0) {
60 $list_items[
$id] = $item;
61 if (count($list_items) >= $max) {
77 if ($this->postings ===
null) {
78 $this->postings = $this->posting_manager->getAllPostings($this->obj_id);
79 if (!$this->include_inactive) {
80 $this->postings = array_filter($this->postings,
function (
Posting $posting) {
85 return $this->postings;
94 foreach ($this->getPostings() as $posting) {
95 if (substr($posting->getCreated()->get(
IL_CAL_DATE), 0, 7) === $month) {
96 $res[$posting->getId()] = $posting;
108 foreach ($this->getPostings() as $posting) {
109 if ($posting->getAuthor() === $author_id) {
110 $res[$posting->getId()] = $posting;
113 foreach ($this->page_manager->getPageContributors(
"blp", $posting->getId()) as $editor) {
114 if ((
int) $editor[
"user_id"] === $author_id) {
115 $res[$posting->getId()] = $posting;
129 foreach ($this->getPostings() as $posting) {
132 $this->posting_manager->getKeywords($this->obj_id, $posting->getId()),
135 $res[$posting->getId()] = $posting;
147 foreach ($this->getPostings() as $posting) {
148 $month = substr($posting->getCreated()->get(
IL_CAL_DATE), 0, 7);
149 $items[$month][$posting->getId()] = $posting;
158 if ($author && !$this->hasAuthorPostings($author)) {
162 $items = $this->getPostingsGroupedByMonth();
163 if ($items && (!$month || !isset($items[$month]) || $items[$month] === [])) {
164 $month = (string) array_key_first($items);
167 return new PostingViewState($month, $author);
176 foreach ($this->getPostings() as $posting) {
177 $month = substr($posting->getCreated()->get(
IL_CAL_DATE), 0, 7);
178 if (!in_array($month, $months,
true)) {
192 foreach ($this->getPostings() as $posting) {
193 $author_id = $posting->getAuthor();
194 if ($author_id > 0 && !in_array($author_id, $authors,
true)) {
195 $authors[] = $author_id;
198 foreach ($this->page_manager->getPageContributors(
"blp", $posting->getId()) as $editor) {
199 $editor_id = (
int) $editor[
"user_id"];
200 if ($editor_id > 0 && !in_array($editor_id, $authors,
true)) {
201 $authors[] = $editor_id;
210 foreach ($this->getPostings() as $posting) {
211 if ($posting->getAuthor() ===
$user_id) {
214 foreach ($this->page_manager->getPageContributors(
"blp", $posting->getId()) as $editor) {
215 if ((
int) $editor[
"user_id"] ===
$user_id) {
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
getByKeyword(string $keyword)
getByMonth(string $month)
getByAuthor(int $author_id)
__construct(protected int $obj_id, protected PostingManager $posting_manager, protected \ILIAS\Blog\Settings\Settings $settings, protected PageManagerInterface $page_manager, protected bool $include_inactive=true)
hasAuthorPostings(int $user_id)
getPostingsGroupedByMonth()
prepareViewState(string $month, ?int $author)
getPostingsForView(int $author_id=0, string $keyword="", string $month="")
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
foreach($_POST as $key=> $value) $res
if(!file_exists('../ilias.ini.php'))