ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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".
 setIncludePermanentLinkText ($a_includepermanentlinktext)
 Set Include permanent link text.
 getIncludePermanentLinkText ()
 Get Include permanent link text.
 setType ($a_type)
 Set Type.
 getType ()
 Get Type.
 setId ($a_id)
 Set Id.
 getId ()
 Get Id.
 setAppend ($a_append)
 Set Append.
 getAppend ()
 Get Append.
 setTarget ($a_target)
 Set Target.
 getTarget ()
 Get Target.
 setTitle ($a_val)
 Set title.
 getTitle ()
 Get title.
 setAlignCenter ($a_val)
 Set center alignment.
 getAlignCenter ()
 Get center alignment.
 getHTML ()
 Get HTML for link.

Static Public Member Functions

static _getBookmarksSelectionList ($title, $href)
 returns the active bookmark links.

Protected Attributes

 $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

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

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

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

References setAppend(), setId(), setIncludePermanentLinkText(), setTarget(), and setType().

{
$this->setType($a_type);
$this->setId($a_id);
$this->setAppend($a_append);
$this->setTarget($a_target);
}

+ Here is the call graph for this function:

Member Function Documentation

static ilPermanentLinkGUI::_getBookmarksSelectionList (   $title,
  $href 
)
static

returns the active bookmark links.

if only one link is enabled, a single link is returned. otherwise a the html of an advanced selection list is returned.

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

References $_SESSION, $ilDB, $ilSetting, $lng, $row, ilPermanentLink\getActiveBookmarks(), and ilUtil\getImagePath().

Referenced by ilInfoScreenGUI\addObjectSections(), and getHTML().

