ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilECSNodeMappingCmsExplorer Class Reference

Explorer for ILIAS tree. More...

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

Public Member Functions

 __construct ($a_target, $a_server_id, $a_mid, $a_tree_id)
 
 setTree (ilECSCmsTree $tree)
 Set cms tree. More...
 
 isClickable ($a_type, $a_ref_id=0, $a_obj_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 ($tpl, $a_obj_id, $a_option)
 
 buildTitle ($title, $a_obj_id, $a_type)
 
- Public Member Functions inherited from ilExplorer
 __construct ($a_target)
 Constructor public. More...
 
 setId ($a_val)
 Set id. More...
 
 getId ()
 Get id. More...
 
 setAsynchExpanding ($a_val)
 Set asynch expanding. More...
 
 getAsynchExpanding ()
 Get asynch expanding. More...
 
 initItemCounter ($a_number)
 Init item counter. More...
 
 setTitle ($a_val)
 Set title. More...
 
 setTitleLength ($a_length)
 Set max title length. More...
 
 getTitleLength ()
 Get max title length. More...
 
 getTitle ()
 Get title. More...
 
 setRoot ($a_root_id)
 Set root node. More...
 
 getRoot ()
 get root id More...
 
 setOrderColumn ($a_column)
 set the order column public More...
 
 setOrderDirection ($a_direction)
 set the order direction public More...
 
 setTargetGet ($a_target_get)
 set the varname in Get-string public More...
 
 setParamsGet ($a_params_get)
 set additional params to be passed in Get-string public More...
 
 setExpandTarget ($a_exp_target)
 target script for expand icons More...
 
 setFrameUpdater ($a_up_frame, $a_up_script, $a_params="")
 Set Explorer Updater. More...
 
 highlightNode ($a_id)
 set highlighted node More...
 
 checkPermissions ($a_check)
 check permissions via rbac More...
 
 setSessionExpandVariable ($a_var_name="expand")
 set name of expand session variable More...
 
 outputIcons ($a_icons)
 output icons More...
 
 setClickable ($a_type, $a_clickable)
 (de-)activates links for a certain object type More...
 
 isVisible ($a_ref_id, $a_type)
 
 setTreeLead ($a_val)
 Set tree leading content. More...
 
 getTreeLead ()
 Get tree leading content. More...
 
 isClickable ($a_type, $a_ref_id=0)
 check if links for certain object type are activated More...
 
 setPostSort ($a_sort)
 process post sorting More...
 
 setFilterMode ($a_mode=IL_FM_NEGATIVE)
 set filter mode More...
 
 getFilterMode ()
 get filter mode More...
 
 setUseStandardFrame ($a_val)
 Set use standard frame. More...
 
 getUseStandardFrame ()
 Get use standard explorer frame. More...
 
 getChildsOfNode ($a_parent_id)
 Get childs of node. More...
 
 setOutput ($a_parent_id, $a_depth=1, $a_obj_id=0, $a_highlighted_subtree=false)
 Creates output for explorer view in admin menue recursive method public. More...
 
 modifyChilds ($a_parent_id, $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 ()
 Get maximum tree depth. More...
 
 getOutput ()
 Creates output recursive method public. More...
 
 handleListEndTags (&$a_tpl_tree, $a_cur_depth, $a_item_depth)
 handle list end tags ( and ) More...
 
 handleListStartTags (&$a_tpl_tree, $a_cur_depth, $a_item_depth)
 handle list start tags ( More...
 
 formatHeader ($tpl, $a_obj_id, $a_option)
 Creates output for header (is empty here but can be overwritten in derived classes) More...
 
 formatObject ($tpl, $a_node_id, $a_option, $a_obj_id=0)
 Creates output recursive method private. More...
 
 getImage ($a_name, $a_type="", $a_obj_id="")
 get image path (may be overwritten by derived classes) More...
 
 getImageAlt ($a_default_text, $a_type="", $a_obj_id="")
 get image alt text More...
 
 getNodeStyleClass ($a_id, $a_type)
 get style class for node More...
 
 buildLinkTarget ($a_node_id, $a_type)
 get link target (may be overwritten by derived classes) More...
 
 buildOnClick ($a_node_id, $a_type, $a_title)
 get onclick event handling (may be overwritten by derived classes) More...
 
 buildTitle ($a_title, $a_id, $a_type)
 standard implementation for title, may be overwritten by derived classes More...
 
 buildDescription ($a_desc, $a_id, $a_type)
 standard implementation for description, may be overwritten by derived classes More...
 
 buildSelect ($a_node_id, $a_type)
 standard implementation for adding an option select box between image and title More...
 
 buildFrameTarget ($a_type, $a_child=0, $a_obj_id=0)
 get frame target (may be overwritten by derived classes) More...
 
 createTarget ($a_type, $a_node_id, $a_highlighted_subtree=false, $a_append_anch=true)
 Creates Get Parameter private. More...
 
 setFrameTarget ($a_target)
 set target frame or not frame? More...
 
 createLines ($a_depth)
 Creates lines for explorer view private. More...
 
 is_in_array ($a_start, $a_depth)
 DESCRIPTION MISSING private. More...
 
 getIndex ($a_data)
 get index of format_options array from specific ref_id,parent_id private More...
 
 addFilter ($a_item)
 adds item to the filter public More...
 
 delFilter ($a_item)
 removes item from the filter public More...
 
 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,...) private More...
 
 forceExpandAll ($a_mode, $a_show_minus=true)
 force expandAll. More...
 
 setFiltered ($a_bool)
 active/deactivate the filter public More...
 
 checkFilter ($a_item)
 check if item is in filter private More...
 
 sortNodes ($a_nodes, $a_parent_obj_id)
 sort nodes and put adm object to the end of sorted array private More...
 

Data Fields

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

Private Attributes

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

Additional Inherited Members

- Protected Attributes inherited from ilExplorer
 $obj_definition
 
 $error
 
 $rbacsystem
 
 $tpl
 
 $lng
 

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 $Id$

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

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC, ilExplorer\$tree, addFormItemForType(), ilExplorer\setOrderColumn(), and ilExplorer\setTitleLength().

27  {
28  global $DIC;
29 
30  $tree = $DIC['tree'];
31 
32  parent::__construct($a_target);
33 
34  $this->type = self::SEL_TYPE_CHECK;
35  $this->setOrderColumn('title');
36  $this->setTitleLength(1024);
37 
38  // reset filter
39  $this->filter = array();
40  $this->addFormItemForType('');
41 
42  $this->server_id = $a_server_id;
43  $this->mid = $a_mid;
44  $this->tree_id = $a_tree_id;
45  }
global $DIC
Definition: saml.php:7
setTitleLength($a_length)
Set max title length.
setOrderColumn($a_column)
set the order column public
+ Here is the call graph for this function:

Member Function Documentation

◆ addFormItemForType()

ilECSNodeMappingCmsExplorer::addFormItemForType (   $type)

Add form item.

Parameters
<type>$type

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

References $type.

Referenced by __construct().

72  {
73  $this->form_items[$type] = true;
74  }
+ Here is the caller graph for this function:

◆ buildFormItem()

ilECSNodeMappingCmsExplorer::buildFormItem (   $a_node_id,
  $a_type 
)

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

References $a_type, ilUtil\formCheckbox(), ilUtil\formRadioButton(), isItemChecked(), ilECSCmsData\lookupStatusByObjId(), and ilECSCmsData\MAPPING_DELETED.

Referenced by formatHeader(), and formatObject().

101  {
102  if (!array_key_exists($a_type, $this->form_items) || !$this->form_items[$a_type]) {
103  return '';
104  }
105 
106  include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
108  $this->server_id,
109  $this->mid,
110  $this->tree_id,
111  $a_node_id
112  );
113 
114  if ($status == ilECSCmsData::MAPPING_DELETED) {
115  return ilUtil::formCheckbox((int) $this->isItemChecked($a_node_id), $this->post_var, $a_node_id, true);
116  }
117  switch ($this->type) {
118  case self::SEL_TYPE_CHECK:
119  return ilUtil::formCheckbox((int) $this->isItemChecked($a_node_id), $this->post_var, $a_node_id);
120  break;
121 
122  case self::SEL_TYPE_RADIO:
123  return ilUtil::formRadioButton((int) $this->isItemChecked($a_node_id), $this->post_var, $a_node_id);
124  break;
125  }
126  }
static lookupStatusByObjId($a_server_id, $a_mid, $a_tree_id, $obj_id)
Lookup status.
$a_type
Definition: workflow.php:92
static formRadioButton($checked, $varname, $value, $onclick=null, $disabled=false)
??? public
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildTitle()

ilECSNodeMappingCmsExplorer::buildTitle (   $title,
  $a_obj_id,
  $a_type 
)

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

References $title, 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().

278  {
279  if (strlen($title) >= 22) {
280  #$title = substr($title, 0,22).'...';
281  }
282 
283  include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
285  $this->server_id,
286  $this->mid,
287  $this->tree_id,
288  $a_obj_id
289  );
290 
291 
292 
293  switch ($status) {
295  return '<font style="font-weight: bold">' . $title . '</font>';
296 
298  return '<font style="font-weight: bold;font-style: italic">' . $title . '</font>';
299 
301  return '<font style="font-style: italic">' . $title . '</font>';
302 
304  return $title;
305 
307  return '<font class="warning">' . $title . '</font>';
308 
309  default:
310  return $title;
311  }
312  }
const MAPPING_PENDING_DISCONNECTABLE
static lookupStatusByObjId($a_server_id, $a_mid, $a_tree_id, $obj_id)
Lookup status.
const MAPPING_PENDING_NOT_DISCONNECTABLE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ formatHeader()

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

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

