5 require_once(
"./Services/Bookmarks/classes/class.ilBookmarkFolder.php");
6 require_once(
"./Services/Bookmarks/classes/class.ilBookmark.php");
7 require_once(
"./Services/Table/classes/class.ilTableGUI.php");
75 $this->
user = $DIC->user();
76 $this->toolbar = $DIC->toolbar();
77 $this->error = $DIC[
"ilErr"];
78 $this->tabs = $DIC->tabs();
80 $lng = $DIC->language();
86 $tpl->getStandardTemplate();
90 $this->
id = (empty(
$_GET[
"bmf_id"]))
98 $this->ctrl->setParameter($this,
"bmf_id", $this->
id);
99 $this->user_id =
$ilUser->getId();
101 $this->tree =
new ilTree($this->user_id);
102 $this->tree->setTableNames(
'bookmark_tree',
'bookmark_data');
103 $this->root_id = $this->tree->readRootId();
105 $this->lng->loadLanguageModule(
"bkm");
107 $this->mode =
"tree";
115 $next_class = $this->ctrl->getNextClass();
117 switch ($next_class) {
119 $cmd = $this->ctrl->getCmd(
"view");
122 if ($this->
getMode() ==
'tree') {
127 $this->tpl->show(
true);
133 switch (
$_POST[
"selected_cmd"]) {
166 include_once(
"./Services/Bookmarks/classes/class.ilBookmarkExplorerGUI.php");
168 if (!$exp->handleCommand()) {
169 $tpl->setLeftNavContent($exp->getHTML());
183 if ($this->message) {
188 $this->tpl->setTitle($this->lng->txt(
"bookmarks"));
198 if ($this->
id > 0 && !$this->tree->isInTree($this->id)) {
199 $this->ctrl->setParameter($this,
'bmf_id',
'');
200 $this->ctrl->redirect($this);
203 $ilToolbar->addButton(
204 $this->lng->txt(
"bookmark_new"),
205 $this->ctrl->getLinkTarget($this,
"newFormBookmark")
207 $ilToolbar->addButton(
208 $this->lng->txt(
"bookmark_folder_new"),
209 $this->ctrl->getLinkTarget($this,
"newFormBookmarkFolder")
214 include_once
'Services/Bookmarks/classes/class.ilBookmarkAdministrationTableGUI.php';
216 $table->setId(
'bookmark_adm_table');
217 $table->setData($objects);
218 $this->tpl->setVariable(
"ADM_CONTENT",
$table->getHTML());
227 $this->tpl->setCurrentBlock(
"begin_link");
228 $this->tpl->setVariable(
"LINK_TARGET", $link);
229 $this->tpl->parseCurrentBlock();
230 $this->tpl->touchBlock(
"end_link");
233 $this->tpl->setCurrentBlock(
"text");
234 $this->tpl->setVariable(
"TEXT_CONTENT", $val);
235 $this->tpl->parseCurrentBlock();
236 $this->tpl->setCurrentBlock(
"table_cell");
237 $this->tpl->parseCurrentBlock();
247 if (empty($this->
id)) {
251 if (!$this->tree->isInTree($this->id)) {
255 $this->tpl->addBlockFile(
"LOCATOR",
"locator",
"tpl.locator.html",
"Services/Locator");
257 $path = $this->tree->getPathFull($this->
id);
262 $this->tpl->setVariable(
"TXT_LOCATOR", $this->lng->txt(
"locator"));
263 $this->tpl->touchBlock(
"locator_separator");
264 $this->tpl->touchBlock(
"locator_item");
274 $this->tpl->touchBlock(
"locator_separator");
277 $this->tpl->setCurrentBlock(
"locator_item");
279 $lng->txt(
"bookmarks") :
281 $this->tpl->setVariable(
"ITEM",
$title);
282 $this->ctrl->setParameter($this,
"bmf_id",
$row[
"child"]);
283 $this->tpl->setVariable(
285 $this->ctrl->getLinkTarget($this)
287 $this->tpl->parseCurrentBlock();
290 $this->tpl->setCurrentBlock(
"locator");
292 $this->tpl->parseCurrentBlock();
319 if (!$this->tree->isInTree($this->id)) {
320 $this->ctrl->setParameter($this,
'bmf_id',
'');
321 $this->ctrl->redirect($this);
325 $this->tpl->setVariable(
"ADM_CONTENT",
$form->getHTML());
338 if (!$this->tree->isInTree($this->id)) {
339 $this->ctrl->setParameter($this,
'bmf_id',
'');
340 $this->ctrl->redirect($this);
343 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
345 $form->setTopAnchor(
"bookmark_top");
347 $form->setTitle(
$lng->txt(
"bookmark_folder_new"));
349 if (
$action ==
'updateBookmarkFolder') {
350 $ilCtrl->setParameter($this,
'bmf_id', $this->
id);
351 $ilCtrl->setParameter($this,
'obj_id',
$_GET[
"obj_id"]);
354 $hash = (
$ilUser->prefs[
"screen_reader_optimization"])
360 $ilCtrl->clearParameters($this);
365 $form->addItem($prop);
369 $form->addCommandButton(
'cancel',
$lng->txt(
'cancel'));
378 if (!$this->tree->isInTree(
$_GET[
"obj_id"])) {
379 $this->ctrl->setParameter($this,
'bmf_id',
'');
380 $this->ctrl->setParameter($this,
'obj_id',
'');
381 $this->ctrl->redirect($this);
386 $form->setValuesByArray(
388 "title" => $this->
get_last(
"title", $bmf->getTitle()),
389 "obj_id" =>
$_GET[
"obj_id"],
392 $this->tpl->setVariable(
"ADM_CONTENT",
$form->getHTML());
406 if (!$this->tree->isInTree($this->id)) {
407 $this->ctrl->setParameter($this,
'bmf_id',
'');
408 $this->ctrl->redirect($this);
411 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
413 $form->setTopAnchor(
"bookmark_top");
415 $form->setTitle(
$lng->txt(
"bookmark_new"));
417 if (
$action ==
'updateBookmark') {
418 $ilCtrl->setParameter($this,
'bmf_id', $this->
id);
419 $ilCtrl->setParameter($this,
'obj_id',
$_GET[
"obj_id"]);
422 $hash = (
$ilUser->prefs[
"screen_reader_optimization"])
427 $ilCtrl->clearParameters($this);
431 $prop->setRequired(
true);
432 $form->addItem($prop);
436 $form->addItem($prop);
441 $prop->setRequired(
true);
442 $form->addItem($prop);
445 if (
$_GET[
'return_to']) {
447 $prop->setValue(
$_GET[
'return_to']);
448 $form->addItem($prop);
451 if (
$_GET[
'return_to_url']) {
452 $prop->setValue(
$_GET[
'return_to_url']);
454 $prop->setValue(
$_GET[
'bm_link']);
456 $form->addItem($prop);
461 $form->addCommandButton(
'cancel',
$lng->txt(
'cancel'));
486 if (!$this->tree->isInTree($this->id)) {
487 $this->ctrl->setParameter($this,
'bmf_id',
'');
488 $this->ctrl->redirect($this);
491 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
493 $form->setFormAction(
$ilCtrl->getFormAction($this,
"importFile"));
494 $form->setTopAnchor(
"bookmark_top");
495 $form->setTitle(
$lng->txt(
"bkm_import"));
501 $form->addCommandButton(
"importFile",
$lng->txt(
'import'));
502 $form->addCommandButton(
'cancel',
$lng->txt(
'cancel'));
515 if (!$_REQUEST[
"bm_link"]) {
517 $html2 =
"<br />" . $form2->getHTML();
519 $this->tpl->setVariable(
"ADM_CONTENT",
$html1 .
$html2);
528 return (!empty(
$_POST[$a_var])) ?
541 if (!$this->tree->isInTree(
$_GET[
"obj_id"])) {
542 $this->ctrl->setParameter($this,
'obj_id',
'');
543 $this->ctrl->setParameter($this,
'bmf_id',
'');
544 $this->ctrl->redirect($this);
549 $form->setValuesByArray(
551 "title" => $bookmark->getTitle(),
552 "target" => $bookmark->getTarget(),
553 "description" => $bookmark->getDescription(),
554 "obj_id" =>
$_GET[
"obj_id"],
557 $this->tpl->setVariable(
"ADM_CONTENT",
$form->getHTML());
566 if (!$this->tree->isInTree($this->id)) {
567 $this->ctrl->setParameter($this,
'bmf_id',
'');
568 $this->ctrl->redirect($this);
572 if (empty(
$_POST[
"title"])) {
579 $bmf->setParent($this->
id);
585 $ilCtrl->saveParameter($this,
'bmf_id');
586 $ilCtrl->redirect($this,
'view');
596 if (!$this->tree->isInTree(
$_GET[
"obj_id"])) {
597 $this->ctrl->setParameter($this,
'obj_id',
'');
598 $this->ctrl->setParameter($this,
'bmf_id',
'');
599 $this->ctrl->redirect($this);
603 if (empty(
$_POST[
"title"])) {
613 $ilCtrl->saveParameter($this,
'bmf_id');
614 $ilCtrl->redirect($this,
'view');
627 if (!$this->tree->isInTree($this->id)) {
628 $this->ctrl->setParameter($this,
'bmf_id',
'');
629 $this->ctrl->redirect($this);
633 if (empty(
$_POST[
"title"])) {
636 } elseif (empty(
$_POST[
"target"])) {
645 $bm->setParent($this->
id);
650 $ilCtrl->saveParameter($this,
'bmf_id');
651 $ilCtrl->redirect($this,
'view');
660 if (!$this->tree->isInTree(
$_GET[
"obj_id"])) {
661 $this->ctrl->setParameter($this,
'obj_id',
'');
662 $this->ctrl->setParameter($this,
'bmf_id',
'');
663 $this->ctrl->redirect($this);
667 if (empty(
$_POST[
"title"])) {
670 } elseif (empty(
$_POST[
"target"])) {
695 $ilErr->raiseError($this->lng->txt(
"no_checkbox"),
$ilErr->MESSAGE);
697 $export_ids =
array();
698 foreach ($bm_ids as
$id) {
699 if ($this->tree->isInTree($id)) {
706 require_once(
"./Services/Bookmarks/classes/class.ilBookmarkImportExport.php");
710 $this->lng->txt(
"bookmarks_of") .
" " .
$ilUser->getFullname()
716 return $html_content;
726 include_once
'./Services/Mail/classes/class.ilFileDataMail.php';
727 require_once
"Services/Mail/classes/class.ilFormatMail.php";
731 $html_content = $this->
export(
false);
733 $fp = fopen($tempfile,
'w');
734 fwrite($fp, $html_content);
737 $mfile->copyAttachmentFile($tempfile,
$filename);
738 $umail->savePostData(
751 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
758 public function delete()
764 $ilErr->raiseError($this->lng->txt(
"no_checkbox"),
$ilErr->MESSAGE);
767 $this->ctrl->setParameter($this,
"bmf_id", $this->
id);
770 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
772 $cgui->setFormAction($this->ctrl->getFormAction($this));
773 $cgui->setHeaderText($this->lng->txt(
"info_delete_sure"));
774 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancel");
775 $cgui->setConfirm($this->lng->txt(
"confirm"),
"confirm");
777 foreach ($bm_ids as $obj_id) {
780 if (!$this->tree->isInTree($obj_id)) {
787 $title = $BookmarkFolder->getTitle();
789 unset($BookmarkFolder);
794 $title = $Bookmark->getTitle();
795 $target = $Bookmark->getTarget();
806 $cgui->addItem(
"id[]", $obj_id, $caption);
809 $this->tpl->setContent($cgui->getHTML());
829 $ilErr->raiseError($this->lng->txt(
"no_checkbox"),
$ilErr->MESSAGE);
837 if ($this->tree->isInTree($id)) {
838 $node_data = $this->tree->getNodeData($id);
839 $subtree_nodes = $this->tree->getSubTree($node_data);
845 $this->tree->deleteTree($node_data);
848 foreach ($subtree_nodes as $node) {
849 switch ($node[
"type"]) {
852 $BookmarkFolder->delete();
876 "delete" => $this->lng->txt(
"delete"),
877 "export" => $this->lng->txt(
"export"),
878 "sendmail"=> $this->lng->txt(
"bkm_sendmail"),
881 $subobj =
array(
"bm",
"bmf");
883 if (is_array($subobj)) {
887 $this->tpl->setCurrentBlock(
"add_object");
888 $this->tpl->setVariable(
"COLUMN_COUNTS", 7);
889 $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
890 $this->tpl->setVariable(
"BTN_NAME",
"newForm");
891 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"add"));
892 $this->tpl->parseCurrentBlock();
895 $this->tpl->setVariable(
"TPLPATH", $this->tpl->tplPath);
897 $this->tpl->setCurrentBlock(
"tbl_action_select");
898 $this->tpl->setVariable(
"SELECT_ACTION",
ilUtil::formSelect(
$_SESSION[
"error_post_vars"][
'action'],
"action", $actions,
false,
true));
899 $this->tpl->setVariable(
"BTN_NAME",
"executeAction");
900 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"execute"));
911 $this->tpl->parseCurrentBlock();
919 include_once(
"./Services/Bookmarks/classes/class.ilBookmarkBlockGUI.php");
922 return $bookmark_block_gui->getHTML();
933 if (!$this->tree->isInTree($this->id)) {
934 $this->ctrl->setParameter($this,
'bmf_id',
'');
935 $this->ctrl->redirect($this);
938 if ($_FILES[
"bkmfile"][
"error"] > UPLOAD_ERR_OK) {
943 require_once(
"./Services/Bookmarks/classes/class.ilBookmarkImportExport.php");
945 if ($objects ===
false) {
951 $num_create =
array(
'bm'=> 0,
'bmf'=> 0);
955 $this->lng->txt(
"bkm_import_ok"),
972 if (is_array($objects[$start_key])) {
973 foreach ($objects[$start_key] as $obj_key=> $object) {
974 switch ($object[
'type']) {
976 if (!$object[
"title"]) {
979 if (!$object[
"target"]) {
983 $bm->setTitle($object[
"title"]);
984 $bm->setDescription($object[
"description"]);
985 $bm->setTarget($object[
"target"]);
986 $bm->setParent($folder_id);
991 if (!$object[
"title"]) {
995 $bmf->setTitle($object[
"title"]);
996 $bmf->setParent($folder_id);
998 $num_create[
'bmf']++;
999 if (is_array($objects[$obj_key])) {
1019 $bm_ids = $_REQUEST[
'bm_id'];
1020 if (!$bm_ids &&
$_GET[
"bm_id_tgt"] ==
"") {
1022 return $this->
view();
1025 $ilTabs->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTarget($this));
1027 $this->ctrl->setParameter($this,
"bm_id_tgt",
$_GET[
"bm_id_tgt"] ?
$_GET[
"bm_id_tgt"] : implode(
";", $bm_ids));
1029 include_once(
"./Services/Bookmarks/classes/class.ilBookmarkMoveExplorerGUI.php");
1031 if (!$exp->handleCommand()) {
1032 $this->mode =
"flat";
1033 $this->tpl->setContent($exp->getHTML());
1041 $tgt = (int) $_REQUEST[
"bmfmv_id"];
1042 $bm_ids = explode(
";", $_REQUEST[
'bm_id_tgt']);
1043 if (!$bm_ids || !$tgt) {
1045 return $this->
view();
1049 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
1051 $tgt_node =
$tree->getNodeData($tgt);
1054 foreach ($bm_ids as $node_id) {
1055 if (
$tree->isGrandChild($node_id, $tgt)) {
1057 $this->ctrl->redirect($this,
"view");
1060 $node =
$tree->getNodeData($node_id);
1063 if ($node[
"parent"] == $tgt) {
1067 $tree->moveTree($node_id, $tgt);
1071 $this->ctrl->setParameter($this,
"bmf_id", $tgt);
1072 $this->ctrl->redirect($this,
"view");
displayHeader()
display header and locator
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
Class Bookmarks Bookmark management.
initImportBookmarksForm()
Init import bookmark form.
getMode()
return display mode flat or tree
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
createBookmark()
create new bookmark in db
Bookmark explorer GUI class.
createBookmarkFolder()
create new bookmark folder in db
BlockGUI class for Bookmarks block.
sendmail()
send bookmarks as attachment
editFormBookmarkFolder()
display edit bookmark folder form
This class handles all operations on files (attachments) in directory ilias_data/mail.
export($deliver=true)
export bookmarks
static getImageTagByType($a_type, $a_path, $a_big=false)
Builds an html image tag TODO: function still in use, but in future use getImagePath and move HTML-Co...
showPossibleSubObjects()
display subobject addition selection
__importBookmarks(&$objects, &$num_create, $folder_id, $start_key=0)
creates the bookmarks and folders
updateBookmark()
update bookmark in db
editFormBookmark()
display edit bookmark form
Bookmark explorer GUI class.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
confirm()
deletion confirmed -> delete folders / bookmarks
newFormBookmark()
display new bookmark form
importFile()
imports a bookmark file into database display status information or report errors messages in case of...
if(isset($_POST['submit'])) $form
explorer()
output explorer tree with bookmark folders
This class represents a text property in a property form.
static infoPanel($a_keep=true)
GUI class for personal bookmark administration.
add_cell($val, $link="")
output a cell in object list
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Table GUI for Bookmark management.
static _getTypeOfId($a_id)
get type of a given id
__construct()
Constructor public.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Create styles array
The data for the language used.
executeCommand()
execute command
initFormBookmark($action='createBookmark')
init Bookmark create/edit form
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static _exportBookmark($obj_ids, $recursive=true, $title='')
export bookmarks static method return html string
initFormBookmarkFolder($action='createBookmarkFolder')
init bookmark folder create/edit form
static ilTempnam($a_temp_path=null)
Create a temporary file in an ILIAS writable directory.
static formSelect( $selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
displayLocator()
display locator
bookmark folder (note: this class handles personal bookmarks folders only)
This class represents a text area property in a property form.
newFormBookmarkFolder()
display new bookmark folder form
static getObjects($a_id)
static
if(empty($password)) $table
getHTML()
Get Bookmark list for personal desktop.
setValue($a_value)
Set Value.
static redirect($a_script)
cancel()
cancel deletion,insert, update
updateBookmarkFolder()
update bookmark folder
static _parseFile($file)
parse Bookmark file static method returns 3 dimensional array of bookmarks and folders ...
get_last($a_var, $a_value)
get stored post var in case of an error/warning otherwise return passed value
Confirmation screen class.