{
global $ilDB, $lng, $ilSetting;
require_once 'Services/PermanentLink/classes/class.ilPermanentLink.php';
// social bookmarkings
include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
$current_selection_list = new ilAdvancedSelectionListGUI();
//$current_selection_list->setListTitle($lng->txt("bm_add_to_social_bookmarks"));
$current_selection_list->setId("socialbm_actions");
$current_selection_list->setUseImages(true);
$cnt = 0;
if ($_SESSION["AccountId"] != ANONYMOUS_USER_ID && !$ilSetting->get('disable_bookmarks'))
{
$linktpl = 'ilias.php?cmd=redirect&baseClass=ilPersonalDesktopGUI&redirectClass=ilbookmarkadministrationgui&redirectCmd=newFormBookmark&param_bmf_id=1&param_return_to=true&param_bm_title='. urlencode(urlencode($title)) . '&param_bm_link=' . urlencode(urlencode($href))."&param_return_to_url=".urlencode(urlencode($_SERVER['REQUEST_URI']));
$current_selection_list->addItem($lng->txt("bm_add_to_ilias"), '', $linktpl, ilUtil::getImagePath('socialbookmarks/icon_bm_15x15.gif') , $lng->txt("bm_add_to_ilias"), '_top');
$cnt++;
}
foreach ($rset as $row)
{
$linktpl = $row->sbm_link;
$linktpl = str_replace('{LINK}', urlencode($href), $linktpl);
$linktpl = str_replace('{TITLE}', urlencode($title), $linktpl);
$current_selection_list->addItem($row->sbm_title, '', $linktpl, $row->sbm_icon, $row->title, '_blank');
$cnt++;
}
if ($cnt == 1 && $_SESSION["AccountId"] != ANONYMOUS_USER_ID && !$ilSetting->get('disable_bookmarks'))
{
$loc_tpl = new ilTemplate('tpl.single_link.html', true, true, 'Services/PermanentLink');
$loc_tpl->setVariable("TXT_ADD_TO_ILIAS_BM", $lng->txt("bm_add_to_ilias"));
$loc_tpl->setVariable("URL_ADD_TO_BM", 'ilias.php?cmd=redirect&baseClass=ilPersonalDesktopGUI&redirectClass=ilbookmarkadministrationgui&redirectCmd=newFormBookmark&param_bmf_id=1&param_return_to=true&param_bm_title='. urlencode(urlencode($title)) . '&param_bm_link=' . urlencode(urlencode($href))."&param_return_to_url=".urlencode(urlencode($_SERVER['REQUEST_URI'])));
$loc_tpl->setVariable("ICON", ilUtil::getImagePath('icon_bm.svg'));
return $loc_tpl->get();
}
else if ($cnt >= 1)
{
return $current_selection_list->getHTML();
}
else
return '';
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPermanentLinkGUI::getAlignCenter ( )

Get center alignment.

Returns
boolean align the link at center

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

References $align_center.

Referenced by getHTML().

{
}

+ Here is the caller graph for this function:

ilPermanentLinkGUI::getAppend ( )

Get Append.

Returns
string Append

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

Referenced by getHTML().

{
return $this->append;
}

+ Here is the caller graph for this function:

ilPermanentLinkGUI::getHTML ( )

Get HTML for link.

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

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

Referenced by ilPublicUserProfileGUI\getEmbeddable().

{
global $lng, $ilCtrl, $ilObjDataCache;
$tpl = new ilTemplate("tpl.permanent_link.html", true, true,
"Services/PermanentLink");
include_once('./Services/Link/classes/class.ilLink.php');
$href = ilLink::_getStaticLink($this->getId(), $this->getType(),
true, $this->getAppend());
{
$tpl->setVariable("TXT_PERMA", $lng->txt("perma_link").":");
}
$title = '';
// fetch default title for bookmark
if ($this->getTitle() != "")
{
$title = $this->getTitle();
}
else
{
$obj_id = $ilObjDataCache->lookupObjId($this->getId());
$title = $ilObjDataCache->lookupTitle($obj_id);
}
#if (!$title)
# $bookmark->setTitle("untitled");
$tpl->setVariable("TXT_BOOKMARK_DEFAULT", $title);
$tpl->setVariable("LINK", $href);
if ($this->getAlignCenter())
{
$tpl->setVariable("ALIGN", "center");
}
else
{
$tpl->setVariable("ALIGN", "left");
}
if ($this->getTarget() != "")
{
$tpl->setVariable("TARGET", 'target="'.$this->getTarget().'"');
}
// bookmark links
$bm_html = self::_getBookmarksSelectionList($title, $href);
if ($bm_html)
{
$tpl->setVariable('SELECTION_LIST', $bm_html);
}
return $tpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPermanentLinkGUI::getId ( )

Get Id.

Returns
string Id

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

Referenced by getHTML().

{
return $this->id;
}

+ Here is the caller graph for this function:

ilPermanentLinkGUI::getIncludePermanentLinkText ( )

Get Include permanent link text.

Returns
boolean Include permanent link text

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

Referenced by getHTML().

{
return $this->includepermanentlinktext;
}

+ Here is the caller graph for this function:

ilPermanentLinkGUI::getTarget ( )

Get Target.

Returns
string Target

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

Referenced by getHTML().

{
return $this->target;
}

+ Here is the caller graph for this function:

ilPermanentLinkGUI::getTitle ( )

Get title.

Returns
string title

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

Referenced by getHTML(), and ilLMPresentationGUI\ilLMSubMenu().

{
return $this->title;
}

+ Here is the caller graph for this function:

ilPermanentLinkGUI::getType ( )

Get Type.

Returns
string Type

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

Referenced by getHTML().

{
return $this->type;
}

+ Here is the caller graph for this function:

ilPermanentLinkGUI::setAlignCenter (   $a_val)

Set center alignment.

Parameters
booleanalign the link at center

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

{
$this->align_center = $a_val;
}
ilPermanentLinkGUI::setAppend (   $a_append)

Set Append.

Parameters
string$a_appendAppend

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

Referenced by __construct().

{
$this->append = $a_append;
}

+ Here is the caller graph for this function:

ilPermanentLinkGUI::setId (   $a_id)

Set Id.

Parameters
string$a_idId

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

Referenced by __construct().

{
$this->id = $a_id;
}

+ Here is the caller graph for this function:

ilPermanentLinkGUI::setIncludePermanentLinkText (   $a_includepermanentlinktext)

Set Include permanent link text.

Parameters
boolean$a_includepermanentlinktextInclude permanent link text

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

Referenced by __construct().

{
$this->includepermanentlinktext = $a_includepermanentlinktext;
}

+ Here is the caller graph for this function:

ilPermanentLinkGUI::setTarget (   $a_target)

Set Target.

Parameters
string$a_targetTarget

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

Referenced by __construct().

{
$this->target = $a_target;
}

+ Here is the caller graph for this function:

ilPermanentLinkGUI::setTitle (   $a_val)

Set title.

Parameters
stringtitle

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

Referenced by ilLMPresentationGUI\ilLMSubMenu().

{
$this->title = $a_val;
}

+ Here is the caller graph for this function:

ilPermanentLinkGUI::setType (   $a_type)

Set Type.

Parameters
string$a_typeType

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

Referenced by __construct().

{
$this->type = $a_type;
}

+ Here is the caller graph for this function:

Field Documentation

ilPermanentLinkGUI::$align_center = true
protected

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

Referenced by getAlignCenter().


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