References $DIC, ilExplorer\$lng, $nd, $path, $title, ilExplorer\$tpl, buildFormItem(), buildTitle(), and ilExplorer\getRoot().

249  {
250  global $DIC;
251 
252  $lng = $DIC['lng'];
253  $ilias = $DIC['ilias'];
254 
255  // custom icons
256  $path = ilObject::_getIcon($a_obj_id, "tiny", "root");
257 
258 
259  $tpl->setCurrentBlock("icon");
260  $nd = $this->tree->getNodeData($this->getRoot());
261 
262  $title = $nd["title"];
263 
264  $tpl->setVariable("ICON_IMAGE", $path);
265  $tpl->setVariable("TXT_ALT_IMG", $title);
266  $tpl->parseCurrentBlock();
267 
268  if (strlen($formItem = $this->buildFormItem($a_obj_id, $a_option['type']))) {
269  $tpl->setCurrentBlock('check');
270  $tpl->setVariable('OBJ_CHECK', $formItem);
271  $tpl->parseCurrentBlock();
272  }
273 
274  $tpl->setVariable('OBJ_TITLE', $this->buildTitle($title, $a_obj_id, ''));
275  }
$path
Definition: aliased.php:25
global $DIC
Definition: saml.php:7
$nd
Definition: error.php:10
getRoot()
get root id
+ Here is the call graph for this function:

