ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilBookmarkAdministrationGUI Class Reference

GUI class for personal bookmark administration. More...

+ Collaboration diagram for ilBookmarkAdministrationGUI:

Public Member Functions

 ilBookmarkAdministrationGUI ()
 Constructor public. More...
 
executeCommand ()
 execute command More...
 
 executeAction ()
 
 getMode ()
 return display mode flat or tree More...
 
 explorer ()
 output explorer tree with bookmark folders More...
 
 displayHeader ()
 display header and locator More...
 
 view ()
 
 add_cell ($val, $link="")
 output a cell in object list More...
 
 displayLocator ()
 display locator More...
 
 newForm ($type)
 new form More...
 
 newFormBookmarkFolder ()
 display new bookmark folder form More...
 
 editFormBookmarkFolder ()
 display edit bookmark folder form More...
 
 newFormBookmark ()
 display new bookmark form More...
 
 get_last ($a_var, $a_value)
 get stored post var in case of an error/warning otherwise return passed value More...
 
 editFormBookmark ()
 display edit bookmark form More...
 
 createBookmarkFolder ()
 create new bookmark folder in db More...
 
 updateBookmarkFolder ()
 update bookmark folder More...
 
 createBookmark ()
 create new bookmark in db More...
 
 updateBookmark ()
 update bookmark in db More...
 
 export ($deliver=true)
 export bookmarks More...
 
 sendmail ()
 send bookmarks as attachment More...
 
 delete ()
 display deletion conformation screen More...
 
 cancel ()
 cancel deletion,insert, update More...
 
 confirm ()
 deletion confirmed -> delete folders / bookmarks More...
 
 showPossibleSubObjects ()
 display subobject addition selection More...
 
 getHTML ()
 Get Bookmark list for personal desktop. More...
 
 importFile ()
 imports a bookmark file into database display status information or report errors messages in case of error public More...
 
 __importBookmarks (&$objects, &$num_create, $folder_id, $start_key=0)
 creates the bookmarks and folders More...
 
 move ()
 
 confirmedMove ()
 

Data Fields

 $user_id
 
 $ilias
 
 $tpl
 
 $lng
 
 $tree
 
 $id
 
 $data
 
 $textwidth = 100
 

Private Member Functions

 initFormBookmarkFolder ($action='createBookmarkFolder')
 init bookmark folder create/edit form More...
 
 initFormBookmark ($action='createBookmark')
 init Bookmark create/edit form More...
 
 initImportBookmarksForm ()
 Init import bookmark form. More...
 

Detailed Description

GUI class for personal bookmark administration.

It manages folders and bookmarks with the help of the two corresponding core classes ilBookmarkFolder and ilBookmark. Their methods are called in this User Interface class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Manfred Thaler manfr.nosp@m.ed.t.nosp@m.haler.nosp@m.@end.nosp@m.o7.co.nosp@m.m
Version
$Id$

ilBookmarkAdministrationGUI:

Definition at line 19 of file class.ilBookmarkAdministrationGUI.php.

Member Function Documentation

◆ __importBookmarks()

ilBookmarkAdministrationGUI::__importBookmarks ( $objects,
$num_create,
  $folder_id,
  $start_key = 0 
)

creates the bookmarks and folders

Parameters
arrayarray of objects
arraystores the number of created objects
folder_idid where to store the bookmarks
start_keykey of the objects array where to start private

Definition at line 972 of file class.ilBookmarkAdministrationGUI.php.

Referenced by importFile().

973  {
974  if(is_array($objects[$start_key]))
975  {
976  foreach($objects[$start_key] as $obj_key=> $object)
977  {
978  switch($object['type'])
979  {
980  case 'bm':
981  if(!$object["title"]) continue;
982  if(!$object["target"]) continue;
983  $bm = new ilBookmark();
984  $bm->setTitle($object["title"]);
985  $bm->setDescription($object["description"]);
986  $bm->setTarget($object["target"]);
987  $bm->setParent($folder_id);
988  $bm->create();
989  $num_create['bm']++;
990  break;
991  case 'bmf':
992  if(!$object["title"]) continue;
993  $bmf = new ilBookmarkFolder();
994  $bmf->setTitle($object["title"]);
995  $bmf->setParent($folder_id);
996  $bmf->create();
997  $num_create['bmf']++;
998  if(is_array($objects[$obj_key]))
999  {
1000  $this->__importBookmarks($objects, $num_create,
1001  $bmf->getId(), $obj_key);
1002  }
1003  break;
1004  }
1005  }
1006  }
1007  }
Class Bookmarks Bookmark management.
__importBookmarks(&$objects, &$num_create, $folder_id, $start_key=0)
creates the bookmarks and folders
bookmark folder (note: this class handles personal bookmarks folders only)
+ Here is the caller graph for this function:

◆ add_cell()

ilBookmarkAdministrationGUI::add_cell (   $val,
  $link = "" 
)

output a cell in object list

Definition at line 187 of file class.ilBookmarkAdministrationGUI.php.

188  {
189  if(!empty($link))
190  {
191  $this->tpl->setCurrentBlock("begin_link");
192  $this->tpl->setVariable("LINK_TARGET", $link);
193  $this->tpl->parseCurrentBlock();
194  $this->tpl->touchBlock("end_link");
195  }
196 
197  $this->tpl->setCurrentBlock("text");
198  $this->tpl->setVariable("TEXT_CONTENT", $val);
199  $this->tpl->parseCurrentBlock();
200  $this->tpl->setCurrentBlock("table_cell");
201  $this->tpl->parseCurrentBlock();
202  }

◆ cancel()

ilBookmarkAdministrationGUI::cancel ( )

cancel deletion,insert, update

Definition at line 804 of file class.ilBookmarkAdministrationGUI.php.

References $_POST, ilUtil\redirect(), and view().

805  {
806  if($_POST['return_to'])
807  ilUtil::redirect($_POST['return_to_url']);
808  else
809  $this->view();
810  }
$_POST['username']
Definition: cron.php:12
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ confirm()

