ILIAS  release_8 Revision v8.24
ilECSNodeMappingCmsExplorer Class Reference

Explorer for ILIAS tree. More...

+ Inheritance diagram for ilECSNodeMappingCmsExplorer:
+ Collaboration diagram for ilECSNodeMappingCmsExplorer:

Public Member Functions

 __construct (string $a_target, int $a_server_id, int $a_mid, int $a_tree_id)
 
 setTree (ilECSCmsTree $tree)
 Set cms tree. More...
 
 isClickable (string $type, int $ref_id=0)
 no item is clickable More...
 
 addFormItemForType ($type)
 Add form item. More...
 
 removeFormItemForType ($type)
 
 setCheckedItems ($a_checked_items=array())
 
 isItemChecked ($a_id)
 
 setPostVar ($a_post_var)
 
 getPostVar ()
 
 buildFormItem ($a_node_id, $a_type)
 
 formatObject ($tpl, $a_node_id, $a_option, $a_obj_id=0)
 
 formatHeader (ilTemplate $tpl, $a_obj_id, array $a_option)
 
 buildTitle (string $a_title, $a_id, string $a_type)
 
- Public Member Functions inherited from ilExplorer
 setId (string $a_val)
 
 getId ()
 
 setAsynchExpanding (bool $a_val)
 
 getAsynchExpanding ()
 
 initItemCounter (int $a_number)
 
 setTitle (string $a_val)
 
 setTitleLength (int $a_length)
 
 getTitleLength ()
 
 getTitle ()
 
 setRoot ($a_root_id)
 
 getRoot ()
 
 setOrderColumn (string $a_column)
 
 setOrderDirection (string $a_direction)
 
 setTargetGet (string $a_target_get)
 
 setParamsGet (array $a_params_get)
 
 setExpandTarget (string $a_exp_target)
 target script for expand icons More...
 
 setFrameUpdater (string $a_up_frame, string $a_up_script, string $a_params="")
 
 highlightNode (string $a_id)
 
 checkPermissions (bool $a_check)
 
 setSessionExpandVariable (string $a_var_name="expand")
 
 outputIcons (bool $a_icons)
 
 setClickable (string $a_type, bool $a_clickable)
 
 isVisible ( $a_ref_id, string $a_type)
 
 setTreeLead (string $a_val)
 
 getTreeLead ()
 
 isClickable (string $type, int $ref_id=0)
 
 setPostSort (bool $a_sort)
 
 setFilterMode (int $a_mode=IL_FM_NEGATIVE)
 
 getFilterMode ()
 
 setUseStandardFrame (bool $a_val)
 Set use standard frame. More...
 
 getUseStandardFrame ()
 
 getChildsOfNode ($a_parent_id)
 
 setOutput ( $a_parent_id, int $a_depth=1, int $a_obj_id=0, bool $a_highlighted_subtree=false)
 Creates output for explorer view in admin menue recursive method. More...
 
 modifyChilds ( $a_parent_id, array $a_objects)
 
 showChilds ($a_parent_id)
 determines wether the childs of an object should be shown or not note: this standard implementation always returns true but it could be overwritten by derived classes (e.g. More...
 
 forceExpanded ($a_obj_id)
 force expansion of node More...
 
 getMaximumTreeDepth ()
 
 getOutput ()
 
 handleListEndTags (ilTemplate $a_tpl_tree, int $a_cur_depth, int $a_item_depth)
 handle list end tags ( and ) More...
 
 handleListStartTags (ilTemplate $a_tpl_tree, int $a_cur_depth, int $a_item_depth)
 handle list start tags ( More...
 
 formatHeader (ilTemplate $tpl, $a_obj_id, array $a_option)
 
 formatObject (ilTemplate $tpl, $a_node_id, array $a_option, $a_obj_id=0)
 
 getImage (string $a_name, string $a_type="", $a_obj_id="")
 
 getImageAlt (string $a_default_text, string $a_type="", $a_obj_id="")
 
 getNodeStyleClass ( $a_id, string $a_type)
 
 buildLinkTarget ( $a_node_id, string $a_type)
 
 buildOnClick ( $a_node_id, string $a_type, string $a_title)
 
 buildTitle (string $a_title, $a_id, string $a_type)
 
 buildDescription (string $a_desc, $a_id, string $a_type)
 
 buildSelect ($a_node_id, string $a_type)
 standard implementation for adding an option select box between image and title More...
 
 buildFrameTarget (string $a_type, $a_child=0, $a_obj_id=0)
 
 createTarget (string $a_type, $a_node_id, bool $a_highlighted_subtree=false, bool $a_append_anch=true)
 
 setFrameTarget (string $a_target)
 
 createLines (int $a_depth)
 
 is_in_array (int $a_start, int $a_depth)
 
 getIndex (array $a_data)
 
 addFilter (string $a_item)
 
 delFilter (string $a_item)
 
 setExpand ($a_node_id)
 set the expand option this value is stored in a SESSION variable to save it different view (lo view, frm view,...) More...
 
 forceExpandAll (bool $a_mode, bool $a_show_minus=true)
 force expandAll. More...
 
 setFiltered (bool $a_bool)
 
 checkFilter (string $a_item)
 
 sortNodes (array $a_nodes, $a_parent_obj_id)
 sort nodes and put adm object to the end of sorted array More...
 

Data Fields

const SEL_TYPE_CHECK = 1
 
const SEL_TYPE_RADIO = 2
 
- Data Fields inherited from ilExplorer
string $id = ""
 
string $output = ""
 
array $format_options = []
 
ilTree $tree
 
string $target = ""
 
string $target_get = ""
 
string $params_get = ""
 
array $expanded = []
 
string $order_column = ""
 
string $order_direction = "asc"
 
string $expand_target = null
 
bool $rbac_check = false
 
bool $output_icons = false
 
string $expand_variable = ""
 
array $is_clickable = []
 
bool $post_sort = false
 
bool $filtered = false
 
bool $filter_mode
 
bool $expand_all = false
 
 $root_id = null
 
bool $use_standard_frame = false
 

Private Attributes

int $server_id
 
int $mid
 
int $tree_id
 
array $checked_items = array()
 
string $post_var = ''
 
array $form_items = array()
 
int $type
 

Additional Inherited Members

- Protected Member Functions inherited from ilExplorer
 requestStr (string $key)
 
- Protected Attributes inherited from ilExplorer
ilObjectDefinition $obj_definition
 
ilErrorHandling $error
 
ilRbacSystem $rbacsystem
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
 $filter = []
 
string $highlighted = ""
 
bool $show_minus = true
 
int $counter = 0
 
bool $asnch_expanding = false
 
int $textwidth = 0
 
string $title = ""
 
string $up_frame = ""
 
string $a_up_script = ""
 
string $up_params = ""
 
string $frame_target = ""
 
string $up_script = ""
 
string $tree_lead = ""
 
array $iconList = []
 
ILIAS Refinery Factory $refinery
 
ILIAS HTTP Wrapper WrapperFactory $wrapper
 

Detailed Description

Explorer for ILIAS tree.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 25 of file class.ilECSNodeMappingCmsExplorer.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSNodeMappingCmsExplorer::__construct ( string  $a_target,
int  $a_server_id,
int  $a_mid,
int  $a_tree_id 
)

Definition at line 39 of file class.ilECSNodeMappingCmsExplorer.php.

40 {
41 parent::__construct($a_target);
42
43 $this->type = self::SEL_TYPE_CHECK;
44 $this->setOrderColumn('title');
45 $this->setTitleLength(1024);
46
47 // reset filter
48 $this->filter = array();
49 $this->addFormItemForType('');
50
51 $this->server_id = $a_server_id;
52 $this->mid = $a_mid;
53 $this->tree_id = $a_tree_id;
54 }
setOrderColumn(string $a_column)
setTitleLength(int $a_length)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct(), addFormItemForType(), ILIAS\UI\examples\Symbol\Glyph\Filter\filter(), SEL_TYPE_CHECK, ilExplorer\setOrderColumn(), and ilExplorer\setTitleLength().

+ Here is the call graph for this function:

Member Function Documentation

◆ addFormItemForType()

ilECSNodeMappingCmsExplorer::addFormItemForType (   $type)

Add form item.

Definition at line 75 of file class.ilECSNodeMappingCmsExplorer.php.

75 : void
76 {
77 $this->form_items[$type] = true;
78 }

References $type.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ buildFormItem()

ilECSNodeMappingCmsExplorer::buildFormItem (   $a_node_id,
  $a_type 
)

Definition at line 104 of file class.ilECSNodeMappingCmsExplorer.php.

104 : string
105 {
106 if (!array_key_exists($a_type, $this->form_items) || !$this->form_items[$a_type]) {
107 return '';
108 }
109
111 $this->server_id,
112 $this->mid,
113 $this->tree_id,
114 $a_node_id
115 );
116
117 if ($status === ilECSCmsData::MAPPING_DELETED) {
119 $this->isItemChecked($a_node_id),
120 $this->post_var,
121 $a_node_id,
122 true
123 );
124 }
125 switch ($this->type) {
128 $this->isItemChecked($a_node_id),
129 $this->post_var,
130 $a_node_id
131 );
132 break;
133
136 $this->isItemChecked($a_node_id),
137 $this->post_var,
138 $a_node_id
139 );
140 break;
141 }
142
143 return '';
144 }
static lookupStatusByObjId(int $a_server_id, int $a_mid, int $a_tree_id, int $obj_id)
Lookup status.
static formCheckbox(bool $checked, string $varname, string $value, bool $disabled=false)
static formRadioButton(bool $checked, string $varname, string $value, string $onclick=null, bool $disabled=false)

