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(
"./Services/Link/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"));
216 $val.=
"|".$_POST[$this->
getPostVar().
"_ajax_target"];
237 $has_int = $has_ext = $has_radio =
false;
258 $title = $has_radio ? $lng->txt(
"url") :
"";
262 $ti->setMaxLength(200);
269 $ilCtrl->setParameterByClass(
"ilformpropertydispatchgui",
"postvar", $this->
getPostVar());
270 $link = array(get_class($this->
getParent()),
"ilformpropertydispatchgui", get_class($this),
"ilinternallinkgui");
271 $link = $ilCtrl->getLinkTargetByClass($link,
"",
false,
true,
false);
272 $ilCtrl->setParameterByClass(
"ilformpropertydispatchgui",
"postvar",
"");
274 $no_disp_class = (strpos($this->
getValue(),
"|"))
278 $itpl =
new ilTemplate(
'tpl.prop_link.html',
true,
true,
'Services/Form');
279 $itpl->setVariable(
"VAL_ID", $this->
getPostVar());
280 $itpl->setVariable(
"URL_EDIT", $link);
281 $itpl->setVariable(
"TXT_EDIT", $lng->txt(
"form_get_link"));
282 $itpl->setVariable(
"CSS_REMOVE", $no_disp_class);
283 $itpl->setVariable(
"TXT_REMOVE", $lng->txt(
"remove"));
296 $ext =
new ilRadioOption($lng->txt(
"form_link_external"),
"ext");
299 $int =
new ilRadioOption($lng->txt(
"form_link_internal"),
"int");
303 $mode->addOption($ext);
304 $mode->addOption($int);
311 $mode->setValue(
"int");
315 $mode->setValue(
"ext");
324 if($has_int && self::isInternalLink($value))
326 $mode->setValue(
"int");
330 $value = explode(
"|", $value);
331 $hidden_type->setValue($value[0]);
332 $hidden_id->setValue($value[1]);
333 $hidden_target->setValue($value[2]);
335 $itpl->setVariable(
"VAL_OBJECT_TYPE", $value_trans[
"type"]);
336 $itpl->setVariable(
"VAL_OBJECT_NAME", $value_trans[
"name"]);
340 $mode->setValue(
"ext");
342 $ti->setValue($value);
347 if($has_ext && !$ti->getValue())
349 $ti->setValue(
"http://");
352 $ne->setValue($itpl->get());
357 $html = $mode->render();
361 $html = $mode->getToolbarHTML();
365 $html.= $ti->getToolbarHTML();
369 $html.= $ne->render().
370 '<div class="help-block">'.$ne->getInfo().
'</div>';
377 include_once(
"./Services/Link/classes/class.ilInternalLinkGUI.php");
378 $html.= $hidden_type->getToolbarHTML().
379 $hidden_id->getToolbarHTML().
380 $hidden_target->getToolbarHTML();
398 if(strpos($a_value,
"|"))
400 $parts = explode(
"|", $a_value);
401 if(
sizeof($parts) == 2 ||
sizeof($parts) == 3)
404 if(is_numeric($parts[1]))
407 if(preg_match(
"/^[a-zA-Z_]+$/", $parts[0], $matches))
421 $value = explode(
"|", $a_value);
426 $type = $lng->txt(
"obj_mob");
431 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
432 $type = $lng->txt(
"obj_pg");
437 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
438 $type = $lng->txt(
"term");
443 $type = $lng->txt(
"obj_".$value[0]);
448 return array(
"type"=>
$type,
"name"=>$name);
460 $a_tpl->setCurrentBlock(
"prop_generic");
461 $a_tpl->setVariable(
"PROP_GENERIC", $html);
462 $a_tpl->parseCurrentBlock();