ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilPermanentLinkGUI Class Reference

Class for permanent links. More...

+ Collaboration diagram for ilPermanentLinkGUI:

Public Member Functions

 __construct ($a_type, $a_id, $a_append="", $a_target="")
 Example: type = "wiki", id (ref_id) = "234", append = "_Start_Page". More...
 
 setIncludePermanentLinkText ($a_includepermanentlinktext)
 Set Include permanent link text. More...
 
 getIncludePermanentLinkText ()
 Get Include permanent link text. More...
 
 setType ($a_type)
 Set Type. More...
 
 getType ()
 Get Type. More...
 
 setId ($a_id)
 Set Id. More...
 
 getId ()
 Get Id. More...
 
 setAppend ($a_append)
 Set Append. More...
 
 getAppend ()
 Get Append. More...
 
 setTarget ($a_target)
 Set Target. More...
 
 getTarget ()
 Get Target. More...
 
 setTitle ($a_val)
 Set title. More...
 
 getTitle ()
 Get title. More...
 
 setAlignCenter ($a_val)
 Set center alignment. More...
 
 getAlignCenter ()
 Get center alignment. More...
 
 getHTML ()
 Get HTML for link. More...
 

Static Protected Member Functions

static getBookmarksSelectionList ($title, $href)
 

Protected Attributes

 $lng
 
 $ctrl
 
 $obj_data_cache
 
 $align_center = true
 

Detailed Description

Class for permanent links.

Version
$Id$

ilPermanentLinkGUI: ilNoteGUI, ilColumnGUI, ilPublicUserProfileGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilPermanentLinkGUI::__construct (   $a_type,
  $a_id,
  $a_append = "",
  $a_target = "" 
)

Example: type = "wiki", id (ref_id) = "234", append = "_Start_Page".

Definition at line 39 of file class.ilPermanentLinkGUI.php.

References $a_type, $DIC, setAppend(), setId(), setIncludePermanentLinkText(), setTarget(), and setType().

40  {
41  global $DIC;
42 
43  $this->lng = $DIC->language();
44  $this->ctrl = $DIC->ctrl();
45  $this->obj_data_cache = $DIC["ilObjDataCache"];
46  $this->setType($a_type);
47  $this->setId($a_id);
48  $this->setAppend($a_append);
49  $this->setIncludePermanentLinkText(true);
50  $this->setTarget($a_target);
51  }
setAppend($a_append)
Set Append.
global $DIC
Definition: saml.php:7
setTarget($a_target)
Set Target.
setIncludePermanentLinkText($a_includepermanentlinktext)
Set Include permanent link text.
$a_type
Definition: workflow.php:92
setType($a_type)
Set Type.
+ Here is the call graph for this function:

Member Function Documentation

◆ getAlignCenter()

ilPermanentLinkGUI::getAlignCenter ( )

Get center alignment.

Returns
boolean align the link at center

Definition at line 188 of file class.ilPermanentLinkGUI.php.

References $align_center.

Referenced by getHTML().

189  {
190  return $this->align_center;
191  }
+ Here is the caller graph for this function:

◆ getAppend()

ilPermanentLinkGUI::getAppend ( )

Get Append.

Returns
string Append

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

Referenced by getHTML().

129  {
130  return $this->append;
131  }
+ Here is the caller graph for this function:

◆ getBookmarksSelectionList()

static ilPermanentLinkGUI::getBookmarksSelectionList (   $title,
  $href 
)
staticprotected
Returns
string

Definition at line 258 of file class.ilPermanentLinkGUI.php.

References $_SERVER, $GLOBALS, $html, and $title.

