32 "page" =>
"PageObject",
33 "chap" =>
"StructureObject",
34 "term" =>
"GlossaryItem",
53 $this->ctrl = $DIC->ctrl();
54 $this->lng = $DIC->language();
59 $this->obj_definition = $DIC[
"objDefinition"];
69 $this->allowed_link_types = $a_val;
90 $this->int_link_default_type = $a_type;
91 $this->int_link_default_obj = $a_obj;
101 $this->int_link_filter_types = $a_val;
111 return self::$iltypemap;
121 return array_flip(self::$iltypemap);
131 $this->filter_white_list = $a_val;
149 $this->external_link_max_length = $a_max;
168 $next_class = $ilCtrl->getNextClass($this);
169 $cmd = $ilCtrl->getCmd();
171 switch ($next_class) {
172 case "ilinternallinkgui":
173 $lng->loadLanguageModule(
"content");
174 require_once(
"./Services/Link/classes/class.ilInternalLinkGUI.php");
176 $this->int_link_default_type,
177 $this->int_link_default_obj
179 foreach ($this->int_link_filter_types as $t) {
180 $link_gui->filterLinkType($t);
183 $link_gui->setMode(
"asynch");
185 $ret = $ilCtrl->forwardCommand($link_gui);
203 $this->value = $a_value;
223 switch ($a_values[$this->
getPostVar() .
"_mode"]) {
225 if ($a_values[$this->
getPostVar() .
"_ajax_type"] &&
226 $a_values[$this->
getPostVar() .
"_ajax_id"]) {
227 $val = $a_values[$this->
getPostVar() .
"_ajax_type"] .
"|" .
229 if ($a_values[$this->
getPostVar() .
"_ajax_target"] !=
"") {
230 $val .=
"|" . $a_values[$this->
getPostVar() .
"_ajax_target"];
318 $has_int = $has_ext = $has_radio = $has_list =
false;
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"));
394 $mode->addOption($no);
396 $mode->addOption($ext);
398 $mode->addOption($int);
403 $mode->setValue(
"int");
405 $mode->setValue(
"ext");
413 $mode_type->addOption($mode_single);
415 $mode_type->addOption($mode_list);
419 $mode->addOption($no);
425 $mode->addOption($ext);
426 $mode->addOption($int);
427 $mode_single->addSubItem($mode);
434 if ($has_int && self::isInternalLink($value)) {
435 $mode->setValue(
"int");
437 $value_trans = self::getTranslatedValue($value);
439 $value = explode(
"|", $value);
440 $hidden_type->setValue($value[0]);
441 $hidden_id->setValue($value[1]);
442 $hidden_target->setValue($value[2]);
444 $itpl->setVariable(
"VAL_OBJECT_TYPE", $value_trans[
"type"]);
445 $itpl->setVariable(
"VAL_OBJECT_NAME", $value_trans[
"name"]);
446 if ($value[2] !=
"") {
447 $itpl->setVariable(
"VAL_TARGET_FRAME",
"(" . $value[2] .
")");
449 } elseif ($has_ext) {
450 $mode->setValue(
"ext");
452 $ti->setValue($value);
455 $mode->setValue(
"no");
459 if ($has_ext && !$ti->getValue()) {
460 $ti->setValue(
"https://");
464 $ne->setValue($itpl->get());
469 $html = $mode->render();
471 $html = $mode->getToolbarHTML();
474 $html .= $ti->getToolbarHTML();
475 } elseif ($has_int) {
476 $html .= $ne->render() .
477 '<div class="help-block">' . $ne->getInfo() .
'</div>';
481 $html = $mode_type->render();
486 include_once(
"./Services/Link/classes/class.ilInternalLinkGUI.php");
487 $html .= $hidden_type->getToolbarHTML() .
488 $hidden_id->getToolbarHTML() .
489 $hidden_target->getToolbarHTML();
507 if (strpos($a_value,
"|")) {
508 $parts = explode(
"|", $a_value);
509 if (
sizeof($parts) == 2 ||
sizeof($parts) == 3) {
511 if (is_numeric($parts[1])) {
513 if (preg_match(
"/^[a-zA-Z_]+$/", $parts[0], $matches)) {
526 $lng = $DIC->language();
528 $value = explode(
"|", $a_value);
537 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
543 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
559 return array(
"type" =>
$type,
"name" =>
$name);
571 $a_tpl->setCurrentBlock(
"prop_generic");
572 $a_tpl->setVariable(
"PROP_GENERIC", $html);
573 $a_tpl->parseCurrentBlock();
589 $target_frame = $val[2];
590 $map = self::getTypeToAttrType();
591 if (isset($map[$val[0]])) {
592 $type = $map[$val[0]];
594 if ($val[0] ==
"chap") {
597 if ($val[0] ==
"term") {
600 if ($val[0] ==
"page") {
604 } elseif ($this->obj_definition->isRBACObject($val[0])) {
605 $type =
"RepositoryItem";
606 $target =
"il__obj_" . $val[1];
612 "TargetFrame" => $target_frame
627 $t = explode(
"_", $a_target);
630 $map = self::getAttrTypeToType();
631 if ($a_type ==
"RepositoryItem") {
633 } elseif (isset($map[$a_type])) {
634 $type = $map[$a_type];
638 if ($a_target_frame !=
"") {
639 $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)
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.
__construct(Container $dic, ilPlugin $plugin)
static _lookGlossaryTerm($term_id)
get glossary term