◆ formatObject()

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

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

References $DIC, ilExplorer\$lng, ilExplorer\$target, ilExplorer\$tpl, ilExplorer\buildDescription(), buildFormItem(), ilExplorer\buildFrameTarget(), ilExplorer\buildLinkTarget(), ilExplorer\buildOnClick(), buildTitle(), ilExplorer\createTarget(), ilExplorer\getImage(), ilExplorer\getNodeStyleClass(), isClickable(), and ilUtil\shortenText().

129  {
130  global $DIC;
131 
132  $lng = $DIC['lng'];
133 
134  if (!isset($a_node_id) or !is_array($a_option)) {
135  $this->ilias->raiseError(get_class($this) . "::formatObject(): Missing parameter or wrong datatype! " .
136  "node_id: " . $a_node_id . " options:" . var_dump($a_option), $this->ilias->error_obj->WARNING);
137  }
138 
139  $pic = false;
140  foreach ($a_option["tab"] as $picture) {
141  if ($picture == 'plus') {
142  $tpl->setCurrentBlock("expander");
143  $tpl->setVariable("EXP_DESC", $lng->txt("expand"));
144  $target = $this->createTarget('+', $a_node_id);
145  $tpl->setVariable("LINK_NAME", $a_node_id);
146  $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
147  $tpl->setVariable("IMGPATH", $this->getImage("browser/plus.png"));
148  $tpl->parseCurrentBlock();
149  $pic = true;
150  }
151 
152  if ($picture == 'minus' && $this->show_minus) {
153  $tpl->setCurrentBlock("expander");
154  $tpl->setVariable("EXP_DESC", $lng->txt("collapse"));
155  $target = $this->createTarget('-', $a_node_id);
156  $tpl->setVariable("LINK_NAME", $a_node_id);
157  $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
158  $tpl->setVariable("IMGPATH", $this->getImage("browser/minus.png"));
159  $tpl->parseCurrentBlock();
160  $pic = true;
161  }
162  }
163 
164  if (!$pic) {
165  $tpl->setCurrentBlock("blank");
166  $tpl->setVariable("BLANK_PATH", $this->getImage("browser/blank.png"));
167  $tpl->parseCurrentBlock();
168  }
169 
170  if ($this->output_icons) {
171  $tpl->setCurrentBlock("icon");
172  $tpl->setVariable("ICON_IMAGE", $this->getImage("icon_cat.svg", $a_option["type"], $a_obj_id));
173 
174  $tpl->setVariable("TARGET_ID", "iconid_" . $a_node_id);
175  $this->iconList[] = "iconid_" . $a_node_id;
176  $tpl->setVariable("TXT_ALT_IMG", $lng->txt($a_option["desc"]));
177  $tpl->parseCurrentBlock();
178  }
179 
180  if (strlen($formItem = $this->buildFormItem($a_node_id, $a_option['type']))) {
181  $tpl->setCurrentBlock('check');
182  $tpl->setVariable('OBJ_CHECK', $formItem);
183  $tpl->parseCurrentBlock();
184  }
185 
186  if ($this->isClickable($a_option["type"], $a_node_id, $a_obj_id)) { // output link
187  $tpl->setCurrentBlock("link");
188  //$target = (strpos($this->target, "?") === false) ?
189  // $this->target."?" : $this->target."&";
190  //$tpl->setVariable("LINK_TARGET", $target.$this->target_get."=".$a_node_id.$this->params_get);
191  $tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($a_node_id, $a_option["type"]));
192 
193  $style_class = $this->getNodeStyleClass($a_node_id, $a_option["type"]);
194 
195  if ($style_class != "") {
196  $tpl->setVariable("A_CLASS", ' class="' . $style_class . '" ');
197  }
198 
199  if (($onclick = $this->buildOnClick($a_node_id, $a_option["type"], $a_option["title"])) != "") {
200  $tpl->setVariable("ONCLICK", "onClick=\"$onclick\"");
201  }
202 
203  $tpl->setVariable("LINK_NAME", $a_node_id);
204  $tpl->setVariable("TITLE", ilUtil::shortenText(
205  $this->buildTitle($a_option["title"], $a_node_id, $a_option["type"]),
206  $this->textwidth,
207  true
208  ));
209  $tpl->setVariable("DESC", ilUtil::shortenText(
210  $this->buildDescription($a_option["description"], $a_node_id, $a_option["type"]),
211  $this->textwidth,
212  true
213  ));
214  $frame_target = $this->buildFrameTarget($a_option["type"], $a_node_id, $a_option["obj_id"]);
215  if ($frame_target != "") {
216  $tpl->setVariable("TARGET", " target=\"" . $frame_target . "\"");
217  }
218  $tpl->parseCurrentBlock();
219  } else { // output text only
220  $tpl->setCurrentBlock("text");
221  $tpl->setVariable("OBJ_TITLE", ilUtil::shortenText(
222  $this->buildTitle($a_option["title"], $a_node_id, $a_option["type"]),
223  $this->textwidth,
224  true
225  ));
226  $tpl->setVariable("OBJ_DESC", ilUtil::shortenText(
227  $this->buildDescription($a_option["desc"], $a_node_id, $a_option["type"]),
228  $this->textwidth,
229  true
230  ));
231  $tpl->parseCurrentBlock();
232  }
233 
234  $tpl->setCurrentBlock("list_item");
235  $tpl->parseCurrentBlock();
236  $tpl->touchBlock("element");
237  }
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
get frame target (may be overwritten by derived classes)
getNodeStyleClass($a_id, $a_type)
get style class for node
buildLinkTarget($a_node_id, $a_type)
get link target (may be overwritten by derived classes)
global $DIC
Definition: saml.php:7
isClickable($a_type, $a_ref_id=0, $a_obj_id=0)
no item is clickable
createTarget($a_type, $a_node_id, $a_highlighted_subtree=false, $a_append_anch=true)
Creates Get Parameter private.
buildOnClick($a_node_id, $a_type, $a_title)
get onclick event handling (may be overwritten by derived classes)
redirection script todo: (a better solution should control the processing via a xml file) ...
getImage($a_name, $a_type="", $a_obj_id="")
get image path (may be overwritten by derived classes)
buildDescription($a_desc, $a_id, $a_type)
standard implementation for description, may be overwritten by derived classes
+ Here is the call graph for this function:

