31 "page" =>
"PageObject",
32 "chap" =>
"StructureObject",
33 "term" =>
"GlossaryItem",
52 $this->ctrl = $DIC->ctrl();
53 $this->lng = $DIC->language();
55 parent::__construct($a_title, $a_postvar);
58 $this->obj_definition = $DIC[
"objDefinition"];
68 $this->allowed_link_types = $a_val;
89 $this->int_link_default_type =
$a_type;
90 $this->int_link_default_obj = $a_obj;
100 $this->int_link_filter_types = $a_val;
110 return self::$iltypemap;
120 return array_flip(self::$iltypemap);
130 $this->filter_white_list = $a_val;
148 $this->external_link_max_length = $a_max;
167 $next_class =
$ilCtrl->getNextClass($this);
170 switch ($next_class) {
171 case "ilinternallinkgui":
172 $lng->loadLanguageModule(
"content");
173 require_once(
"./Services/Link/classes/class.ilInternalLinkGUI.php");
175 $this->int_link_default_type,
176 $this->int_link_default_obj
178 foreach ($this->int_link_filter_types as
$t) {
179 $link_gui->filterLinkType($t);
182 $link_gui->setMode(
"asynch");
202 $this->value = $a_value;
222 switch ($a_values[$this->
getPostVar() .
"_mode"]) {
224 if ($a_values[$this->
getPostVar() .
"_ajax_type"] &&
225 $a_values[$this->
getPostVar() .
"_ajax_id"]) {
226 $val = $a_values[$this->
getPostVar() .
"_ajax_type"] .
"|" .
228 if ($a_values[$this->
getPostVar() .
"_ajax_target"] !=
"") {
229 $val .=
"|" . $a_values[$this->
getPostVar() .
"_ajax_target"];
313 $has_int = $has_ext = $has_radio =
false;
345 $ilCtrl->setParameterByClass(
"ilformpropertydispatchgui",
"postvar", $this->
getPostVar());
346 $link = array(get_class($this->
getParent()),
"ilformpropertydispatchgui", get_class($this),
"ilinternallinkgui");
347 $link =
$ilCtrl->getLinkTargetByClass($link,
"",
false,
true,
false);
348 $ilCtrl->setParameterByClass(
"ilformpropertydispatchgui",
"postvar", $_REQUEST[
"postvar"]);
350 $no_disp_class = (strpos($this->
getValue(),
"|"))
354 $itpl =
new ilTemplate(
'tpl.prop_link.html',
true,
true,
'Services/Form');
355 $itpl->setVariable(
"VAL_ID", $this->
getPostVar());
356 $itpl->setVariable(
"URL_EDIT", $link);
357 $itpl->setVariable(
"TXT_EDIT",
$lng->txt(
"form_get_link"));
358 $itpl->setVariable(
"CSS_REMOVE", $no_disp_class);
359 $itpl->setVariable(
"TXT_REMOVE",
$lng->txt(
"remove"));
375 $int->addSubItem($ne);
380 $mode->addOption($no);
382 $mode->addOption($ext);
383 $mode->addOption(
$int);
387 $mode->setValue(
"int");
389 $mode->setValue(
"ext");
397 if ($has_int && self::isInternalLink($value)) {
398 $mode->setValue(
"int");
400 $value_trans = self::getTranslatedValue($value);
402 $value = explode(
"|", $value);
403 $hidden_type->setValue($value[0]);
404 $hidden_id->setValue($value[1]);
405 $hidden_target->setValue($value[2]);
407 $itpl->setVariable(
"VAL_OBJECT_TYPE", $value_trans[
"type"]);
408 $itpl->setVariable(
"VAL_OBJECT_NAME", $value_trans[
"name"]);
409 if ($value[2] !=
"") {
410 $itpl->setVariable(
"VAL_TARGET_FRAME",
"(" . $value[2] .
")");
412 } elseif ($has_ext) {
413 $mode->setValue(
"ext");
415 $ti->setValue($value);
418 $mode->setValue(
"no");
422 if ($has_ext && !$ti->getValue()) {
423 $ti->setValue(
"http://");
426 $ne->setValue($itpl->get());
430 $html = $mode->render();
432 $html = $mode->getToolbarHTML();
435 $html .= $ti->getToolbarHTML();
437 $html .= $ne->render() .
438 '<div class="help-block">' . $ne->getInfo() .
'</div>';
444 include_once(
"./Services/Link/classes/class.ilInternalLinkGUI.php");
445 $html .= $hidden_type->getToolbarHTML() .
446 $hidden_id->getToolbarHTML() .
447 $hidden_target->getToolbarHTML();
464 if (strpos($a_value,
"|")) {
465 $parts = explode(
"|", $a_value);
466 if (
sizeof($parts) == 2 ||
sizeof($parts) == 3) {
468 if (is_numeric($parts[1])) {
470 if (preg_match(
"/^[a-zA-Z_]+$/", $parts[0], $matches)) {
483 $lng = $DIC->language();
485 $value = explode(
"|", $a_value);
494 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
500 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
506 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
517 return array(
"type" =>
$type,
"name" =>
$name);
529 $a_tpl->setCurrentBlock(
"prop_generic");
530 $a_tpl->setVariable(
"PROP_GENERIC",
$html);
531 $a_tpl->parseCurrentBlock();
547 $target_frame = $val[2];
548 $map = self::getTypeToAttrType();
549 if (isset(
$map[$val[0]])) {
552 if ($val[0] ==
"chap") {
555 if ($val[0] ==
"term") {
558 if ($val[0] ==
"page") {
562 } elseif ($this->obj_definition->isRBACObject($val[0])) {
563 $type =
"RepositoryItem";
564 $target =
"il__obj_" . $val[1];
570 "TargetFrame" => $target_frame
585 $t = explode(
"_", $a_target);
588 $map = self::getAttrTypeToType();
589 if (
$a_type ==
"RepositoryItem") {
596 if ($a_target_frame !=
"") {
597 $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
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