References ilLegacyFormElementsUtil\formCheckbox(), ilLegacyFormElementsUtil\formRadioButton(), isItemChecked(), ilECSCmsData\lookupStatusByObjId(), ilECSCmsData\MAPPING_DELETED, SEL_TYPE_CHECK, and SEL_TYPE_RADIO.

Referenced by formatHeader(), and formatObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildTitle()

ilECSNodeMappingCmsExplorer::buildTitle ( string  $a_title,
  $a_id,
string  $a_type 
)

Reimplemented from ilExplorer.

Definition at line 298 of file class.ilECSNodeMappingCmsExplorer.php.

298 : string
299 {
301 $this->server_id,
302 $this->mid,
303 $this->tree_id,
304 $a_id
305 );
306
307
308
309 switch ($status) {
311 return '<font style="font-weight: bold">' . $a_title . '</font>';
312
314 return '<font style="font-weight: bold;font-style: italic">' . $a_title . '</font>';
315
317 return '<font style="font-style: italic">' . $a_title . '</font>';
318
320 return '<font class="warning">' . $a_title . '</font>';
321
323 default:
324 return $a_title;
325 }
326 }
const MAPPING_PENDING_DISCONNECTABLE
const MAPPING_PENDING_NOT_DISCONNECTABLE