ilBookmarkAdministrationGUI::confirm ( )

deletion confirmed -> delete folders / bookmarks

Definition at line 815 of file class.ilBookmarkAdministrationGUI.php.

References $_POST, $tree, ilBookmark\_getTypeOfId(), ilUtil\sendSuccess(), and view().

816  {
817  global $tree, $rbacsystem, $rbacadmin;
818  // AT LEAST ONE OBJECT HAS TO BE CHOSEN.
819  if(!$_POST["id"])
820  {
821  $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
822  }
823 
824  // FOR ALL SELECTED OBJECTS
825  foreach($_POST["id"] as $id)
826  {
827  $type = ilBookmark::_getTypeOfId($id);
828 
829  // get node data and subtree nodes
830  if($this->tree->isInTree($id))
831  {
832  $node_data = $this->tree->getNodeData($id);
833  $subtree_nodes = $this->tree->getSubTree($node_data);
834  }
835  else
836  {
837  continue;
838  }
839 
840  // delete tree
841  $this->tree->deleteTree($node_data);
842 
843  // delete objects of subtree nodes
844  foreach($subtree_nodes as $node)
845  {
846  switch($node["type"])
847  {
848  case "bmf":
849  $BookmarkFolder = new ilBookmarkFolder($node["obj_id"]);
850  $BookmarkFolder->delete();
851  break;
852 
853  case "bm":
854  $Bookmark = new ilBookmark($node["obj_id"]);
855  $Bookmark->delete();
856  break;
857  }
858  }
859  }
860 
861  // Feedback
862  ilUtil::sendSuccess($this->lng->txt("info_deleted"), true);
863 
864  $this->view();
865  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class Bookmarks Bookmark management.
$_POST['username']
Definition: cron.php:12
redirection script todo: (a better solution should control the processing via a xml file) ...
static _getTypeOfId($a_id)
get type of a given id
bookmark folder (note: this class handles personal bookmarks folders only)
+ Here is the call graph for this function:

◆ confirmedMove()

ilBookmarkAdministrationGUI::confirmedMove ( )

Definition at line 1033 of file class.ilBookmarkAdministrationGUI.php.

References $_REQUEST, $ilUser, ilUtil\sendFailure(), ilUtil\sendSuccess(), ilTree\setTableNames(), and view().

1034  {
1035  global $ilUser;
1036 
1037  $tgt = (int)$_REQUEST["bmfmv_id"];
1038  $bm_ids = explode(";", $_REQUEST['bm_id_tgt']);
1039  if(!$bm_ids || !$tgt)
1040  {
1041  ilUtil::sendFailure($this->lng->txt("no_checkbox"));
1042  return $this->view();
1043  }
1044 
1045  $tree = new ilTree($ilUser->getId());
1046  $tree->setTableNames('bookmark_tree', 'bookmark_data');
1047 
1048  $tgt_node = $tree->getNodeData($tgt);
1049 
1050  // sanity check
1051  foreach($bm_ids as $node_id)
1052  {
1053  if($tree->isGrandChild($node_id, $tgt))
1054  {
1055  ilUtil::sendFailure($this->lng->txt("error"), true);
1056  $this->ctrl->redirect($this, "view");
1057  }
1058 
1059  $node = $tree->getNodeData($node_id);
1060 
1061  // already at correct position
1062  if($node["parent"] == $tgt)
1063  {
1064  continue;
1065  }
1066 
1067  $tree->moveTree($node_id, $tgt);
1068  }
1069 
1070  ilUtil::sendSuccess($this->lng->txt("bookmark_moved_ok"), true);
1071  $this->ctrl->setParameter($this, "bmf_id", $tgt);
1072  $this->ctrl->redirect($this, "view");
1073  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $ilUser
Definition: imgupload.php:15
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ createBookmark()

ilBookmarkAdministrationGUI::createBookmark ( )

create new bookmark in db

Definition at line 600 of file class.ilBookmarkAdministrationGUI.php.

References $_POST, $ilCtrl, $lng, newFormBookmark(), ilUtil\redirect(), ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\stripSlashes().

601  {
602  global $lng, $ilCtrl;
603 
604  if(!$this->tree->isInTree($this->id))
605  {
606  $this->ctrl->setParameter($this, 'bmf_id', '');
607  $this->ctrl->redirect($this);
608  }
609 
610  // check title and target
611  if(empty($_POST["title"]))
612  {
613  ilUtil::sendFailure($this->lng->txt("please_enter_title"));
614  $this->newFormBookmark();
615  }
616  else if(empty($_POST["target"]))
617  {
618  ilUtil::sendFailure($this->lng->txt("please_enter_target"));
619  $this->newFormBookmark();
620  }
621  else
622  {
623  // create bookmark
624  $bm = new ilBookmark();
625  $bm->setTitle(ilUtil::stripSlashes($_POST["title"]));
626  $bm->setDescription(ilUtil::stripSlashes($_POST["description"]));
627  $bm->setTarget(ilUtil::stripSlashes($_POST["target"]));
628  $bm->setParent($this->id);
629  $bm->create();
630 
631  ilUtil::sendInfo($lng->txt('bookmark_added'), true);
632 
633  if($_POST['return_to'])
634  ilUtil::redirect($_POST['return_to_url']);
635  else
636  {
637  $ilCtrl->saveParameter($this, 'bmf_id');
638  $ilCtrl->redirect($this, 'view');
639  }
640  }
641  }
Class Bookmarks Bookmark management.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ createBookmarkFolder()

ilBookmarkAdministrationGUI::createBookmarkFolder ( )

create new bookmark folder in db

Definition at line 536 of file class.ilBookmarkAdministrationGUI.php.

References $_POST, $ilCtrl, newFormBookmarkFolder(), ilUtil\sendFailure(), and ilUtil\stripSlashes().

537  {
538  if(!$this->tree->isInTree($this->id))
539  {
540  $this->ctrl->setParameter($this, 'bmf_id', '');
541  $this->ctrl->redirect($this);
542  }
543 
544  // check title
545  if(empty($_POST["title"]))
546  {
547  ilUtil::sendFailure($this->lng->txt("please_enter_title"));
548  $this->newFormBookmarkFolder();
549  }
550  else
551  {
552  // create bookmark folder
553  $bmf = new ilBookmarkFolder();
554  $bmf->setTitle(ilUtil::stripSlashes($_POST["title"]));
555  $bmf->setParent($this->id);
556  $bmf->create();
557 
558  global $ilCtrl;
559  $ilCtrl->saveParameter($this, 'bmf_id');
560  $ilCtrl->redirect($this, 'view');
561  }
562  }
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
bookmark folder (note: this class handles personal bookmarks folders only)
newFormBookmarkFolder()
display new bookmark folder form
+ Here is the call graph for this function:

◆ delete()

ilBookmarkAdministrationGUI::delete ( )

display deletion conformation screen

Definition at line 744 of file class.ilBookmarkAdministrationGUI.php.

References $_GET, $_POST, ilBookmark\_getTypeOfId(), ilUtil\getImageTagByType(), and ilUtil\shortenText().

745  {
746  $bm_ids = $_GET['bm_id'] ? array($_GET['bm_id']) : $_POST['bm_id'];
747  if(!$bm_ids)
748  {
749  $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
750  }
751 
752  $this->ctrl->setParameter($this, "bmf_id", $this->id);
753 
754  // display confirmation message
755  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
756  $cgui = new ilConfirmationGUI();
757  $cgui->setFormAction($this->ctrl->getFormAction($this));
758  $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
759  $cgui->setCancel($this->lng->txt("cancel"), "cancel");
760  $cgui->setConfirm($this->lng->txt("confirm"), "confirm");
761 
762  foreach($bm_ids as $obj_id)
763  {
764  $type = ilBookmark::_getTypeOfId($obj_id);
765 
766  if(!$this->tree->isInTree($obj_id))
767  {
768  continue;
769  }
770 
771  switch($type)
772  {
773  case "bmf":
774  $BookmarkFolder = new ilBookmarkFolder($obj_id);
775  $title = $BookmarkFolder->getTitle();
776  $target = "";
777  unset($BookmarkFolder);
778  break;
779 
780  case "bm":
781  $Bookmark = new ilBookmark($obj_id);
782  $title = $Bookmark->getTitle();
783  $target = $Bookmark->getTarget();
784  unset($Bookmark);
785  break;
786  }
787 
788  $caption = ilUtil::getImageTagByType($type, $this->tpl->tplPath) .
789  " " . $title;
790  if($target)
791  {
792  $caption .= " (" . ilUtil::shortenText($target, $this->textwidth, true) . ")";
793  }
794 
795  $cgui->addItem("id[]", $obj_id, $caption);
796  }
797 
798  $this->tpl->setContent($cgui->getHTML());
799  }
Class Bookmarks Bookmark management.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
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 shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
redirection script todo: (a better solution should control the processing via a xml file) ...
static _getTypeOfId($a_id)
get type of a given id
bookmark folder (note: this class handles personal bookmarks folders only)
Confirmation screen class.
+ Here is the call graph for this function:

◆ displayHeader()

ilBookmarkAdministrationGUI::displayHeader ( )

display header and locator

Definition at line 147 of file class.ilBookmarkAdministrationGUI.php.

References displayLocator(), ilUtil\infoPanel(), and ilUtil\sendInfo().

Referenced by executeCommand().

148  {
149  // output locator
150  $this->displayLocator();
151 
152  // output message
153  if($this->message)
154  {
155  ilUtil::sendInfo($this->message);
156  }
158 
159 // $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_pd_b.png"),
160 // "");
161  $this->tpl->setTitle($this->lng->txt("bookmarks"));
162  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static infoPanel($a_keep=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displayLocator()

ilBookmarkAdministrationGUI::displayLocator ( )

display locator

Definition at line 207 of file class.ilBookmarkAdministrationGUI.php.

References $lng, $path, and $row.

Referenced by displayHeader().

208  {
209  global $lng;
210 
211  if(empty($this->id))
212  {
213  return;
214  }
215 
216  if(!$this->tree->isInTree($this->id))
217  {
218  return;
219  }
220 
221  $this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html", "Services/Locator");
222 
223  $path = $this->tree->getPathFull($this->id);
224 //print_r($path);
225  $modifier = 1;
226 
227  return;
228  $this->tpl->setVariable("TXT_LOCATOR", $this->lng->txt("locator"));
229  $this->tpl->touchBlock("locator_separator");
230  $this->tpl->touchBlock("locator_item");
231  //$this->tpl->setCurrentBlock("locator_item");
232  //$this->tpl->setVariable("ITEM", $this->lng->txt("personal_desktop"));
233  //$this->tpl->setVariable("LINK_ITEM", $this->ctrl->getLinkTargetByClass("ilpersonaldesktopgui"));
234  //$this->tpl->setVariable("LINK_TARGET","target=\"".
235  // ilFrameTargetInfo::_getFrame("MainContent")."\"");
236  //$this->tpl->parseCurrentBlock();
237 
238  foreach($path as $key => $row)
239  {
240  if($key < count($path) - $modifier)
241  {
242  $this->tpl->touchBlock("locator_separator");
243  }
244 
245  $this->tpl->setCurrentBlock("locator_item");
246  $title = ($row["child"] == 1) ?
247  $lng->txt("bookmarks") :
248  $row["title"];
249  $this->tpl->setVariable("ITEM", $title);
250  $this->ctrl->setParameter($this, "bmf_id", $row["child"]);
251  $this->tpl->setVariable("LINK_ITEM",
252  $this->ctrl->getLinkTarget($this));
253  $this->tpl->parseCurrentBlock();
254  }
255 
256  $this->tpl->setCurrentBlock("locator");
257 
258  $this->tpl->parseCurrentBlock();
259  }
$path
Definition: index.php:22
+ Here is the caller graph for this function:

◆ editFormBookmark()

ilBookmarkAdministrationGUI::editFormBookmark ( )

display edit bookmark form

Definition at line 506 of file class.ilBookmarkAdministrationGUI.php.

References $_GET, $ilCtrl, $lng, and initFormBookmark().

Referenced by updateBookmark().

507  {
508  global $lng, $ilCtrl;
509 
510  if(!$this->tree->isInTree($_GET["obj_id"]))
511  {
512  $this->ctrl->setParameter($this, 'obj_id', '');
513  $this->ctrl->setParameter($this, 'bmf_id', '');
514  $this->ctrl->redirect($this);
515  }
516 
517  $form = $this->initFormBookmark('updateBookmark');
518  $bookmark = new ilBookmark($_GET["obj_id"]);
519  $form->setValuesByArray
520  (
521  array
522  (
523  "title" => $bookmark->getTitle(),
524  "target" => $bookmark->getTarget(),
525  "description" => $bookmark->getDescription(),
526  "obj_id" => $_GET["obj_id"],
527  )
528  );
529  $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
530  }
Class Bookmarks Bookmark management.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
initFormBookmark($action='createBookmark')
init Bookmark create/edit form
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editFormBookmarkFolder()

ilBookmarkAdministrationGUI::editFormBookmarkFolder ( )

display edit bookmark folder form

Definition at line 343 of file class.ilBookmarkAdministrationGUI.php.

References $_GET, get_last(), and initFormBookmarkFolder().

Referenced by updateBookmarkFolder().

344  {
345  if(!$this->tree->isInTree($_GET["obj_id"]))
346  {
347  $this->ctrl->setParameter($this, 'bmf_id', '');
348  $this->ctrl->setParameter($this, 'obj_id', '');
349  $this->ctrl->redirect($this);
350  }
351 
352  $bmf = new ilBookmarkFolder($_GET["obj_id"]);
353  $form = $this->initFormBookmarkFolder('updateBookmarkFolder', $this->id);
354  $form->setValuesByArray
355  (
356  array
357  (
358  "title" => $this->get_last("title", $bmf->getTitle()),
359  "obj_id" => $_GET["obj_id"],
360  )
361  );
362  $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
363  }
$_GET["client_id"]
initFormBookmarkFolder($action='createBookmarkFolder')
init bookmark folder create/edit form
bookmark folder (note: this class handles personal bookmarks folders only)
get_last($a_var, $a_value)
get stored post var in case of an error/warning otherwise return passed value
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeAction()

ilBookmarkAdministrationGUI::executeAction ( )

Definition at line 99 of file class.ilBookmarkAdministrationGUI.php.

References $_POST, export(), sendmail(), and view().

100  {
101  switch($_POST["selected_cmd"])
102  {
103  case "delete":
104  $this->delete();
105  break;
106  case "export":
107  $this->export();
108  break;
109  case "sendmail":
110  $this->sendmail();
111  break;
112  default:
113  $this->view();
114  break;
115  }
116  return true;
117  }
$_POST['username']
Definition: cron.php:12
export($deliver=true)
export bookmarks
+ Here is the call graph for this function:

◆ executeCommand()

& ilBookmarkAdministrationGUI::executeCommand ( )

execute command

Definition at line 79 of file class.ilBookmarkAdministrationGUI.php.

References $cmd, displayHeader(), explorer(), and getMode().

80  {
81  $next_class = $this->ctrl->getNextClass();
82 
83  switch($next_class)
84  {
85  default:
86  $cmd = $this->ctrl->getCmd("view");
87  $this->displayHeader();
88  $this->$cmd();
89  if($this->getMode() == 'tree')
90  {
91  $this->explorer();
92  }
93  break;
94  }
95  $this->tpl->show(true);
96  return true;
97  }
getMode()
return display mode flat or tree
$cmd
Definition: sahs_server.php:35
explorer()
output explorer tree with bookmark folders
+ Here is the call graph for this function:

◆ explorer()

ilBookmarkAdministrationGUI::explorer ( )

output explorer tree with bookmark folders

Definition at line 131 of file class.ilBookmarkAdministrationGUI.php.

References $tpl.

Referenced by executeCommand().

132  {
133  global $tpl;
134 
135  include_once("./Services/Bookmarks/classes/class.ilBookmarkExplorerGUI.php");
136  $exp = new ilBookmarkExplorerGUI($this, "explorer");
137  if (!$exp->handleCommand())
138  {
139  $tpl->setLeftNavContent($exp->getHTML());
140  }
141  }
Bookmark explorer GUI class.
+ Here is the caller graph for this function:

◆ export()

ilBookmarkAdministrationGUI::export (   $deliver = true)

export bookmarks

Definition at line 682 of file class.ilBookmarkAdministrationGUI.php.

References $_GET, $_POST, $id, ilBookmarkImportExport\_exportBookmark(), and ilUtil\deliverData().

Referenced by executeAction(), and sendmail().

683  {
684  $bm_ids = $_GET['bm_id'] ? array($_GET['bm_id']) : $_POST['bm_id'];
685  if(!$bm_ids)
686  {
687  $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
688  }
689  $export_ids = array();
690  foreach($bm_ids as $id)
691  {
692  if($this->tree->isInTree($id))
693  {
694  //list($type, $obj_id) = explode(":", $id);
695  //$export_ids[]=$obj_id;
696  $export_ids[] = $id;
697  }
698  }
699 
700  require_once ("./Services/Bookmarks/classes/class.ilBookmarkImportExport.php");
701  $html_content = ilBookmarkImportExport::_exportBookmark($export_ids, true,
702  $this->lng->txt("bookmarks_of") . " " . $this->ilias->account->getFullname());
703 
704  if($deliver)
705  {
706  ilUtil::deliverData($html_content, 'bookmarks.html', "application/save", $charset = "");
707  }
708  else
709  {
710  return $html_content;
711  }
712  }
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
_exportBookmark($obj_ids, $recursive=true, $title='')
export bookmarks static method return html string
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_last()

ilBookmarkAdministrationGUI::get_last (   $a_var,
  $a_value 
)

get stored post var in case of an error/warning otherwise return passed value

Definition at line 496 of file class.ilBookmarkAdministrationGUI.php.

References $_POST, and ilUtil\prepareFormOutput().

Referenced by editFormBookmarkFolder().

497  {
498  return (!empty($_POST[$a_var])) ?
499  ilUtil::prepareFormOutput(($_POST[$a_var]), true) :
500  ilUtil::prepareFormOutput($a_value);
501  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
$_POST['username']
Definition: cron.php:12
Util class various functions, usage as namespace.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

ilBookmarkAdministrationGUI::getHTML ( )

Get Bookmark list for personal desktop.

Definition at line 917 of file class.ilBookmarkAdministrationGUI.php.

918  {
919  include_once("./Services/Bookmarks/classes/class.ilBookmarkBlockGUI.php");
920  $bookmark_block_gui = new ilBookmarkBlockGUI("ilpersonaldesktopgui", "show");
921 
922  return $bookmark_block_gui->getHTML();
923  }
BlockGUI class for Bookmarks block.

◆ getMode()

ilBookmarkAdministrationGUI::getMode ( )

return display mode flat or tree

Definition at line 123 of file class.ilBookmarkAdministrationGUI.php.

Referenced by executeCommand().

124  {
125  return $this->mode;
126  }
+ Here is the caller graph for this function:

◆ ilBookmarkAdministrationGUI()

ilBookmarkAdministrationGUI::ilBookmarkAdministrationGUI ( )

Constructor public.

Parameters
integeruser_id (optional)

Definition at line 47 of file class.ilBookmarkAdministrationGUI.php.

References $_GET, $ilCtrl, $ilias, $ilUser, $lng, and $tpl.

48  {
49  global $ilias, $tpl, $lng, $ilCtrl, $ilUser;
50 
51 // $tpl->enableAdvancedColumnLayout(true, false);
52 
53  $tpl->getStandardTemplate();
54 
55  //print_r($_SESSION["error_post_vars"]);
56  // if no bookmark folder id is given, take dummy root node id (that is 1)
57  $this->id = (empty($_GET["bmf_id"]))
58  ? 1
59  : $_GET["bmf_id"];
60 
61  // initiate variables
62  $this->ilias =& $ilias;
63  $this->tpl =& $tpl;
64  $this->lng =& $lng;
65  $this->ctrl =& $ilCtrl;
66  $this->ctrl->setParameter($this, "bmf_id", $this->id);
67  $this->user_id = $ilUser->getId();
68 
69  $this->tree = new ilTree($this->user_id);
70  $this->tree->setTableNames('bookmark_tree', 'bookmark_data');
71  $this->root_id = $this->tree->readRootId();
72 
73  $this->mode = "tree";
74  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
global $ilUser
Definition: imgupload.php:15

◆ importFile()

ilBookmarkAdministrationGUI::importFile ( )

imports a bookmark file into database display status information or report errors messages in case of error public

Definition at line 931 of file class.ilBookmarkAdministrationGUI.php.

References __importBookmarks(), ilBookmarkImportExport\_parseFile(), newFormBookmark(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and view().

932  {
933  if(!$this->tree->isInTree($this->id))
934  {
935  $this->ctrl->setParameter($this, 'bmf_id', '');
936  $this->ctrl->redirect($this);
937  }
938 
939  if($_FILES["bkmfile"]["error"] > UPLOAD_ERR_OK)
940  {
941  ilUtil::sendFailure($this->lng->txt("import_file_not_valid"));
942  $this->newFormBookmark();
943  return;
944  }
945  require_once ("./Services/Bookmarks/classes/class.ilBookmarkImportExport.php");
946  $objects = ilBookmarkImportExport::_parseFile($_FILES["bkmfile"]['tmp_name']);
947  if($objects === false)
948  {
949  ilUtil::sendFailure($this->lng->txt("import_file_not_valid"));
950  $this->newFormBookmark();
951  return;
952  }
953  // holds the number of created objects
954  $num_create = array('bm'=> 0, 'bmf'=> 0);
955  $this->__importBookmarks($objects, $num_create, $this->id, 0);
956 
957  ilUtil::sendSuccess(sprintf($this->lng->txt("bkm_import_ok"), $num_create['bm'],
958  $num_create['bmf']));
959  $this->view();
960 
961 
962  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
__importBookmarks(&$objects, &$num_create, $folder_id, $start_key=0)
creates the bookmarks and folders
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
_parseFile($file)
parse Bookmark file static method returns 3 dimensional array of bookmarks and folders ...
+ Here is the call graph for this function:

◆ initFormBookmark()

ilBookmarkAdministrationGUI::initFormBookmark (   $action = 'createBookmark')
private

init Bookmark create/edit form

Parameters
stringform action type; valid values: createBookmark, updateBookmark

Definition at line 370 of file class.ilBookmarkAdministrationGUI.php.

References $_GET, $ilCtrl, $ilUser, $lng, and ilTextInputGUI\setValue().

Referenced by editFormBookmark(), and newFormBookmark().

371  {
372  global $lng, $ilCtrl, $ilUser;
373 
374  if(!$this->tree->isInTree($this->id))
375  {
376  $this->ctrl->setParameter($this, 'bmf_id', '');
377  $this->ctrl->redirect($this);
378  }
379 
380  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
381  $form = new ilPropertyFormGUI();
382  $form->setTopAnchor("bookmark_top");
383 
384  $form->setTitle($lng->txt("bookmark_new"));
385 
386  if($action == 'updateBookmark')
387  {
388  $ilCtrl->setParameter($this, 'bmf_id', $this->id);
389  $ilCtrl->setParameter($this, 'obj_id', $_GET["obj_id"]);
390  }
391 
392  $hash = ($ilUser->prefs["screen_reader_optimization"])
393  ? "bookmark_top"
394  : "";
395 
396  $form->setFormAction($ilCtrl->getFormAction($this, $action, $hash));
397  $ilCtrl->clearParameters($this);
398  // title
399  $prop = new ilTextInputGUI($lng->txt("title"), "title");
400  $prop->setValue($_GET['bm_title']);
401  $prop->setRequired(true);
402  $form->addItem($prop);
403 
404  // description
405  $prop = new ilTextAreaInputGUI($lng->txt('description'), 'description');
406  $form->addItem($prop);
407 
408  // target link
409  $prop = new ilTextInputGUI($lng->txt('bookmark_target'), 'target');
410  $prop->setValue($_GET['bm_link']);
411  $prop->setRequired(true);
412  $form->addItem($prop);
413 
414  // hidden redirect field
415  if($_GET['return_to'])
416  {
417  $prop = new ilHiddenInputGUI('return_to');
418  $prop->setValue($_GET['return_to']);
419  $form->addItem($prop);
420 
421  $prop = new ilHiddenInputGUI('return_to_url');
422  if($_GET['return_to_url'])
423  $prop->setValue($_GET['return_to_url']);
424  else
425  $prop->setValue($_GET['bm_link']);
426  $form->addItem($prop);
427  }
428 
429  // buttons
430  $form->addCommandButton($action, $lng->txt('save'));
431  $form->addCommandButton('cancel', $lng->txt('cancel'));
432 
433  // keep imports?
434  /*
435  $this->tpl->setCurrentBlock('bkm_import');
436  $this->tpl->setVariable("TXT_IMPORT_BKM", $this->lng->txt("bkm_import"));
437  $this->tpl->setVariable("TXT_FILE", $this->lng->txt("file_add"));
438  $this->tpl->setVariable("TXT_IMPORT", $this->lng->txt("import"));
439  $this->tpl->parseCurrentBlock();
440  //vd($_POST);
441  */
442 
443  return $form;
444  }
This class represents a property form user interface.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
This class represents a hidden form property in a property form.
This class represents a text property in a property form.
global $ilUser
Definition: imgupload.php:15
This class represents a text area property in a property form.
setValue($a_value)
Set Value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormBookmarkFolder()

ilBookmarkAdministrationGUI::initFormBookmarkFolder (   $action = 'createBookmarkFolder')
private

init bookmark folder create/edit form

Parameters
stringform action type; valid values: createBookmark, updateBookmark

Definition at line 299 of file class.ilBookmarkAdministrationGUI.php.

References $_GET, $ilCtrl, $ilUser, $lng, and ilFormPropertyGUI\setRequired().

Referenced by editFormBookmarkFolder(), and newFormBookmarkFolder().

300  {
301  global $lng, $ilCtrl, $ilUser;
302 
303  if(!$this->tree->isInTree($this->id))
304  {
305  $this->ctrl->setParameter($this, 'bmf_id', '');
306  $this->ctrl->redirect($this);
307  }
308 
309  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
310  $form = new ilPropertyFormGUI();
311  $form->setTopAnchor("bookmark_top");
312 
313  $form->setTitle($lng->txt("bookmark_folder_new"));
314 
315  if($action == 'updateBookmarkFolder')
316  {
317  $ilCtrl->setParameter($this, 'bmf_id', $this->id);
318  $ilCtrl->setParameter($this, 'obj_id', $_GET["obj_id"]);
319  }
320 
321  $hash = ($ilUser->prefs["screen_reader_optimization"])
322  ? "bookmark_top"
323  : "";
324 
325  $form->setFormAction($ilCtrl->getFormAction($this, $action, $hash));
326 
327  $ilCtrl->clearParameters($this);
328 
329  // title
330  $prop = new ilTextInputGUI($lng->txt("title"), "title");
331  $prop->setRequired(true);
332  $form->addItem($prop);
333 
334  // buttons
335  $form->addCommandButton($action, $lng->txt('save'));
336  $form->addCommandButton('cancel', $lng->txt('cancel'));
337  return $form;
338  }
This class represents a property form user interface.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
This class represents a text property in a property form.
global $ilUser
Definition: imgupload.php:15
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initImportBookmarksForm()

ilBookmarkAdministrationGUI::initImportBookmarksForm ( )
private

Init import bookmark form.

Definition at line 450 of file class.ilBookmarkAdministrationGUI.php.

References $ilCtrl, $ilUser, $lng, and ilFormPropertyGUI\setRequired().

Referenced by newFormBookmark().

451  {
452  global $lng, $ilCtrl, $ilUser;
453 
454  if(!$this->tree->isInTree($this->id))
455  {
456  $this->ctrl->setParameter($this, 'bmf_id', '');
457  $this->ctrl->redirect($this);
458  }
459 
460  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
461  $form = new ilPropertyFormGUI();
462  $form->setFormAction($ilCtrl->getFormAction($this, "importFile")); // #16133
463  $form->setTopAnchor("bookmark_top");
464  $form->setTitle($lng->txt("bkm_import"));
465 
466  $fi = new ilFileInputGUI($lng->txt("file_add"), "bkmfile");
467  $fi->setRequired(true);
468  $form->addItem($fi);
469 
470  $form->addCommandButton("importFile", $lng->txt('import'));
471  $form->addCommandButton('cancel', $lng->txt('cancel'));
472 
473  return $form;
474  }
This class represents a property form user interface.
This class represents a file property in a property form.
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ move()

ilBookmarkAdministrationGUI::move ( )

Definition at line 1009 of file class.ilBookmarkAdministrationGUI.php.

References $_GET, $_REQUEST, $ilUser, $tpl, ilUtil\sendFailure(), ilUtil\sendInfo(), and view().

1010  {
1011  global $ilUser, $ilTabs, $tpl;
1012 
1013  $bm_ids = $_REQUEST['bm_id'];
1014  if(!$bm_ids && $_GET["bm_id_tgt"] == "")
1015  {
1016  ilUtil::sendFailure($this->lng->txt("no_checkbox"));
1017  return $this->view();
1018  }
1019 
1020  $ilTabs->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this));
1021 
1022  $this->ctrl->setParameter($this, "bm_id_tgt", $_GET["bm_id_tgt"] ? $_GET["bm_id_tgt"] : implode(";", $bm_ids));
1023  ilUtil::sendInfo($this->lng->txt("bookmark_select_target"));
1024  include_once("./Services/Bookmarks/classes/class.ilBookmarkMoveExplorerGUI.php");
1025  $exp = new ilBookmarkMoveExplorerGUI($this, "move");
1026  if (!$exp->handleCommand())
1027  {
1028  $this->mode = "flat";
1029  $this->tpl->setContent($exp->getHTML());
1030  }
1031  }
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $ilUser
Definition: imgupload.php:15
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ newForm()

ilBookmarkAdministrationGUI::newForm (   $type)

new form

Definition at line 264 of file class.ilBookmarkAdministrationGUI.php.

References $_POST, newFormBookmark(), and newFormBookmarkFolder().

265  {
266  if(!$type)
267  $type = $_POST["type"];
268  switch($type)
269  {
270  case "bmf":
271  $this->newFormBookmarkFolder();
272  break;
273 
274  case "bm":
275  $this->newFormBookmark();
276  break;
277  }
278  }
$_POST['username']
Definition: cron.php:12
newFormBookmarkFolder()
display new bookmark folder form
+ Here is the call graph for this function:

◆ newFormBookmark()

ilBookmarkAdministrationGUI::newFormBookmark ( )

display new bookmark form

Definition at line 479 of file class.ilBookmarkAdministrationGUI.php.

References $_REQUEST, initFormBookmark(), and initImportBookmarksForm().

Referenced by createBookmark(), importFile(), and newForm().

480  {
481  $form = $this->initFormBookmark();
482  $html1 = $form->getHTML();
483  $html2 = '';
484  if(!$_REQUEST["bm_link"])
485  {
486  $form2 = $this->initImportBookmarksForm();
487  $html2 = "<br />" . $form2->getHTML();
488  }
489  $this->tpl->setVariable("ADM_CONTENT", $html1 . $html2);
490  }
initImportBookmarksForm()
Init import bookmark form.
initFormBookmark($action='createBookmark')
init Bookmark create/edit form
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newFormBookmarkFolder()

ilBookmarkAdministrationGUI::newFormBookmarkFolder ( )

display new bookmark folder form

Definition at line 283 of file class.ilBookmarkAdministrationGUI.php.

References initFormBookmarkFolder().

Referenced by createBookmarkFolder(), and newForm().

284  {
285  if(!$this->tree->isInTree($this->id))
286  {
287  $this->ctrl->setParameter($this, 'bmf_id', '');
288  $this->ctrl->redirect($this);
289  }
290 
291  $form = $this->initFormBookmarkFolder();
292  $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
293  }
initFormBookmarkFolder($action='createBookmarkFolder')
init bookmark folder create/edit form
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendmail()

ilBookmarkAdministrationGUI::sendmail ( )

send bookmarks as attachment

Definition at line 717 of file class.ilBookmarkAdministrationGUI.php.

References $filename, $ilUser, export(), ilMailFormCall\getRedirectTarget(), ilUtil\ilTempnam(), and ilUtil\redirect().

Referenced by executeAction().

718  {
719  global $ilUser;
720  include_once './Services/Mail/classes/class.ilFileDataMail.php';
721  require_once "Services/Mail/classes/class.ilFormatMail.php";
722  $mfile = new ilFileDataMail($ilUser->getId());
723  $umail = new ilFormatMail($ilUser->getId());
724 
725  $html_content = $this->export(false);
726  $tempfile = ilUtil::ilTempnam();
727  $fp = fopen($tempfile, 'w');
728  fwrite($fp, $html_content);
729  fclose($fp);
730  $filename = 'bookmarks.html';
731  $mfile->copyAttachmentFile($tempfile, $filename);
732  $umail->savePostData($ilUser->getId(), array($filename),
733  '', '', '', '', '',
734  '',
735  '', 0);
736 
737  require_once 'Services/Mail/classes/class.ilMailFormCall.php';
738  ilUtil::redirect(ilMailFormCall::getRedirectTarget($this, '', array(), array('type' => 'attach')));
739  }
static getRedirectTarget($gui, $cmd, Array $gui_params=array(), Array $mail_params=array())
This class handles all operations on files (attachments) in directory ilias_data/mail.
export($deliver=true)
export bookmarks
Class UserMail this class handles user mails.
$filename
Definition: buildRTE.php:89
global $ilUser
Definition: imgupload.php:15
static ilTempnam()
Create a temporary file in an ILIAS writable directory.
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showPossibleSubObjects()

ilBookmarkAdministrationGUI::showPossibleSubObjects ( )

display subobject addition selection

Definition at line 871 of file class.ilBookmarkAdministrationGUI.php.

References $_SESSION, and ilUtil\formSelect().

872  {
873  $actions = array(
874  "delete" => $this->lng->txt("delete"),
875  "export" => $this->lng->txt("export"),
876  "sendmail"=> $this->lng->txt("bkm_sendmail"),
877  );
878 
879  $subobj = array("bm", "bmf");
880 
881  if(is_array($subobj))
882  {
883  //build form
884  $opts = ilUtil::formSelect("", "type", $subobj);
885 
886  $this->tpl->setCurrentBlock("add_object");
887  $this->tpl->setVariable("COLUMN_COUNTS", 7);
888  $this->tpl->setVariable("SELECT_OBJTYPE", $opts);
889  $this->tpl->setVariable("BTN_NAME", "newForm");
890  $this->tpl->setVariable("TXT_ADD", $this->lng->txt("add"));
891  $this->tpl->parseCurrentBlock();
892  }
893 
894  $this->tpl->setVariable("TPLPATH", $this->tpl->tplPath);
895 
896  $this->tpl->setCurrentBlock("tbl_action_select");
897  $this->tpl->setVariable("SELECT_ACTION", ilUtil::formSelect($_SESSION["error_post_vars"]['action'], "action", $actions, false, true));
898  $this->tpl->setVariable("BTN_NAME", "executeAction");
899  $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("execute"));
900 
901  /*
902  $this->tpl->setVariable("BTN_NAME","delete");
903  $this->tpl->setVariable("BTN_VALUE",$this->lng->txt("delete"));
904  $this->tpl->parseCurrentBlock();
905 
906  $this->tpl->setVariable("BTN_NAME","export");
907  $this->tpl->setVariable("BTN_VALUE",$this->lng->txt("export"));
908  $this->tpl->parseCurrentBlock();
909  */
910  $this->tpl->parseCurrentBlock();
911 
912  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
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.
+ Here is the call graph for this function:

◆ updateBookmark()

ilBookmarkAdministrationGUI::updateBookmark ( )

update bookmark in db

Definition at line 646 of file class.ilBookmarkAdministrationGUI.php.

References $_GET, $_POST, editFormBookmark(), ilUtil\sendFailure(), ilUtil\stripSlashes(), and view().

647  {
648  if(!$this->tree->isInTree($_GET["obj_id"]))
649  {
650  $this->ctrl->setParameter($this, 'obj_id', '');
651  $this->ctrl->setParameter($this, 'bmf_id', '');
652  $this->ctrl->redirect($this);
653  }
654 
655  // check title and target
656  if(empty($_POST["title"]))
657  {
658  ilUtil::sendFailure($this->lng->txt("please_enter_title"));
659  $this->editFormBookmark();
660  }
661  else if(empty($_POST["target"]))
662  {
663  ilUtil::sendFailure($this->lng->txt("please_enter_target"));
664  $this->editFormBookmark();
665  }
666  else
667  {
668  // update bookmark
669  $bm = new ilBookmark($_GET["obj_id"]);
670  $bm->setTitle(ilUtil::stripSlashes($_POST["title"]));
671  $bm->setTarget(ilUtil::stripSlashes($_POST["target"]));
672  $bm->setDescription(ilUtil::stripSlashes($_POST["description"]));
673  $bm->update();
674 
675  $this->view();
676  }
677  }
Class Bookmarks Bookmark management.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
editFormBookmark()
display edit bookmark form
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ updateBookmarkFolder()

ilBookmarkAdministrationGUI::updateBookmarkFolder ( )

update bookmark folder

Definition at line 568 of file class.ilBookmarkAdministrationGUI.php.

References $_GET, $_POST, $ilCtrl, editFormBookmarkFolder(), ilUtil\sendFailure(), and ilUtil\stripSlashes().

569  {
570  if(!$this->tree->isInTree($_GET["obj_id"]))
571  {
572  $this->ctrl->setParameter($this, 'obj_id', '');
573  $this->ctrl->setParameter($this, 'bmf_id', '');
574  $this->ctrl->redirect($this);
575  }
576 
577  // check title
578  if(empty($_POST["title"]))
579  {
580  ilUtil::sendFailure($this->lng->txt("please_enter_title"));
581  $this->editFormBookmarkFolder();
582  }
583  else
584  {
585  // update bookmark folder
586  $bmf = new ilBookmarkFolder($_GET["obj_id"]);
587  $bmf->setTitle(ilUtil::stripSlashes($_POST["title"]));
588  $bmf->update();
589 
590  global $ilCtrl;
591  $ilCtrl->saveParameter($this, 'bmf_id');
592  $ilCtrl->redirect($this, 'view');
593  }
594  }
$_POST['username']
Definition: cron.php:12
editFormBookmarkFolder()
display edit bookmark folder form
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
bookmark folder (note: this class handles personal bookmarks folders only)
+ Here is the call graph for this function:

◆ view()

ilBookmarkAdministrationGUI::view ( )

Definition at line 167 of file class.ilBookmarkAdministrationGUI.php.

References ilBookmarkFolder\getObjects().

Referenced by cancel(), confirm(), confirmedMove(), executeAction(), importFile(), move(), and updateBookmark().

168  {
169  if($this->id > 0 && !$this->tree->isInTree($this->id))
170  {
171  $this->ctrl->setParameter($this, 'bmf_id', '');
172  $this->ctrl->redirect($this);
173  }
174 
175  $objects = ilBookmarkFolder::getObjects($this->id);
176 
177  include_once 'Services/Bookmarks/classes/class.ilBookmarkAdministrationTableGUI.php';
178  $table = new ilBookmarkAdministrationTableGUI($this);
179  $table->setId('bookmark_adm_table');
180  $table->setData($objects);
181  $this->tpl->setVariable("ADM_CONTENT", $table->getHTML());
182  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $data

ilBookmarkAdministrationGUI::$data

Definition at line 39 of file class.ilBookmarkAdministrationGUI.php.

◆ $id

ilBookmarkAdministrationGUI::$id

Definition at line 38 of file class.ilBookmarkAdministrationGUI.php.

Referenced by export().

◆ $ilias

ilBookmarkAdministrationGUI::$ilias

Definition at line 33 of file class.ilBookmarkAdministrationGUI.php.

Referenced by ilBookmarkAdministrationGUI().

◆ $lng

◆ $textwidth

ilBookmarkAdministrationGUI::$textwidth = 100

Definition at line 40 of file class.ilBookmarkAdministrationGUI.php.

◆ $tpl

ilBookmarkAdministrationGUI::$tpl

◆ $tree

ilBookmarkAdministrationGUI::$tree

Definition at line 37 of file class.ilBookmarkAdministrationGUI.php.

Referenced by confirm().

◆ $user_id

ilBookmarkAdministrationGUI::$user_id

Definition at line 26 of file class.ilBookmarkAdministrationGUI.php.


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