ILIAS  Release_4_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, ilFeedbackGUI, ilColumnGUI, ilPublicUserProfileGUI

Definition at line 36 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 43 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 261 of file class.ilPermanentLinkGUI.php.

References $_SESSION, $ilDB, $ilSetting, $lng, $q, $row, $title, and ilUtil\getImagePath().

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

{
global $ilDB, $lng, $ilSetting;
// social bookmarkings
$q = 'SELECT sbm_title, sbm_link, sbm_icon, sbm_active FROM bookmark_social_bm WHERE sbm_active = 1 ORDER BY sbm_title';
$rset = $ilDB->query($q);
include_once("./Services/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($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++;
}
while ($row = $ilDB->fetchObject($rset))
{
$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($title) . '&param_bm_link=' . urlencode(urlencode($href))."&param_return_to_url=".urlencode(urlencode($_SERVER['REQUEST_URI'])));
$loc_tpl->setVariable("ICON", ilUtil::getImagePath('icon_bm.gif'));
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 187 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 127 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 195 of file class.ilPermanentLinkGUI.php.

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

{
global $lng, $ilCtrl, $ilObjDataCache, $ilDB;
$tpl = new ilTemplate("tpl.permanent_link.html", true, true,
"Services/PermanentLink");
include_once('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
if ($bm_html)
{
$tpl->setVariable('SELECTION_LIST', $bm_html);
}
return $tpl->get();
}

+ Here is the call graph for this function:

ilPermanentLinkGUI::getId ( )

Get Id.

Returns
string Id

Definition at line 107 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 67 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 147 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 167 of file class.ilPermanentLinkGUI.php.

References $title.

Referenced by getHTML().

{
return $this->title;
}

+ Here is the caller graph for this function:

ilPermanentLinkGUI::getType ( )

Get Type.

Returns
string Type

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

References $type.

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 177 of file class.ilPermanentLinkGUI.php.

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

Set Append.

Parameters
string$a_appendAppend

Definition at line 117 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 97 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 57 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 137 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 157 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 77 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 38 of file class.ilPermanentLinkGUI.php.

Referenced by getAlignCenter().


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