References ilECSCmsData\lookupStatusByObjId(), ilECSCmsData\MAPPING_DELETED, ilECSCmsData\MAPPING_MAPPED, ilECSCmsData\MAPPING_PENDING_DISCONNECTABLE, ilECSCmsData\MAPPING_PENDING_NOT_DISCONNECTABLE, and ilECSCmsData\MAPPING_UNMAPPED.

Referenced by formatHeader(), and formatObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ formatHeader()

ilECSNodeMappingCmsExplorer::formatHeader ( ilTemplate  $tpl,
  $a_obj_id,
array  $a_option 
)

Reimplemented from ilExplorer.

Definition at line 274 of file class.ilECSNodeMappingCmsExplorer.php.

274 : void
275 {
276 // custom icons
277 $path = ilObject::_getIcon((int) $a_obj_id, "tiny", "root");
278
279
280 $tpl->setCurrentBlock("icon");
281 $nd = $this->tree->getNodeData($this->getRoot());
282
283 $title = $nd["title"];
284
285 $tpl->setVariable("ICON_IMAGE", $path);
286 $tpl->setVariable("TXT_ALT_IMG", $title);
288
289 if ($formItem = ($this->buildFormItem($a_obj_id, $a_option['type']) !== '')) {
290 $tpl->setCurrentBlock('check');
291 $tpl->setVariable('OBJ_CHECK', $formItem);
293 }
294
295 $tpl->setVariable('OBJ_TITLE', $this->buildTitle($title, $a_obj_id, ''));
296 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
buildTitle(string $a_title, $a_id, string $a_type)
ilGlobalTemplateInterface $tpl
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
$nd
Definition: error.php:12
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
$path
Definition: ltiservices.php:32

References $nd, $path, ilExplorer\$title, ilExplorer\$tpl, ilObject\_getIcon(), buildFormItem(), buildTitle(), ilExplorer\getRoot(), ilGlobalTemplateInterface\parseCurrentBlock(), ilGlobalTemplateInterface\setCurrentBlock(), HTML_Template_IT\setVariable(), and ilGlobalTemplateInterface\setVariable().

+ Here is the call graph for this function:

◆ formatObject()

ilECSNodeMappingCmsExplorer::formatObject (   $tpl,
  $a_node_id,
  $a_option,
  $a_obj_id = 0 
)

Definition at line 146 of file class.ilECSNodeMappingCmsExplorer.php.

146 : void
147 {
148 global $DIC;
149 if (!isset($a_node_id) || !is_array($a_option)) {
150 $this->error->raiseError(get_class($this) . "::formatObject(): Missing parameter or wrong datatype! " .
151 "node_id: " . $a_node_id . " options:" . print_r($a_option, true), $this->error->WARNING);
152 }
153
154 $pic = false;
155 foreach ($a_option["tab"] as $picture) {
156 if ($picture === 'plus') {
157 $tpl->setCurrentBlock("expander");
158 $tpl->setVariable("EXP_DESC", $this->lng->txt("expand"));
159 $target = $this->createTarget('+', $a_node_id);
160 $tpl->setVariable("LINK_NAME", $a_node_id);
161 $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
162 $tpl->setVariable("IMGPATH", $this->getImage("browser/plus.png"));
164 $pic = true;
165 }
166
167 if ($picture === 'minus' && $this->show_minus) {
168 $tpl->setCurrentBlock("expander");
169 $tpl->setVariable("EXP_DESC", $this->lng->txt("collapse"));
170 $target = $this->createTarget('-', $a_node_id);
171 $tpl->setVariable("LINK_NAME", $a_node_id);
172 $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
173 $tpl->setVariable("IMGPATH", $this->getImage("browser/minus.png"));
175 $pic = true;
176 }
177 }
178
179 if (!$pic) {
180 $tpl->setCurrentBlock("blank");
181 $tpl->setVariable("BLANK_PATH", $this->getImage("browser/blank.png"));
183 }
184
185 if ($this->output_icons) {
186 $tpl->setCurrentBlock("icon");
187 $tpl->setVariable("ICON_IMAGE", $this->getImage("icon_cat.svg", $a_option["type"], $a_obj_id));
188
189 $tpl->setVariable("TARGET_ID", "iconid_" . $a_node_id);
190 $this->iconList[] = "iconid_" . $a_node_id;
191 $tpl->setVariable("TXT_ALT_IMG", $this->lng->txt($a_option["desc"]));
193 }
194
195 if ($formItem = ($this->buildFormItem($a_node_id, $a_option['type']) !== '')) {
196 $tpl->setCurrentBlock('check');
197 $tpl->setVariable('OBJ_CHECK', $formItem);
199 }
200
201 if ($this->isClickable($a_option["type"], $a_node_id)) { // output link
202 $tpl->setCurrentBlock("link");
203 //$target = (strpos($this->target, "?") === false) ?
204 // $this->target."?" : $this->target."&";
205 //$tpl->setVariable("LINK_TARGET", $target.$this->target_get."=".$a_node_id.$this->params_get);
206 $tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($a_node_id, $a_option["type"]));
207
208 $style_class = $this->getNodeStyleClass($a_node_id, $a_option["type"]);
209
210 if ($style_class !== "") {
211 $tpl->setVariable("A_CLASS", ' class="' . $style_class . '" ');
212 }
213
214 if (($onclick = $this->buildOnClick($a_node_id, $a_option["type"], $a_option["title"])) !== "") {
215 $tpl->setVariable("ONCLICK", "onClick=\"$onclick\"");
216 }
217
218 $tpl->setVariable("LINK_NAME", $a_node_id);
220 "TITLE",
222 $this->buildTitle($a_option["title"], $a_node_id, $a_option["type"]),
223 $this->textwidth,
224 true
225 )
226 );
228 "DESC",
230 $this->buildDescription($a_option["description"], $a_node_id, $a_option["type"]),
231 $this->textwidth,
232 true
233 )
234 );
235 $frame_target = $this->buildFrameTarget($a_option["type"], $a_node_id, $a_option["obj_id"]);
236 if ($frame_target !== "") {
237 $tpl->setVariable("TARGET", " target=\"" . $frame_target . "\"");
238 }
239 } else { // output text only
240 $tpl->setCurrentBlock("text");
242 "OBJ_TITLE",
244 $this->buildTitle($a_option["title"], $a_node_id, $a_option["type"]),
245 $this->textwidth,
246 true
247 )
248 );
250 "OBJ_DESC",
252 $this->buildDescription($a_option["desc"], $a_node_id, $a_option["type"]),
253 $this->textwidth,
254 true
255 )
256 );
257 }
259
260 $tpl->setCurrentBlock("list_item");
262 $tpl->touchBlock("element");
263 }
error(string $a_errmsg)
isClickable(string $type, int $ref_id=0)
no item is clickable
buildOnClick( $a_node_id, string $a_type, string $a_title)
getNodeStyleClass( $a_id, string $a_type)
buildFrameTarget(string $a_type, $a_child=0, $a_obj_id=0)
buildDescription(string $a_desc, $a_id, string $a_type)
getImage(string $a_name, string $a_type="", $a_obj_id="")
buildLinkTarget( $a_node_id, string $a_type)
string $frame_target
createTarget(string $a_type, $a_node_id, bool $a_highlighted_subtree=false, bool $a_append_anch=true)
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
global $DIC
Definition: feed.php:28
touchBlock(string $block)
overwrites ITX::touchBlock.

