4 include_once
'./Services/UIComponent/Explorer/classes/class.ilExplorer.php';
33 parent::__construct($a_target);
38 $this->type = self::SEL_TYPE_RADIO;
46 $this->filter = array();
88 $this->form_items[
$type] =
true;
93 $this->form_items[
$type] =
false;
98 $this->checked_items = $a_checked_items;
108 return in_array($a_id, $this->checked_items) ? true :
false;
113 $this->post_var = $a_post_var;
122 if (!array_key_exists(
$a_type, $this->form_items) || !$this->form_items[
$a_type]) {
126 switch ($this->type) {
127 case self::SEL_TYPE_CHECK:
131 case self::SEL_TYPE_RADIO:
143 if (!isset($a_node_id)
or !is_array($a_option)) {
144 $this->
ilias->raiseError(get_class($this) .
"::formatObject(): Missing parameter or wrong datatype! " .
145 "node_id: " . $a_node_id .
" options:" . var_dump($a_option), $this->
ilias->error_obj->WARNING);
149 foreach ($a_option[
"tab"] as $picture) {
150 if ($picture ==
'plus') {
151 $tpl->setCurrentBlock(
"expander");
152 $tpl->setVariable(
"EXP_DESC",
$lng->txt(
"expand"));
154 $tpl->setVariable(
"LINK_NAME", $a_node_id);
155 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
156 $tpl->setVariable(
"IMGPATH", $this->
getImage(
"browser/plus.png"));
157 $tpl->parseCurrentBlock();
161 if ($picture ==
'minus' && $this->show_minus) {
162 $tpl->setCurrentBlock(
"expander");
163 $tpl->setVariable(
"EXP_DESC",
$lng->txt(
"collapse"));
165 $tpl->setVariable(
"LINK_NAME", $a_node_id);
166 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
167 $tpl->setVariable(
"IMGPATH", $this->
getImage(
"browser/minus.png"));
168 $tpl->parseCurrentBlock();
174 $tpl->setCurrentBlock(
"blank");
175 $tpl->setVariable(
"BLANK_PATH", $this->
getImage(
"browser/blank.png"));
176 $tpl->parseCurrentBlock();
179 if ($this->output_icons) {
180 $tpl->setCurrentBlock(
"icon");
181 $tpl->setVariable(
"ICON_IMAGE", $this->
getImage(
"icon_" . $a_option[
"type"] .
".svg", $a_option[
"type"], $a_obj_id));
183 $tpl->setVariable(
"TARGET_ID",
"iconid_" . $a_node_id);
184 $this->iconList[] =
"iconid_" . $a_node_id;
185 $tpl->setVariable(
"TXT_ALT_IMG",
$lng->txt($a_option[
"desc"]));
186 $tpl->parseCurrentBlock();
189 if (strlen($formItem = $this->
buildFormItem($a_node_id, $a_option[
'type']))) {
190 $tpl->setCurrentBlock(
'check');
191 $tpl->setVariable(
'OBJ_CHECK', $formItem);
192 $tpl->parseCurrentBlock();
195 if ($this->
isClickable($a_option[
"type"], $a_node_id, $a_obj_id)) {
196 $tpl->setCurrentBlock(
"link");
204 if ($style_class !=
"") {
205 $tpl->setVariable(
"A_CLASS",
' class="' . $style_class .
'" ');
208 if (($onclick = $this->
buildOnClick($a_node_id, $a_option[
"type"], $a_option[
"title"])) !=
"") {
209 $tpl->setVariable(
"ONCLICK",
"onClick=\"$onclick\"");
212 $tpl->setVariable(
"LINK_NAME", $a_node_id);
215 $this->
buildTitle($a_option[
"title"], $a_node_id, $a_option[
"type"])
218 $this->
buildDescription($a_option[
"description"], $a_node_id, $a_option[
"type"]),
222 $frame_target = $this->
buildFrameTarget($a_option[
"type"], $a_node_id, $a_option[
"obj_id"]);
223 if ($frame_target !=
"") {
224 $tpl->setVariable(
"TARGET",
" target=\"" . $frame_target .
"\"");
226 $tpl->parseCurrentBlock();
228 $tpl->setCurrentBlock(
"text");
231 $this->
buildTitle($a_option[
"title"], $a_node_id, $a_option[
"type"])
238 $tpl->parseCurrentBlock();
241 $tpl->setCurrentBlock(
"list_item");
242 $tpl->parseCurrentBlock();
243 $tpl->touchBlock(
"element");
260 $ilias = $DIC[
'ilias'];
261 $tree = $DIC[
'tree'];
264 $path = ilObject::_getIcon($a_obj_id,
"tiny",
"root");
267 $tpl->setCurrentBlock(
"icon");
268 $nd =
$tree->getNodeData(ROOT_FOLDER_ID);
276 $tpl->parseCurrentBlock();
278 if (strlen($formItem = $this->
buildFormItem($a_obj_id, $a_option[
'type']))) {
279 $tpl->setCurrentBlock(
'check');
280 $tpl->setVariable(
'OBJ_CHECK', $formItem);
281 $tpl->parseCurrentBlock();
284 if ($this->
isMapped(ROOT_FOLDER_ID)) {
287 '<font style="font-weight: bold">' .
$title .
'</font>' 304 return '<font style="font-weight: bold">' .
$title .
'</font>';
307 return '<font style="font-style: italic">' .
$title .
'</font>';
317 include_once
'./Services/WebServices/ECS/classes/Course/class.ilECSCourseMappingRule.php';
324 $this->mappings[$ref_id] =
$GLOBALS[
'DIC'][
'tree']->getPathId($ref_id, 1);
331 return array_key_exists($a_ref_id, $this->mappings);
336 foreach ($this->mappings as $ref_id => $parent_nodes) {
337 if (in_array($a_ref_id, $parent_nodes)) {
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
formatHeader($tpl, $a_obj_id, $a_option)
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
get frame target (may be overwritten by derived classes)
setFilterMode($a_mode=IL_FM_NEGATIVE)
set filter mode
initMappings()
Init (read) current mappings.
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)
buildFormItem($a_node_id, $a_type)
__construct($a_target, $a_sid, $a_mid)
formatObject($tpl, $a_node_id, $a_option, $a_obj_id=0)
setOrderColumn($a_column)
set the order column public
setFiltered($a_bool)
active/deactivate the filter public
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) ...
buildTitle($title, $a_obj_id, $a_type)
Format title (bold for direct mappings, italic for child mappings)
static getRuleRefIds($a_sid, $a_mid)
setRoot($a_root_id)
Set root node.
static formRadioButton($checked, $varname, $value, $onclick=null, $disabled=false)
??? public
Class ilExplorer class for explorer view in admin frame.
setCheckedItems($a_checked_items=array())
getImage($a_name, $a_type="", $a_obj_id="")
get image path (may be overwritten by derived classes)
isClickable($a_type, $a_ref_id=0, $a_obj_id=0)
no item is clickable
addFormItemForType($type)
Add form item.
addFilter($a_item)
adds item to the filter public
hasParentMapping($a_ref_id)
buildDescription($a_desc, $a_id, $a_type)
standard implementation for description, may be overwritten by derived classes
removeFormItemForType($type)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public