19declare(strict_types=1);
34 protected bool $is_repository
39 bool $show_inactive =
false,
42 $keywords = $this->
getKeywords($show_inactive, $blpg);
44 $wtpl = new \ilTemplate(
"tpl.blog_list_navigation_keywords.html",
true,
true,
"components/ILIAS/Blog");
46 $max = max($keywords);
48 $wtpl->setCurrentBlock(
"keyword");
49 foreach ($keywords as $keyword => $counter) {
50 $url = $this->link_builder->forKeyword($keyword);
52 $wtpl->setVariable(
"TXT_KEYWORD", (
string) $keyword);
54 $wtpl->setVariable(
"URL_KEYWORD", $url);
55 $wtpl->parseCurrentBlock();
65 ?
int $posting_id =
null
68 $posting_manager = $this->domain->posting();
69 if ($this->is_repository) {
72 $obj_id = $this->domain->getObjectIdForWspId($this->gui->standardRequest()->getWspId());
76 foreach ($posting_manager->getKeywords($obj_id, $posting_id) as $keyword) {
77 if (isset($keywords[$keyword])) {
78 $keywords[$keyword]++;
80 $keywords[$keyword] = 1;
84 $posting_list = $this->domain->postingList(
88 $all_items = $posting_list->getPostingsGroupedByMonth();
89 foreach ($all_items as $month => $month_items) {
90 foreach ($month_items as $item) {
91 $item_id = $item->getId();
92 foreach ($posting_manager->getKeywords($obj_id, $item_id) as $keyword) {
93 if (isset($keywords[$keyword])) {
94 $keywords[$keyword]++;
96 $keywords[$keyword] = 1;
104 foreach ($keywords as $keyword => $counter) {
105 $tmp[] = array(
"keyword" => $keyword,
"counter" => $counter);
110 foreach ($tmp as $item) {
111 $keywords[(string) $item[
"keyword"]] = $item[
"counter"];
getKeywords(bool $show_inactive, ?int $posting_id=null)
render(bool $show_inactive=false, int $blpg=0)
__construct(protected InternalDomainService $domain, protected InternalGUIService $gui, protected LinkBuilder $link_builder, protected bool $is_repository)
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
static _lookupObjId(int $ref_id)
static getRelevanceClass(int $cnt, int $max)
Interface for building links within the Blog component.