ILIAS  release_8 Revision v8.24
class.ilUserActionGUI.php
Go to the documentation of this file.
1<?php
2
24{
27 protected bool $init_done = false;
28 protected int $current_user_id;
29
30 protected function __construct(
31 ilUserActionContext $a_user_action_context,
32 ilGlobalTemplateInterface $a_global_tpl,
33 int $a_current_user_id
34 ) {
35 $this->tpl = $a_global_tpl;
36 $this->user_action_context = $a_user_action_context;
37 $this->current_user_id = $a_current_user_id;
38 }
39
40 public static function getInstance(
41 ilUserActionContext $a_user_action_context,
42 ilGlobalTemplateInterface $a_global_tpl,
43 int $a_current_user_id
45 return new ilUserActionGUI($a_user_action_context, $a_global_tpl, $a_current_user_id);
46 }
47
48 public function init(): void
49 {
51
53 foreach ($prov->getActionTypes() as $act_type => $txt) {
55 $this->user_action_context->getComponentId(),
56 $this->user_action_context->getContextId(),
57 $prov->getComponentId(),
58 $act_type
59 )) {
60 foreach ($prov->getJsScripts($act_type) as $script) {
61 $tpl->addJavaScript($script);
62 }
63 }
64 }
65 }
66 }
67
68 public function renderDropDown(int $a_target_user_id): string
69 {
70 if (!$this->init_done) {
71 $this->init();
72 }
73 $act_collector = ilUserActionCollector::getInstance($this->current_user_id, $this->user_action_context);
74 $action_collection = $act_collector->getActionsForTargetUser($a_target_user_id);
75 $list = new ilAdvancedSelectionListGUI();
76 $list->setListTitle("");
77 $list->setPullRight(false);
78 foreach ($action_collection->getActions() as $action) {
79 $list->addItem($action->getText(), "", $action->getHref(), "", "", "", "", false, "", "", "", "", true, $action->getData());
80 }
81 return $list->getHTML();
82 }
83}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupActive(string $a_context_comp, string $a_context_id, string $a_action_comp, string $a_action_type)
static getInstance(int $a_user_id, ilUserActionContext $a_context)
Get instance (for a user)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
renderDropDown(int $a_target_user_id)
ilGlobalTemplateInterface $tpl
static getInstance(ilUserActionContext $a_user_action_context, ilGlobalTemplateInterface $a_global_tpl, int $a_current_user_id)
__construct(ilUserActionContext $a_user_action_context, ilGlobalTemplateInterface $a_global_tpl, int $a_current_user_id)
ilUserActionContext $user_action_context
static getAllProviders()
Get all action providers.
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']
$txt
Definition: error.php:13
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41