31 "page" =>
"PageObject",
32 "chap" =>
"StructureObject",
33 "term" =>
"GlossaryItem",
51 parent::__construct($a_title, $a_postvar);
54 $this->obj_definition = $DIC[
"objDefinition"];
64 $this->allowed_link_types = $a_val;
85 $this->int_link_default_type =
$a_type;
86 $this->int_link_default_obj = $a_obj;
96 $this->int_link_filter_types = $a_val;
106 return self::$iltypemap;
116 return array_flip(self::$iltypemap);
126 $this->filter_white_list = $a_val;
144 $this->external_link_max_length = $a_max;
162 $next_class = $ilCtrl->getNextClass($this);
163 $cmd = $ilCtrl->getCmd();
167 case "ilinternallinkgui":
168 $lng->loadLanguageModule(
"content");
169 require_once(
"./Services/Link/classes/class.ilInternalLinkGUI.php");
171 $this->int_link_default_obj);
172 foreach ($this->int_link_filter_types as
$t)
174 $link_gui->filterLinkType($t);
177 $link_gui->setMode(
"asynch");
179 $ret = $ilCtrl->forwardCommand($link_gui);
197 $this->value = $a_value;
217 switch($a_values[$this->
getPostVar().
"_mode"])
220 if($a_values[$this->
getPostVar().
"_ajax_type"] &&
223 $val = $a_values[$this->
getPostVar().
"_ajax_type"].
"|".
225 if ($a_values[$this->
getPostVar().
"_ajax_target"] !=
"")
227 $val.=
"|".$a_values[$this->
getPostVar().
"_ajax_target"];
264 $this->
setAlert($lng->txt(
"msg_input_is_required"));
273 $this->
setAlert($lng->txt(
"msg_input_is_required"));
280 $this->
setAlert($lng->txt(
"msg_input_is_required"));
296 $val.=
"|".$_POST[$this->
getPostVar().
"_ajax_target"];
321 $has_int = $has_ext = $has_radio =
false;
347 $title = $has_radio ? $lng->txt(
"url") :
"";
357 $ilCtrl->setParameterByClass(
"ilformpropertydispatchgui",
"postvar", $this->
getPostVar());
358 $link =
array(get_class($this->
getParent()),
"ilformpropertydispatchgui", get_class($this),
"ilinternallinkgui");
359 $link = $ilCtrl->getLinkTargetByClass($link,
"",
false,
true,
false);
360 $ilCtrl->setParameterByClass(
"ilformpropertydispatchgui",
"postvar", $_REQUEST[
"postvar"]);
362 $no_disp_class = (strpos($this->
getValue(),
"|"))
366 $itpl =
new ilTemplate(
'tpl.prop_link.html',
true,
true,
'Services/Form');
367 $itpl->setVariable(
"VAL_ID", $this->
getPostVar());
368 $itpl->setVariable(
"URL_EDIT", $link);
369 $itpl->setVariable(
"TXT_EDIT", $lng->txt(
"form_get_link"));
370 $itpl->setVariable(
"CSS_REMOVE", $no_disp_class);
371 $itpl->setVariable(
"TXT_REMOVE", $lng->txt(
"remove"));
384 $ext =
new ilRadioOption($lng->txt(
"form_link_external"),
"ext");
387 $int =
new ilRadioOption($lng->txt(
"form_link_internal"),
"int");
394 $mode->addOption($no);
396 $mode->addOption($ext);
397 $mode->addOption($int);
404 $mode->setValue(
"int");
408 $mode->setValue(
"ext");
417 if($has_int && self::isInternalLink($value))
419 $mode->setValue(
"int");
421 $value_trans = self::getTranslatedValue($value);
423 $value = explode(
"|", $value);
424 $hidden_type->setValue($value[0]);
425 $hidden_id->setValue($value[1]);
426 $hidden_target->setValue($value[2]);
428 $itpl->setVariable(
"VAL_OBJECT_TYPE", $value_trans[
"type"]);
429 $itpl->setVariable(
"VAL_OBJECT_NAME", $value_trans[
"name"]);
432 $itpl->setVariable(
"VAL_TARGET_FRAME",
"(" . $value[2].
")");
437 $mode->setValue(
"ext");
439 $ti->setValue($value);
444 $mode->setValue(
"no");
448 if($has_ext && !$ti->getValue())
450 $ti->setValue(
"http://");
453 $ne->setValue($itpl->get());
458 $html = $mode->render();
462 $html = $mode->getToolbarHTML();
466 $html.= $ti->getToolbarHTML();
470 $html.= $ne->render().
471 '<div class="help-block">'.$ne->getInfo().
'</div>';
478 include_once(
"./Services/Link/classes/class.ilInternalLinkGUI.php");
479 $html.= $hidden_type->getToolbarHTML().
480 $hidden_id->getToolbarHTML().
481 $hidden_target->getToolbarHTML();
499 if(strpos($a_value,
"|"))
501 $parts = explode(
"|", $a_value);
502 if(
sizeof($parts) == 2 ||
sizeof($parts) == 3)
505 if(is_numeric($parts[1]))
508 if(preg_match(
"/^[a-zA-Z_]+$/", $parts[0], $matches))
522 $value = explode(
"|", $a_value);
527 $type = $lng->txt(
"obj_mob");
532 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
533 $type = $lng->txt(
"obj_pg");
538 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
539 $type = $lng->txt(
"obj_st");
544 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
545 $type = $lng->txt(
"term");
550 $type = $lng->txt(
"obj_".$value[0]);
567 $a_tpl->setCurrentBlock(
"prop_generic");
568 $a_tpl->setVariable(
"PROP_GENERIC",
$html);
569 $a_tpl->parseCurrentBlock();
586 $target_frame = $val[2];
587 $map = self::getTypeToAttrType();
588 if (isset($map[$val[0]]))
590 $type = $map[$val[0]];
592 if ($val[0] ==
"chap")
596 if ($val[0] ==
"term")
600 if ($val[0] ==
"page")
604 $target =
"il__".$target_type.
"_".$val[1];
606 else if ($this->obj_definition->isRBACObject($val[0]))
608 $type =
"RepositoryItem";
616 "TargetFrame" => $target_frame
631 $t = explode(
"_", $a_target);
634 $map = self::getAttrTypeToType();
635 if (
$a_type ==
"RepositoryItem")
646 if ($a_target_frame !=
"")
648 $val.=
"|".$a_target_frame;
This class represents an option in a radio group.
static getInitHTML($a_url)
Get initialisation HTML to use interna link editing.
static _lookupTitle($a_id)
lookup object title
static _lookupTitle($a_obj_id)
Lookup title.
addSubItem($a_item)
Add Subitem.
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
This class represents a non editable value in a property form.
static _lookGlossaryTerm($term_id)
get glossary term