19declare(strict_types=1);
78 $this->ui_factory =
$ui_factory ?? $this->dic->ui()->factory();
79 $this->ui_renderer =
$ui_renderer ?? $this->dic->ui()->renderer();
80 $this->
user = $user ?? $this->dic->user();
81 $this->
ctrl = $ctrl ?? $this->dic->ctrl();
82 $this->http_wrapper =
$http_wrapper ?? $this->dic->http()->wrapper();
83 $this->
refinery = $refinery ?? $this->dic->refinery();
84 $this->
lng = $lng ?? $this->dic->language();
85 $this->icon_factory =
$icon_factory ?? $this->ui_factory->symbol()->icon();
92 return $this->context_collection->
main()->repository()->administration();
101 $additional_data = $called_contexts->
getLast()->getAdditionalData();
102 if ($additional_data->exists(self::SHOW_MAIL_FOLDERS_TOOL) &&
103 $additional_data->get(self::SHOW_MAIL_FOLDERS_TOOL) ===
true) {
106 ->tool($identification(
'mail_folders_tree'))
107 ->withTitle($this->
lng->txt(
'mail'))
108 ->withSymbol($this->icon_factory->standard(
'mail', $this->lng->txt(
'mail')))
109 ->withContentWrapper(
function (): LegacyContent {
110 $current_folder_id = $this->http_wrapper->query()->retrieve(
119 $this->lng->txt(
'mail_new'),
121 $this->buildFolderLink($current_folder_id, ilMailFormGUI::class)
123 ...$this->buildSubItems(),
125 $this->lng->txt(
'mail_attachments'),
127 $this->buildFolderLink($current_folder_id, [ilMailGUI::class, ilMailAttachmentGUI::class])
131 if ($this->dic->settings()->get(
'show_mail_settings',
'0')) {
132 $sub_items[] = $this->buildItem(
133 $this->lng->txt(
'mail_options'),
135 $this->buildFolderLink($current_folder_id, ilMailOptionsGUI::class)
139 $item = $this->ui_factory->menu()->drilldown(
140 $this->lng->txt(
'mail'),
144 return $this->ui_factory->legacy()->content(
145 $this->ui_renderer->render($item)
160 $folders = $this->mbox->getSubFolders();
167 foreach ($folders as $folder) {
168 if ($folder->isUserLocalFolder() && $user_folders !== []) {
169 $icon_name = $folder->getType()->value;
170 $items[] = $this->ui_factory->menu()->sub(
174 $this->lng->txt(
'mail_main_folder'),
176 $this->buildFolderLink($folder->getFolderId(), ilMailFolderGUI::class)
183 $this->buildFolderLink($folder->
getFolderId(), ilMailFolderGUI::class)
195 $folder->getType()->value,
196 $this->buildFolderLink($folder->getFolderId(), ilMailFolderGUI::class)
207 private function buildFolderLink(
int $folderId,
string|array $class, ?
string $cmd =
null): string
209 $this->
ctrl->setParameterByClass(is_array($class) ? current($class) : $class,
'mobj_id', $folderId);
210 $url = $this->
ctrl->getLinkTargetByClass($class, $cmd);
211 $this->
ctrl->setParameterByClass(is_array($class) ? current($class) : $class,
'mob_id',
null);
216 private function buildItem(
string $title,
string $icon_name,
string $link): BulkyLink
218 return $this->ui_factory->link()->bulky(
221 new URI(ILIAS_HTTP_PATH .
'/' . $link)
225 private function buildIcon(
string $title,
string $type): CustomIcon
227 return $this->icon_factory->custom(
240 $filtered_folders = [];
242 foreach ($folders as $folder) {
243 if ($folder->isUserFolder()) {
244 $user_folders[] = $folder;
248 $filtered_folders[] = $folder;
250 $folders = $filtered_folders;
252 return $user_folders;
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Customizing of pimple-DIC for ILIAS.
Builds a Color from either hex- or rgb values.
The scope of this class is split ilias-conform URI's into components.
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.
Bulky Link - a visually enriched link that looks like a button but behaves like a link.
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'))