44 $this->allowed_link_types = $a_val;
65 $this->int_link_default_type = $a_type;
66 $this->int_link_default_obj = $a_obj;
76 $this->int_link_filter_types = $a_val;
86 $next_class = $ilCtrl->getNextClass($this);
87 $cmd = $ilCtrl->getCmd();
91 case "ilinternallinkgui":
92 $lng->loadLanguageModule(
"content");
93 require_once(
"./Modules/LearningModule/classes/class.ilInternalLinkGUI.php");
95 $this->int_link_default_obj);
96 foreach ($this->int_link_filter_types as
$t)
98 $link_gui->filterLinkType($t);
100 $link_gui->setFilterWhiteList(
true);
101 $link_gui->setMode(
"asynch");
103 $ret = $ilCtrl->forwardCommand($link_gui);
121 $this->value = $a_value;
141 switch($a_values[$this->
getPostVar().
"_mode"])
144 if($a_values[$this->
getPostVar().
"_ajax_type"] &&
147 $val = $a_values[$this->
getPostVar().
"_ajax_type"].
"|".
149 if ($a_values[$this->
getPostVar().
"_ajax_target"] !=
"")
151 $val.=
"|".$a_values[$this->
getPostVar().
"_ajax_target"];
185 $this->
setAlert($lng->txt(
"msg_input_is_required"));
194 $this->
setAlert($lng->txt(
"msg_input_is_required"));
200 $this->
setAlert($lng->txt(
"msg_input_is_required"));
212 $val.=
"|".$_POST[$this->
getPostVar().
"_ajax_target"];
229 $has_int = $has_ext = $has_radio =
false;
250 $title = $has_radio ? $lng->txt(
"url") :
"";
254 $ti->setMaxLength(200);
261 $ilCtrl->setParameterByClass(
"ilformpropertydispatchgui",
"postvar", $this->
getPostVar());
262 $link = array(get_class($this->
getParent()),
"ilformpropertydispatchgui", get_class($this),
"ilinternallinkgui");
263 $link = $ilCtrl->getLinkTargetByClass($link,
"",
false,
true,
false);
264 $ilCtrl->setParameterByClass(
"ilformpropertydispatchgui",
"postvar",
"");
266 $no_disp_class = (strpos($this->
getValue(),
"|"))
270 $itpl =
new ilTemplate(
'tpl.prop_link.html',
true,
true,
'Services/Form');
271 $itpl->setVariable(
"VAL_ID", $this->
getPostVar());
272 $itpl->setVariable(
"URL_EDIT", $link);
273 $itpl->setVariable(
"TXT_EDIT", $lng->txt(
"form_get_link"));
274 $itpl->setVariable(
"CSS_REMOVE", $no_disp_class);
275 $itpl->setVariable(
"TXT_REMOVE", $lng->txt(
"remove"));
288 $ext =
new ilRadioOption($lng->txt(
"form_link_external"),
"ext");
291 $int =
new ilRadioOption($lng->txt(
"form_link_internal"),
"int");
295 $mode->addOption($ext);
296 $mode->addOption($int);
303 $mode->setValue(
"int");
307 $mode->setValue(
"ext");
316 if($has_int && self::isInternalLink($value))
318 $mode->setValue(
"int");
322 $value = explode(
"|", $value);
323 $hidden_type->setValue($value[0]);
324 $hidden_id->setValue($value[1]);
325 $hidden_target->setValue($value[2]);
327 $itpl->setVariable(
"VAL_OBJECT_TYPE", $value_trans[
"type"]);
328 $itpl->setVariable(
"VAL_OBJECT_NAME", $value_trans[
"name"]);
332 $mode->setValue(
"ext");
334 $ti->setValue($value);
339 if($has_ext && !$ti->getValue())
341 $ti->setValue(
"http://");
344 $ne->setValue($itpl->get());
349 $html = $mode->render();
353 $html = $mode->getToolbarHTML();
357 $html.= $ti->getToolbarHTML();
361 $html.= $ne->render().
362 '<div class="ilFormInfo">'.$ne->getInfo().
'</div>';
369 include_once(
"./Modules/LearningModule/classes/class.ilInternalLinkGUI.php");
370 $html.= $hidden_type->getToolbarHTML().
371 $hidden_id->getToolbarHTML().
372 $hidden_target->getToolbarHTML().
381 if(strpos($a_value,
"|"))
383 $parts = explode(
"|", $a_value);
384 if(
sizeof($parts) == 2 ||
sizeof($parts) == 3)
387 if(is_numeric($parts[1]))
390 if(preg_match(
"/^[a-zA-Z_]+$/", $parts[0], $matches))
404 $value = explode(
"|", $a_value);
409 $type = $lng->txt(
"obj_mob");
414 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
415 $type = $lng->txt(
"obj_pg");
420 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
421 $type = $lng->txt(
"term");
426 $type = $lng->txt(
"obj_".$value[0]);
431 return array(
"type"=>
$type,
"name"=>$name);
443 $a_tpl->setCurrentBlock(
"prop_generic");
444 $a_tpl->setVariable(
"PROP_GENERIC", $html);
445 $a_tpl->parseCurrentBlock();