19 declare(strict_types=1);
34 protected \ILIAS\Blog\Presentation\Util
$util;
59 $this->blog_access = $blog_acces;
60 $toolbar = $this->gui->toolbar();
61 $lng = $this->domain->lng();
62 $this->
ctrl = $ctrl = $this->gui->ctrl();
63 $f = $this->gui->ui()->factory();
64 $this->items = $a_items;
65 $this->current_month = $month;
72 :
"previewFullscreen";
74 if ($single_posting) {
76 if ($next_posting > 0) {
85 if ($prev_posting > 0) {
92 $ctrl->setParameterByClass(\ilObjBlogGUI::class,
"blpg", $blog_page);
98 if ($next_month !==
"") {
107 if ($prev_month !==
"") {
113 $ctrl->setParameterByClass(\ilObjBlogGUI::class,
"bmn", $month);
121 $lng = $this->domain->lng();
122 $toolbar = $this->gui->toolbar();
123 $f = $this->gui->ui()->factory();
126 if ($this->blog_access->mayContribute()) {
129 $ctrl->setParameterByClass(\ilObjBlogGUI::class,
"bmn",
"");
130 $ctrl->setParameterByClass(\ilObjBlogGUI::class,
"blpg",
"");
131 $link = $ctrl->getLinkTargetByClass(\ilObjBlogGUI::class,
"");
132 $ctrl->setParameterByClass(\ilObjBlogGUI::class,
"blpg", $this->blog_page);
133 $ctrl->setParameterByClass(\ilObjBlogGUI::class,
"bmn", $this->current_month);
134 $actions[] =
$f->button()->shy(
135 $lng->txt(
"blog_edit"),
140 if ($single_posting && $this->blog_access->mayContribute() && $this->blog_access->mayEditPosting($this->blog_page)) {
141 $ctrl->setParameterByClass(\ilBlogPostingGUI::class,
"blpg", $this->blog_page);
142 if ($this->prtf_embed) {
143 $ctrl->setParameterByClass(\ilObjPortfolioGUI::class,
"ppage", $this->portfolio_page);
145 $link = $ctrl->getLinkTargetByClass(\ilBlogPostingGUI::class,
"edit");
146 $actions[] =
$f->button()->shy(
147 $lng->txt(
"blog_edit_posting"),
151 if (count($actions) > 0) {
152 $toolbar->addStickyItem(
$f->dropdown()->standard($actions));
159 $month = current($this->items);
160 if (is_array($month)) {
161 return (
int) current($month)[
"id"];
172 foreach ($this->items as $month => $items) {
173 foreach ($items as $item) {
174 if ($item[
"id"] == $blog_page) {
178 $next_blpg = (
int) $item[
"id"];
191 foreach ($this->items as $month => $items) {
192 foreach ($items as $item) {
193 if ($found && $prev_blpg === 0) {
194 $prev_blpg = (
int) $item[
"id"];
206 $this->
ctrl->setParameterByClass(\ilBlogPostingGUI::class,
"blpg", (
string) $posting);
207 return $this->
ctrl->getLinkTargetByClass(\ilBlogPostingGUI::class, $cmd);
212 $this->
ctrl->setParameterByClass(\ilObjBlogGUI::class,
"bmn", $month);
213 return $this->
ctrl->getLinkTargetByClass(\ilObjBlogGUI::class,
"preview");
218 $toolbar = $this->gui->toolbar();
219 $f = $this->gui->ui()->factory();
221 foreach ($this->items as $month => $items) {
222 $label = $this->util->getMonthPresentation($month);
223 if ($month === $this->current_month) {
224 $label =
"» " . $label;
226 $m[] =
$f->link()->standard(
232 $toolbar->addStickyItem(
$f->dropdown()->standard($m)->withLabel(
233 $this->
getDropdownLabel($this->util->getMonthPresentation($this->current_month))
243 foreach ($this->items as $month => $items) {
256 foreach ($this->items as $month => $items) {
270 return key($this->items);
285 $toolbar = $this->gui->toolbar();
286 $b = $this->gui->ui()->factory()->button()->standard(
287 "<span class=\"glyphicon glyphicon-chevron-" . $dir .
" \" aria-hidden=\"true\"></span>",
291 $b =
$b->withUnavailableAction();
293 $toolbar->addStickyItem(
$b);
298 $toolbar = $this->gui->toolbar();
299 $f = $this->gui->ui()->factory();
302 foreach ($this->items as $month => $items) {
303 $label = $this->util->getMonthPresentation($month);
304 $m[] =
$f->button()->shy(
307 )->withUnavailableAction();
308 foreach ($items as $item) {
309 $label = $item[
"title"];
310 if ((
int) $item[
"id"] === $this->blog_page) {
311 $label =
"» " . $label;
312 $dd_title = $item[
"title"];
314 $label = str_pad(
"", 12,
" ") . $label;
315 $m[] =
$f->link()->standard(
322 $toolbar->addStickyItem(
$f->dropdown()->standard($m)->withLabel(
330 return "<span style='vertical-align: bottom; max-width:60px; display: inline-block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;'>" . $label .
"</span>";
getDropdownLabel(string $label)
renderPostingDropdown(string $cmd)
renderPreviousButton(string $href="")
renderToolbarNavigation(BlogAccess $blog_acces, array $a_items, int $blog_page, bool $single_posting, bool $prtf_embed, $month, int $portfolio_page)
getPostingTarget(int $posting, string $cmd)
renderNextButton(string $href="")
setParameterByClass(string $a_class, string $a_parameter, $a_value)
getPreviousMonth( $current_month)
getPreviousPosting(int $blog_page)
ILIAS Blog Presentation Util $util
getMonthTarget(string $month)
renderActionDropdown(bool $single_posting)
InternalDomainService $domain
renderNavButton(string $dir, string $href="")
getNextPosting(int $blog_page)
getNextMonth( $current_month)
__construct(InternalDomainService $domain, InternalGUIService $gui)