43 function __construct($a_type, $a_id, $a_append =
"", $a_target =
"")
59 $this->includepermanentlinktext = $a_includepermanentlinktext;
69 return $this->includepermanentlinktext;
79 $this->type = $a_type;
119 $this->append = $a_append;
129 return $this->append;
139 $this->target = $a_target;
149 return $this->target;
159 $this->title = $a_val;
179 $this->align_center = $a_val;
200 "Services/PermanentLink");
202 include_once(
'classes/class.ilLink.php');
207 $tpl->setVariable(
"TXT_PERMA", $lng->txt(
"perma_link").
":");
220 $obj_id = $ilObjDataCache->lookupObjId($this->
getId());
221 $title = $ilObjDataCache->lookupTitle($obj_id);
224 # $bookmark->setTitle("untitled");
226 $tpl->setVariable(
"TXT_BOOKMARK_DEFAULT",
$title);
228 $tpl->setVariable(
"LINK", $href);
232 $tpl->setVariable(
"ALIGN",
"center");
236 $tpl->setVariable(
"ALIGN",
"left");
241 $tpl->setVariable(
"TARGET",
'target="'.$this->
getTarget().
'"');
250 $tpl->setVariable(
'SELECTION_LIST', $bm_html);
267 $q =
'SELECT sbm_title, sbm_link, sbm_icon, sbm_active FROM bookmark_social_bm WHERE sbm_active = 1 ORDER BY sbm_title';
268 $rset = $ilDB->query(
$q);
270 include_once(
"./Services/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
273 $current_selection_list->setListTitle($lng->txt(
"bm_add_to_social_bookmarks"));
274 $current_selection_list->setId(
"socialbm_actions");
275 $current_selection_list->setUseImages(
true);
279 if (
$_SESSION[
"AccountId"] != ANONYMOUS_USER_ID && !$ilSetting->get(
'disable_bookmarks'))
281 $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']));
282 $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');
286 while (
$row = $ilDB->fetchObject($rset))
288 $linktpl =
$row->sbm_link;
289 $linktpl = str_replace(
'{LINK}', urlencode($href), $linktpl);
290 $linktpl = str_replace(
'{TITLE}', urlencode(
$title), $linktpl);
291 $current_selection_list->addItem(
$row->sbm_title,
'', $linktpl,
$row->sbm_icon,
$row->title,
'_blank');
295 if ($cnt == 1 &&
$_SESSION[
"AccountId"] != ANONYMOUS_USER_ID && !$ilSetting->get(
'disable_bookmarks'))
297 $loc_tpl =
new ilTemplate(
'tpl.single_link.html',
true,
true,
'Services/PermanentLink');
298 $loc_tpl->setVariable(
"TXT_ADD_TO_ILIAS_BM", $lng->txt(
"bm_add_to_ilias"));
299 $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'])));
301 return $loc_tpl->get();
305 return $current_selection_list->getHTML();