ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLinkInputGUI Class Reference

This class represents a external and/or internal link in a property form. More...

+ Inheritance diagram for ilLinkInputGUI:
+ Collaboration diagram for ilLinkInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setAllowedLinkTypes ($a_val)
 Set allowed link types (BOTH, INT, EXT) More...
 
 getAllowedLinkTypes ()
 Get allowed link types (BOTH, INT, EXT) More...
 
 setInternalLinkDefault ($a_type, $a_obj=0)
 Set internal link default. More...
 
 setInternalLinkFilterTypes (array $a_val)
 Set internal link filter types. More...
 
 setFilterWhiteList ($a_val)
 Set filter white list. More...
 
 getFilterWhiteList ()
 Get filter white list. More...
 
 setExternalLinkMaxLength ($a_max)
 
 getExternalLinkMaxLength ()
 
 executeCommand ()
 Execute current command. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 render ()
 Render item. More...
 
 getContentOutsideFormTag ()
 
 insert ($a_tpl)
 Insert property html. More...
 
 getIntLinkAttributes ()
 Get value as internal link attributes. More...
 
 setValueByIntLinkAttributes ($a_type, $a_target, $a_target_frame="")
 Set value by internal links attributes. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setPostVar ($a_postvar)
 Set Post Variable. More...
 
 getPostVar ()
 Get Post Variable. More...
 
 getFieldId ()
 Get Post Variable. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setAlert ($a_alert)
 Set Alert Text. More...
 
 getAlert ()
 Get Alert Text. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required. More...
 
 setDisabled ($a_disabled)
 Set Disabled. More...
 
 getDisabled ()
 Get Disabled. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm ($a_parentform)
 Set Parent Form. More...
 
 getParentForm ()
 Get Parent Form. More...
 
 setParent ($a_val)
 Set Parent GUI object. More...
 
 getParent ()
 Get Parent GUI object. More...
 
 getSubForm ()
 Get sub form html. More...
 
 hideSubForm ()
 Sub form hidden on init? More...
 
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders) More...
 
 getHiddenTitle ()
 Get hidden title. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 writeToSession ()
 Write to session. More...
 
 clearFromSession ()
 Clear session value. More...
 
 readFromSession ()
 Read from session. More...
 
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties) More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi. More...
 
 getMulti ()
 Get Multi. More...
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 getMultiValues ()
 Get multi values. More...
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback ($a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
 
 getTableFilterLabelFor ()
 Get label "for" attribute value for filter. More...
 
 getFormLabelFor ()
 Get label "for" attribute value for form. More...
 

Static Public Member Functions

static getTypeToAttrType ()
 Get internal types to xml attribute types map. More...
 
static getAttrTypeToType ()
 Get internal types to xml attribute types map (reverse) More...
 
static isInternalLink ($a_value)
 
static getTranslatedValue ($a_value)
 
- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 

Data Fields

const EXTERNAL_LINK_MAX_LENGTH = 200
 
const BOTH = "both"
 
const INT = "int"
 
const EXT = "ext"
 

Protected Attributes

 $allowed_link_types = self::BOTH
 
 $int_link_default_type = "RepositoryItem"
 
 $int_link_default_obj = 0
 
 $int_link_filter_types = array("RepositoryItem")
 
 $filter_white_list = true
 
 $external_link_max_length = self::EXTERNAL_LINK_MAX_LENGTH
 
 $obj_definition
 
- Protected Attributes inherited from ilFormPropertyGUI
 $ctrl
 
 $lng
 
 $type
 
 $title
 
 $postvar
 
 $info
 
 $alert
 
 $required = false
 
 $parentgui
 
 $parentform
 
 $hidden_title = ""
 
 $multi = false
 
 $multi_sortable = false
 
 $multi_addremove = true
 
 $multi_values
 

Static Protected Attributes

static $iltypemap
 

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

Detailed Description

This class represents a external and/or internal link in a property form.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

ilLinkInputGUI: ilFormPropertyDispatchGUI ilLinkInputGUI: ilInternalLinkGUI

Definition at line 15 of file class.ilLinkInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilLinkInputGUI::__construct (   $a_title = "",
  $a_postvar = "" 
)

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Definition at line 48 of file class.ilLinkInputGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and ilFormPropertyGUI\setType().

49  {
50  global $DIC;
51 
52  $this->ctrl = $DIC->ctrl();
53  $this->lng = $DIC->language();
54 
55  parent::__construct($a_title, $a_postvar);
56  $this->setType("link");
57 
58  $this->obj_definition = $DIC["objDefinition"];
59  }
setType($a_type)
Set Type.
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilLinkInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Definition at line 251 of file class.ilLinkInputGUI.php.

References $_POST, ilFormPropertyGUI\$lng, ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilFormPropertyGUI\setAlert(), and ilUtil\stripSlashes().

252  {
253  $lng = $this->lng;
254 
255  // debugging
256  // return false;
257 
258  if ($this->getRequired()) {
259  switch ($_POST[$this->getPostVar() . "_mode"]) {
260  case "ext":
261  if (!$_POST[$this->getPostVar()]) {
262  $this->setAlert($lng->txt("msg_input_is_required"));
263  return false;
264  }
265  break;
266 
267  case "int":
268  if (!$_POST[$this->getPostVar() . "_ajax_type"] ||
269  !$_POST[$this->getPostVar() . "_ajax_id"]) {
270  $this->setAlert($lng->txt("msg_input_is_required"));
271  return false;
272  }
273  break;
274 
275  case "no":
276  default:
277  $this->setAlert($lng->txt("msg_input_is_required"));
278  return false;
279  }
280  }
281 
282  if ($_POST[$this->getPostVar() . "_mode"] == "int") {
283  $_POST[$this->getPostVar() . "_ajax_type"] = ilUtil::stripSlashes($_POST[$this->getPostVar() . "_ajax_type"]);
284  $_POST[$this->getPostVar() . "_ajax_id"] = ilUtil::stripSlashes($_POST[$this->getPostVar() . "_ajax_id"]);
285  $_POST[$this->getPostVar() . "_ajax_target"] = ilUtil::stripSlashes($_POST[$this->getPostVar() . "_ajax_target"]);
286 
287  // overwriting post-data so getInput() will work
288  $val = $_POST[$this->getPostVar() . "_ajax_type"] . "|" .
289  $_POST[$this->getPostVar() . "_ajax_id"];
290  if ($_POST[$this->getPostVar() . "_ajax_target"] != "") {
291  $val .= "|" . $_POST[$this->getPostVar() . "_ajax_target"];
292  }
293 
294  $_POST[$this->getPostVar()] = $val;
295  } elseif ($_POST[$this->getPostVar() . "_mode"] == "no") {
296  $_POST[$this->getPostVar()] = "";
297  } else {
298  $_POST[$this->getPostVar()] = ilUtil::stripSlashes($_POST[$this->getPostVar()]);
299  }
300 
301  return true;
302  }
getPostVar()
Get Post Variable.
setAlert($a_alert)
Set Alert Text.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ executeCommand()

ilLinkInputGUI::executeCommand ( )

Execute current command.

Definition at line 162 of file class.ilLinkInputGUI.php.

References ilFormPropertyGUI\$ctrl, $ilCtrl, ilFormPropertyGUI\$lng, $ret, and getFilterWhiteList().

163  {
165  $lng = $this->lng;
166 
167  $next_class = $ilCtrl->getNextClass($this);
168  $cmd = $ilCtrl->getCmd();
169 
170  switch ($next_class) {
171  case "ilinternallinkgui":
172  $lng->loadLanguageModule("content");
173  require_once("./Services/Link/classes/class.ilInternalLinkGUI.php");
174  $link_gui = new ilInternalLinkGUI(
175  $this->int_link_default_type,
176  $this->int_link_default_obj
177  );
178  foreach ($this->int_link_filter_types as $t) {
179  $link_gui->filterLinkType($t);
180  }
181  $link_gui->setFilterWhiteList($this->getFilterWhiteList());
182  $link_gui->setMode("asynch");
183 
184  $ret = $ilCtrl->forwardCommand($link_gui);
185  break;
186 
187  default:
188  var_dump($cmd);
189  //exit();
190  }
191 
192  return $ret;
193  }
getFilterWhiteList()
Get filter white list.
Class ilInternalLinkGUI.
global $ilCtrl
Definition: ilias.php:18
$ret
Definition: parser.php:6
+ Here is the call graph for this function:

◆ getAllowedLinkTypes()

ilLinkInputGUI::getAllowedLinkTypes ( )

Get allowed link types (BOTH, INT, EXT)

Returns
string self::BOTH|self::INT|self::EXT

Definition at line 76 of file class.ilLinkInputGUI.php.

References $allowed_link_types.

Referenced by getContentOutsideFormTag(), and render().

77  {
79  }
+ Here is the caller graph for this function:

◆ getAttrTypeToType()

static ilLinkInputGUI::getAttrTypeToType ( )
static

Get internal types to xml attribute types map (reverse)

Returns
string[]

Definition at line 118 of file class.ilLinkInputGUI.php.

119  {
120  return array_flip(self::$iltypemap);
121  }

◆ getContentOutsideFormTag()

ilLinkInputGUI::getContentOutsideFormTag ( )

Definition at line 459 of file class.ilLinkInputGUI.php.

References getAllowedLinkTypes(), and ilInternalLinkGUI\getInitHTML().

460  {
461  if ($this->getAllowedLinkTypes() == self::INT ||
462  $this->getAllowedLinkTypes() == self::BOTH) {
463  // as the ajax-panel uses a form it has to be outside of the parent form!
465  }
466  }
static getInitHTML($a_url)
Get initialisation HTML to use interna link editing.
getAllowedLinkTypes()
Get allowed link types (BOTH, INT, EXT)
+ Here is the call graph for this function:

◆ getExternalLinkMaxLength()

ilLinkInputGUI::getExternalLinkMaxLength ( )
Returns
int

Definition at line 154 of file class.ilLinkInputGUI.php.

References $external_link_max_length.

Referenced by render().

155  {
157  }
+ Here is the caller graph for this function:

◆ getFilterWhiteList()

ilLinkInputGUI::getFilterWhiteList ( )

Get filter white list.

Returns
bool filter list is white list

Definition at line 138 of file class.ilLinkInputGUI.php.

References $filter_white_list.

Referenced by executeCommand().

139  {
141  }
+ Here is the caller graph for this function:

◆ getIntLinkAttributes()

ilLinkInputGUI::getIntLinkAttributes ( )

Get value as internal link attributes.

Returns
array (with keys "Type", "Target" and "TargetFrame")

Definition at line 544 of file class.ilLinkInputGUI.php.

References $_POST, $ret, $target_type, ilFormPropertyGUI\$type, and ilFormPropertyGUI\getPostVar().

545  {
546  $val = explode("|", $_POST[$this->getPostVar()]);
547 
548  $ret = false;
549  $type = "";
550  $target = "";
551  if (self::isInternalLink($_POST[$this->getPostVar()])) {
552  $target_frame = $val[2];
553  $map = self::getTypeToAttrType();
554  if (isset($map[$val[0]])) {
555  $type = $map[$val[0]];
556  $target_type = $val[0];
557  if ($val[0] == "chap") {
558  $target_type = "st";
559  }
560  if ($val[0] == "term") {
561  $target_type = "git";
562  }
563  if ($val[0] == "page") {
564  $target_type = "pg";
565  }
566  $target = "il__" . $target_type . "_" . $val[1];
567  } elseif ($this->obj_definition->isRBACObject($val[0])) {
568  $type = "RepositoryItem";
569  $target = "il__obj_" . $val[1];
570  }
571  if ($type != "") {
572  $ret = array(
573  "Target" => $target,
574  "Type" => $type,
575  "TargetFrame" => $target_frame
576  );
577  }
578  }
579  return $ret;
580  }
$target_type
Definition: goto.php:48
getPostVar()
Get Post Variable.
$ret
Definition: parser.php:6
$_POST["username"]
+ Here is the call graph for this function:

◆ getTranslatedValue()

static ilLinkInputGUI::getTranslatedValue (   $a_value)
static

Definition at line 485 of file class.ilLinkInputGUI.php.

References $DIC, ilFormPropertyGUI\$lng, $name, ilFormPropertyGUI\$type, ilGlossaryTerm\_lookGlossaryTerm(), ilObject\_lookupObjId(), ilLMObject\_lookupTitle(), and ilObject\_lookupTitle().

Referenced by ilWebResourceEditableLinkTableGUI\fillRow().

486  {
487  global $DIC;
488 
489  $lng = $DIC->language();
490 
491  $value = explode("|", $a_value);
492 
493  switch ($value[0]) {
494  case "media":
495  $type = $lng->txt("obj_mob");
496  $name = ilObject::_lookupTitle($value[1]);
497  break;
498 
499  case "page":
500  include_once("./Modules/LearningModule/classes/class.ilLMPageObject.php");
501  $type = $lng->txt("obj_pg");
502  $name = ilLMPageObject::_lookupTitle($value[1]);
503  break;
504 
505  case "chap":
506  include_once("./Modules/LearningModule/classes/class.ilStructureObject.php");
507  $type = $lng->txt("obj_st");
509  break;
510 
511  case "term":
512  $type = $lng->txt("term");
514  break;
515 
516  default:
517  $type = $lng->txt("obj_" . $value[0]);
519  break;
520  }
521 
522  return array("type" => $type, "name" => $name);
523  }
static _lookupTitle($a_id)
lookup object title
static _lookupTitle($a_obj_id)
Lookup title.
if($format !==null) $name
Definition: metadata.php:230
static _lookupObjId($a_id)
$DIC
Definition: xapitoken.php:46
static _lookGlossaryTerm($term_id)
get glossary term
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTypeToAttrType()

static ilLinkInputGUI::getTypeToAttrType ( )
static

Get internal types to xml attribute types map.

Returns
string[]

Definition at line 108 of file class.ilLinkInputGUI.php.

109  {
110  return self::$iltypemap;
111  }

◆ getValue()

ilLinkInputGUI::getValue ( )

Get Value.

Returns
string Value

Definition at line 210 of file class.ilLinkInputGUI.php.

Referenced by render().

211  {
212  return $this->value;
213  }
+ Here is the caller graph for this function:

◆ insert()

ilLinkInputGUI::insert (   $a_tpl)

Insert property html.

Returns
int Size

Definition at line 530 of file class.ilLinkInputGUI.php.

References render().

531  {
532  $html = $this->render();
533 
534  $a_tpl->setCurrentBlock("prop_generic");
535  $a_tpl->setVariable("PROP_GENERIC", $html);
536  $a_tpl->parseCurrentBlock();
537  }
render()
Render item.
+ Here is the call graph for this function:

◆ isInternalLink()

static ilLinkInputGUI::isInternalLink (   $a_value)
static

Definition at line 468 of file class.ilLinkInputGUI.php.

Referenced by ilObjLinkResourceGUI\checkLinkInput(), ilObjLinkResourceListGUI\getCommandFrame(), ilObjLinkResourceGUI\handleSubItemLinks(), ilWebResourceLinkTableGUI\parse(), and ilObjLinkResourceGUI\updateLinks().

469  {
470  if (strpos($a_value, "|")) {
471  $parts = explode("|", $a_value);
472  if (sizeof($parts) == 2 || sizeof($parts) == 3) {
473  // numeric id
474  if (is_numeric($parts[1])) {
475  // simple type
476  if (preg_match("/^[a-zA-Z_]+$/", $parts[0], $matches)) {
477  return true;
478  }
479  }
480  }
481  }
482  return false;
483  }
+ Here is the caller graph for this function:

◆ render()

ilLinkInputGUI::render ( )

Render item.

Definition at line 307 of file class.ilLinkInputGUI.php.

References ilFormPropertyGUI\$ctrl, $ilCtrl, ilFormPropertyGUI\$lng, ilFormPropertyGUI\$title, ilRadioOption\addSubItem(), getAllowedLinkTypes(), getExternalLinkMaxLength(), ilFormPropertyGUI\getParent(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), and getValue().

Referenced by insert().

308  {
309  $lng = $this->lng;
311 
312  // parse settings
313  $has_int = $has_ext = $has_radio = false;
314  switch ($this->getAllowedLinkTypes()) {
315  case self::EXT:
316  $has_ext = true;
317  break;
318 
319  case self::INT:
320  $has_int = true;
321  break;
322 
323  case self::BOTH:
324  $has_int = true;
325  $has_ext = true;
326  $has_radio = true;
327  break;
328  }
329  if (!$this->getRequired()) {
330  // see #0021274
331  $has_radio = true;
332  }
333 
334  // external
335  if ($has_ext) {
336  $title = $has_radio ? $lng->txt("url") : "";
337 
338  // external
339  $ti = new ilTextInputGUI($title, $this->getPostVar());
340  $ti->setMaxLength($this->getExternalLinkMaxLength());
341  }
342 
343  // internal
344  if ($has_int) {
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"]);
349 
350  $no_disp_class = (strpos($this->getValue(), "|"))
351  ? ""
352  : " ilNoDisplay";
353 
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"));
360 
361  $ne = new ilNonEditableValueGUI($lng->txt("object"), $this->getPostVar() . "_val", true);
362 
363  // hidden field for selected value
364  $hidden_type = new ilHiddenInputGUI($this->getPostVar() . "_ajax_type");
365  $hidden_id = new ilHiddenInputGUI($this->getPostVar() . "_ajax_id");
366  $hidden_target = new ilHiddenInputGUI($this->getPostVar() . "_ajax_target");
367  }
368 
369  // mode
370  if ($has_radio) {
371  $ext = new ilRadioOption($lng->txt("form_link_external"), "ext");
372  $ext->addSubItem($ti);
373 
374  if ($has_int) {
375  $int = new ilRadioOption($lng->txt("form_link_internal"), "int");
376  $int->addSubItem($ne);
377  }
378 
379  $mode = new ilRadioGroupInputGUI("", $this->getPostVar() . "_mode");
380  if (!$this->getRequired()) {
381  $no = new ilRadioOption($lng->txt("form_no_link"), "no");
382  $mode->addOption($no);
383  }
384  $mode->addOption($ext);
385  if ($has_int) {
386  $mode->addOption($int);
387  }
388  } else {
389  $mode = new ilHiddenInputGUI($this->getPostVar() . "_mode");
390  if ($has_int) {
391  $mode->setValue("int");
392  } else {
393  $mode->setValue("ext");
394  }
395  }
396 
397  // value
398  $value = $this->getValue();
399  if ($value) {
400  // #15647
401  if ($has_int && self::isInternalLink($value)) {
402  $mode->setValue("int");
403 
404  $value_trans = self::getTranslatedValue($value);
405 
406  $value = explode("|", $value);
407  $hidden_type->setValue($value[0]);
408  $hidden_id->setValue($value[1]);
409  $hidden_target->setValue($value[2]);
410 
411  $itpl->setVariable("VAL_OBJECT_TYPE", $value_trans["type"]);
412  $itpl->setVariable("VAL_OBJECT_NAME", $value_trans["name"]);
413  if ($value[2] != "") {
414  $itpl->setVariable("VAL_TARGET_FRAME", "(" . $value[2] . ")");
415  }
416  } elseif ($has_ext) {
417  $mode->setValue("ext");
418 
419  $ti->setValue($value);
420  }
421  } elseif (!$this->getRequired()) {
422  $mode->setValue("no");
423  }
424 
425  // #10185 - default for external urls
426  if ($has_ext && !$ti->getValue()) {
427  $ti->setValue("https://");
428  }
429 
430  if ($has_int) {
431  $ne->setValue($itpl->get());
432  }
433 
434  // to html
435  if ($has_radio) {
436  $html = $mode->render();
437  } else {
438  $html = $mode->getToolbarHTML();
439 
440  if ($has_ext) {
441  $html .= $ti->getToolbarHTML();
442  } elseif ($has_int) {
443  $html .= $ne->render() .
444  '<div class="help-block">' . $ne->getInfo() . '</div>';
445  }
446  }
447 
448  // js for internal link
449  if ($has_int) {
450  include_once("./Services/Link/classes/class.ilInternalLinkGUI.php");
451  $html .= $hidden_type->getToolbarHTML() .
452  $hidden_id->getToolbarHTML() .
453  $hidden_target->getToolbarHTML();
454  }
455 
456  return $html;
457  }
This class represents an option in a radio group.
getPostVar()
Get Post Variable.
global $ilCtrl
Definition: ilias.php:18
This class represents a hidden form property in a property form.
This class represents a property in a property form.
addSubItem($a_item)
Add Subitem.
getParent()
Get Parent GUI object.
This class represents a non editable value in a property form.
getAllowedLinkTypes()
Get allowed link types (BOTH, INT, EXT)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAllowedLinkTypes()

ilLinkInputGUI::setAllowedLinkTypes (   $a_val)

Set allowed link types (BOTH, INT, EXT)

Parameters
string$a_valself::BOTH|self::INT|self::EXT

Definition at line 66 of file class.ilLinkInputGUI.php.

Referenced by ilPCSectionGUI\initForm(), and ilPageObjectGUI\initOpenedContentForm().

67  {
68  $this->allowed_link_types = $a_val;
69  }
+ Here is the caller graph for this function:

◆ setExternalLinkMaxLength()

ilLinkInputGUI::setExternalLinkMaxLength (   $a_max)
Parameters
intmax length for external links

Definition at line 146 of file class.ilLinkInputGUI.php.

147  {
148  $this->external_link_max_length = $a_max;
149  }

◆ setFilterWhiteList()

ilLinkInputGUI::setFilterWhiteList (   $a_val)

Set filter white list.

Parameters
bool$a_valfilter list is white list

Definition at line 128 of file class.ilLinkInputGUI.php.

129  {
130  $this->filter_white_list = $a_val;
131  }

◆ setInternalLinkDefault()

ilLinkInputGUI::setInternalLinkDefault (   $a_type,
  $a_obj = 0 
)

Set internal link default.

Parameters
string$a_typelink type
int$a_objobject id

Definition at line 87 of file class.ilLinkInputGUI.php.

References $a_type.

88  {
89  $this->int_link_default_type = $a_type;
90  $this->int_link_default_obj = $a_obj;
91  }
$a_type
Definition: workflow.php:92

◆ setInternalLinkFilterTypes()

ilLinkInputGUI::setInternalLinkFilterTypes ( array  $a_val)

Set internal link filter types.

Parameters
array$a_valfilter types

Definition at line 98 of file class.ilLinkInputGUI.php.

Referenced by ilObjLinkResourceGUI\initFormLink().

99  {
100  $this->int_link_filter_types = $a_val;
101  }
+ Here is the caller graph for this function:

◆ setValue()

ilLinkInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

Definition at line 200 of file class.ilLinkInputGUI.php.

Referenced by setValueByArray(), and setValueByIntLinkAttributes().

201  {
202  $this->value = $a_value;
203  }
+ Here is the caller graph for this function:

◆ setValueByArray()

ilLinkInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Definition at line 220 of file class.ilLinkInputGUI.php.

References ilFormPropertyGUI\getPostVar(), and setValue().

221  {
222  switch ($a_values[$this->getPostVar() . "_mode"]) {
223  case "int":
224  if ($a_values[$this->getPostVar() . "_ajax_type"] &&
225  $a_values[$this->getPostVar() . "_ajax_id"]) {
226  $val = $a_values[$this->getPostVar() . "_ajax_type"] . "|" .
227  $a_values[$this->getPostVar() . "_ajax_id"];
228  if ($a_values[$this->getPostVar() . "_ajax_target"] != "") {
229  $val .= "|" . $a_values[$this->getPostVar() . "_ajax_target"];
230  }
231  $this->setValue($val);
232  }
233  break;
234 
235  case "no":
236  break;
237 
238  default:
239  if ($a_values[$this->getPostVar()]) {
240  $this->setValue($a_values[$this->getPostVar()]);
241  }
242  break;
243  }
244  }
getPostVar()
Get Post Variable.
setValue($a_value)
Set Value.
+ Here is the call graph for this function:

◆ setValueByIntLinkAttributes()

ilLinkInputGUI::setValueByIntLinkAttributes (   $a_type,
  $a_target,
  $a_target_frame = "" 
)

Set value by internal links attributes.

Parameters

Definition at line 588 of file class.ilLinkInputGUI.php.

References $a_type, $target_id, ilFormPropertyGUI\$type, ilObject\_lookupType(), and setValue().

589  {
590  $t = explode("_", $a_target);
591  $target_id = $t[3];
592  $type = "";
593  $map = self::getAttrTypeToType();
594  if ($a_type == "RepositoryItem") {
596  } elseif (isset($map[$a_type])) {
597  $type = $map[$a_type];
598  }
599  if ($type != "" && $target_id != "") {
600  $val = $type . "|" . $target_id;
601  if ($a_target_frame != "") {
602  $val .= "|" . $a_target_frame;
603  }
604  $this->setValue($val);
605  }
606  }
$target_id
Definition: goto.php:49
setValue($a_value)
Set Value.
$a_type
Definition: workflow.php:92
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:

Field Documentation

◆ $allowed_link_types

ilLinkInputGUI::$allowed_link_types = self::BOTH
protected

Definition at line 22 of file class.ilLinkInputGUI.php.

Referenced by getAllowedLinkTypes().

◆ $external_link_max_length

ilLinkInputGUI::$external_link_max_length = self::EXTERNAL_LINK_MAX_LENGTH
protected

Definition at line 28 of file class.ilLinkInputGUI.php.

Referenced by getExternalLinkMaxLength().

◆ $filter_white_list

ilLinkInputGUI::$filter_white_list = true
protected

Definition at line 26 of file class.ilLinkInputGUI.php.

Referenced by getFilterWhiteList().

◆ $iltypemap

ilLinkInputGUI::$iltypemap
staticprotected
Initial value:
= array(
"page" => "PageObject",
"chap" => "StructureObject",
"term" => "GlossaryItem",
"wpage" => "WikiPage"
)

Definition at line 30 of file class.ilLinkInputGUI.php.

◆ $int_link_default_obj

ilLinkInputGUI::$int_link_default_obj = 0
protected

Definition at line 24 of file class.ilLinkInputGUI.php.

◆ $int_link_default_type

ilLinkInputGUI::$int_link_default_type = "RepositoryItem"
protected

Definition at line 23 of file class.ilLinkInputGUI.php.

◆ $int_link_filter_types

ilLinkInputGUI::$int_link_filter_types = array("RepositoryItem")
protected

Definition at line 25 of file class.ilLinkInputGUI.php.

◆ $obj_definition

ilLinkInputGUI::$obj_definition
protected

Definition at line 40 of file class.ilLinkInputGUI.php.

◆ BOTH

const ilLinkInputGUI::BOTH = "both"

Definition at line 19 of file class.ilLinkInputGUI.php.

Referenced by ilPCSectionGUI\initForm().

◆ EXT

const ilLinkInputGUI::EXT = "ext"

Definition at line 21 of file class.ilLinkInputGUI.php.

Referenced by ilPCSectionGUI\initForm().

◆ EXTERNAL_LINK_MAX_LENGTH

const ilLinkInputGUI::EXTERNAL_LINK_MAX_LENGTH = 200

Definition at line 17 of file class.ilLinkInputGUI.php.

◆ INT

const ilLinkInputGUI::INT = "int"

Definition at line 20 of file class.ilLinkInputGUI.php.

Referenced by ilPageObjectGUI\initOpenedContentForm().


The documentation for this class was generated from the following file: