00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 class ilPersonalDesktopGUI
00027 {
00028 var $tpl;
00029 var $lng;
00030 var $ilias;
00031
00032
00033
00034 function ilPersonalDesktopGUI()
00035 {
00036 global $ilias, $tpl, $lng, $rbacsystem;
00037
00038
00039 $this->tpl =& $tpl;
00040 $this->lng =& $lng;
00041 $this->ilias =& $ilias;
00042 }
00043
00044
00048 function displaySelectedItems()
00049 {
00050 $types = array(
00051 array("title" => $this->lng->txt("objs_cat"),
00052 "types" => "cat"),
00053 array("title" => $this->lng->txt("objs_fold"),
00054 "types" => "fold"),
00055 array("title" => $this->lng->txt("objs_crs"),
00056 "types" => "crs"),
00057 array("title" => $this->lng->txt("objs_grp"),
00058 "types" => "grp"),
00059 array("title" => $this->lng->txt("objs_chat"),
00060 "types" => "chat"),
00061 array("title" => $this->lng->txt("objs_frm"),
00062 "types" => "frm"),
00063 array("title" => $this->lng->txt("learning_objects"),
00064 "types" => array("lm", "htlm", "sahs", "dbk")),
00065 array("title" => $this->lng->txt("objs_glo"),
00066 "types" => "glo"),
00067 array("title" => $this->lng->txt("objs_file"),
00068 "types" => "file"),
00069 array("title" => $this->lng->txt("objs_exc"),
00070 "types" => "exc"),
00071 array("title" => $this->lng->txt("objs_tst"),
00072 "types" => "tst"),
00073 array("title" => $this->lng->txt("objs_svy"),
00074 "types" => "svy"),
00075 array("title" => $this->lng->txt("objs_mep"),
00076 "types" => "mep"),
00077 array("title" => $this->lng->txt("objs_qpl"),
00078 "types" => "qpl"),
00079 array("title" => $this->lng->txt("objs_spl"),
00080 "types" => "spl")
00081 );
00082 $html = "";
00083 foreach($types as $type)
00084 {
00085 $html.= $this->getSelectedItemBlockHTML($type["title"], $type["types"]);
00086 }
00087 if ($html != "")
00088 {
00089 $this->tpl->setCurrentBlock("selected_items");
00090 $this->tpl->setVariable("TXT_SELECTED_ITEMS", $this->lng->txt("selected_items"));
00091 $this->tpl->setVariable("SELECTED_ITEMS", $html);
00092 $this->tpl->parseCurrentBlock();
00093 }
00094 }
00095
00096
00100 function getSelectedItemBlockHTML($a_title, $a_type)
00101 {
00102 include_once './classes/class.ilRepositoryExplorer.php';
00103
00104 global $rbacsystem;
00105
00106 $items = $this->ilias->account->getDesktopItems($a_type);
00107
00108
00109
00110 $showViewInFrameset = $this->ilias->ini->readVariable("layout","view_target") == "frame";
00111
00112 if (count($items) > 0)
00113 {
00114 $tstCount = 0;
00115 $unsetCount = 0;
00116 $progressCount = 0;
00117 $unsetFlag = 0;
00118 $progressFlag = 0;
00119 $completedFlag = 0;
00120 if (strcmp($a_type, "tst") == 0) {
00121 $items = $this->multiarray_sort($items, "used_tries; title");
00122 foreach ($items as $tst_item) {
00123 if (!isset($tst_item["used_tries"])) {
00124 $unsetCount++;
00125 }
00126 elseif ($tst_item["used_tries"] == 0) {
00127 $progressCount++;
00128 }
00129 }
00130 }
00131
00132 $tpl = new ilTemplate("tpl.usr_pd_selected_item_block.html", true, true);
00133 $tpl->setVariable("TXT_BLOCK_HEADER", $a_title);
00134 $img_type = (is_array($a_type))
00135 ? $a_type[0]
00136 : $a_type;
00137
00138 $tpl->setVariable("IMG_HEADER", ilUtil::getImagePath("icon_".$img_type.".gif"));
00139 $this->lng->loadLanguageModule("assessment");
00140 $this->lng->loadLanguageModule("survey");
00141 $this->lng->loadLanguageModule("crs");
00142 foreach($items as $item)
00143 {
00144 if (strcmp($a_type, "tst")==0) {
00145 $tpl->setCurrentBlock("tbl_tstheader");
00146 if (($tstCount < $unsetCount)&&($unsetFlag==0)) {
00147 $tpl->setVariable("TXT_TST_TITLE", $this->lng->txt("tst_status_not_entered"));
00148 $unsetFlag++;
00149 }
00150 elseif (($tstCount < ($unsetCount+$progressCount))&&($progressFlag==0)) {
00151 $tpl->setVariable("TXT_TST_TITLE", $this->lng->txt("tst_status_progress"));
00152 $progressFlag++;
00153 }
00154 elseif (($tstCount >= ($unsetCount+$progressCount))&&($completedFlag==0)) {
00155 $tpl->setVariable("TXT_TST_TITLE", $this->lng->txt("tst_status_completed_more_tries_possible"));
00156 $completedFlag++;
00157 }
00158 $tstCount++;
00159 $tpl->parseCurrentBlock();
00160 }
00161 if (strcmp($a_type, "svy")==0) {
00162 if ($item["finished"] === 0)
00163 {
00164 $tpl->setCurrentBlock("finished");
00165 $tpl->setVariable("TXT_FINISHED", $this->lng->txt("not_finished"));
00166 $tpl->parseCurrentBlock();
00167 }
00168 else if ($item["finished"] === 1)
00169 {
00170 $tpl->setCurrentBlock("finished");
00171 $tpl->setVariable("TXT_FINISHED", $this->lng->txt("finished"));
00172 $tpl->parseCurrentBlock();
00173 }
00174 else
00175 {
00176 $tpl->setCurrentBlock("finished");
00177 $tpl->setVariable("TXT_FINISHED", $this->lng->txt("not_started"));
00178 $tpl->parseCurrentBlock();
00179 }
00180 }
00181
00182
00183 if ($item["continue_link"] != "" &&
00184 $rbacsystem->checkAccess("read", $item["id"]))
00185 {
00186 $tpl->setCurrentBlock("continue_link");
00187 $tpl->setVariable("LINK_CONTINUE", $item["continue_link"]);
00188
00189 if ($showViewInFrameset)
00190 {
00191 $tpl->setVariable("TARGET_CONTINUE", "bottom");
00192 }
00193 else
00194 {
00195 $tpl->setVariable("TARGET_CONTINUE", $item["target"]);
00196 }
00197
00198 $tpl->setVariable("TXT_CONTINUE", $this->lng->txt("continue_work"));
00199 $tpl->setVariable("IMG_CONTINUE", ilUtil::getImagePath("nav_arr_R.gif"));
00200 $tpl->parseCurrentBlock();
00201 }
00202 else
00203 {
00204 $tpl->setVariable("CONTINUE", " ");
00205 }
00206
00207
00208 if ($item["edit_link"] != "" and
00209 $rbacsystem->checkAccess("write", $item["id"]))
00210 {
00211 $tpl->setCurrentBlock("edit_link");
00212 $tpl->setVariable("LINK_EDIT", $item["edit_link"]);
00213 $tpl->setVariable("TARGET_EDIT", "bottom");
00214 $tpl->setVariable("TXT_EDIT", $this->lng->txt("edit"));
00215 $tpl->setVariable("IMG_EDIT", ilUtil::getImagePath("icon_pencil.gif"));
00216 $tpl->parseCurrentBlock();
00217 }
00218 else
00219 {
00220 $tpl->setVariable("EDIT", " ");
00221 }
00222
00223
00224 $tpl->setCurrentBlock("drop_link");
00225 $tpl->setVariable("TYPE", $item["type"]);
00226 $tpl->setVariable("ID", $item["id"]);
00227 $tpl->setVariable("TXT_DROP", $this->lng->txt("drop"));
00228 $tpl->setVariable("IMG_DROP", ilUtil::getImagePath("delete.gif"));
00229 $tpl->parseCurrentBlock();
00230
00231
00232 if ($item["description"] != "")
00233 {
00234 $tpl->setCurrentBlock("description");
00235 $tpl->setVariable("TXT_ITEM_DESCRIPTION", $item["description"]);
00236 $tpl->parseCurrentBlock();
00237 }
00238
00239 if($a_type == 'crs')
00240 {
00241 $tmp_course =& ilObjectFactory::getInstanceByRefId($item['id']);
00242 $tmp_course->initCourseMemberObject();
00243 $id = ilObject::_lookupObjId($item['id']);
00244
00245 if($tmp_course->members_obj->isBlocked($this->ilias->account->getId()))
00246 {
00247 $tpl->setCurrentBlock("crs_status");
00248 $tpl->setVariable("STATUS",$this->lng->txt("crs_status_blocked"));
00249 $tpl->parseCurrentBlock();
00250 }
00251 $conditions_ok = ilConditionHandler::_checkAllConditionsOfTarget($id);
00252
00253 if(!$conditions_ok and 0)
00254 {
00255 foreach(ilConditionHandler::_getConditionsOfTarget($id) as $condition)
00256 {
00257 if(ilConditionHandler::_checkCondition($id))
00258 {
00259 continue;
00260 }
00261 $trigger_obj =& ilObjectFactory::getInstanceByRefId($condition['trigger_ref_id']);
00262
00263 if(ilRepositoryExplorer::isClickable($trigger_obj->getType(),$trigger_obj->getRefId(),$trigger_obj->getId()))
00264 {
00265 $tpl->setCurrentBlock("pre_link");
00266 $tpl->setVariable("PRECONDITION_LINK",
00267 ilRepositoryExplorer::buildLinkTarget($trigger_obj->getRefId(),$trigger_obj->getType()));
00268 $tpl->setVariable("PRECONDITION_NAME",$trigger_obj->getTitle());
00269 $tpl->parseCurrentBlock();
00270 }
00271 else
00272 {
00273 $tpl->setCurrentBlock("pre_no_link");
00274 $tpl->setVariable("PRECONDITION_NO_TITLE",$trigger_obj->getTitle());
00275 $tpl->parseCurrentBlock();
00276 }
00277 }
00278 $tpl->setCurrentBlock("crs_preconditions");
00279 $tpl->setVariable("TXT_PRECONDITIONS",$this->lng->txt('condition_precondition'));
00280 $tpl->parseCurrentBlock();
00281 }
00282
00283
00284 }
00285
00286 if($a_type == 'frm')
00287 {
00288 global $ilUser;
00289
00290 $frm_obj = ilObjectFactory::getInstanceByRefId($item['id']);
00291 $this->lng->loadLanguageModule('forum');
00292
00293 $num_unread = $frm_obj->getCountUnread($ilUser->getId());
00294 $num_new = $frm_obj->getCountNew($ilUser->getId());
00295
00296 if($num_unread)
00297 {
00298 $tpl->setCurrentBlock("frm_info");
00299
00300 $text = $num_unread.' '.$this->lng->txt('articels_unread').' '.$this->lng->txt('and').' '.
00301 $num_new.' '.$this->lng->txt('forums_new_articles');
00302 $tpl->setVariable("TXT_FRM_INFO",$text);
00303 $tpl->parseCurrentBlock();
00304 }
00305 }
00306
00307
00308 if($a_type != 'crs' or ilRepositoryExplorer::isClickable($a_type,$item['id'],ilObject::_lookupObjId($item['id'])))
00309 {
00310 $tpl->setCurrentBlock("show_link");
00311 $tpl->setVariable("TXT_ITEM_TITLE", $item["title"]);
00312 $tpl->setVariable("LINK_SHOW", $item["link"]);
00313 if ($showViewInFrameset)
00314 {
00315 $tpl->setVariable("TARGET_SHOW", "bottom");
00316 }
00317 else
00318 {
00319 $tpl->setVariable("TARGET_SHOW", $item["target"]);
00320 }
00321 $tpl->parseCurrentBlock();
00322 }
00323 else
00324 {
00325 $tpl->setCurrentBlock("no_link");
00326 $tpl->setVariable("TXT_NO_LINK_TITLE",$item['title']);
00327 $tpl->parseCurrentBlock();
00328 }
00329
00330 $tpl->setCurrentBlock("block_row");
00331 $tpl->setVariable("ROWCOL","tblrow".(($i++ % 2)+1));
00332 $tpl->parseCurrentBlock();
00333
00334 }
00335 return $tpl->get();
00336 }
00337
00338 return "";
00339 }
00340
00341 function displaySystemMessages()
00342 {
00343
00344 $umail = new ilMail($_SESSION["AccountId"]);
00345 $smails = $umail->getMailsOfFolder(0);
00346
00347 if(count($smails))
00348 {
00349
00350 $counter = 1;
00351 foreach ($smails as $mail)
00352 {
00353
00354 require_once "classes/class.ilMailbox.php";
00355
00356 $mbox = new ilMailbox($_SESSION["AccountId"]);
00357 $inbox = $mbox->getInboxFolder();
00358
00359 $this->tpl->setCurrentBlock("tbl_system_msg_row");
00360 $this->tpl->setVariable("ROWCOL",++$counter%2 ? 'tblrow1' : 'tblrow2');
00361
00362
00363 $user = new ilObjUser($mail["sender_id"]);
00364
00365 if(!($fullname = $user->getFullname()))
00366 {
00367 $fullname = $this->lng->txt("unknown");
00368 }
00369
00370
00371 $this->tpl->setVariable("MAILCLASS", $mail["m_status"] == 'read' ? 'mailread' : 'mailunread');
00372 $this->tpl->setVariable("MAIL_FROM", $fullname);
00373 $this->tpl->setVariable("MAIL_SUBJ", $mail["m_subject"]);
00374 $this->tpl->setVariable("MAIL_DATE", ilFormat::formatDate($mail["send_time"]));
00375 $target_name = htmlentities(urlencode("mail_read.php?mobj_id=".$inbox."&mail_id=".$mail["mail_id"]));
00376 $this->tpl->setVariable("MAIL_LINK_READ", "mail_frameset.php?target=".$target_name);
00377 $this->tpl->parseCurrentBlock();
00378 }
00379 $this->tpl->setCurrentBlock("tbl_system_msg");
00380
00381 $this->tpl->setVariable("SYSTEM_MAILS",$this->lng->txt("mail_system"));
00382
00383 $this->tpl->setVariable("TXT_SENDER", $this->lng->txt("sender"));
00384 $this->tpl->setVariable("TXT_SUBJECT", $this->lng->txt("subject"));
00385 $this->tpl->setVariable("TXT_DATETIME",$this->lng->txt("date")."/".$this->lng->txt("time"));
00386 $this->tpl->parseCurrentBlock();
00387 }
00388 }
00389
00390
00391
00397 function displayMails()
00398 {
00399
00400
00401
00402 require_once "./include/inc.header.php";
00403 require_once "./include/inc.mail.php";
00404 require_once "classes/class.ilObjUser.php";
00405 require_once "classes/class.ilMailbox.php";
00406 require_once "classes/class.ilMail.php";
00407
00408
00409
00410 $umail = new ilMail($_SESSION["AccountId"]);
00411 $mbox = new ilMailBox($_SESSION["AccountId"]);
00412 $inbox = $mbox->getInboxFolder();
00413
00414
00415 $mail_data = $umail->getMailsOfFolder($inbox);
00416 $mail_counter = $umail->getMailCounterData();
00417 $this->tpl->setVariable("MAIL_COUNTER", $mail_counter["total"]);
00418 $this->tpl->setVariable("MAIL_UNREAD", $mail_counter["unread"]);
00419
00420
00421 foreach ($mail_data as $mail)
00422 {
00423
00424 if($unreadmails != $mail_counter["unread"])
00425 {
00426
00427 $unreadmails++;
00428 $this->tpl->setCurrentBlock("tbl_mails");
00429 $this->tpl->setVariable("ROWCOL",++$counter%2 ? 'tblrow1' : 'tblrow2');
00430 $this->tpl->setVariable("NEW_MAIL",$this->lng->txt("email"));
00431
00432
00433 $user = new ilObjUser($mail["sender_id"]);
00434
00435 if(!($fullname = $user->getFullname()))
00436 {
00437 $fullname = $this->lng->txt("unknown");
00438 }
00439
00440
00441 $this->tpl->setCurrentBlock("tbl_mails");
00442
00443 $this->tpl->setVariable("NEW_TXT_SENDER", $this->lng->txt("sender"));
00444 $this->tpl->setVariable("NEW_TXT_SUBJECT", $this->lng->txt("subject"));
00445 $this->tpl->setVariable("NEW_TXT_DATE",$this->lng->txt("date")."/".$this->lng->txt("time"));
00446
00447
00448 $this->tpl->setCurrentBlock("tbl_mails_row");
00449 $this->tpl->setVariable("NEW_MAIL_FROM", $fullname);
00450 $this->tpl->setVariable("NEW_MAILCLASS", $mail["status"] == 'read' ? 'mailread' : 'mailunread');
00451 $this->tpl->setVariable("NEW_MAIL_SUBJ", $mail["m_subject"]);
00452 $this->tpl->setVariable("NEW_MAIL_DATE", ilFormat::formatDate($mail["send_time"]));
00453 $target_name = htmlentities(urlencode("mail_read.php?mobj_id=".$inbox."&mail_id=".$mail["mail_id"]));
00454 $this->tpl->setVariable("NEW_MAIL_LINK_READ", "mail_frameset.php?target=".$target_name);
00455 $this->tpl->parseCurrentBlock();
00456
00457 }
00458 }
00459 }
00460
00461
00462
00463
00467 function displayUsersOnline()
00468 {
00469 global $ilUser;
00470
00471 if ($ilUser->getPref("show_users_online") != "y")
00472 {
00473 return;
00474 }
00475
00476 $this->tpl->setVariable("TXT_USERS_ONLINE",$this->lng->txt("users_online"));
00477
00478 $users = ilUtil::getUsersOnline();
00479
00480 $num = 0;
00481
00482 foreach ($users as $user_id => $user)
00483 {
00484 if ($user_id != ANONYMOUS_USER_ID)
00485 {
00486 $num++;
00487 }
00488 else
00489 {
00490 $guests = $user["num"];
00491 }
00492 }
00493
00494
00495 if (empty($guests))
00496 {
00497 $guest_text = "";
00498 }
00499 elseif ($guests == "1")
00500 {
00501 $guest_text = "1 ".$this->lng->txt("guest");
00502 }
00503 else
00504 {
00505 $guest_text = $guests." ".$this->lng->txt("guests");
00506 }
00507
00508
00509 if ($num > 0)
00510 {
00511 if ($num == 1)
00512 {
00513 $user_list = $num." ".$this->lng->txt("registered_user");
00514 }
00515 else
00516 {
00517 $user_list = $num." ".$this->lng->txt("registered_users");
00518 }
00519
00520
00521 if ($_GET["cmd"] == "whoisdetail")
00522 {
00523 $text = $this->lng->txt("hide_details");
00524 $cmd = "hidedetails";
00525 }
00526 else
00527 {
00528 $text = $this->lng->txt("show_details");
00529 $cmd = "whoisdetail";
00530 }
00531
00532 $user_details_link = " <span style=\"font-weight:lighter\">[</span><a class=\"std\" href=\"usr_personaldesktop.php?cmd=".$cmd."\">".$text."</a><span style=\"font-weight:lighter\">]</span>";
00533
00534 if (!empty($guest_text))
00535 {
00536 $user_list .= " ".$this->lng->txt("and")." ".$guest_text;
00537 }
00538
00539 $user_list .= $user_details_link;
00540 }
00541 else
00542 {
00543 $user_list = $guest_text;
00544 }
00545
00546 $this->tpl->setVariable("USER_LIST",$user_list);
00547
00548
00549 if ($_GET["cmd"] == "whoisdetail")
00550 {
00551 $z = 0;
00552
00553 foreach ($users as $user_id => $user)
00554 {
00555 if ($user_id != ANONYMOUS_USER_ID)
00556 {
00557 $rowCol = ilUtil::switchColor($z,"tblrow2","tblrow1");
00558 $login_time = ilFormat::dateDiff(ilFormat::datetime2unixTS($user["last_login"]),time());
00559
00560
00561 if ($_SESSION["AccountId"] != ANONYMOUS_USER_ID and $_SESSION["AccountId"] != $user_id)
00562 {
00563 $this->tpl->setCurrentBlock("mailto_link");
00564 $this->tpl->setVariable("IMG_MAIL", ilUtil::getImagePath("icon_pencil_b.gif", false));
00565 $this->tpl->setVariable("ALT_TXT_MAIL",$this->lng->txt("mail"));
00566 $this->tpl->setVariable("USR_LOGIN",$user["login"]);
00567 $this->tpl->parseCurrentBlock();
00568 }
00569
00570
00571
00572 $user_obj = new ilObjUser($user_id);
00573 $q = "SELECT value FROM usr_pref WHERE usr_id='".$user_id."' AND keyword='public_profile' AND value='y'";
00574 $r = $this->ilias->db->query($q);
00575
00576 if ($r->numRows())
00577 {
00578 $this->tpl->setCurrentBlock("profile_link");
00579 $this->tpl->setVariable("IMG_VIEW", ilUtil::getImagePath("enlarge.gif", false));
00580 $this->tpl->setVariable("ALT_TXT_VIEW",$this->lng->txt("view"));
00581 $this->tpl->setVariable("USR_ID",$user_id);
00582 $this->tpl->parseCurrentBlock();
00583 }
00584
00585
00586 $webspace_dir = ilUtil::getWebspaceDir();
00587 $image_dir = $webspace_dir."/usr_images";
00588 $xxthumb_file = $image_dir."/usr_".$user_obj->getID()."_xxsmall.jpg";
00589 if ($user_obj->getPref("public_upload") == "y" &&
00590 $user_obj->getPref("public_profile") == "y" &&
00591 @is_file($xxthumb_file))
00592 {
00593 $this->tpl->setCurrentBlock("usr_image");
00594 $this->tpl->setVariable("USR_IMAGE", $xxthumb_file."?t=".rand(1, 99999));
00595 $this->tpl->parseCurrentBlock();
00596 }
00597 else
00598 {
00599 $this->tpl->setVariable("NO_IMAGE", " ");
00600 }
00601
00602 $this->tpl->setCurrentBlock("tbl_users_row");
00603 $this->tpl->setVariable("ROWCOL",$rowCol);
00604 $this->tpl->setVariable("USR_LOGIN",$user["login"]);
00605 $this->tpl->setVariable("USR_FULLNAME",ilObjUser::setFullname($user["title"],$user["firstname"],$user["lastname"]));
00606 $this->tpl->setVariable("USR_LOGIN_TIME",$login_time);
00607
00608 $this->tpl->parseCurrentBlock();
00609
00610 $z++;
00611 }
00612 }
00613
00614 if ($z > 0)
00615 {
00616 $this->tpl->setCurrentBlock("tbl_users_header");
00617 $this->tpl->setVariable("TXT_USR_LOGIN",ucfirst($this->lng->txt("username")));
00618 $this->tpl->setVariable("TXT_USR_FULLNAME",ucfirst($this->lng->txt("fullname")));
00619 $this->tpl->setVariable("TXT_USR_LOGIN_TIME",ucfirst($this->lng->txt("login_time")));
00620 $this->tpl->parseCurrentBlock();
00621 }
00622 }
00623 }
00624
00625
00629 function displayBookmarks()
00630 {
00631 include_once("classes/class.ilBookmarkFolder.php");
00632 if (!empty($_GET["curBMFolder"]))
00633 {
00634 $_SESSION["ilCurBMFolder"] = $_GET["curBMFolder"];
00635 }
00636 $bm_items = ilBookmarkFolder::getObjects($_SESSION["ilCurBMFolder"]);
00637 $i = 0;
00638
00639 if (!ilBookmarkFolder::isRootFolder($_SESSION["ilCurBMFolder"])
00640 && !empty($_SESSION["ilCurBMFolder"]))
00641 {
00642 $i++;
00643 $this->tpl->setCurrentBlock("tbl_bm_row");
00644 $this->tpl->setVariable("ROWCOL","tblrow".(($i % 2)+1));
00645 $this->tpl->setVariable("BM_TITLE", "<img border=\"0\" vspace=\"0\" align=\"left\" src=\"".
00646 ilUtil::getImagePath("icon_cat.gif")."\"> "."..");
00647 $this->tpl->setVariable("BM_LINK", "usr_personaldesktop.php?curBMFolder=".
00648 ilBookmarkFolder::getRootFolder());
00649 $this->tpl->setVariable("BM_TARGET", "");
00650 $this->tpl->parseCurrentBlock();
00651 }
00652
00653 foreach ($bm_items as $bm_item)
00654 {
00655 $i++;
00656 $this->tpl->setCurrentBlock("tbl_bm_row");
00657 $this->tpl->setVariable("ROWCOL","tblrow".(($i % 2)+1));
00658 $this->tpl->setVariable("BM_LINK", "target URL");
00659
00660 switch ($bm_item["type"])
00661 {
00662 case "bmf":
00663 $this->tpl->setVariable("BM_TITLE", "<img border=\"0\" vspace=\"0\" align=\"left\" src=\"".
00664 ilUtil::getImagePath("icon_cat.gif")."\"> ".$bm_item["title"]);
00665 $this->tpl->setVariable("BM_LINK", "usr_personaldesktop.php?curBMFolder=".$bm_item["obj_id"]);
00666 $this->tpl->setVariable("BM_TARGET", "");
00667 break;
00668
00669 case "bm":
00670 $this->tpl->setVariable("BM_TITLE", "<img border=\"0\" vspace=\"0\" align=\"left\" src=\"".
00671 ilUtil::getImagePath("icon_bm.gif")."\"> ".$bm_item["title"]);
00672 $this->tpl->setVariable("BM_LINK", $bm_item["target"]);
00673 $this->tpl->setVariable("BM_TARGET", "_blank");
00674 break;
00675 }
00676
00677 $this->tpl->parseCurrentBlock();
00678 }
00679
00680 if ($i == 0)
00681 {
00682 $this->tpl->setCurrentBlock("tbl_no_bm");
00683 $this->tpl->setVariable("ROWCOL","tblrow".(($i % 2)+1));
00684 $this->tpl->setVariable("TXT_NO_BM", $this->lng->txt("no_bm_in_personal_list"));
00685 $this->tpl->parseCurrentBlock();
00686 }
00687
00688 $this->tpl->setCurrentBlock("tbl_bm");
00689 $this->tpl->setVariable("TXT_BM_HEADER",$this->lng->txt("my_bms"));
00690 $this->tpl->setVariable("TXT_BM_TITLE",$this->lng->txt("title"));
00691 $this->tpl->parseCurrentBlock();
00692 }
00693
00704 function multiarray_sort ($array, $key_sort)
00705 {
00706 if ($array) {
00707 $key_sorta = explode(";", $key_sort);
00708
00709 $multikeys = array_keys($array);
00710 $keys = array_keys($array[$multikeys[0]]);
00711
00712 for($m=0; $m < count($key_sorta); $m++) {
00713 $nkeys[$m] = trim($key_sorta[$m]);
00714 }
00715 $n += count($key_sorta);
00716
00717 for($i=0; $i < count($keys); $i++){
00718 if(!in_array($keys[$i], $key_sorta)) {
00719 $nkeys[$n] = $keys[$i];
00720 $n += "1";
00721 }
00722 }
00723
00724 for($u=0;$u<count($array); $u++) {
00725 $arr = $array[$multikeys[$u]];
00726 for($s=0; $s<count($nkeys); $s++) {
00727 $k = $nkeys[$s];
00728 $output[$multikeys[$u]][$k] = $array[$multikeys[$u]][$k];
00729 }
00730 }
00731 sort($output);
00732 return $output;
00733 }
00734 }
00735 }
00736 ?>