19declare(strict_types=1);
77 $this->ui_factory =
$ui_factory ?? $this->dic->ui()->factory();
78 $this->ui_renderer =
$ui_renderer ?? $this->dic->ui()->renderer();
79 $this->
user = $user ?? $this->dic->user();
80 $this->
ctrl = $ctrl ?? $this->dic->ctrl();
81 $this->http_wrapper =
$http_wrapper ?? $this->dic->http()->wrapper();
82 $this->
refinery = $refinery ?? $this->dic->refinery();
83 $this->
lng = $lng ?? $this->dic->language();
84 $this->icon_factory =
$icon_factory ?? $this->ui_factory->symbol()->icon();
91 return $this->context_collection->
main()->repository()->administration();
100 $additional_data = $called_contexts->
getLast()->getAdditionalData();
101 if ($additional_data->exists(self::SHOW_MAIL_FOLDERS_TOOL) &&
102 $additional_data->get(self::SHOW_MAIL_FOLDERS_TOOL) ===
true) {
105 ->tool($identification(
'mail_folders_tree'))
106 ->withTitle($this->
lng->txt(
'mail'))
107 ->withSymbol($this->icon_factory->standard(
'mail', $this->lng->txt(
'mail')))
108 ->withContentWrapper(
function (): LegacyContent {
109 $current_folder_id = $this->http_wrapper->query()->retrieve(
118 $this->lng->txt(
'mail_new'),
120 $this->buildFolderLink($current_folder_id, ilMailFormGUI::class)
122 ...$this->buildSubItems(),
124 $this->lng->txt(
'mail_attachments'),
126 $this->buildFolderLink($current_folder_id, [ilMailGUI::class, ilMailAttachmentGUI::class])
130 if ($this->dic->settings()->get(
'show_mail_settings',
'0')) {
131 $sub_items[] = $this->buildItem(
132 $this->lng->txt(
'mail_options'),
134 $this->buildFolderLink($current_folder_id, ilMailOptionsGUI::class)
138 $item = $this->ui_factory->menu()->drilldown(
139 $this->lng->txt(
'mail'),
143 return $this->ui_factory->legacy()->content(
144 $this->ui_renderer->render($item)
159 $folders = $this->mbox->getSubFolders();
166 foreach ($folders as $folder) {
167 if ($folder->isUserLocalFolder() && $user_folders !== []) {
168 $icon_name = $folder->getType()->value;
169 $items[] = $this->ui_factory->menu()->sub(
173 $this->lng->txt(
'mail_main_folder'),
175 $this->buildFolderLink($folder->getFolderId(), ilMailFolderGUI::class)
182 $this->buildFolderLink($folder->
getFolderId(), ilMailFolderGUI::class)
194 $folder->getType()->value,
195 $this->buildFolderLink($folder->getFolderId(), ilMailFolderGUI::class)
206 private function buildFolderLink(
int $folderId,
string|array $class, ?
string $cmd =
null): string
208 $this->
ctrl->setParameterByClass(is_array($class) ? current($class) : $class,
'mobj_id', $folderId);
209 $url = $this->
ctrl->getLinkTargetByClass($class, $cmd);
210 $this->
ctrl->setParameterByClass(is_array($class) ? current($class) : $class,
'mob_id',
null);
215 private function buildItem(
string $title,
string $icon_name,
string $link): BulkyButton
217 return $this->ui_factory->button()->bulky(
224 private function buildIcon(
string $title,
string $type): CustomIcon
226 return $this->icon_factory->custom(
239 $filtered_folders = [];
241 foreach ($folders as $folder) {
242 if ($folder->isUserFolder()) {
243 $user_folders[] = $folder;
247 $filtered_folders[] = $folder;
249 $folders = $filtered_folders;
251 return $user_folders;
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Customizing of pimple-DIC for ILIAS.
Builds a Color from either hex- or rgb values.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
@ilCtrl_Calls ilMailFolderGUI: ILIAS\User\Profile\PublicProfileGUI
@ilCtrl_Calls ilMailGUI: ilMailFolderGUI, ilMailFormGUI, ilContactGUI, ilMailOptionsGUI,...
Util class various functions, usage as namespace.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
Interface IdentificationInterface.
This describes the behavior of an custom icon.
This is how a factory for icons looks like.
An entity that renders components to a string output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
if(!file_exists('../ilias.ini.php'))