ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.InternalGUIService.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
21 namespace ILIAS\Notes;
22 
26 
31 {
33 
36 
37  public function __construct(
39  InternalDataService $data_service,
40  InternalDomainService $domain_service
41  ) {
42  $this->data_service = $data_service;
43  $this->domain_service = $domain_service;
44  $this->initGUIServices($DIC);
45  }
46 
48  {
49  return new StandardGUIRequest(
50  $this->http(),
51  $this->domain_service->refinery()
52  );
53  }
54 
55  public function initJavascript(
56  string $ajax_url = "",
57  ?\ilGlobalTemplateInterface $main_tpl = null
58  ): void {
59  $tpl = $main_tpl ?? $this->mainTemplate();
60  $lng = $this->domain_service->lng();
61  $ctrl = $this->ctrl();
62  // temporary patch to make this work...
63  global $DIC;
64  $ref_id = $DIC->repository()->internal()->gui()->standardRequest()->getRefId();
66  switch ($type) {
67  /*
68  case "cat":
69  $path = ["ilrepositorygui", "ilobjcategorygui", "ilcommonactiondispatchergui", "ilnotegui"];
70  break;
71  case "root":
72  $path = ["ilrepositorygui", "ilobjrootfoldergui", "ilcommonactiondispatchergui", "ilnotegui"];
73  break;
74  case "lm":
75  $path = ["illmpresentationgui", "ilcommonactiondispatchergui", "ilnotegui"];
76  break;
77  case "wiki":
78  $path = ["ilwikihandlergui", "ilobjwikigui", "ilcommonactiondispatchergui", "ilnotegui"];
79  break;*/
80  default: // not working
81  $path = ["ilcommonactiondispatchergui", "ilnotegui"];
82  break;
83  }
84 
85  if ($ajax_url === "") {
86  $ajax_url = $this->ctrl()->getLinkTargetByClass(
87  $path,
88  "",
89  "",
90  true,
91  false
92  );
93  }
94  $lng->loadLanguageModule("notes");
96 
97  $lng->toJS(array("private_notes", "notes_public_comments", "cancel"), $tpl);
100  $tpl->addJavaScript("./Services/Notes/js/ilNotes.js");
101  $tpl->addOnLoadCode("ilNotes.setAjaxUrl('" . $ajax_url . "');");
102  }
103 
107  public function filter(
108  string $filter_id,
109  $class_path,
110  string $cmd,
111  bool $activated = true,
112  bool $expanded = true
113  ): FilterAdapterGUI {
114  return new FilterAdapterGUI(
115  $filter_id,
116  $class_path,
117  $cmd,
118  $activated,
119  $expanded
120  );
121  }
122 
123  public function print(): PrintProcessGUI
124  {
126  return new PrintProcessGUI(
127  $provider,
128  $this->http(),
129  $this->ui(),
130  $this->domain_service->lng()
131  );
132  }
133 }
initGUIServices(\ILIAS\DI\Container $DIC)
$type
$lng
static initJS(ilGlobalTemplateInterface $a_main_tpl=null)
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:31
$path
Definition: ltiservices.php:32
Repository internal data service.
global $DIC
Definition: feed.php:28
$provider
Definition: ltitoken.php:83
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
$ref_id
Definition: ltiauth.php:67
static http()
Fetches the global http state from ILIAS.
__construct(Container $DIC, InternalDataService $data_service, InternalDomainService $domain_service)
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
initJavascript(string $ajax_url="", ?\ilGlobalTemplateInterface $main_tpl=null)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
static _lookupType(int $id, bool $reference=false)
static initConnection(?ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Connection module.