References $DIC, ilExplorer\$frame_target, ilExplorer\$target, ilExplorer\$tpl, ilExplorer\buildDescription(), buildFormItem(), ilExplorer\buildFrameTarget(), ilExplorer\buildLinkTarget(), ilExplorer\buildOnClick(), buildTitle(), ilExplorer\createTarget(), error(), ilExplorer\getImage(), ilExplorer\getNodeStyleClass(), isClickable(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\parseCurrentBlock(), ilGlobalTemplateInterface\setCurrentBlock(), ilGlobalTemplateInterface\setVariable(), ilStr\shortenTextExtended(), and ilGlobalTemplateInterface\touchBlock().

+ Here is the call graph for this function:

◆ getPostVar()

ilECSNodeMappingCmsExplorer::getPostVar ( )

Definition at line 99 of file class.ilECSNodeMappingCmsExplorer.php.

99 : string
100 {
101 return $this->post_var;
102 }

References $post_var.

◆ isClickable()

ilECSNodeMappingCmsExplorer::isClickable ( string  $type,
int  $ref_id = 0 
)

no item is clickable

Reimplemented from ilExplorer.

Definition at line 67 of file class.ilECSNodeMappingCmsExplorer.php.

67 : bool
68 {
69 return false;
70 }

Referenced by formatObject().

+ Here is the caller graph for this function:

◆ isItemChecked()

ilECSNodeMappingCmsExplorer::isItemChecked (   $a_id)

Definition at line 90 of file class.ilECSNodeMappingCmsExplorer.php.

90 : bool
91 {
92 return in_array($a_id, $this->checked_items, true) ? true : false;
93 }
return true

References true.

Referenced by buildFormItem().

+ Here is the caller graph for this function:

◆ removeFormItemForType()

ilECSNodeMappingCmsExplorer::removeFormItemForType (   $type)

Definition at line 80 of file class.ilECSNodeMappingCmsExplorer.php.

80 : void
81 {
82 $this->form_items[$type] = false;
83 }

References $type.

◆ setCheckedItems()

ilECSNodeMappingCmsExplorer::setCheckedItems (   $a_checked_items = array())

Definition at line 85 of file class.ilECSNodeMappingCmsExplorer.php.

85 : void
86 {
87 $this->checked_items = $a_checked_items;
88 }

◆ setPostVar()

ilECSNodeMappingCmsExplorer::setPostVar (   $a_post_var)

Definition at line 95 of file class.ilECSNodeMappingCmsExplorer.php.

95 : void
96 {
97 $this->post_var = $a_post_var;
98 }

◆ setTree()

ilECSNodeMappingCmsExplorer::setTree ( ilECSCmsTree  $tree)

Set cms tree.

Definition at line 59 of file class.ilECSNodeMappingCmsExplorer.php.

59 : void
60 {
61 $this->tree = $tree;
62 }

References ilExplorer\$tree.

Field Documentation

◆ $checked_items

array ilECSNodeMappingCmsExplorer::$checked_items = array()
private

Definition at line 34 of file class.ilECSNodeMappingCmsExplorer.php.

◆ $form_items

array ilECSNodeMappingCmsExplorer::$form_items = array()
private

Definition at line 36 of file class.ilECSNodeMappingCmsExplorer.php.

◆ $mid

int ilECSNodeMappingCmsExplorer::$mid
private

Definition at line 31 of file class.ilECSNodeMappingCmsExplorer.php.

◆ $post_var

string ilECSNodeMappingCmsExplorer::$post_var = ''
private

Definition at line 35 of file class.ilECSNodeMappingCmsExplorer.php.

Referenced by getPostVar().

◆ $server_id

int ilECSNodeMappingCmsExplorer::$server_id
private

Definition at line 30 of file class.ilECSNodeMappingCmsExplorer.php.

◆ $tree_id

int ilECSNodeMappingCmsExplorer::$tree_id
private

Definition at line 32 of file class.ilECSNodeMappingCmsExplorer.php.

◆ $type

int ilECSNodeMappingCmsExplorer::$type
private

◆ SEL_TYPE_CHECK

const ilECSNodeMappingCmsExplorer::SEL_TYPE_CHECK = 1

Definition at line 27 of file class.ilECSNodeMappingCmsExplorer.php.

Referenced by __construct(), and buildFormItem().

◆ SEL_TYPE_RADIO

const ilECSNodeMappingCmsExplorer::SEL_TYPE_RADIO = 2

Definition at line 28 of file class.ilECSNodeMappingCmsExplorer.php.

Referenced by buildFormItem().


The documentation for this class was generated from the following file: