21 function __construct($a_type, $a_id, $a_append =
"", $a_target =
"")
37 $this->includepermanentlinktext = $a_includepermanentlinktext;
47 return $this->includepermanentlinktext;
57 $this->type = $a_type;
97 $this->append = $a_append;
107 return $this->append;
117 $this->target = $a_target;
127 return $this->target;
137 $this->title = $a_val;
157 $this->align_center = $a_val;
178 "Services/PermanentLink");
180 include_once(
'classes/class.ilLink.php');
185 $tpl->setVariable(
"TXT_PERMA", $lng->txt(
"perma_link").
":");
198 $obj_id = $ilObjDataCache->lookupObjId($this->
getId());
199 $title = $ilObjDataCache->lookupTitle($obj_id);
202 # $bookmark->setTitle("untitled");
204 $tpl->setVariable(
"TXT_BOOKMARK_DEFAULT",
$title);
206 $tpl->setVariable(
"LINK", $href);
210 $tpl->setVariable(
"ALIGN",
"center");
214 $tpl->setVariable(
"ALIGN",
"left");
219 $tpl->setVariable(
"TARGET",
'target="'.$this->
getTarget().
'"');
228 $tpl->setVariable(
'SELECTION_LIST', $bm_html);
243 require_once
'Services/PermanentLink/classes/class.ilPermanentLink.php';
249 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
252 $current_selection_list->setListTitle($lng->txt(
"bm_add_to_social_bookmarks"));
253 $current_selection_list->setId(
"socialbm_actions");
254 $current_selection_list->setUseImages(
true);
258 if (
$_SESSION[
"AccountId"] != ANONYMOUS_USER_ID && !$ilSetting->get(
'disable_bookmarks'))
260 $linktpl =
'ilias.php?cmd=redirect&baseClass=ilPersonalDesktopGUI&redirectClass=ilbookmarkadministrationgui&redirectCmd=newFormBookmark¶m_bmf_id=1¶m_return_to=true¶m_bm_title='. urlencode(
$title) .
'¶m_bm_link=' . urlencode(urlencode($href)).
"¶m_return_to_url=".urlencode(urlencode($_SERVER[
'REQUEST_URI']));
261 $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');
265 foreach ($rset as
$row)
267 $linktpl = $row->sbm_link;
268 $linktpl = str_replace(
'{LINK}', urlencode($href), $linktpl);
269 $linktpl = str_replace(
'{TITLE}', urlencode(
$title), $linktpl);
270 $current_selection_list->addItem($row->sbm_title,
'', $linktpl, $row->sbm_icon, $row->title,
'_blank');
274 if ($cnt == 1 &&
$_SESSION[
"AccountId"] != ANONYMOUS_USER_ID && !$ilSetting->get(
'disable_bookmarks'))
276 $loc_tpl =
new ilTemplate(
'tpl.single_link.html',
true,
true,
'Services/PermanentLink');
277 $loc_tpl->setVariable(
"TXT_ADD_TO_ILIAS_BM", $lng->txt(
"bm_add_to_ilias"));
278 $loc_tpl->setVariable(
"URL_ADD_TO_BM",
'ilias.php?cmd=redirect&baseClass=ilPersonalDesktopGUI&redirectClass=ilbookmarkadministrationgui&redirectCmd=newFormBookmark¶m_bmf_id=1¶m_return_to=true¶m_bm_title='. urlencode(
$title) .
'¶m_bm_link=' . urlencode(urlencode($href)).
"¶m_return_to_url=".urlencode(urlencode($_SERVER[
'REQUEST_URI'])));
280 return $loc_tpl->get();
284 return $current_selection_list->getHTML();