• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Services/Tracking/classes/class.ilLPListOfObjectsGUI.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00037 include_once './Services/Tracking/classes/class.ilLearningProgressBaseGUI.php';
00038 include_once './Services/Tracking/classes/class.ilLPStatusWrapper.php';
00039 include_once 'Services/Tracking/classes/class.ilLPObjSettings.php';
00040 include_once 'Services/Search/classes/class.ilUserFilterGUI.php';
00041 
00042 class ilLPListOfObjectsGUI extends ilLearningProgressBaseGUI
00043 {
00044         var $details_id = 0;
00045         var $details_type = '';
00046         var $details_mode = 0;
00047 
00048         function ilLPListOfObjectsGUI($a_mode,$a_ref_id)
00049         {
00050                 global $ilUser,$ilObjDataCache;
00051 
00052                 parent::ilLearningProgressBaseGUI($a_mode,$a_ref_id);
00053                 $this->__checkPDF();
00054 
00055                 $this->__initFilterGUI();
00056 
00057                 // Set item id for details
00058                 $this->__initDetails((int) $_REQUEST['details_id']);
00059 
00060                 $this->item_ref_id = (int) $_REQUEST['item_id'];
00061                 $this->item_id = $ilObjDataCache->lookupObjId($this->item_ref_id);
00062                 $this->offset = (int) $_GET['offset'];
00063                 $this->ctrl->saveParameter($this,'offset',$this->offset);
00064                 $this->ctrl->saveParameter($this,'details_id',$_REQUEST['details_id']);
00065                 $this->max_count = $ilUser->getPref('hits_per_page');
00066         }
00070         function &executeCommand()
00071         {
00072                 global $ilBench,$ilUser;
00073 
00074                 $ilBench->start('LearningProgress','1000_LPListOfObjects');
00075 
00076                 $this->ctrl->setReturn($this, "");
00077 
00078                 switch($this->ctrl->getNextClass())
00079                 {
00080                         case 'illpfiltergui':
00081                                 $this->ctrl->forwardCommand($this->filter_gui);
00082                                 break;
00083 
00084                         case 'ilpdfpresentation':
00085                                 include_once './Services/Tracking/classes/class.ilPDFPresentation.php';
00086                                 $pdf_gui = new ilPDFPresentation($this->getMode(),$this->details_id,$this->getUserId());
00087                                 $pdf_gui->setType(LP_ACTIVE_OBJECTS);
00088                                 $this->ctrl->setReturn($this,'show');
00089                                 $this->ctrl->forwardCommand($pdf_gui);
00090                                 break;
00091 
00092                         case 'iluserfiltergui':
00093                                 switch($this->getMode())
00094                                 {
00095                                         case LP_MODE_REPOSITORY:
00096                                                 $this->ctrl->setReturn($this,'show');
00097                                                 break;
00098                                         default:
00099                                                 $this->ctrl->setReturn($this,'details');
00100                                                 break;
00101                                 }
00102                                 $this->user_filter_gui = new ilUserFilterGUI($ilUser->getId());
00103                                 $this->ctrl->forwardCommand($this->user_filter_gui);
00104                                 break;
00105 
00106                         default:
00107                                 $cmd = $this->__getDefaultCommand();
00108                                 $this->$cmd();
00109 
00110                 }
00111 
00112                 $ilBench->stop('LearningProgress','1000_LPListOfObjects');
00113                 return true;
00114         }
00115 
00116         function updateUser()
00117         {
00118                 include_once 'Services/Tracking/classes/class.ilLPMarks.php';
00119 
00120                 $marks = new ilLPMarks($this->item_id,$_REQUEST['user_id']);
00121                 $marks->setMark(ilUtil::stripSlashes($_POST['mark']));
00122                 $marks->setComment(ilUtil::stripSlashes($_POST['comment']));
00123                 $marks->setCompleted((bool) $_POST['completed']);
00124                 $marks->update();
00125                 sendInfo($this->lng->txt('trac_update_edit_user'));
00126                 $this->details();
00127         }
00128 
00129         function editUser()
00130         {
00131                 global $ilObjDataCache;
00132 
00133                 // Load template
00134                 $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.lp_edit_user.html','Services/Tracking');
00135 
00136 
00137                 include_once 'Services/Tracking/classes/ItemList/class.ilLPItemListFactory.php';
00138                 $item_list = & ilLPItemListFactory::_getInstanceByRefId(0,$this->item_ref_id,$ilObjDataCache->lookupType($this->item_id));
00139                 $info =& $item_list->renderObjectInfo();
00140                 $this->__appendLPDetails($info,$this->item_id,(int) $_GET['user_id']);
00141 
00142                 // Finally set template variable
00143                 $this->tpl->setVariable("INFO_TABLE",$info->getHTML());
00144 
00145                 $this->__showEditUser();
00146         }
00147 
00148         function __showEditUser()
00149         {
00150                 global $ilObjDataCache;
00151 
00152                 include_once 'Services/Tracking/classes/class.ilLPMarks.php';
00153 
00154                 $marks = new ilLPMarks($this->item_id,$_REQUEST['user_id']);
00155 
00156                 $this->ctrl->setParameter($this,'user_id',(int) $_GET['user_id']);
00157                 $this->ctrl->setParameter($this,'item_id',(int) $this->item_ref_id);
00158                 $this->ctrl->setParameter($this,'details_id',$this->details_id);
00159                 $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
00160 
00161                 $this->tpl->setVariable("TYPE_IMG",ilObjUser::_getPersonalPicturePath((int) $_GET['user_id'],'xxsmall'));
00162                 $this->tpl->setVariable("ALT_IMG",$ilObjDataCache->lookupTitle((int) $_GET['user_id']));
00163                 $this->tpl->setVariable("TXT_LP",$this->lng->txt('trac_learning_progress_tbl_header'));
00164 
00165                 $this->tpl->setVariable("COMMENT",ilUtil::prepareFormOutput($marks->getComment(),false));
00166 
00167                 $type = $ilObjDataCache->lookupType($this->item_id);
00168                 if($type != 'lm')
00169                 {
00170                         $this->tpl->setVariable("TXT_MARK",$this->lng->txt('trac_mark'));
00171                         $this->tpl->setVariable("MARK",ilUtil::prepareFormOutput($marks->getMark(),false));
00172                 }
00173 
00174 
00175                 $this->tpl->setVariable("TXT_COMMENT",$this->lng->txt('trac_comment'));
00176 
00177                 if(ilLPObjSettings::_lookupMode($this->item_id) == LP_MODE_MANUAL)
00178                 {
00179                         $completed = ilLPStatusWrapper::_getCompleted($this->item_id);
00180                         
00181                         $this->tpl->setVariable("mode_manual");
00182                         $this->tpl->setVariable("TXT_COMPLETED",$this->lng->txt('trac_completed'));
00183                         $this->tpl->setVariable("CHECK_COMPLETED",ilUtil::formCheckbox(in_array((int) $_GET['user_id'],$completed),
00184                                                                                                                                                    'completed',
00185                                                                                                                                                    '1'));
00186                 }
00187 
00188 
00189                 $this->tpl->setVariable("TXT_CANCEL",$this->lng->txt('cancel'));
00190                 $this->tpl->setVariable("TXT_SAVE",$this->lng->txt('save'));
00191         }
00192 
00193         function __renderContainerRow($a_parent_id,$a_item_id,$a_usr_id,$type,$level)
00194         {
00195                 global $ilObjDataCache,$ilUser;
00196 
00197                 include_once 'Services/Tracking/classes/ItemList/class.ilLPItemListFactory.php';
00198 
00199                 $item_list =& ilLPItemListFactory::_getInstanceByRefId($a_parent_id,$a_item_id,$type);
00200                 if($this->has_timings)
00201                 {
00202                         $item_list->readTimings();
00203                         $item_list->enable('timings');
00204                 }
00205                 $item_list->setCurrentUser($a_usr_id);
00206                 $item_list->readUserInfo();
00207                 $item_list->setIndentLevel($level);
00208 
00209                 // Mark
00210                 $this->obj_tpl->setVariable("MARK",$item_list->getMark());
00211 
00212                 // Edit link, details
00213                 if($type != 'sahs_item' and
00214                    $type != 'objective' and
00215                    $type != 'event' and 
00216                    !$item_list->isAnonymized())
00217                 {
00218 
00219                         // Edit link
00220                         $this->obj_tpl->setCurrentBlock("item_command");
00221                         $this->ctrl->setParameter($this,'details_id',$this->details_id);
00222                         $this->ctrl->setParameter($this,"user_id",$a_usr_id);
00223                         $this->ctrl->setParameter($this,'item_id',$a_item_id);
00224                         $this->obj_tpl->setVariable('HREF_COMMAND',$this->ctrl->getLinkTarget($this,'editUser'));
00225                         $this->obj_tpl->setVariable("TXT_COMMAND",$this->lng->txt('edit'));
00226                         $this->obj_tpl->parseCurrentBlock();
00227 
00228                         // Show checkbox and details button
00229                         if(ilLPObjSettings::_isContainer($item_list->getMode()))
00230                         {
00231                                 $item_list->addCheckbox(array('user_item_ids[]',
00232                                                                                           $a_usr_id.'_'.$a_item_id,
00233                                                                                           $this->__detailsShown($a_usr_id,$a_item_id)));
00234                                 $this->obj_tpl->setCurrentBlock("item_command");
00235                                 $this->ctrl->setParameter($this,'details_id',$this->details_id);
00236                                 $this->ctrl->setParameter($this,'user_item_ids',$a_usr_id.'_'.$a_item_id);
00237                                 if($this->__detailsShown($a_usr_id,$a_item_id))
00238                                 {
00239                                         $this->obj_tpl->setVariable('HREF_COMMAND',$this->ctrl->getLinkTarget($this,'hideDetails'));
00240                                         $this->obj_tpl->setVariable("TXT_COMMAND",$this->lng->txt('hide_details'));
00241                                 }
00242                                 else
00243                                 {
00244                                         $this->obj_tpl->setVariable('HREF_COMMAND',$this->ctrl->getLinkTarget($this,'showDetails'));
00245                                         $this->obj_tpl->setVariable("TXT_COMMAND",$this->lng->txt('show_details'));
00246                                 }
00247                                 $this->ctrl->clearParameters($this);
00248                                 $this->obj_tpl->parseCurrentBlock();
00249                         }
00250 
00251                 }
00252 
00253                 if($this->has_timings)
00254                 {
00255                         if(ilTimingCache::_showWarning($a_item_id,$a_usr_id)) 
00256                         {
00257                                 $this->obj_tpl->setCurrentBlock('warning_img');
00258                                 $this->obj_tpl->setVariable('WARNING_IMG',ilUtil::getImagePath('warning.gif'));
00259                                 $this->obj_tpl->setVariable('WARNING_ALT',$this->lng->txt('trac_editing_time_passed'));
00260                                 $this->obj_tpl->parseCurrentBlock();
00261                         }
00262 
00263                         $this->obj_tpl->setCurrentBlock('timing');
00264                         $this->obj_tpl->setVariable('END_EDITING_TIME',$item_list->getEditingTime() ? 
00265                                                                         ilFormat::formatUnixTime($item_list->getEditingTime()) : 
00266                                                                         '');
00267                         $this->obj_tpl->parseCurrentBlock();
00268                 }
00269                 
00270                 // Status image
00271                 $this->obj_tpl->setCurrentBlock("container_standard_row");
00272 
00273                 $item_list->renderObjectDetails();
00274 
00275                 $this->obj_tpl->setVariable("ITEM_HTML",$item_list->getHTML());
00276                 if(!$item_list->isAnonymized())
00277                 {
00278                         $this->__showImageByStatus($this->obj_tpl,$item_list->getUserStatus());
00279                 }
00280                 $this->obj_tpl->setVariable("TBLROW",ilUtil::switchColor($this->container_row_counter,'tblrow1','tblrow2'));
00281                 $this->obj_tpl->parseCurrentBlock();
00282 
00283                 if(!$this->__detailsShown($a_usr_id,$a_item_id))
00284                 {
00285                         return true;
00286                 }
00287                 if($type == 'sahs_item' or
00288                    $type == 'objective' or
00289                    $type == 'event')
00290                 {
00291                         return true;
00292                 }
00293                 
00294                 include_once './Services/Tracking/classes/class.ilLPEventCollections.php';
00295                 foreach(ilLPEventCollections::_getItems($ilObjDataCache->lookupObjId($a_item_id)) as $event_id)
00296                 {
00297                         $this->__renderContainerRow($a_item_id,$event_id,$a_usr_id,'event',$level+2);
00298                 }
00299                 include_once './Services/Tracking/classes/class.ilLPCollectionCache.php';
00300                 foreach(ilLPCollectionCache::_getItems($ilObjDataCache->lookupObjId($a_item_id)) as $child_id)
00301                 {
00302                         switch($item_list->getMode())
00303                         {
00304                                 case LP_MODE_OBJECTIVES:
00305                                         $this->__renderContainerRow($a_item_id,$child_id,$a_usr_id,'objective',$level + 2);
00306                                         break;
00307 
00308                                 case LP_MODE_SCORM:
00309                                         $this->__renderContainerRow($a_item_id,$child_id,$a_usr_id,'sahs_item',$level + 2);
00310                                         break;
00311 
00312                                 default:
00313                                         $this->__renderContainerRow($a_item_id,$child_id,$a_usr_id,
00314                                                                                                 $ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($child_id)),$level + 2);
00315                                         break;
00316                         }
00317                 }
00318         }
00319 
00320 
00321         function details()
00322         {
00323                 global $ilObjDataCache;
00324                 global $ilBench;
00325 
00326                 $ilBench->start('LearningProgress','1200_LPListOfObjects_details');
00327 
00328                 $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.lp_loo.html','Services/Tracking');
00329 
00330                 // Show back button
00331                 if($this->getMode() == LP_MODE_PERSONAL_DESKTOP or
00332                    $this->getMode() == LP_MODE_ADMINISTRATION)
00333                 {
00334                         $this->__showButton($this->ctrl->getLinkTarget($this,'show'),$this->lng->txt('trac_view_list'));
00335                 }
00336 
00337                 if($this->activePDF())
00338                 {
00339                         $this->__showButton($this->ctrl->getLinkTargetByClass('ilpdfpresentation','createDetails'),$this->lng->txt('pdf_export'));
00340                 }
00341 
00342                 include_once 'Services/Tracking/classes/ItemList/class.ilLPItemListFactory.php';
00343                 $item_list = & ilLPItemListFactory::_getInstanceByRefId(0,$this->details_id,$this->details_type);
00344                 $info =& $item_list->renderObjectInfo();
00345                 $this->tpl->setVariable("INFO_TABLE",$info->getHTML());
00346 
00347                 $this->__showUsersList();
00348                 $ilBench->stop('LearningProgress','1200_LPListOfObjects_details');
00349         }
00350 
00351 
00352 
00353         function __showUsersList()
00354         {
00355                 include_once 'Services/Tracking/classes/class.ilLPMarks.php';
00356                 include_once 'Services/Tracking/classes/ItemList/class.ilLPItemListFactory.php';
00357 
00358                 global $ilObjDataCache,$ilUser;
00359 
00360                 $not_attempted = ilLPStatusWrapper::_getNotAttempted($this->details_obj_id);
00361                 $in_progress = ilLPStatusWrapper::_getInProgress($this->details_obj_id);
00362                 $completed = ilLPStatusWrapper::_getCompleted($this->details_obj_id);
00363                 $failed = ilLPStatusWrapper::_getFailed($this->details_obj_id);
00364 
00365                 $all_users = array_merge($completed,$in_progress,$not_attempted,$failed);
00366 
00367                 if(count($all_users) > 1)
00368                 {
00369                         include_once 'Services/Search/classes/class.ilUserFilterGUI.php';
00370                         $user_filter_gui = new ilUserFilterGUI($ilUser->getId());
00371                         $this->tpl->setVariable("FILTER",$user_filter_gui->getHTML());
00372                         $user_filter = new ilUserFilter($ilUser->getId());
00373                         $user_filter->enableMemberFilter(true);
00374                         $user_filter->setPossibleUsers($all_users);
00375                         
00376                         $all_users = $user_filter->getUsers();
00377                         if(!count($all_users))
00378                         {
00379                                 sendInfo($this->lng->txt('trac_filter_no_access'));
00380                                 return false;
00381                         }
00382                 }
00383 
00384                 $all_users = $this->__sort($all_users,'usr_data','lastname','usr_id');
00385                 $sliced_users = array_slice($all_users,$this->offset,$this->max_count);
00386                 $this->obj_tpl = new ilTemplate('tpl.lp_loo_user_list.html',true,true,'Services/Tracking');
00387 
00388 
00389                 $this->__initFilter();
00390                 $type = $this->filter->getFilterType();
00391                 $this->obj_tpl->setVariable("HEADER_IMG",ilUtil::getImagePath('icon_usr.gif'));
00392                 $this->obj_tpl->setVariable("HEADER_ALT",$this->lng->txt('objs_usr'));
00393                 $this->obj_tpl->setVariable("BLOCK_HEADER_CONTENT",$this->lng->txt('trac_usr_list'));
00394 
00395                 // Show table header
00396                 $this->obj_tpl->setVariable("HEAD_STATUS",$this->lng->txt('trac_status'));
00397                 $this->obj_tpl->setVariable("HEAD_MARK",$this->lng->txt('trac_mark'));
00398                 $this->obj_tpl->setVariable("HEAD_OPTIONS",$this->lng->txt('actions'));
00399 
00400                 // Show timings header
00401                 include_once 'course/classes/class.ilCourseItems.php';
00402                 if($this->has_timings = ilCourseItems::_hasCollectionTimings($this->details_id))
00403                 {
00404                         $this->obj_tpl->setVariable('HEAD_TIMING',$this->lng->txt('trac_head_timing'));
00405                         $this->obj_tpl->setVariable('HEAD_TIME_PASSED',$this->lng->txt('trac_time_passed'));
00406                 }
00407 
00408                 // Show linkbar
00409                 if(count($all_users) > $this->max_count)
00410                 {
00411                         $this->obj_tpl->setCurrentBlock("linkbar");
00412                         $this->ctrl->setParameter($this,'details_id',$this->details_id);
00413                         $this->obj_tpl->setVariable("LINKBAR",ilUtil::Linkbar($this->ctrl->getLinkTarget($this,'details'),
00414                                                                                                                                   count($all_users),
00415                                                                                                                                   $this->max_count,
00416                                                                                                                                   (int) $this->offset,
00417                                                                                                                                   array(),
00418                                                                                                                                   array('link' => '',
00419                                                                                                                                                 'prev' => '<<<',
00420                                                                                                                                                 'next' => '>>>')));
00421                         $this->tpl->parseCurrentBlock();
00422                 }
00423 
00424                 // Render item list
00425                 $this->container_row_counter = 0;
00426                 foreach($sliced_users as $user)
00427                 {
00428                         $this->__renderContainerRow(0,$this->details_id,$user,'usr',0);
00429                         $this->container_row_counter++;
00430                 }
00431 
00432                 // Hide button
00433                 $this->obj_tpl->setVariable("DOWNRIGHT",ilUtil::getImagePath('arrow_downright.gif'));
00434                 $this->obj_tpl->setVariable("BTN_HIDE_SELECTED",$this->lng->txt('show_details'));
00435                 $this->obj_tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
00436 
00437                 $this->tpl->setVariable("LP_OBJECTS",$this->obj_tpl->get());
00438                 $this->tpl->setVariable("LEGEND", $this->__getLegendHTML());
00439         }
00440 
00441         function showDetails()
00442         {
00443                 if(isset($_GET['user_item_ids']))
00444                 {
00445                         $ids = array($_GET['user_item_ids']);
00446                 }
00447                 else
00448                 {
00449                         unset($_SESSION['lp_show'][$this->details_id]);
00450                         $ids = $_POST['user_item_ids'] ? $_POST['user_item_ids'] : array();
00451                 }
00452                 foreach($ids as $id)
00453                 {                       
00454                         $_SESSION['lp_show'][$this->details_id][$id] = true;
00455                 }
00456                 $this->details();
00457 
00458                 return true;
00459         }
00460 
00461         function hideDetails()
00462         {
00463                 if(isset($_GET['user_item_ids']))
00464                 {
00465                         unset($_SESSION['lp_show'][$this->details_id]["$_GET[user_item_ids]"]);
00466                         $this->details();
00467                         return true;
00468                 }
00469         }
00470 
00471         function __detailsShown($a_usr_id,$item_id)
00472         {
00473                 return $_SESSION['lp_show'][$this->details_id][$a_usr_id.'_'.$item_id] ? true : false;
00474                 #return $_SESSION['lp_show'][$this->details_id][$a_usr_id];
00475         }
00476 
00477 
00478         function show()
00479         {
00480                 global $ilObjDataCache;
00481                 global $ilBench;
00482 
00483                 $ilBench->start('LearningProgress','1100_LPListOfObjects_show');
00484 
00485                 // Clear table offset
00486                 $this->ctrl->saveParameter($this,'offset',0);
00487 
00488                 // Show only detail of current repository item if called from repository
00489                 switch($this->getMode())
00490                 {
00491                         case LP_MODE_REPOSITORY:
00492                                 $this->__initDetails($this->getRefId());
00493                                 $this->details();
00494                                 
00495                                 $ilBench->stop('LearningProgress','1100_LPListOfObjects_show');
00496                                 return true;
00497                 }
00498                 $this->__listObjects();
00499                 $ilBench->stop('LearningProgress','1100_LPListOfObjects_show');
00500                 return true;
00501         }
00502 
00503         function __listObjects()
00504         {
00505                 global $ilUser,$ilObjDataCache;
00506 
00507                 include_once './Services/Tracking/classes/ItemList/class.ilLPItemListFactory.php';
00508 
00509                 $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.lp_loo.html','Services/Tracking');
00510 
00511                 $this->__initFilter();
00512                 $this->__showFilter();
00513 
00514                 $tpl = new ilTemplate('tpl.lp_loo_objects.html',true,true,'Services/Tracking');
00515 
00516                 if($this->activePDF())
00517                 {
00518                         $this->__showButton($this->ctrl->getLinkTargetByClass('ilpdfpresentation','createList'),$this->lng->txt('pdf_export'));
00519                 }
00520 
00521                 $this->filter->setRequiredPermission('edit_learning_progress');
00522                 if(!count($objs = $this->filter->getObjects()))
00523                 {
00524                         sendInfo($this->lng->txt('trac_filter_no_access'));
00525                         return true;
00526                 }
00527 
00528                 // Limit info
00529                 if($this->filter->limitReached())
00530                 {
00531                         $info = sprintf($this->lng->txt('trac_filter_limit_reached'),$this->filter->getLimit());
00532                         $this->tpl->setVariable("LIMIT_REACHED",$info);
00533                 }
00534 
00535                 // Show table header
00536                 $tpl->setVariable("HEAD_STATUS",$this->lng->txt('trac_status'));
00537                 $tpl->setVariable("HEAD_OPTIONS",$this->lng->txt('actions'));
00538                 
00539                 $type = $this->filter->getFilterType();
00540                 $tpl->setVariable("HEADER_IMG",ilUtil::getImagePath('icon_'.$type.'.gif'));
00541                 $tpl->setVariable("HEADER_ALT",$this->lng->txt('objs_'.$type));
00542                 $tpl->setVariable("BLOCK_HEADER_CONTENT",$this->lng->txt('objs_'.$type));
00543 
00544                 // Sort objects by title
00545                 $sorted_objs = $this->__sort(array_keys($objs),'object_data','title','obj_id');
00546 
00547                 // Render item list
00548                 $counter = 0;
00549                 foreach($sorted_objs as $object_id)
00550                 {
00551                         $item_list =& ilLPItemListFactory::_getInstance(0,$object_id,$ilObjDataCache->lookupType($object_id));
00552                         $item_list->read();
00553                         $item_list->addCheckbox(array('item_id[]',$object_id,false));
00554                         $item_list->setCmdClass(get_class($this));
00555                         $item_list->addReferences($objs[$object_id]['ref_ids']);
00556                         $item_list->enable('path');
00557                         $item_list->renderObjectList();
00558 
00559                         // Details link
00560                         #if(!$this->isAnonymized())
00561                         #{
00562                         #       $tpl->setCurrentBlock("item_command");
00563                         #       $this->ctrl->setParameter($this,'details_id',$object_id);
00564                         #       $tpl->setVariable("HREF_COMMAND",$this->ctrl->getLinkTarget($this,'details'));
00565                         #       $tpl->setVariable("TXT_COMMAND",$this->lng->txt('details'));
00566                         #       $tpl->parseCurrentBlock();
00567                         #}
00568                         
00569                         // Hide link
00570                         $tpl->setCurrentBlock("item_command");
00571                         $this->ctrl->setParameterByClass('illpfiltergui','hide',$object_id);
00572                         $tpl->setVariable("HREF_COMMAND",$this->ctrl->getLinkTargetByClass('illpfiltergui','hide'));
00573                         $tpl->setVariable("TXT_COMMAND",$this->lng->txt('trac_hide'));
00574                         $tpl->parseCurrentBlock();
00575 
00576                         $tpl->setCurrentBlock("container_standard_row");
00577                         $tpl->setVariable("ITEM_HTML",$item_list->getHTML());
00578                         $tpl->setVariable("TBLROW",ilUtil::switchColor($counter++,'tblrow1','tblrow2'));
00579                         $tpl->parseCurrentBlock();
00580                 }
00581 
00582                 // Hide button
00583                 $tpl->setVariable("DOWNRIGHT",ilUtil::getImagePath('arrow_downright.gif'));
00584                 $tpl->setVariable("BTN_HIDE_SELECTED",$this->lng->txt('trac_hide'));
00585                 $tpl->setVariable("FORMACTION",$this->ctrl->getFormActionByClass('illpfiltergui'));
00586 
00587                 $this->tpl->setVariable("LP_OBJECTS",$tpl->get());
00588         }
00589 
00590         // Private
00591         function __showFilter()
00592         {
00593                 global $ilBench;
00594 
00595                 $ilBench->start('LearningProgress','1110_LPListOfObjects_showFilter');
00596                 $this->tpl->setVariable("FILTER",$this->filter_gui->getHTML());
00597                 $ilBench->stop('LearningProgress','1110_LPListOfObjects_showFilter');
00598         }
00599 
00600         function __initFilterGUI()
00601         {
00602                 global $ilUser;
00603 
00604                 include_once './Services/Tracking/classes/class.ilLPFilterGUI.php';
00605 
00606                 $this->filter_gui = new ilLPFilterGUI($ilUser->getId());
00607         }
00608 
00609         function __initFilter()
00610         {
00611                 global $ilUser;
00612 
00613                 include_once './Services/Tracking/classes/class.ilLPFilter.php';
00614 
00615                 $this->filter = new ilLPFilter($ilUser->getId());
00616         }
00617 
00618         function __initDetails($a_details_id)
00619         {
00620                 global $ilObjDataCache;
00621 
00622 
00623                 if(!$a_details_id)
00624                 {
00625                         $a_details_id = $this->getRefId();
00626                 }
00627                 if($a_details_id)
00628                 {
00629                         $_GET['details_id'] = $a_details_id;
00630                         $this->details_id = $a_details_id;
00631                         $this->details_obj_id = $ilObjDataCache->lookupObjId($this->details_id);
00632                         $this->details_type = $ilObjDataCache->lookupType($this->details_obj_id);
00633                         $this->details_mode = ilLPObjSettings::_lookupMode($this->details_obj_id);
00634                 }
00635         }
00636 }
00637 ?>

Generated on Fri Dec 13 2013 13:52:12 for ILIAS Release_3_7_x_branch .rev 46817 by  doxygen 1.7.1