ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
SearchMetaBarProvider.php
Go to the documentation of this file.
1 <?php
2 
4 
11 
18 {
19 
23  private function getId() : IdentificationInterface
24  {
25  return $this->if->identifier('search');
26  }
27 
28 
32  public function getAllIdentifications() : array
33  {
34  return [$this->getId()];
35  }
36 
37 
41  public function getMetaBarItems() : array
42  {
43  $content = function () {
44  $main_search = new ilMainMenuSearchGUI();
45  $html = "";
46 
47  // user interface plugin slot + default rendering
48  $uip = new ilUIHookProcessor(
49  "Services/MainMenu",
50  "main_menu_search",
51  array("main_menu_gui" => $this, "main_menu_search_gui" => $main_search)
52  );
53  if (!$uip->replaced()) {
54  $html = $main_search->getHTML();
55  }
56 
57  return $this->dic->ui()->factory()->legacy($uip->getHTML($html));
58  };
59 
60  $mb = $this->globalScreen()->metaBar();
61 
62  $item = $mb
63  ->topLegacyItem($this->getId())
64  ->withLegacyContent($content())
65  ->withSymbol($this->dic->ui()->factory()->symbol()->glyph()->search())
66  ->withTitle($this->dic->language()->txt("search"))
67  ->withPosition(1)
68  ->withAvailableCallable(
69  function () {
70  return (bool) $this->dic->rbac()->system()->checkAccess('search', ilSearchSettings::_getSearchSettingRefId());
71  }
72  );
73 
74  return [$item];
75  }
76 }
static _getSearchSettingRefId()
Read the ref_id of Search Settings object.