4 require_once
'Services/Repository/classes/class.ilRepositoryExplorer.php';
52 $this->lng = $DIC->language();
53 $this->error = $DIC[
"ilErr"];
54 $this->access = $DIC->access();
55 $tree = $DIC->repositoryTree();
58 $this->
setId(
"cont_paste_explorer");
63 parent::__construct($a_target);
65 $this->root_id = $this->tree->readRootId();
66 $this->order_column =
'title';
70 $this->filter = array();
95 $this->form_items[
$type] =
true;
99 $this->form_items[
$type] =
false;
103 $this->checked_items = $a_checked_items;
107 return in_array($a_id, $this->checked_items) ? true :
false;
111 $this->post_var = $a_post_var;
126 $this->form_item_permission = $a_form_item_permission;
143 if (!
$access->checkAccess($this->getRequiredFormItemPermission(),
'', $a_node_id)) {
148 !array_key_exists(
$a_type, $this->form_items) ||
155 if (is_array(
$_SESSION[
"clipboard"][
"ref_ids"])) {
156 $disabled = in_array($a_node_id,
$_SESSION[
"clipboard"][
"ref_ids"]);
157 } elseif ((
int)
$_SESSION[
"clipboard"][
"ref_ids"]) {
158 $disabled = $a_node_id == $_SESSION[
"clipboard"][
"ref_ids"];
159 } elseif ($_SESSION[
"clipboard"][
"cmd"] ==
'copy' && $a_node_id == $_SESSION[
"clipboard"][
"parent"]) {
163 switch ($this->type) {
164 case self::SEL_TYPE_CHECK:
168 case self::SEL_TYPE_RADIO:
179 if (!isset($a_node_id)
or !is_array($a_option)) {
180 $ilErr->raiseError(get_class($this) .
"::formatObject(): Missing parameter or wrong datatype! " .
181 "node_id: " . $a_node_id .
" options:" . var_dump($a_option),
$ilErr->WARNING);
185 foreach ($a_option[
"tab"] as $picture) {
186 if ($picture ==
'plus') {
187 $tpl->setCurrentBlock(
"expander");
188 $tpl->setVariable(
"EXP_DESC",
$lng->txt(
"expand"));
190 $tpl->setVariable(
"LINK_NAME", $a_node_id);
191 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
192 $tpl->setVariable(
"IMGPATH", $this->
getImage(
"browser/plus.png"));
193 $tpl->parseCurrentBlock();
197 if ($picture ==
'minus' && $this->show_minus) {
198 $tpl->setCurrentBlock(
"expander");
199 $tpl->setVariable(
"EXP_DESC",
$lng->txt(
"collapse"));
201 $tpl->setVariable(
"LINK_NAME", $a_node_id);
202 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
203 $tpl->setVariable(
"IMGPATH", $this->
getImage(
"browser/minus.png"));
204 $tpl->parseCurrentBlock();
210 $tpl->setCurrentBlock(
"blank");
211 $tpl->setVariable(
"BLANK_PATH", $this->
getImage(
"browser/blank.png"));
212 $tpl->parseCurrentBlock();
215 if ($this->output_icons) {
216 $tpl->setCurrentBlock(
"icon");
218 $path = ilObject::_getIcon($a_obj_id,
"tiny", $a_option[
"type"]);
221 $tpl->setVariable(
"TARGET_ID",
"iconid_" . $a_node_id);
222 $this->iconList[] =
"iconid_" . $a_node_id;
223 $tpl->setVariable(
"TXT_ALT_IMG",
$lng->txt($a_option[
"desc"]));
224 $tpl->parseCurrentBlock();
227 if (strlen($formItem = $this->
buildFormItem($a_node_id, $a_option[
'type']))) {
228 $tpl->setCurrentBlock(
'check');
229 $tpl->setVariable(
'OBJ_CHECK', $formItem);
230 $tpl->parseCurrentBlock();
233 if ($this->
isClickable($a_option[
"type"], $a_node_id, $a_obj_id)) {
234 $tpl->setCurrentBlock(
"link");
242 if ($style_class !=
"") {
243 $tpl->setVariable(
"A_CLASS",
' class="' . $style_class .
'" ');
246 if (($onclick = $this->
buildOnClick($a_node_id, $a_option[
"type"], $a_option[
"title"])) !=
"") {
247 $tpl->setVariable(
"ONCLICK",
"onClick=\"$onclick\"");
250 $tpl->setVariable(
"LINK_NAME", $a_node_id);
251 $tpl->setVariable(
"TITLE", $this->
buildTitle($a_option[
"title"], $a_node_id, $a_option[
"type"]));
253 $this->
buildDescription($a_option[
"description"], $a_node_id, $a_option[
"type"]),
257 $frame_target = $this->
buildFrameTarget($a_option[
"type"], $a_node_id, $a_option[
"obj_id"]);
258 if ($frame_target !=
"") {
259 $tpl->setVariable(
"TARGET",
" target=\"" . $frame_target .
"\"");
261 $tpl->parseCurrentBlock();
263 $obj_title = $this->
buildTitle($a_option[
"title"], $a_node_id, $a_option[
"type"]);
266 if ($a_node_id == $this->highlighted) {
267 $obj_title =
"<span class=\"ilHighlighted\">" . $obj_title .
"</span>";
270 $tpl->setCurrentBlock(
"text");
271 $tpl->setVariable(
"OBJ_TITLE", $obj_title);
277 $tpl->parseCurrentBlock();
280 $tpl->setCurrentBlock(
"list_item");
281 $tpl->parseCurrentBlock();
282 $tpl->touchBlock(
"element");
298 $path = ilObject::_getIcon($a_obj_id,
"tiny",
"root");
301 $tpl->setCurrentBlock(
"icon");
302 $nd =
$tree->getNodeData(ROOT_FOLDER_ID);
310 $tpl->parseCurrentBlock();
312 if (strlen($formItem = $this->
buildFormItem($a_obj_id, $a_option[
'type']))) {
313 $tpl->setCurrentBlock(
'check');
314 $tpl->setVariable(
'OBJ_CHECK', $formItem);
315 $tpl->parseCurrentBlock();
325 if ($a_ref_id == 0) {
329 if ($ilAccess->checkAccess(
"read",
"", $a_ref_id)) {
340 if (!$ilAccess->checkAccess(
'visible',
'', $a_ref_id)) {
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
setFilterMode($a_mode=IL_FM_NEGATIVE)
set filter mode
formatHeader($tpl, $a_obj_id, $a_option)
getNodeStyleClass($a_id, $a_type)
get style class for node
buildLinkTarget($a_node_id, $a_type)
note: most of this stuff is used by ilCourseContentInterface too
getRequiredFormItemPermission()
Get required permission.
addFormItemForType($type)
isClickable($a_type, $a_ref_id=0, $a_obj_id=0)
showChilds($a_ref_id, $a_obj_id=0)
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)
__construct($a_type, $a_target, $a_session_variable)
Constructor public.
isVisible($a_ref_id, $a_type)
getImage($a_name, $a_type="", $a_obj_id="")
get image path
buildFormItem($a_node_id, $a_type)
formatObject($tpl, $a_node_id, $a_option, $a_obj_id=0)
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
STATIC, do not use $this inside!
static formRadioButton($checked, $varname, $value, $onclick=null, $disabled=false)
??? public
buildTitle($a_title, $a_id, $a_type)
standard implementation for title, may be overwritten by derived classes
setCheckedItems($a_checked_items=array())
setRequiredFormItemPermission($a_form_item_permission)
Set required perission for form item visibility.
setSessionExpandVariable($a_var_name="expand")
set name of expand session variable
addFilter($a_item)
adds item to the filter public
removeFormItemForType($type)
buildDescription($a_desc, $a_id, $a_type)
standard implementation for description, may be overwritten by derived classes
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public