259  {
260  require_once 'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
261 
262  $current_selection_list = new ilAdvancedSelectionListGUI();
263  $random = new \ilRandom();
264  $current_selection_list->setId('socialbm_actions_' . md5(uniqid($random->int(), true)));
265 
266  $html = '';
267 
268  if (!$GLOBALS['DIC']['ilUser']->isAnonymous() && !$GLOBALS['DIC']['ilSetting']->get('disable_bookmarks')) {
269  $GLOBALS['DIC']->ctrl()->setParameterByClass(
270  'ilbookmarkadministrationgui',
271  'bmf_id',
272  1
273  );
274  $GLOBALS['DIC']->ctrl()->setParameterByClass(
275  'ilbookmarkadministrationgui',
276  'return_to',
277  'true'
278  );
279  $GLOBALS['DIC']->ctrl()->setParameterByClass(
280  'ilbookmarkadministrationgui',
281  'bm_title',
282  urlencode($title)
283  );
284  $GLOBALS['DIC']->ctrl()->setParameterByClass(
285  'ilbookmarkadministrationgui',
286  'bm_link',
287  urlencode($href)
288  );
289  $GLOBALS['DIC']->ctrl()->setParameterByClass(
290  'ilbookmarkadministrationgui',
291  'return_to_url',
292  urlencode($_SERVER['REQUEST_URI'])
293  );
294  $link = $GLOBALS['DIC']->ctrl()->getLinkTargetByClass(
295  ['ilPersonalDesktopGUI', 'ilbookmarkadministrationgui'],
296  'newFormBookmark'
297  );
298  $current_selection_list->addItem($GLOBALS['DIC']['lng']->txt("bm_add_to_ilias"), '', $link, '', $GLOBALS['DIC']['lng']->txt('bm_add_to_ilias'), '_top');
299  $html = $current_selection_list->getHTML();
300  }
301 
302  return $html;
303  }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
User interface class for advanced drop-down selection lists.
$html
Definition: example_001.php:87
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.

◆ getHTML()

ilPermanentLinkGUI::getHTML ( )

Get HTML for link.

Definition at line 196 of file class.ilPermanentLinkGUI.php.

References $ctrl, $ilCtrl, $lng, $obj_data_cache, $title, $tpl, ilLink\_getStaticLink(), getAlignCenter(), getAppend(), getId(), getIncludePermanentLinkText(), getTarget(), getTitle(), and getType().

Referenced by ilPublicUserProfileGUI\getEmbeddable().

197  {
198  $lng = $this->lng;
200  $ilObjDataCache = $this->obj_data_cache;
201 
202  $tpl = new ilTemplate(
203  "tpl.permanent_link.html",
204  true,
205  true,
206  "Services/PermanentLink"
207  );
208 
209  include_once('./Services/Link/classes/class.ilLink.php');
210  $href = ilLink::_getStaticLink(
211  $this->getId(),
212  $this->getType(),
213  true,
214  $this->getAppend()
215  );
216  if ($this->getIncludePermanentLinkText()) {
217  $tpl->setVariable("TXT_PERMA", $lng->txt("perma_link") . ":");
218  }
219 
220  $title = '';
221 
222  // fetch default title for bookmark
223 
224  if ($this->getTitle() != "") {
225  $title = $this->getTitle();
226  } elseif (is_numeric($this->getId())) {
227  $obj_id = $ilObjDataCache->lookupObjId($this->getId());
228  $title = $ilObjDataCache->lookupTitle($obj_id);
229  }
230  #if (!$title)
231  # $bookmark->setTitle("untitled");
232 
233  $tpl->setVariable("TXT_BOOKMARK_DEFAULT", $title);
234 
235  $tpl->setVariable("LINK", $href);
236 
237  if ($this->getAlignCenter()) {
238  $tpl->setVariable("ALIGN", "center");
239  } else {
240  $tpl->setVariable("ALIGN", "left");
241  }
242 
243  if ($this->getTarget() != "") {
244  $tpl->setVariable("TARGET", 'target="' . $this->getTarget() . '"');
245  }
246 
247  $bm_html = self::getBookmarksSelectionList($title, $href);
248  if ($bm_html) {
249  $tpl->setVariable('SELECTION_LIST', $bm_html);
250  }
251 
252  return $tpl->get();
253  }
getIncludePermanentLinkText()
Get Include permanent link text.
$tpl
Definition: ilias.php:10
global $ilCtrl
Definition: ilias.php:18
getAlignCenter()
Get center alignment.
special template class to simplify handling of ITX/PEAR
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getId()

ilPermanentLinkGUI::getId ( )

Get Id.

Returns
string Id

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

References $id.

Referenced by getHTML().

109  {
110  return $this->id;
111  }
if(!array_key_exists('StateId', $_REQUEST)) $id
+ Here is the caller graph for this function:

◆ getIncludePermanentLinkText()

ilPermanentLinkGUI::getIncludePermanentLinkText ( )

Get Include permanent link text.

Returns
boolean Include permanent link text

Definition at line 68 of file class.ilPermanentLinkGUI.php.

Referenced by getHTML().

69  {
70  return $this->includepermanentlinktext;
71  }
+ Here is the caller graph for this function:

◆ getTarget()

ilPermanentLinkGUI::getTarget ( )

Get Target.

Returns
string Target

Definition at line 148 of file class.ilPermanentLinkGUI.php.

References $target.

Referenced by getHTML().

149  {
150  return $this->target;
151  }
$target
Definition: test.php:19
+ Here is the caller graph for this function:

◆ getTitle()

ilPermanentLinkGUI::getTitle ( )

Get title.

Returns
string title

Definition at line 168 of file class.ilPermanentLinkGUI.php.

References $title.

Referenced by getHTML().

169  {
170  return $this->title;
171  }
+ Here is the caller graph for this function:

◆ getType()

ilPermanentLinkGUI::getType ( )

Get Type.

Returns
string Type

Definition at line 88 of file class.ilPermanentLinkGUI.php.

References $type.

Referenced by getHTML().

89  {
90  return $this->type;
91  }
$type
+ Here is the caller graph for this function:

◆ setAlignCenter()

ilPermanentLinkGUI::setAlignCenter (   $a_val)

Set center alignment.

Parameters
booleanalign the link at center

Definition at line 178 of file class.ilPermanentLinkGUI.php.

179  {
180  $this->align_center = $a_val;
181  }

◆ setAppend()

ilPermanentLinkGUI::setAppend (   $a_append)

Set Append.

Parameters
string$a_appendAppend

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

Referenced by __construct().

119  {
120  $this->append = $a_append;
121  }
+ Here is the caller graph for this function:

◆ setId()

ilPermanentLinkGUI::setId (   $a_id)

Set Id.

Parameters
string$a_idId

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

Referenced by __construct().

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

◆ setIncludePermanentLinkText()

ilPermanentLinkGUI::setIncludePermanentLinkText (   $a_includepermanentlinktext)

Set Include permanent link text.

Parameters
boolean$a_includepermanentlinktextInclude permanent link text

Definition at line 58 of file class.ilPermanentLinkGUI.php.

Referenced by __construct().

59  {
60  $this->includepermanentlinktext = $a_includepermanentlinktext;
61  }
+ Here is the caller graph for this function:

◆ setTarget()

ilPermanentLinkGUI::setTarget (   $a_target)

Set Target.

Parameters
string$a_targetTarget

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

Referenced by __construct().

139  {
140  $this->target = $a_target;
141  }
+ Here is the caller graph for this function:

◆ setTitle()

ilPermanentLinkGUI::setTitle (   $a_val)

Set title.

Parameters
stringtitle

Definition at line 158 of file class.ilPermanentLinkGUI.php.

Referenced by ilLMPresentationGUI\ilLMSubMenu().

159  {
160  $this->title = $a_val;
161  }
+ Here is the caller graph for this function:

◆ setType()

ilPermanentLinkGUI::setType (   $a_type)

Set Type.

Parameters
string$a_typeType

Definition at line 78 of file class.ilPermanentLinkGUI.php.

References $a_type.

Referenced by __construct().

79  {
80  $this->type = $a_type;
81  }
$a_type
Definition: workflow.php:92
+ Here is the caller graph for this function:

Field Documentation

◆ $align_center

ilPermanentLinkGUI::$align_center = true
protected

Definition at line 34 of file class.ilPermanentLinkGUI.php.

Referenced by getAlignCenter().

◆ $ctrl

ilPermanentLinkGUI::$ctrl
protected

Definition at line 27 of file class.ilPermanentLinkGUI.php.

Referenced by getHTML().

◆ $lng

ilPermanentLinkGUI::$lng
protected

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

Referenced by getHTML().

◆ $obj_data_cache

ilPermanentLinkGUI::$obj_data_cache
protected

Definition at line 32 of file class.ilPermanentLinkGUI.php.

Referenced by getHTML().


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