5require_once (
"./Services/Bookmarks/classes/class.ilBookmarkFolder.php");
6require_once (
"./Services/Bookmarks/classes/class.ilBookmark.php");
7require_once (
"./Services/Table/classes/class.ilTableGUI.php");
53 $tpl->getStandardTemplate();
57 $this->
id = (empty(
$_GET[
"bmf_id"]))
66 $this->ctrl->setParameter($this,
"bmf_id", $this->
id);
67 $this->user_id =
$ilUser->getId();
69 $this->tree =
new ilTree($this->user_id);
70 $this->tree->setTableNames(
'bookmark_tree',
'bookmark_data');
71 $this->root_id = $this->tree->readRootId();
73 $this->lng->loadLanguageModule(
"bkm");
83 $next_class = $this->ctrl->getNextClass();
88 $cmd = $this->ctrl->getCmd(
"view");
97 $this->tpl->show(
true);
103 switch(
$_POST[
"selected_cmd"])
137 include_once(
"./Services/Bookmarks/classes/class.ilBookmarkExplorerGUI.php");
139 if (!$exp->handleCommand())
141 $tpl->setLeftNavContent($exp->getHTML());
161 $this->tpl->setTitle($this->lng->txt(
"bookmarks"));
171 if($this->
id > 0 && !$this->tree->isInTree($this->id))
173 $this->ctrl->setParameter($this,
'bmf_id',
'');
174 $this->ctrl->redirect($this);
177 $ilToolbar->addButton($this->lng->txt(
"bookmark_new"),
178 $this->ctrl->getLinkTarget($this,
"newFormBookmark"));
179 $ilToolbar->addButton($this->lng->txt(
"bookmark_folder_new"),
180 $this->ctrl->getLinkTarget($this,
"newFormBookmarkFolder"));
184 include_once
'Services/Bookmarks/classes/class.ilBookmarkAdministrationTableGUI.php';
186 $table->setId(
'bookmark_adm_table');
187 $table->setData($objects);
188 $this->tpl->setVariable(
"ADM_CONTENT", $table->getHTML());
198 $this->tpl->setCurrentBlock(
"begin_link");
199 $this->tpl->setVariable(
"LINK_TARGET", $link);
200 $this->tpl->parseCurrentBlock();
201 $this->tpl->touchBlock(
"end_link");
204 $this->tpl->setCurrentBlock(
"text");
205 $this->tpl->setVariable(
"TEXT_CONTENT", $val);
206 $this->tpl->parseCurrentBlock();
207 $this->tpl->setCurrentBlock(
"table_cell");
208 $this->tpl->parseCurrentBlock();
223 if(!$this->tree->isInTree($this->id))
228 $this->tpl->addBlockFile(
"LOCATOR",
"locator",
"tpl.locator.html",
"Services/Locator");
230 $path = $this->tree->getPathFull($this->
id);
235 $this->tpl->setVariable(
"TXT_LOCATOR", $this->lng->txt(
"locator"));
236 $this->tpl->touchBlock(
"locator_separator");
237 $this->tpl->touchBlock(
"locator_item");
247 if($key < count(
$path) - $modifier)
249 $this->tpl->touchBlock(
"locator_separator");
252 $this->tpl->setCurrentBlock(
"locator_item");
253 $title = (
$row[
"child"] == 1) ?
254 $lng->txt(
"bookmarks") :
256 $this->tpl->setVariable(
"ITEM", $title);
257 $this->ctrl->setParameter($this,
"bmf_id",
$row[
"child"]);
258 $this->tpl->setVariable(
"LINK_ITEM",
259 $this->ctrl->getLinkTarget($this));
260 $this->tpl->parseCurrentBlock();
263 $this->tpl->setCurrentBlock(
"locator");
265 $this->tpl->parseCurrentBlock();
292 if(!$this->tree->isInTree($this->id))
294 $this->ctrl->setParameter($this,
'bmf_id',
'');
295 $this->ctrl->redirect($this);
299 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
310 if(!$this->tree->isInTree($this->id))
312 $this->ctrl->setParameter($this,
'bmf_id',
'');
313 $this->ctrl->redirect($this);
316 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
318 $form->setTopAnchor(
"bookmark_top");
320 $form->setTitle(
$lng->txt(
"bookmark_folder_new"));
322 if($action ==
'updateBookmarkFolder')
324 $ilCtrl->setParameter($this,
'bmf_id', $this->
id);
325 $ilCtrl->setParameter($this,
'obj_id',
$_GET[
"obj_id"]);
328 $hash = (
$ilUser->prefs[
"screen_reader_optimization"])
332 $form->setFormAction(
$ilCtrl->getFormAction($this, $action, $hash));
334 $ilCtrl->clearParameters($this);
338 $prop->setRequired(
true);
339 $form->addItem($prop);
342 $form->addCommandButton($action,
$lng->txt(
'save'));
343 $form->addCommandButton(
'cancel',
$lng->txt(
'cancel'));
352 if(!$this->tree->isInTree(
$_GET[
"obj_id"]))
354 $this->ctrl->setParameter($this,
'bmf_id',
'');
355 $this->ctrl->setParameter($this,
'obj_id',
'');
356 $this->ctrl->redirect($this);
361 $form->setValuesByArray
365 "title" => $this->
get_last(
"title", $bmf->getTitle()),
366 "obj_id" =>
$_GET[
"obj_id"],
369 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
381 if(!$this->tree->isInTree($this->id))
383 $this->ctrl->setParameter($this,
'bmf_id',
'');
384 $this->ctrl->redirect($this);
387 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
389 $form->setTopAnchor(
"bookmark_top");
391 $form->setTitle(
$lng->txt(
"bookmark_new"));
393 if($action ==
'updateBookmark')
395 $ilCtrl->setParameter($this,
'bmf_id', $this->
id);
396 $ilCtrl->setParameter($this,
'obj_id',
$_GET[
"obj_id"]);
399 $hash = (
$ilUser->prefs[
"screen_reader_optimization"])
403 $form->setFormAction(
$ilCtrl->getFormAction($this, $action, $hash));
404 $ilCtrl->clearParameters($this);
407 $prop->setValue(
$_GET[
'bm_title']);
408 $prop->setRequired(
true);
409 $form->addItem($prop);
413 $form->addItem($prop);
417 $prop->setValue(
$_GET[
'bm_link']);
418 $prop->setRequired(
true);
419 $form->addItem($prop);
422 if(
$_GET[
'return_to'])
425 $prop->setValue(
$_GET[
'return_to']);
426 $form->addItem($prop);
429 if(
$_GET[
'return_to_url'])
430 $prop->setValue(
$_GET[
'return_to_url']);
432 $prop->setValue(
$_GET[
'bm_link']);
433 $form->addItem($prop);
437 $form->addCommandButton($action,
$lng->txt(
'save'));
438 $form->addCommandButton(
'cancel',
$lng->txt(
'cancel'));
461 if(!$this->tree->isInTree($this->id))
463 $this->ctrl->setParameter($this,
'bmf_id',
'');
464 $this->ctrl->redirect($this);
467 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
469 $form->setFormAction(
$ilCtrl->getFormAction($this,
"importFile"));
470 $form->setTopAnchor(
"bookmark_top");
471 $form->setTitle(
$lng->txt(
"bkm_import"));
474 $fi->setRequired(
true);
477 $form->addCommandButton(
"importFile",
$lng->txt(
'import'));
478 $form->addCommandButton(
'cancel',
$lng->txt(
'cancel'));
489 $html1 = $form->getHTML();
494 $html2 =
"<br />" . $form2->getHTML();
496 $this->tpl->setVariable(
"ADM_CONTENT",
$html1 .
$html2);
505 return (!empty(
$_POST[$a_var])) ?
517 if(!$this->tree->isInTree(
$_GET[
"obj_id"]))
519 $this->ctrl->setParameter($this,
'obj_id',
'');
520 $this->ctrl->setParameter($this,
'bmf_id',
'');
521 $this->ctrl->redirect($this);
526 $form->setValuesByArray
530 "title" => $bookmark->getTitle(),
531 "target" => $bookmark->getTarget(),
532 "description" => $bookmark->getDescription(),
533 "obj_id" =>
$_GET[
"obj_id"],
536 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
545 if(!$this->tree->isInTree($this->id))
547 $this->ctrl->setParameter($this,
'bmf_id',
'');
548 $this->ctrl->redirect($this);
552 if(empty(
$_POST[
"title"]))
562 $bmf->setParent($this->
id);
568 $ilCtrl->saveParameter($this,
'bmf_id');
569 $ilCtrl->redirect($this,
'view');
579 if(!$this->tree->isInTree(
$_GET[
"obj_id"]))
581 $this->ctrl->setParameter($this,
'obj_id',
'');
582 $this->ctrl->setParameter($this,
'bmf_id',
'');
583 $this->ctrl->redirect($this);
587 if(empty(
$_POST[
"title"]))
600 $ilCtrl->saveParameter($this,
'bmf_id');
601 $ilCtrl->redirect($this,
'view');
613 if(!$this->tree->isInTree($this->id))
615 $this->ctrl->setParameter($this,
'bmf_id',
'');
616 $this->ctrl->redirect($this);
620 if(empty(
$_POST[
"title"]))
625 else if(empty(
$_POST[
"target"]))
637 $bm->setParent($this->
id);
642 $ilCtrl->saveParameter($this,
'bmf_id');
643 $ilCtrl->redirect($this,
'view');
652 if(!$this->tree->isInTree(
$_GET[
"obj_id"]))
654 $this->ctrl->setParameter($this,
'obj_id',
'');
655 $this->ctrl->setParameter($this,
'bmf_id',
'');
656 $this->ctrl->redirect($this);
660 if(empty(
$_POST[
"title"]))
665 else if(empty(
$_POST[
"target"]))
691 $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"), $this->ilias->error_obj->MESSAGE);
693 $export_ids = array();
694 foreach($bm_ids as
$id)
696 if($this->tree->isInTree(
$id))
704 require_once (
"./Services/Bookmarks/classes/class.ilBookmarkImportExport.php");
706 $this->lng->txt(
"bookmarks_of") .
" " . $this->ilias->account->getFullname());
714 return $html_content;
724 include_once
'./Services/Mail/classes/class.ilFileDataMail.php';
725 require_once
"Services/Mail/classes/class.ilFormatMail.php";
729 $html_content = $this->
export(
false);
731 $fp = fopen($tempfile,
'w');
732 fwrite($fp, $html_content);
735 $mfile->copyAttachmentFile($tempfile,
$filename);
741 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
753 $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"), $this->ilias->error_obj->MESSAGE);
756 $this->ctrl->setParameter($this,
"bmf_id", $this->
id);
759 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
761 $cgui->setFormAction($this->ctrl->getFormAction($this));
762 $cgui->setHeaderText($this->lng->txt(
"info_delete_sure"));
763 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancel");
764 $cgui->setConfirm($this->lng->txt(
"confirm"),
"confirm");
766 foreach($bm_ids as $obj_id)
770 if(!$this->tree->isInTree($obj_id))
779 $title = $BookmarkFolder->getTitle();
781 unset($BookmarkFolder);
786 $title = $Bookmark->getTitle();
787 $target = $Bookmark->getTarget();
799 $cgui->addItem(
"id[]", $obj_id, $caption);
802 $this->tpl->setContent($cgui->getHTML());
818 global
$tree, $rbacsystem, $rbacadmin;
822 $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"), $this->ilias->error_obj->MESSAGE);
831 if($this->tree->isInTree(
$id))
833 $node_data = $this->tree->getNodeData(
$id);
834 $subtree_nodes = $this->tree->getSubTree($node_data);
842 $this->tree->deleteTree($node_data);
845 foreach($subtree_nodes as $node)
847 switch($node[
"type"])
851 $BookmarkFolder->delete();
875 "delete" => $this->lng->txt(
"delete"),
876 "export" => $this->lng->txt(
"export"),
877 "sendmail"=> $this->lng->txt(
"bkm_sendmail"),
880 $subobj = array(
"bm",
"bmf");
882 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();
920 include_once(
"./Services/Bookmarks/classes/class.ilBookmarkBlockGUI.php");
923 return $bookmark_block_gui->getHTML();
934 if(!$this->tree->isInTree($this->id))
936 $this->ctrl->setParameter($this,
'bmf_id',
'');
937 $this->ctrl->redirect($this);
940 if($_FILES[
"bkmfile"][
"error"] > UPLOAD_ERR_OK)
946 require_once (
"./Services/Bookmarks/classes/class.ilBookmarkImportExport.php");
948 if($objects ===
false)
955 $num_create = array(
'bm'=> 0,
'bmf'=> 0);
959 $num_create[
'bmf']));
975 if(is_array($objects[$start_key]))
977 foreach($objects[$start_key] as $obj_key=> $object)
979 switch($object[
'type'])
982 if(!$object[
"title"])
continue;
983 if(!$object[
"target"])
continue;
985 $bm->setTitle($object[
"title"]);
986 $bm->setDescription($object[
"description"]);
987 $bm->setTarget($object[
"target"]);
988 $bm->setParent($folder_id);
993 if(!$object[
"title"])
continue;
995 $bmf->setTitle($object[
"title"]);
996 $bmf->setParent($folder_id);
998 $num_create[
'bmf']++;
999 if(is_array($objects[$obj_key]))
1002 $bmf->getId(), $obj_key);
1015 if(!$bm_ids &&
$_GET[
"bm_id_tgt"] ==
"")
1018 return $this->
view();
1021 $ilTabs->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTarget($this));
1023 $this->ctrl->setParameter($this,
"bm_id_tgt",
$_GET[
"bm_id_tgt"] ?
$_GET[
"bm_id_tgt"] : implode(
";", $bm_ids));
1025 include_once(
"./Services/Bookmarks/classes/class.ilBookmarkMoveExplorerGUI.php");
1027 if (!$exp->handleCommand())
1029 $this->mode =
"flat";
1030 $this->tpl->setContent($exp->getHTML());
1039 $bm_ids = explode(
";",
$_REQUEST[
'bm_id_tgt']);
1040 if(!$bm_ids || !$tgt)
1043 return $this->
view();
1047 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
1049 $tgt_node =
$tree->getNodeData($tgt);
1052 foreach($bm_ids as $node_id)
1054 if(
$tree->isGrandChild($node_id, $tgt))
1057 $this->ctrl->redirect($this,
"view");
1060 $node =
$tree->getNodeData($node_id);
1063 if($node[
"parent"] == $tgt)
1068 $tree->moveTree($node_id, $tgt);
1072 $this->ctrl->setParameter($this,
"bmf_id", $tgt);
1073 $this->ctrl->redirect($this,
"view");
GUI class for personal bookmark administration.
updateBookmarkFolder()
update bookmark folder
createBookmark()
create new bookmark in db
displayLocator()
display locator
& executeCommand()
execute command
showPossibleSubObjects()
display subobject addition selection
newFormBookmark()
display new bookmark form
explorer()
output explorer tree with bookmark folders
__importBookmarks(&$objects, &$num_create, $folder_id, $start_key=0)
creates the bookmarks and folders
export($deliver=true)
export bookmarks
getMode()
return display mode flat or tree
newFormBookmarkFolder()
display new bookmark folder form
editFormBookmarkFolder()
display edit bookmark folder form
importFile()
imports a bookmark file into database display status information or report errors messages in case of...
displayHeader()
display header and locator
createBookmarkFolder()
create new bookmark folder in db
updateBookmark()
update bookmark in db
confirm()
deletion confirmed -> delete folders / bookmarks
sendmail()
send bookmarks as attachment
initFormBookmarkFolder($action='createBookmarkFolder')
init bookmark folder create/edit form
initFormBookmark($action='createBookmark')
init Bookmark create/edit form
ilBookmarkAdministrationGUI()
Constructor @access public.
cancel()
cancel deletion,insert, update
get_last($a_var, $a_value)
get stored post var in case of an error/warning otherwise return passed value
initImportBookmarksForm()
Init import bookmark form.
editFormBookmark()
display edit bookmark form
getHTML()
Get Bookmark list for personal desktop.
add_cell($val, $link="")
output a cell in object list
Table GUI for Bookmark management.
BlockGUI class for Bookmarks block.
Bookmark explorer GUI class.
bookmark folder (note: this class handles personal bookmarks folders only)
_parseFile($file)
parse Bookmark file static method returns 3 dimensional array of bookmarks and folders
_exportBookmark($obj_ids, $recursive=true, $title='')
export bookmarks static method return html string
Bookmark explorer GUI class.
Class Bookmarks Bookmark management.
static _getTypeOfId($a_id)
get type of a given id
Confirmation screen class.
This class handles all operations on files (attachments) in directory ilias_data/mail.
This class represents a text area property in a property form.
This class represents a text property in a property form.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
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...
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
http redirect to other script
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
static ilTempnam($a_temp_path=null)
Create a temporary file in an ILIAS writable directory.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
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.
static infoPanel($a_keep=true)
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
redirection script todo: (a better solution should control the processing via a xml file)
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']