◆ getPostVar()

ilECSNodeMappingCmsExplorer::getPostVar ( )

◆ isClickable()

ilECSNodeMappingCmsExplorer::isClickable (   $a_type,
  $a_ref_id = 0,
  $a_obj_id = 0 
)

no item is clickable

Parameters
<type>$a_type
<type>$a_ref_id
<type>$a_obj_id
Returns
<type>

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

Referenced by formatObject().

63  {
64  return false;
65  }
+ Here is the caller graph for this function:

◆ isItemChecked()

ilECSNodeMappingCmsExplorer::isItemChecked (   $a_id)

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

Referenced by buildFormItem().

87  {
88  return in_array($a_id, $this->checked_items) ? true : false;
89  }
+ Here is the caller graph for this function:

◆ removeFormItemForType()

ilECSNodeMappingCmsExplorer::removeFormItemForType (   $type)

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

References $type.

77  {
78  $this->form_items[$type] = false;
79  }

◆ setCheckedItems()

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

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

82  {
83  $this->checked_items = $a_checked_items;
84  }

◆ setPostVar()

ilECSNodeMappingCmsExplorer::setPostVar (   $a_post_var)

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

92  {
93  $this->post_var = $a_post_var;
94  }

◆ setTree()

ilECSNodeMappingCmsExplorer::setTree ( ilECSCmsTree  $tree)

Set cms tree.

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

References ilExplorer\$tree.

51  {
52  $this->tree = $tree;
53  }

Field Documentation

◆ $checked_items

ilECSNodeMappingCmsExplorer::$checked_items = array()
private

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

◆ $form_items

ilECSNodeMappingCmsExplorer::$form_items = array()
private

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

◆ $mid

ilECSNodeMappingCmsExplorer::$mid
private

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

◆ $post_var

ilECSNodeMappingCmsExplorer::$post_var = ''
private

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

Referenced by getPostVar().

◆ $server_id

ilECSNodeMappingCmsExplorer::$server_id
private

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

◆ $tree_id

ilECSNodeMappingCmsExplorer::$tree_id
private

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

◆ $type

ilECSNodeMappingCmsExplorer::$type = 0
private

◆ SEL_TYPE_CHECK

const ilECSNodeMappingCmsExplorer::SEL_TYPE_CHECK = 1

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

◆ SEL_TYPE_RADIO

const ilECSNodeMappingCmsExplorer::SEL_TYPE_RADIO = 2

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


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