ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilCourseContentGUI Class Reference

Class ilCourseContentGUI. More...

+ Inheritance diagram for ilCourseContentGUI:
+ Collaboration diagram for ilCourseContentGUI:

Public Member Functions

 ilCourseContentGUI (&$container_gui_obj)
 Constructor @access public. More...
 
executeCommand ()
 execute command More...
 
 __getDefaultCommand ()
 
 __forwardToArchivesGUI ()
 
 __checkStartObjects ()
 
 showStartObjects ()
 
 view ()
 Output course content. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings ($column_gui)
 May be overwritten in subclasses. More...
 
 __forwardToColumnGUI ()
 Get columngui output. More...
 
 editTimings ()
 
 __showUserAcceptanceTable ()
 
 saveAcceptance ()
 
 editUserTimings ()
 
 returnToMembers ()
 
 showUserTimings ()
 
 __renderUserItem ($item, $level)
 
 __editAdvancedUserTimings ()
 
 __editUserTimings ()
 
 __renderItem ($item, $level)
 
 __showTimingsPanel ()
 
 timingsOn ()
 
 timingsOff ()
 
 updateUserTimings ()
 
__loadFromPost (&$item)
 
 updateTimings ()
 
 __setSubTabs ()
 
 __initCourseObject ()
 
 __toUnix ($date, $time=array())
 
 __prepareDateSelect ($a_unix_time)
 
 __prepareTimeSelect ($a_unix_time)
 
 __buildPath ($a_ref_id)
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ($in_rep=false)
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Data Fields

 $container_gui
 
 $container_obj
 
 $course_obj
 
 $tpl
 
 $ctrl
 
 $lng
 
 $tabs_gui
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 

Detailed Description

Member Function Documentation

◆ __buildPath()

ilCourseContentGUI::__buildPath (   $a_ref_id)

Definition at line 1330 of file class.ilCourseContentGUI.php.

1331 {
1332 global $tree;
1333
1334 $path_arr = $tree->getPathFull($a_ref_id,$this->course_obj->getRefId());
1335 $counter = 0;
1336 foreach($path_arr as $data)
1337 {
1338 if($counter++)
1339 {
1340 $path .= " -> ";
1341 }
1342 $path .= $data['title'];
1343 }
1344
1345 return $path;
1346 }
$path
Definition: index.php:22

References ilObjectGUI\$data, $path, and ilObjectGUI\$tree.

◆ __checkStartObjects()

ilCourseContentGUI::__checkStartObjects ( )

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

148 {
149 include_once './Modules/Course/classes/class.ilCourseStart.php';
150
151 global $ilAccess,$ilUser;
152
153 if($ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
154 {
155 return true;
156 }
157 $this->start_obj = new ilCourseStart($this->course_obj->getRefId(),$this->course_obj->getId());
158 if(count($this->start_obj->getStartObjects()) and !$this->start_obj->allFullfilled($ilUser->getId()))
159 {
160 return false;
161 }
162 return true;
163 }
Class ilObj<module_name>
global $ilUser
Definition: imgupload.php:15

References $ilUser.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ __editAdvancedUserTimings()

ilCourseContentGUI::__editAdvancedUserTimings ( )

Definition at line 852 of file class.ilCourseContentGUI.php.

853 {
854 $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.crs_usr_edit_timings_adv.html','Modules/Course');
855 $this->__showTimingsPanel();
857
858 $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
859 $this->tpl->setVariable("HEADER_IMG",ilUtil::getImagePath('icon_crs.svg'));
860 $this->tpl->setVariable("HEADER_ALT",$this->lng->txt('obj_crs'));
861 $this->tpl->setVariable("BLOCK_HEADER_CONTENT",$this->lng->txt('timings_usr_edit'));
862
863 if(!$_SESSION['crs_timings_user_hidden'])
864 {
865 $this->tpl->setVariable("SHOW_HIDE_TEXT",$this->lng->txt('show_details'));
866 $this->ctrl->setParameter($this,'show_details',1);
867 $this->tpl->setVariable("SHOW_HIDE_LINK",$this->ctrl->getLinkTarget($this,'editUserTimings'));
868 }
869 else
870 {
871 $this->tpl->setVariable("SHOW_HIDE_TEXT",$this->lng->txt('hide_details'));
872 $this->ctrl->setParameter($this,'show_details',0);
873 $this->tpl->setVariable("SHOW_HIDE_LINK",$this->ctrl->getLinkTarget($this,'editUserTimings'));
874 }
875 $this->ctrl->clearParameters($this);
876 $this->tpl->setVariable("TXT_TITLE",$this->lng->txt('title'));
877 $this->tpl->setVariable("TXT_START_END",$this->lng->txt('crs_timings_short_start_end'));
878 $this->tpl->setVariable("TXT_INFO_START_END",$this->lng->txt('crs_timings_start_end_info'));
879
880 $this->tpl->setVariable("TXT_LIMIT",$this->lng->txt('crs_timings_short_limit_start_end'));
881 $this->tpl->setVariable("TXT_INFO_LIMIT",$this->lng->txt('crs_timings_from_until'));
882
883 $this->tpl->setVariable("TXT_OWN_PRESETTING",$this->lng->txt('crs_timings_planed_start'));
884 $this->tpl->setVariable("TXT_INFO_OWN_PRESETTING",$this->lng->txt('crs_timings_start_end_info'));
885
886 $this->tpl->setVariable("TXT_DURATION",$this->lng->txt('crs_timings_time_frame'));
887 $this->tpl->setVariable("TXT_INFO_DURATION",$this->lng->txt('crs_timings_in_days'));
888
889 $this->tpl->setVariable("TXT_BTN_UPDATE",$this->lng->txt('save'));
890 $this->tpl->setVariable("TXT_CANCEL",$this->lng->txt('cancel'));
891
892 include_once 'Services/Object/classes/class.ilObjectActivation.php';
893 $sorted_items = ilObjectActivation::getTimingsItems($this->course_obj->getRefId());
894
895 $this->counter = 0;
896 foreach($sorted_items as $item)
897 {
898 switch($item['type'])
899 {
900 case 'itgr':
901 break;
902
903 default:
904 $this->__renderItem($item,0);
905 break;
906 }
907 }
908 }
$_SESSION["AccountId"]
static getTimingsItems($a_container_ref_id)
Get (sub) item data for timings view (no session material, no side blocks)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References $_SESSION, __renderItem(), __showTimingsPanel(), __showUserAcceptanceTable(), ilUtil\getImagePath(), and ilObjectActivation\getTimingsItems().

Referenced by editUserTimings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __editUserTimings()

ilCourseContentGUI::__editUserTimings ( )

Definition at line 910 of file class.ilCourseContentGUI.php.

911 {
912 $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.crs_usr_edit_timings.html','Modules/Course');
913
914 $this->__showTimingsPanel();
916
917 $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
918 $this->tpl->setVariable("HEADER_IMG",ilUtil::getImagePath('icon_crs.svg'));
919 $this->tpl->setVariable("HEADER_ALT",$this->lng->txt('obj_crs'));
920
921 if(!$_SESSION['crs_timings_user_hidden'])
922 {
923 $this->tpl->setVariable("SHOW_HIDE_TEXT",$this->lng->txt('show_details'));
924 $this->ctrl->setParameter($this,'show_details',1);
925 $this->tpl->setVariable("SHOW_HIDE_LINK",$this->ctrl->getLinkTarget($this,'editUserTimings'));
926 }
927 else
928 {
929 $this->tpl->setVariable("SHOW_HIDE_TEXT",$this->lng->txt('hide_details'));
930 $this->ctrl->setParameter($this,'show_details',0);
931 $this->tpl->setVariable("SHOW_HIDE_LINK",$this->ctrl->getLinkTarget($this,'editUserTimings'));
932 }
933 $this->ctrl->clearParameters($this);
934
935 $this->tpl->setVariable("BLOCK_HEADER_CONTENT",$this->lng->txt('timings_timings'));
936 $this->tpl->setVariable("TXT_TITLE",$this->lng->txt('title'));
937 $this->tpl->setVariable("TXT_START",$this->lng->txt('crs_timings_sug_begin'));
938 $this->tpl->setVariable("TXT_END",$this->lng->txt('crs_timings_sug_end'));
939
940 include_once 'Services/Object/classes/class.ilObjectActivation.php';
941 $sorted_items = ilObjectActivation::getTimingsItems($this->course_obj->getRefId());
942
943 $this->counter = 0;
944 foreach($sorted_items as $item)
945 {
946 switch($item['type'])
947 {
948 case 'itgr':
949 break;
950
951 default:
952 $this->__renderItem($item,0);
953 break;
954 }
955 }
956 }

References $_SESSION, __renderItem(), __showTimingsPanel(), __showUserAcceptanceTable(), ilUtil\getImagePath(), and ilObjectActivation\getTimingsItems().

Referenced by editUserTimings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __forwardToArchivesGUI()

ilCourseContentGUI::__forwardToArchivesGUI ( )

Definition at line 133 of file class.ilCourseContentGUI.php.

134 {
135 include_once 'Modules/Course/classes/class.ilCourseArchivesGUI.php';
136
137 $this->ctrl->setReturn($this,'');
138 $archives_gui = new ilCourseArchivesGUI($this->container_gui);
139 $this->ctrl->forwardCommand($archives_gui);
140
141 $this->tabs_gui->setTabActive('view_content');
142 $this->tabs_gui->setSubTabActive('crs_archives');
143
144 return true;
145 }
Class ilCourseArchivesGUI.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ __forwardToColumnGUI()

ilCourseContentGUI::__forwardToColumnGUI ( )

Get columngui output.

Definition at line 399 of file class.ilCourseContentGUI.php.

400 {
401 global $ilCtrl, $ilAccess;
402
403 include_once("Services/Block/classes/class.ilColumnGUI.php");
404
405 $obj_id = ilObject::_lookupObjId($this->container_obj->getRefId());
406 $obj_type = ilObject::_lookupType($obj_id);
407
408 if (!$ilCtrl->isAsynch())
409 {
410 //if ($column_gui->getScreenMode() != IL_SCREEN_SIDE)
412 {
413 // right column wants center
415 {
416 $column_gui = new ilColumnGUI($obj_type, IL_COL_RIGHT);
417 $this->setColumnSettings($column_gui);
418 $html = $ilCtrl->forwardCommand($column_gui);
419 }
420 // left column wants center
422 {
423 $column_gui = new ilColumnGUI($obj_type, IL_COL_LEFT);
424 $this->setColumnSettings($column_gui);
425 $html = $ilCtrl->forwardCommand($column_gui);
426 }
427 }
428 else
429 {
430 {
431 $this->getDefaultView();
432 }
433 }
434 }
435
436 return $html;
437 }
const IL_SCREEN_SIDE
const IL_COL_RIGHT
const IL_COL_LEFT
Column user interface class.
static getScreenMode()
Get Screen Mode for current command.
static getCmdSide()
Get Column Side of Current Command.
setColumnSettings($column_gui)
May be overwritten in subclasses.
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
$html
Definition: example_001.php:87
global $ilCtrl
Definition: ilias.php:18

References $html, $ilCtrl, ilObjectGUI\$obj_id, ilObject\_lookupObjId(), ilObject\_lookupType(), ilColumnGUI\getCmdSide(), ilColumnGUI\getScreenMode(), IL_COL_LEFT, IL_COL_RIGHT, IL_SCREEN_SIDE, and setColumnSettings().

+ Here is the call graph for this function:

◆ __getDefaultCommand()

ilCourseContentGUI::__getDefaultCommand ( )

Definition at line 112 of file class.ilCourseContentGUI.php.

113 {
114 global $ilAccess;
115
116 // edit timings if panel is on
117 if($_SESSION['crs_timings_panel'][$this->course_obj->getId()])
118 {
119 return 'editTimings';
120 }
121 if($ilAccess->checkAccess('write','',$this->container_obj->getRefId()))
122 {
123 return 'view';
124 }
125 if($this->container_obj->getType() == 'crs' and
126 $this->course_obj->getViewMode() == IL_CRS_VIEW_TIMING)
127 {
128 return 'editUserTimings';
129 }
130 return 'view';
131 }
const IL_CRS_VIEW_TIMING

References $_SESSION, and IL_CRS_VIEW_TIMING.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ __initCourseObject()

ilCourseContentGUI::__initCourseObject ( )

Definition at line 1292 of file class.ilCourseContentGUI.php.

1293 {
1294 global $tree;
1295
1296 if($this->container_obj->getType() == 'crs')
1297 {
1298 // Container is course
1299 $this->course_obj =& $this->container_obj;
1300 }
1301 else
1302 {
1303
1304 $course_ref_id = $tree->checkForParentType($this->container_obj->getRefId(),'crs');
1305 $this->course_obj =& ilObjectFactory::getInstanceByRefId($course_ref_id);
1306 }
1307 return true;
1308 }
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id

References $container_obj, ilObjectGUI\$tree, and ilObjectFactory\getInstanceByRefId().

Referenced by ilCourseContentGUI().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __loadFromPost()

& ilCourseContentGUI::__loadFromPost ( $item)

Definition at line 1194 of file class.ilCourseContentGUI.php.

1195 {
1196 $obj_id = $item['obj_id'];
1197
1198 if(!isset($_POST['item'][$obj_id]))
1199 {
1200 return $item;
1201 }
1202 $item['suggestion_start'] = $this->__toUnix($_POST['item'][$obj_id]['sug_start']);
1203 if(isset($_POST['item'][$obj_id]['sug_end']))
1204 {
1205 // #9325
1206 $item['suggestion_end'] = $this->__toUnix($_POST['item'][$obj_id]['sug_end']);
1207 }
1208 $item['earliest_start'] = $this->__toUnix($_POST['item'][$obj_id]['lim_start']);
1209 $item['latest_end'] = $this->__toUnix($_POST['item'][$obj_id]['lim_end']);
1210 $item['changeable'] = $_POST['item'][$obj_id]['change'];
1211 $item['timing_type'] = $_POST['item'][$obj_id]['active'] ? ilObjectActivation::TIMINGS_PRESETTING : $item['timing_type'];
1212 $item['duration_a'] = $_POST['item'][$obj_id]['duration_a'];
1213 $item['duration_b'] = $_POST['item'][$obj_id]['duration_b'];
1214
1215 return $item;
1216 }
__toUnix($date, $time=array())
$_POST['username']
Definition: cron.php:12

References $_POST, ilObjectGUI\$obj_id, __toUnix(), and ilObjectActivation\TIMINGS_PRESETTING.

Referenced by editTimings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __prepareDateSelect()

ilCourseContentGUI::__prepareDateSelect (   $a_unix_time)

Definition at line 1315 of file class.ilCourseContentGUI.php.

1316 {
1317 return array('y' => date('Y',$a_unix_time),
1318 'm' => date('m',$a_unix_time),
1319 'd' => date('d',$a_unix_time));
1320 }

Referenced by __renderItem(), and editTimings().

+ Here is the caller graph for this function:

◆ __prepareTimeSelect()

ilCourseContentGUI::__prepareTimeSelect (   $a_unix_time)

Definition at line 1322 of file class.ilCourseContentGUI.php.

1323 {
1324 return array('h' => date('G',$a_unix_time),
1325 'm' => date('i',$a_unix_time),
1326 's' => date('s',$a_unix_time));
1327 }

◆ __renderItem()

ilCourseContentGUI::__renderItem (   $item,
  $level 
)

Definition at line 958 of file class.ilCourseContentGUI.php.

959 {
960 global $ilUser,$ilAccess;
961
962 include_once 'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
963 include_once './Services/Link/classes/class.ilLink.php';
964 include_once './Services/MetaData/classes/class.ilMDEducational.php';
965
966 if(!$ilAccess->checkAccess('visible','',$item['ref_id']))
967 {
968 return false;
969 }
970
971 $this->lng->loadLanguageModule('meta');
972
973 $usr_planed = new ilTimingPlaned($item['ref_id'],$ilUser->getId());
974
975 for($i = 0;$i < $level;$i++)
976 {
977 $this->tpl->touchBlock('start_indent');
978 $this->tpl->touchBlock('end_indent');
979 }
980 if(strlen($item['description']))
981 {
982 $this->tpl->setCurrentBlock("item_description");
983 $this->tpl->setVariable("DESC",$item['description']);
984 $this->tpl->parseCurrentBlock();
985 }
986 if($tlt = ilMDEducational::_getTypicalLearningTimeSeconds($item['obj_id']))
987 {
988 $this->tpl->setCurrentBlock("tlt");
989 $this->tpl->setVariable("TXT_TLT",$this->lng->txt('meta_typical_learning_time'));
990 $this->tpl->setVariable("TLT_VAL",ilFormat::_secondsToString($tlt));
991 $this->tpl->parseCurrentBlock();
992 }
993
994 if(!$item['title'] &&
995 $item['type'] == 'sess')
996 {
997 include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
999 $item['title'] = ilSessionAppointment::_appointmentToString($app_info['start'], $app_info['end'],$app_info['fullday']);
1000 }
1001
1002 if($ilAccess->checkAccess('read','',$item['ref_id']))
1003 {
1004 $this->tpl->setCurrentBlock("title_as_link");
1005 $this->tpl->setVariable("TITLE_LINK",ilLink::_getLink($item['ref_id'],$item['type']));
1006 $this->tpl->setVariable("TITLE_NAME",$item['title']);
1007 $this->tpl->parseCurrentBlock();
1008 }
1009 else
1010 {
1011 $this->tpl->setCurrentBlock("title_plain");
1012 $this->tpl->setVariable("TITLE",$item['title']);
1013 $this->tpl->parseCurrentBlock();
1014 }
1015 $this->tpl->setCurrentBlock("container_standard_row");
1016
1017 if(isset($this->invalid["$item[ref_id]"]))
1018 {
1019 $this->tpl->setVariable("ROWCLASS",'tblrowmarked');
1020 }
1021 else
1022 {
1023 $this->tpl->setVariable("ROWCLASS",ilUtil::switchColor($this->counter++,'tblrow1','tblrow2'));
1024 }
1025 #$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_'.$item['type'].'.svg'));
1026 $this->tpl->setVariable('TYPE_IMG',ilUtil::getTypeIconPath($item['type'],$item['obj_id'],'small'));
1027 $this->tpl->setVariable("TYPE_ALT_IMG",$this->lng->txt('obj_'.$item['type']));
1028
1029
1030 if($item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING)
1031 {
1032 $this->tpl->setVariable('SUG_START',ilDatePresentation::formatDate(new ilDate($item['suggestion_start'],IL_CAL_UNIX)));
1033 $this->tpl->setVariable('SUG_END',ilDatePresentation::formatDate(new ilDate($item['suggestion_end'],IL_CAL_UNIX)));
1034 }
1035
1036 if($item['changeable'])
1037 {
1038 $item_prefix = "item[".$item['ref_id'].']';
1039
1040 if(is_array($_POST['item']["$item[ref_id]"]['own_start']))
1041 {
1042 #echo "Start post<br>";
1043 $start = $this->__toUnix($_POST['item']["$item[ref_id]"]['own_start']);
1044 }
1045 elseif($usr_planed->getPlanedStartingTime())
1046 {
1047 #echo "Own start<br>";
1048 $start = $usr_planed->getPlanedStartingTime();
1049 }
1050 else
1051 {
1052 #echo "Empfehlung start<br>";
1053 $start = $item['suggestion_start'];
1054 }
1055
1056 $date = $this->__prepareDateSelect($start);
1057 $this->tpl->setVariable("OWN_START",
1058 ilUtil::makeDateSelect($item_prefix."[own_start]",
1059 $date['y'],$date['m'],$date['d'],date('Y',time()),false));
1060
1061 if($usr_planed->getPlanedEndingTime())
1062 {
1063 #echo "Own End<br>";
1064 $end = $usr_planed->getPlanedEndingTime();
1065 }
1066 else
1067 {
1068 #echo "Empfehlung end<br>";
1069 $end = $item['suggestion_end'];
1070 }
1071 $this->tpl->setVariable('OWN_END',ilDatePresentation::formatDate(new ilDate($end,IL_CAL_UNIX)));
1072 $this->tpl->setVariable("NAME_DURATION",$item_prefix."[duration]");
1073
1074 // Duration
1075 if(isset($_POST['item']["$item[ref_id]"]['duration']))
1076 {
1077 $this->tpl->setVariable("VAL_DURATION",$_POST['item']["$item[ref_id]"]['duration']);
1078 }
1079 else
1080 {
1081 $this->tpl->setVariable("VAL_DURATION",intval(($end - $start) / (60 * 60 * 24)));
1082 }
1083 $this->tpl->setVariable('LIM_START',ilDatePresentation::formatDate(new ilDate($item['earliest_start'],IL_CAL_UNIX)));
1084 $this->tpl->setVariable('LIM_END',ilDatePresentation::formatDate(new ilDate($item['latest_end'],IL_CAL_UNIX)));
1085 }
1086
1087 $this->tpl->parseCurrentBlock();
1088
1089 if(!$_SESSION['crs_timings_user_hidden'])
1090 {
1091 return true;
1092 }
1093
1094 foreach(ilObjectActivation::getTimingsItems($item['ref_id']) as $item_data)
1095 {
1096 $this->__renderItem($item_data,$level+1);
1097 }
1098 }
const IL_CAL_UNIX
static formatDate(ilDateTime $date)
Format a date @access public.
Class for single dates.
_secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
_getTypicalLearningTimeSeconds($a_rbac_id, $a_obj_id=0)
static _lookupAppointment($a_obj_id)
lookup appointment
static _appointmentToString($start, $end, $fulltime)
class ilTimingPlaned
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows)
static makeDateSelect($prefix, $year="", $month="", $day="", $startyear="", $a_long_month=true, $a_further_options=array(), $emptyoption=false)
Creates a combination of HTML selects for date inputs.
static getTypeIconPath($a_type, $a_obj_id, $a_size='small')
Get type icon path path Return image path for icon_xxx.pngs Or (if enabled) path to custom icon Depre...

References $_POST, $_SESSION, $ilUser, __prepareDateSelect(), __renderItem(), __toUnix(), ilSessionAppointment\_appointmentToString(), ilLink\_getLink(), ilMDEducational\_getTypicalLearningTimeSeconds(), ilSessionAppointment\_lookupAppointment(), ilObject\_lookupObjId(), ilFormat\_secondsToString(), ilDatePresentation\formatDate(), ilObjectActivation\getTimingsItems(), ilUtil\getTypeIconPath(), IL_CAL_UNIX, ilUtil\makeDateSelect(), ilUtil\switchColor(), and ilObjectActivation\TIMINGS_PRESETTING.

Referenced by __editAdvancedUserTimings(), __editUserTimings(), and __renderItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __renderUserItem()

ilCourseContentGUI::__renderUserItem (   $item,
  $level 
)

Definition at line 753 of file class.ilCourseContentGUI.php.

754 {
755 include_once 'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
756 include_once './Services/MetaData/classes/class.ilMDEducational.php';
757
758 $this->lng->loadLanguageModule('meta');
759
760 $usr_planed = new ilTimingPlaned($item['ref_id'],$_GET['member_id']);
761 for($i = 0;$i < $level;$i++)
762 {
763 $this->tpl->touchBlock('start_indent');
764 $this->tpl->touchBlock('end_indent');
765 }
766 if(strlen($item['description']))
767 {
768 $this->tpl->setCurrentBlock("item_description");
769 $this->tpl->setVariable("DESC",$item['description']);
770 $this->tpl->parseCurrentBlock();
771 }
772 if($tlt = ilMDEducational::_getTypicalLearningTimeSeconds($item['obj_id']))
773 {
774 $this->tpl->setCurrentBlock("tlt");
775 $this->tpl->setVariable("TXT_TLT",$this->lng->txt('meta_typical_learning_time'));
776 $this->tpl->setVariable("TLT_VAL",ilFormat::_secondsToString($tlt));
777 $this->tpl->parseCurrentBlock();
778 }
779
780 if(!$item['title'] &&
781 $item['type'] == 'sess')
782 {
783 include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
785 $item['title'] = ilSessionAppointment::_appointmentToString($app_info['start'], $app_info['end'],$app_info['fullday']);
786 }
787
788 $this->tpl->setCurrentBlock("title_plain");
789 $this->tpl->setVariable("TITLE",$item['title']);
790 $this->tpl->parseCurrentBlock();
791
792 $this->tpl->setCurrentBlock("container_standard_row");
793
794 $this->tpl->setVariable("ROWCLASS",ilUtil::switchColor($this->counter++,'tblrow1','tblrow2'));
795 #$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_'.$item['type'].'.svg'));
796 $this->tpl->setVariable('TYPE_IMG',ilUtil::getTypeIconPath($item['type'],$item['obj_id'],'tiny'));
797 $this->tpl->setVariable("TYPE_ALT_IMG",$this->lng->txt('obj_'.$item['type']));
798
799 if($item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING)
800 {
801 $this->tpl->setVariable('SUG_START',ilDatePresentation::formatDate(new ilDate($item['suggestion_start'],IL_CAL_UNIX)));
802 $this->tpl->setVariable('SUG_END',ilDatePresentation::formatDate(new ilDate($item['suggestion_end'],IL_CAL_UNIX)));
803 }
804
805 if($item['changeable'] and $item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING)
806 {
807 if($usr_planed->getPlanedStartingTime())
808 {
809 $start = $usr_planed->getPlanedStartingTime();
810 }
811 else
812 {
813 $start = $item['suggestion_start'];
814 }
815 $this->tpl->setVariable('OWN_START',ilDatePresentation::formatDate(new ilDate($start,IL_CAL_UNIX)));
816
817 if($usr_planed->getPlanedEndingTime())
818 {
819 $end = $usr_planed->getPlanedEndingTime();
820 }
821 else
822 {
823 $end = $item['suggestion_end'];
824 }
825 if($start != $item['suggestion_start'] or $end != $item['suggestion_end'])
826 {
827 $this->tpl->setVariable("OK_IMG",ilUtil::getImagePath('icon_ok.svg'));
828 $this->tpl->setVariable("OK_ALT",$this->lng->txt('crs_timings_changed'));
829 }
830 else
831 {
832 $this->tpl->setVariable("OK_IMG",ilUtil::getImagePath('icon_not_ok.svg'));
833 $this->tpl->setVariable("OK_ALT",$this->lng->txt('crs_timings_not_changed'));
834 }
835 $this->tpl->setVariable('OWN_END',ilDatePresentation::formatDate(new ilDate($end,IL_CAL_UNIX)));
836 }
837
838 $this->tpl->parseCurrentBlock();
839
840 foreach(ilObjectActivation::getTimingsAdministrationItems($item['ref_id']) as $item_data)
841 {
842 if(($item_data['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING) or
843 ilObjectActivation::hasChangeableTimings($item_data['ref_id']))
844 {
845 $this->__renderUserItem($item_data,$level+1);
846 }
847 }
848 }
$_GET["client_id"]
static getTimingsAdministrationItems($a_parent_id)
Get (sub) item data for timings administration view (active/inactive)
static hasChangeableTimings($a_ref_id)
Check if there is any active changeable timing (in subtree)

References $_GET, __renderUserItem(), ilSessionAppointment\_appointmentToString(), ilMDEducational\_getTypicalLearningTimeSeconds(), ilSessionAppointment\_lookupAppointment(), ilObject\_lookupObjId(), ilFormat\_secondsToString(), ilDatePresentation\formatDate(), ilUtil\getImagePath(), ilObjectActivation\getTimingsAdministrationItems(), ilUtil\getTypeIconPath(), ilObjectActivation\hasChangeableTimings(), IL_CAL_UNIX, ilUtil\switchColor(), and ilObjectActivation\TIMINGS_PRESETTING.

Referenced by __renderUserItem(), and showUserTimings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __setSubTabs()

ilCourseContentGUI::__setSubTabs ( )

Definition at line 1284 of file class.ilCourseContentGUI.php.

1285 {
1286 if($this->container_obj->getType() == 'crs')
1287 {
1288 $this->container_gui->setContentSubTabs();
1289 }
1290 }

Referenced by executeCommand(), timingsOff(), and timingsOn().

+ Here is the caller graph for this function:

◆ __showTimingsPanel()

ilCourseContentGUI::__showTimingsPanel ( )

Definition at line 1100 of file class.ilCourseContentGUI.php.

1101 {
1102 global $ilAccess, $ilToolbar;
1103
1104 if(!$ilAccess->checkAccess('write','',$this->container_obj->getRefId()))
1105 {
1106 return true;
1107 }
1108
1109 include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
1111
1112 if(!$_SESSION['crs_timings_panel'][$this->course_obj->getId()])
1113 {
1114 $btn->setCaption("timings_timings_on");
1115 $btn->setUrl($this->ctrl->getLinkTarget($this,'timingsOn'));
1116 }
1117 else
1118 {
1119 $btn->setCaption("timings_timings_off");
1120 $btn->setUrl($this->ctrl->getLinkTarget($this,'timingsOff'));
1121 }
1122
1123 $ilToolbar->addButtonInstance($btn);
1124 }
static getInstance()
Factory.

References $_SESSION, and ilLinkButton\getInstance().

Referenced by __editAdvancedUserTimings(), __editUserTimings(), and editTimings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __showUserAcceptanceTable()

ilCourseContentGUI::__showUserAcceptanceTable ( )

Definition at line 607 of file class.ilCourseContentGUI.php.

608 {
609 global $ilUser;
610
611 include_once 'Modules/Course/classes/Timings/class.ilTimingAccepted.php';
612 $accept_obj = new ilTimingAccepted($this->course_obj->getId(),$ilUser->getId());
613
614 include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
615 $form = new ilPropertyFormGUI();
616 $form->setFormAction($this->ctrl->getFormAction($this, 'saveAcceptance'));
617 $form->setTitle($this->lng->txt('timing_accept_table'));
618
619 $accept = new ilCheckboxInputGUI($this->lng->txt('timing_user_accept'), "accepted");
620 $accept->setChecked($accept_obj->isAccepted());
621 $form->addItem($accept);
622
623 $remark = new ilTextAreaInputGUI($this->lng->txt('timing_remark'), "remark");
624 $remark->setValue($accept_obj->getRemark());
625 $form->addItem($remark);
626
627 $tutor = new ilCheckboxInputGUI($this->lng->txt('timing_tutor_visible'), "tutor");
628 $tutor->setChecked($accept_obj->isVisible());
629 $form->addItem($tutor);
630
631 $form->addCommandButton('saveAcceptance', $this->lng->txt('save'));
632 $this->tpl->setVariable("FORM", $form->getHTML());
633 }
This class represents a checkbox property in a property form.
This class represents a property form user interface.
This class represents a text area property in a property form.
class ilTimingAccepted

References $ilUser.

Referenced by __editAdvancedUserTimings(), and __editUserTimings().

+ Here is the caller graph for this function:

◆ __toUnix()

ilCourseContentGUI::__toUnix (   $date,
  $time = array() 
)

Definition at line 1310 of file class.ilCourseContentGUI.php.

1311 {
1312 return gmmktime($time['h'],$time['m'],0,$date['m'],$date['d'],$date['y']);
1313 }

Referenced by __loadFromPost(), __renderItem(), editTimings(), updateTimings(), and updateUserTimings().

+ Here is the caller graph for this function:

◆ editTimings()

ilCourseContentGUI::editTimings ( )

Definition at line 439 of file class.ilCourseContentGUI.php.

440 {
441 global $ilAccess,$ilErr;
442
443 include_once 'Services/MetaData/classes/class.ilMDEducational.php';
444 include_once './Services/Link/classes/class.ilLink.php';
445
446 $this->lng->loadLanguageModule('meta');
447
448 if(!$ilAccess->checkAccess('write','',$this->container_obj->getRefId()))
449 {
450 $ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$ilErr->WARNING);
451 }
452 $this->__showTimingsPanel();
453 $this->tabs_gui->setSubTabActive('timings_timings');
454
455 include_once 'Services/Object/classes/class.ilObjectActivation.php';
456 $this->cont_arr = ilObjectActivation::getTimingsAdministrationItems($this->container_obj->getRefId());
457
458 $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.crs_edit_items.html','Modules/Course');
459 $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
460 $this->tpl->setVariable("HEADER_IMG",ilUtil::getImagePath('icon_crs.svg'));
461 $this->tpl->setVariable("HEADER_ALT",$this->lng->txt('crs_materials'));
462 $this->tpl->setVariable("BLOCK_HEADER_CONTENT",$this->lng->txt('edit_timings_list'));
463 $this->tpl->setVariable("TXT_TITLE",$this->lng->txt('title'));
464
465
466 $this->tpl->setVariable("TXT_DURATION",$this->lng->txt('crs_timings_time_frame'));
467 $this->tpl->setVariable("TXT_INFO_DURATION",$this->lng->txt('crs_timings_in_days'));
468
469 $this->tpl->setVariable("TXT_START_END",$this->lng->txt('crs_timings_short_start_end'));
470 $this->tpl->setVariable("TXT_INFO_START_END",$this->lng->txt('crs_timings_start_end_info'));
471
472 $this->tpl->setVariable("TXT_CHANGEABLE",$this->lng->txt('crs_timings_short_changeable'));
473
474 $this->tpl->setVariable("TXT_INFO_LIMIT",$this->lng->txt('crs_timings_from_until'));
475 $this->tpl->setVariable("TXT_LIMIT",$this->lng->txt('crs_timings_short_limit_start_end'));
476 $this->tpl->setVariable("TXT_ACTIVE",$this->lng->txt('crs_timings_short_active'));
477 $this->tpl->setVariable("TXT_INFO_ACTIVE",$this->lng->txt('crs_timings_info_active'));
478
479 $counter = 0;
480 foreach($this->cont_arr as $item)
481 {
482 if($item['type'] == 'itgr')
483 {
484 continue;
485 }
486 $item = $this->__loadFromPost($item);
487 $item_prefix = "item[$item[ref_id]]";
488 $item_change_prefix = "item_change[$item[ref_id]]";
489 $item_active_prefix = "item_active[$item[ref_id]]";
490
491 if($item['type'] == 'grp' or
492 $item['type'] == 'fold')
493 {
494 $this->tpl->setVariable("TITLE_LINK",ilLink::_getLink($item['ref_id'],$item['type']));
495 $this->tpl->setVariable("TITLE_FRAME",ilFrameTargetInfo::_getFrame('MainContent',$item['type']));
496 $this->tpl->setVariable("TITLE_LINK_NAME",$item['title']);
497 }
498 else
499 {
500 if(!$item['title'] &&
501 $item['type'] == 'sess')
502 {
503 include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
505 $item['title'] = ilSessionAppointment::_appointmentToString($app_info['start'], $app_info['end'],$app_info['fullday']);
506 }
507
508 $this->tpl->setVariable("TITLE",$item['title']);
509 }
510
511 if(strlen($item['description']))
512 {
513 $this->tpl->setCurrentBlock("item_description");
514 $this->tpl->setVariable("DESC",$item['description']);
515 $this->tpl->parseCurrentBlock();
516 }
517
518 if($tlt = ilMDEducational::_getTypicalLearningTimeSeconds($item['obj_id']))
519 {
520 $this->tpl->setCurrentBlock("tlt");
521 $this->tpl->setVariable("TXT_TLT",$this->lng->txt('meta_typical_learning_time'));
522 $this->tpl->setVariable("TLT_VAL",ilFormat::_secondsToString($tlt));
523 $this->tpl->parseCurrentBlock();
524 }
525
526 $this->tpl->setCurrentBlock("container_standard_row");
527
528 // Suggested
529 if(is_array($_POST['item']["$item[ref_id]"]['sug_start']))
530 {
531 $start = $this->__toUnix($_POST['item']["$item[ref_id]"]['sug_start']);
532 }
533 else
534 {
535 $start = $item['suggestion_start'];
536 }
537 $end = $item['suggestion_end'];
538 $date = $this->__prepareDateSelect($start);
539 $this->tpl->setVariable("SUG_START",
540 ilUtil::makeDateSelect($item_prefix."[sug_start]",
541 $date['y'],$date['m'],$date['d'],date('Y',time()),false));
542
543 $this->tpl->setVariable("NAME_DURATION_A",$item_prefix."[duration_a]");
544 if(isset($_POST['item']["$item[ref_id]"]['duration_a']))
545 {
546 $this->tpl->setVariable("VAL_DURATION_A",abs($_POST['item']["$item[ref_id]"]['duration_a']));
547 }
548 else
549 {
550 $this->tpl->setVariable("VAL_DURATION_A",intval(($end-$start)/(60*60*24)));
551 }
552
553 $this->tpl->setVariable('SUG_END',ilDatePresentation::formatDate(new ilDate($item['suggestion_end'],IL_CAL_UNIX)));
554
555 // Limit
556 if(is_array($_POST['item']["$item[ref_id]"]['lim_end']))
557 {
558 $end = $this->__toUnix($_POST['item']["$item[ref_id]"]['lim_end']);
559 }
560 else
561 {
562 $end = $item['latest_end'];
563 }
564
565 $date = $this->__prepareDateSelect($end);
566 $this->tpl->setVariable("LIM_END",
567 ilUtil::makeDateSelect($item_prefix."[lim_end]",
568 $date['y'],$date['m'],$date['d'],date('Y',time()),false));
569
570 $this->tpl->setVariable("NAME_CHANGE",$item_change_prefix."[change]");
571 $this->tpl->setVariable("NAME_ACTIVE",$item_active_prefix."[active]");
572
573 if(isset($_POST['item']))
574 {
575 $change = $_POST['item_change']["$item[ref_id]"]['change'];
576 $active = $_POST['item_active']["$item[ref_id]"]['active'];
577 }
578 else
579 {
580 $change = $item['changeable'];
581 $active = ($item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING);
582 }
583
584 $this->tpl->setVariable("CHECKED_ACTIVE",$active ? 'checked="checked"' : '');
585 $this->tpl->setVariable("CHECKED_CHANGE",$change ? 'checked="checked"' : '');
586
587 if(isset($this->failed["$item[ref_id]"]))
588 {
589 $this->tpl->setVariable("ROWCLASS",'tblrowmarked');
590 }
591 else
592 {
593 $this->tpl->setVariable("ROWCLASS",ilUtil::switchColor($counter++,'tblrow1','tblrow2'));
594 }
595 $this->tpl->parseCurrentBlock();
596 }
597
598 // Select all
599 $this->tpl->setVariable("CHECKCLASS",ilUtil::switchColor($counter++,'tblrow1','tblrow2'));
600 $this->tpl->setVariable("SELECT_ALL",$this->lng->txt('select_all'));
601
602 $this->tpl->setVariable("BTN_SAVE",$this->lng->txt('save'));
603 $this->tpl->setVariable("BTN_CANCEL",$this->lng->txt('cancel'));
604
605 }
static _getFrame($a_class, $a_type='')
Get content frame name.

References $_POST, $ilErr, __loadFromPost(), __prepareDateSelect(), __showTimingsPanel(), __toUnix(), ilSessionAppointment\_appointmentToString(), ilFrameTargetInfo\_getFrame(), ilLink\_getLink(), ilMDEducational\_getTypicalLearningTimeSeconds(), ilSessionAppointment\_lookupAppointment(), ilObject\_lookupObjId(), ilFormat\_secondsToString(), ilDatePresentation\formatDate(), ilUtil\getImagePath(), ilObjectActivation\getTimingsAdministrationItems(), IL_CAL_UNIX, ilUtil\makeDateSelect(), ilUtil\switchColor(), and ilObjectActivation\TIMINGS_PRESETTING.

Referenced by editUserTimings(), timingsOn(), and updateTimings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editUserTimings()

ilCourseContentGUI::editUserTimings ( )

Definition at line 650 of file class.ilCourseContentGUI.php.

651 {
652 if($_SESSION['crs_timings_panel'][$this->course_obj->getId()])
653 {
654 return $this->editTimings();
655 }
656 global $ilAccess,$ilErr;
657
658 if(!$ilAccess->checkAccess('read','',$this->container_obj->getRefId()))
659 {
660 $ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$ilErr->WARNING);
661 }
662 $this->tabs_gui->setSubTabActive('timings_timings');
663
664 $_SESSION['crs_timings_user_hidden'] = isset($_GET['show_details']) ? $_GET['show_details'] : $_SESSION['crs_timings_user_hidden'];
665
666 include_once 'Services/Object/classes/class.ilObjectActivation.php';
667 if(ilObjectActivation::hasChangeableTimings($this->course_obj->getRefId()))
668 {
670 }
671 else
672 {
673 $this->__editUserTimings();
674 }
675 }

References $_GET, $_SESSION, $ilErr, __editAdvancedUserTimings(), __editUserTimings(), editTimings(), and ilObjectActivation\hasChangeableTimings().

Referenced by saveAcceptance(), timingsOff(), and updateUserTimings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

& ilCourseContentGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

48 {
49 global $ilAccess, $ilErr, $ilTabs, $ilCtrl;
50
51 if(!$ilAccess->checkAccess('read','',$this->container_obj->getRefId()))
52 {
53 $ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$ilErr->WARNING);
54 }
55
56 // Handle timings view
57 $_SESSION['crs_timings'] = true;
58
59 $this->__setSubTabs();
60 $this->tabs_gui->setTabActive('view_content');
61 $cmd = $this->ctrl->getCmd();
62
63 switch($this->ctrl->getNextClass($this))
64 {
65 case 'ilcoursearchivesgui':
67 break;
68
69 case "ilcolumngui":
70 $ilCtrl->saveParameterByClass("ilcolumngui", "col_return");
71 $ilTabs->setSubTabActive("crs_content");
72 $this->view();
73 break;
74
75 default:
76 if(!$this->__checkStartObjects())
77 {
78 $this->showStartObjects();
79 break;
80 }
81
82 // forward if archives enabled and not tutor
83 if(!$this->is_tutor = $ilAccess->checkAccess('write','',$this->course_obj->getRefId()) and
84 $this->course_obj->isArchived())
85 {
87 break;
88 }
89
90 // forward to objective presentation
91 if((!$this->is_tutor and
92 $this->container_obj->getType() == 'crs' and
93 $this->container_obj->enabledObjectiveView()) ||
94 $_GET["col_return"] == "objectives")
95 {
96 $this->use_objective_presentation = true;
97 $this->view();
98 //$this->__forwardToObjectivePresentation();
99 break;
100 }
101
102
103 if(!$cmd)
104 {
105 $cmd = $this->__getDefaultCommand();
106 }
107 $this->$cmd();
108 break;
109 }
110 }
view()
Output course content.
$cmd
Definition: sahs_server.php:35

References $_GET, $_SESSION, $cmd, $ilCtrl, $ilErr, __checkStartObjects(), __forwardToArchivesGUI(), __getDefaultCommand(), __setSubTabs(), showStartObjects(), and view().

+ Here is the call graph for this function:

◆ getRightColumnHTML()

ilCourseContentGUI::getRightColumnHTML ( )

Display right column.

Reimplemented from ilObjectGUI.

Definition at line 314 of file class.ilCourseContentGUI.php.

315 {
316 global $ilUser, $lng, $ilCtrl, $ilAccess;
317
318 $ilCtrl->saveParameterByClass("ilcolumngui", "col_return");
319
320 $obj_id = ilObject::_lookupObjId($this->container_obj->getRefId());
321 $obj_type = ilObject::_lookupType($obj_id);
322
323 include_once("Services/Block/classes/class.ilColumnGUI.php");
324 $column_gui = new ilColumnGUI($obj_type, IL_COL_RIGHT);
325
326 if ($column_gui->getScreenMode() == IL_SCREEN_FULL)
327 {
328 return "";
329 }
330
331 $this->setColumnSettings($column_gui);
332
333 if ($ilCtrl->getNextClass() == "ilcolumngui" &&
334 $column_gui->getCmdSide() == IL_COL_RIGHT &&
335 $column_gui->getScreenMode() == IL_SCREEN_SIDE)
336 {
337
338 $html = $ilCtrl->forwardCommand($column_gui);
339 }
340 else
341 {
342 if (!$ilCtrl->isAsynch())
343 {
344 $html = $ilCtrl->getHTML($column_gui);
345 }
346 }
347
348 return $html;
349 }
const IL_SCREEN_FULL

References $html, $ilCtrl, $ilUser, $lng, ilObjectGUI\$obj_id, ilObject\_lookupObjId(), ilObject\_lookupType(), IL_COL_RIGHT, IL_SCREEN_FULL, IL_SCREEN_SIDE, and setColumnSettings().

Referenced by view().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilCourseContentGUI()

ilCourseContentGUI::ilCourseContentGUI ( $container_gui_obj)

Constructor @access public.

Definition at line 31 of file class.ilCourseContentGUI.php.

32 {
33 global $tpl,$ilCtrl,$lng,$ilObjDataCache,$ilTabs;
34
35 $this->tpl =& $tpl;
36 $this->ctrl =& $ilCtrl;
37 $this->lng =& $lng;
38 $this->lng->loadLanguageModule('crs');
39 $this->tabs_gui =& $ilTabs;
40
41 $this->container_gui =& $container_gui_obj;
42 $this->container_obj =& $this->container_gui->object;
43
44 $this->__initCourseObject();
45 }

References $ilCtrl, $lng, $tpl, and __initCourseObject().

+ Here is the call graph for this function:

◆ returnToMembers()

ilCourseContentGUI::returnToMembers ( )

Definition at line 677 of file class.ilCourseContentGUI.php.

678 {
679 $this->ctrl->returnToParent($this);
680 }

◆ saveAcceptance()

ilCourseContentGUI::saveAcceptance ( )

Definition at line 635 of file class.ilCourseContentGUI.php.

636 {
637 global $ilUser;
638
639 include_once 'Modules/Course/classes/Timings/class.ilTimingAccepted.php';
640 $accept_obj = new ilTimingAccepted($this->course_obj->getId(),$ilUser->getId());
641
642 $accept_obj->setRemark(ilUtil::stripSlashes($_POST['remark']));
643 $accept_obj->accept($_POST['accepted']);
644 $accept_obj->setVisible($_POST['tutor']);
645 $accept_obj->update();
646 ilUtil::sendSuccess($this->lng->txt('settings_saved'));
647 $this->editUserTimings();
648 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $_POST, $ilUser, editUserTimings(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ setColumnSettings()

ilCourseContentGUI::setColumnSettings (   $column_gui)

May be overwritten in subclasses.

Reimplemented from ilObjectGUI.

Definition at line 351 of file class.ilCourseContentGUI.php.

352 {
353 global $ilAccess, $lng;
354
355 $column_gui->setRepositoryMode(true);
356 $column_gui->setEnableEdit(false);
357 $column_gui->setBlockProperty("news", "title",
358 $lng->txt("crs_news"));
359
360 include_once "Services/Object/classes/class.ilObjectActivation.php";
361 $grouped_items = array();
362 foreach(ilObjectActivation::getItems($this->container_obj->getRefId()) as $item)
363 {
364 $grouped_items[$item["type"]][] = $item;
365 }
366
367 $column_gui->setRepositoryItems($grouped_items);
368 if ($ilAccess->checkAccess("write", "", $this->container_obj->getRefId()))
369 {
370 $column_gui->setEnableEdit(true);
371 }
372
373 // Allow movement of blocks for tutors
374 if ($this->is_tutor &&
375 $this->container_gui->isActiveAdministrationPanel())
376 {
377 $column_gui->setEnableMovement(true);
378 }
379
380 // Configure Settings, if administration panel is on
381 if ($this->is_tutor)
382 {
383 $column_gui->setBlockProperty("news", "settings", true);
384 //$column_gui->setBlockProperty("news", "public_notifications_option", true);
385 $column_gui->setBlockProperty("news", "default_visibility_option", true);
386 $column_gui->setBlockProperty("news", "hide_news_block_option", true);
387 }
388
389 if ($this->container_gui->isActiveAdministrationPanel())
390 {
391 $column_gui->setAdminCommands(true);
392 }
393 }
static getItems($a_parent_id, $a_with_list_data=true)
Get sub item data.

References $lng, and ilObjectActivation\getItems().

Referenced by __forwardToColumnGUI(), and getRightColumnHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showStartObjects()

ilCourseContentGUI::showStartObjects ( )

Definition at line 165 of file class.ilCourseContentGUI.php.

166 {
167 include_once './Modules/Course/classes/class.ilCourseLMHistory.php';
168 include_once './Services/Repository/classes/class.ilRepositoryExplorer.php';
169 include_once './Services/Link/classes/class.ilLink.php';
170
171 global $rbacsystem,$ilias,$ilUser,$ilAccess,$ilObjDataCache;
172
173 $this->tabs_gui->setSubTabActive('crs_content');
174
175 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_start_view.html",'Modules/Course');
176 $this->tpl->setVariable("INFO_STRING",$this->lng->txt('crs_info_start'));
177 $this->tpl->setVariable("TBL_TITLE_START",$this->lng->txt('crs_table_start_objects'));
178 $this->tpl->setVariable("HEADER_NR",$this->lng->txt('crs_nr'));
179 $this->tpl->setVariable("HEADER_DESC",$this->lng->txt('description'));
180 $this->tpl->setVariable("HEADER_EDITED",$this->lng->txt('crs_objective_accomplished'));
181
182
183 $lm_continue =& new ilCourseLMHistory($this->course_obj->getRefId(),$ilUser->getId());
184 $continue_data = $lm_continue->getLMHistory();
185
186 $counter = 0;
187 foreach($this->start_obj->getStartObjects() as $start)
188 {
189 $obj_id = $ilObjDataCache->lookupObjId($start['item_ref_id']);
190 $ref_id = $start['item_ref_id'];
191 $type = $ilObjDataCache->lookupType($obj_id);
192
194
195 $obj_link = ilLink::_getLink($ref_id,$type);
197 $obj_frame = $obj_frame ? $obj_frame : '';
198
199 // Tmp fix for tests
200 $obj_frame = $type == 'tst' ? '' : $obj_frame;
201
202 $contentObj = false;
203
204 if($ilAccess->checkAccess('read','',$ref_id))
205 {
206 $this->tpl->setCurrentBlock("start_read");
207 $this->tpl->setVariable("READ_TITLE_START",$ilObjDataCache->lookupTitle($obj_id));
208 $this->tpl->setVariable("READ_TARGET_START",$obj_frame);
209 $this->tpl->setVariable("READ_LINK_START", $obj_link.'&crs_show_result='.$this->course_obj->getRefId());
210 $this->tpl->parseCurrentBlock();
211 }
212 else
213 {
214 $this->tpl->setCurrentBlock("start_visible");
215 $this->tpl->setVariable("VISIBLE_LINK_START",$ilObjDataCache->lookupTitle($obj_id));
216 $this->tpl->parseCurrentBlock();
217 }
218
219 // CONTINUE LINK
220 if(isset($continue_data[$ref_id]))
221 {
222 $this->tpl->setCurrentBlock("link");
223 $this->tpl->setVariable("LINK_HREF",ilLink::_getLink($ref_id,'',array('obj_id',
224 $continue_data[$ref_id]['lm_page_id'])));
225 #$this->tpl->setVariable("CONTINUE_LINK_TARGET",$target);
226 $this->tpl->setVariable("LINK_NAME",$this->lng->txt('continue_work'));
227 $this->tpl->parseCurrentBlock();
228 }
229
230 // add to desktop link
231 if(!$ilUser->isDesktopItem($ref_id,$type) and
232 $this->course_obj->getAboStatus())
233 {
234 if ($ilAccess->checkAccess('read','',$ref_id))
235 {
236 $this->tpl->setCurrentBlock("link");
237 $this->ctrl->setParameterByClass(get_class($this->container_gui),'item_ref_id',$ref_id);
238 $this->ctrl->setParameterByClass(get_class($this->container_gui),'item_id',$ref_id);
239 $this->ctrl->setParameterByClass(get_class($this->container_gui),'type',$type);
240
241 $this->tpl->setVariable("LINK_HREF",$this->ctrl->getLinkTarget($this->container_gui,'addToDesk'));
242 $this->tpl->setVariable("LINK_NAME", $this->lng->txt("to_desktop"));
243 $this->tpl->parseCurrentBlock();
244 }
245 }
246 elseif($this->course_obj->getAboStatus())
247 {
248 $this->tpl->setCurrentBlock("link");
249 $this->ctrl->setParameterByClass(get_class($this->container_gui),'item_ref_id',$ref_id);
250 $this->ctrl->setParameterByClass(get_class($this->container_gui),'item_id',$ref_id);
251 $this->ctrl->setParameterByClass(get_class($this->container_gui),'type',$type);
252
253 $this->tpl->setVariable("LINK_HREF",$this->ctrl->getLinkTarget($this->container_gui,'removeFromDesk'));
254 $this->tpl->setVariable("LINK_NAME", $this->lng->txt("unsubscribe"));
255 $this->tpl->parseCurrentBlock();
256 }
257
258
259 // Description
260 if(strlen($ilObjDataCache->lookupDescription($obj_id)))
261 {
262 $this->tpl->setCurrentBlock("start_description");
263 $this->tpl->setVariable("DESCRIPTION_START",$ilObjDataCache->lookupDescription($obj_id));
264 $this->tpl->parseCurrentBlock();
265 }
266
267
268 if($this->start_obj->isFullfilled($ilUser->getId(),$ref_id))
269 {
270 $accomplished = 'accomplished';
271 $icon = ilUtil::getImagePath("icon_ok.svg");
272 }
273 else
274 {
275 $accomplished = 'not_accomplished';
276 $icon = ilUtil::getImagePath("icon_not_ok.svg");
277 }
278 $this->tpl->setCurrentBlock("start_row");
279 $this->tpl->setVariable("EDITED_IMG", $icon);
280 $this->tpl->setVariable("EDITED_ALT",$this->lng->txt('crs_objective_'.$accomplished));
281 $this->tpl->setVariable("ROW_CLASS",'option_value');
282 $this->tpl->setVariable("ROW_CLASS_CENTER",'option_value_center');
283 $this->tpl->setVariable("OBJ_NR_START",++$counter.'.');
284 $this->tpl->parseCurrentBlock();
285 }
286 return true;
287 }
_checkAllConditionsOfTarget($a_target_ref_id, $a_target_id, $a_target_type="", $a_usr_id=0)
checks wether all conditions of a target object are fulfilled
class ilCourseLMHistory
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
STATIC, do not use $this inside!

References ilObjectGUI\$ilias, $ilUser, ilObjectGUI\$obj_id, ilObjectGUI\$ref_id, ilConditionHandler\_checkAllConditionsOfTarget(), ilLink\_getLink(), ilRepositoryExplorer\buildFrameTarget(), and ilUtil\getImagePath().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showUserTimings()

ilCourseContentGUI::showUserTimings ( )

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

683 {
684 $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.crs_user_timings.html','Modules/Course');
685 $this->tabs_gui->clearSubTabs();
686 $this->tabs_gui->setTabActive('members');
687
688 if(!$_GET['member_id'])
689 {
690 ilUtil::sendFailure($this->lng->txt('no_checkbox'),true);
691 $this->ctrl->returnToParent($this);
692 }
693
694
695 // Back button
696 $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
697 $this->tpl->setCurrentBlock("btn_cell");
698 $this->tpl->setVariable("BTN_LINK",$this->ctrl->getLinkTarget($this,'returnToMembers'));
699 $this->tpl->setVariable("BTN_TXT",$this->lng->txt("back"));
700 $this->tpl->parseCurrentBlock();
701
702 include_once 'Modules/Course/classes/Timings/class.ilTimingAccepted.php';
703 $usr_accepted = new ilTimingAccepted($this->course_obj->getId(),(int) $_GET['member_id']);
704
705 if($usr_accepted->isAccepted())
706 {
707 $this->tpl->setVariable("ACC_IMG",ilUtil::getImagePath('icon_ok.svg'));
708 $this->tpl->setVariable("ACC_ALT",$this->lng->txt('timing_accepted'));
709 }
710 else
711 {
712 $this->tpl->setVariable("ACC_IMG",ilUtil::getImagePath('icon_not_ok.svg'));
713 $this->tpl->setVariable("ACC_ALT",$this->lng->txt('timing_not_accepted'));
714 }
715 if($usr_accepted->isVisible() and strlen($usr_accepted->getRemark()))
716 {
717 $this->tpl->setVariable("REMARK",nl2br($usr_accepted->getRemark()));
718 }
719 else
720 {
721 $this->tpl->setVariable("REMARK",$this->lng->txt('not_available'));
722 }
723
724 $this->tpl->setVariable("TIMING_ACCEPT",$this->lng->txt('timing_accept_table'));
725 $this->tpl->setVariable("TXT_ACCEPTED",$this->lng->txt('timing_user_accepted'));
726 $this->tpl->setVariable("TXT_REMARK",$this->lng->txt('timing_remark'));
727
728 $this->tpl->setVariable("HEADER_IMG",ilUtil::getImagePath('icon_usr.svg'));
729 $this->tpl->setVariable("HEADER_ALT",$this->lng->txt('obj_usr'));
730 $this->tpl->setVariable("TABLE_HEADER",$this->lng->txt('timings_of'));
731 $name = ilObjUser::_lookupName($_GET['member_id']);
732 $this->tpl->setVariable("USER_NAME",$name['lastname'].', '.$name['firstname']);
733
734 $this->tpl->setVariable("TXT_TITLE",$this->lng->txt('title'));
735 $this->tpl->setVariable("TXT_START_END",$this->lng->txt('crs_timings_short_start_end'));
736 $this->tpl->setVariable("TXT_INFO_START_END",$this->lng->txt('crs_timings_start_end_info'));
737 $this->tpl->setVariable("TXT_CHANGED",$this->lng->txt('crs_timings_changed'));
738 $this->tpl->setVariable("TXT_OWN_PRESETTING",$this->lng->txt('crs_timings_planed_start'));
739 $this->tpl->setVariable("TXT_INFO_OWN_PRESETTING",$this->lng->txt('crs_timings_from_until'));
740
741 include_once 'Services/Object/classes/class.ilObjectActivation.php';
742 $items = ilObjectActivation::getTimingsAdministrationItems($this->course_obj->getRefId());
743 foreach($items as $item)
744 {
745 if(($item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING) or
747 {
748 $this->__renderUserItem($item,0);
749 }
750 }
751 }
static _lookupName($a_user_id)
lookup user name
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $_GET, __renderUserItem(), ilObjUser\_lookupName(), ilUtil\getImagePath(), ilObjectActivation\getTimingsAdministrationItems(), ilObjectActivation\hasChangeableTimings(), ilUtil\sendFailure(), and ilObjectActivation\TIMINGS_PRESETTING.

+ Here is the call graph for this function:

◆ timingsOff()

ilCourseContentGUI::timingsOff ( )

Definition at line 1136 of file class.ilCourseContentGUI.php.

1137 {
1138 global $ilTabs;
1139 $_SESSION['crs_timings_panel'][$this->course_obj->getId()] = 0;
1140
1141 $ilTabs->clearSubTabs();
1142 $this->__setSubTabs();
1143 $this->editUserTimings();
1144 }

References $_SESSION, __setSubTabs(), and editUserTimings().

+ Here is the call graph for this function:

◆ timingsOn()

ilCourseContentGUI::timingsOn ( )

Definition at line 1126 of file class.ilCourseContentGUI.php.

1127 {
1128 global $ilTabs;
1129 $_SESSION['crs_timings_panel'][$this->course_obj->getId()] = 1;
1130
1131 $ilTabs->clearSubTabs();
1132 $this->__setSubTabs();
1133 $this->editTimings();
1134 }

References $_SESSION, __setSubTabs(), and editTimings().

+ Here is the call graph for this function:

◆ updateTimings()

ilCourseContentGUI::updateTimings ( )

Definition at line 1218 of file class.ilCourseContentGUI.php.

1219 {
1220 include_once 'Services/Object/classes/class.ilObjectActivation.php';
1221
1222 global $ilAccess,$ilErr;
1223
1224 if(!$ilAccess->checkAccess('write','',$this->container_obj->getRefId()))
1225 {
1226 $ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$ilErr->WARNING);
1227 }
1228 $this->failed = array();
1229 // Validate
1230
1231 $_POST['item'] = is_array($_POST['item']) ? $_POST['item'] : array();
1232 $all_items = array();
1233
1234 foreach($_POST['item'] as $ref_id => $data)
1235 {
1236 $item_obj = new ilObjectActivation();
1238
1239 $item_obj->setTimingType($_POST['item_active'][$ref_id]['active'] ?
1242 $item_obj->setTimingStart($old_data['timing_start']);
1243 $item_obj->setTimingEnd($old_data['timing_end']);
1244 $item_obj->setSuggestionStart($this->__toUnix($data["sug_start"]));
1245
1246 // add duration
1247 $data['sug_start']['d'] += abs($data['duration_a']);
1248 $item_obj->setSuggestionEnd($this->__toUnix($data['sug_start'],array('h' => 23,'m' => 55)));
1249
1250 $item_obj->setEarliestStart(time());
1251 $item_obj->setLatestEnd($this->__toUnix($data['lim_end'],array('h' => 23,'m' => 55)));
1252
1253 $item_obj->toggleVisible($old_data['visible']);
1254 $item_obj->toggleChangeable($_POST['item_change'][$ref_id]['change']);
1255
1256 if(!$item_obj->validateActivation())
1257 {
1258 $this->failed[$ref_id] = $old_data['title'];
1259 }
1260 $all_items[$ref_id] =& $item_obj;
1261 unset($item_obj);
1262 }
1263
1264 if(count($this->failed))
1265 {
1266 $message = $this->lng->txt('crs_timings_update_error');
1267 $message .= ("<br />".$this->lng->txt('crs_materials').': ');
1268 $message .= (implode(',',$this->failed));
1269 ilUtil::sendFailure($message);
1270 $this->editTimings();
1271 return false;
1272 }
1273
1274 // No do update
1275 foreach($all_items as $ref_id => $item_obj_new)
1276 {
1277 $item_obj_new->update($ref_id);
1278 }
1279 ilUtil::sendSuccess($this->lng->txt('settings_saved'));
1280 $this->editTimings();
1281 return false;
1282 }
Class ilObjectActivation.
static getItem($a_ref_id)
Get item data.

References $_POST, ilObjectGUI\$data, $ilErr, ilObjectGUI\$ref_id, __toUnix(), editTimings(), ilObjectActivation\getItem(), ilUtil\sendFailure(), ilUtil\sendSuccess(), ilObjectActivation\TIMINGS_DEACTIVATED, and ilObjectActivation\TIMINGS_PRESETTING.

+ Here is the call graph for this function:

◆ updateUserTimings()

ilCourseContentGUI::updateUserTimings ( )

Definition at line 1147 of file class.ilCourseContentGUI.php.

1148 {
1149 global $ilUser,$ilObjDataCache;
1150 include_once 'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
1151
1152 // Validate
1153 $this->invalid = array();
1154 foreach($_POST['item'] as $ref_id => $data)
1155 {
1156 $tmp_planed = new ilTimingPlaned($ref_id,$ilUser->getId());
1157
1158 $tmp_planed->setPlanedStartingTime($this->__toUnix($data['own_start']));
1159 if(isset($data['duration']))
1160 {
1161 $data['own_start']['d'] += $data['duration'];
1162 $tmp_planed->setPlanedEndingTime($this->__toUnix($data['own_start'],array('h' => 23,'m' => 55)));
1163 }
1164 else
1165 {
1166 $tmp_planed->setPlanedEndingTime($this->__toUnix($data['own_start']),array('h' => 23,'m' => 55));
1167 }
1168 if(!$tmp_planed->validate())
1169 {
1170 $this->invalid[$ref_id] = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($ref_id));
1171 }
1172 $all_items[] = $tmp_planed;
1173 }
1174 if(count($this->invalid))
1175 {
1176 $message = $this->lng->txt('crs_timings_update_error');
1177 $message .= ("<br />".$this->lng->txt('crs_materials').': ');
1178 $message .= (implode(',',$this->invalid));
1179 ilUtil::sendFailure($message);
1180 $this->editUserTimings();
1181 return false;
1182 }
1183 foreach($all_items as $new_item_obj)
1184 {
1185 $new_item_obj->update();
1186 }
1187 ilUtil::sendSuccess($this->lng->txt('settings_saved'));
1188 $this->editUserTimings();
1189 return true;
1190
1191 }

References $_POST, ilObjectGUI\$data, $ilUser, ilObjectGUI\$ref_id, __toUnix(), editUserTimings(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ view()

ilCourseContentGUI::view ( )

Output course content.

Definition at line 292 of file class.ilCourseContentGUI.php.

293 {
294 // BEGIN ChangeEvent: record read event.
295 require_once('Services/Tracking/classes/class.ilChangeEvent.php');
296 global $ilUser;
297 $obj_id = ilObject::_lookupObjId($this->container_obj->getRefId());
299 $this->container_obj->getType(), $this->container_obj->getRefId(),
300 $obj_id, $ilUser->getId());
301 // END ChangeEvent: record read event.
302
303 $this->getCenterColumnHTML();
304
305 if (!$this->no_right_column)
306 {
307 $this->tpl->setRightContent($this->getRightColumnHTML());
308 }
309 }
_recordReadEvent($a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
getRightColumnHTML()
Display right column.
getCenterColumnHTML()
Get center column.

References $ilUser, ilObjectGUI\$obj_id, ilObject\_lookupObjId(), ilChangeEvent\_recordReadEvent(), ilObjectGUI\getCenterColumnHTML(), and getRightColumnHTML().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $container_gui

ilCourseContentGUI::$container_gui

Definition at line 18 of file class.ilCourseContentGUI.php.

◆ $container_obj

ilCourseContentGUI::$container_obj

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

Referenced by __initCourseObject().

◆ $course_obj

ilCourseContentGUI::$course_obj

Definition at line 20 of file class.ilCourseContentGUI.php.

◆ $ctrl

ilCourseContentGUI::$ctrl

Definition at line 23 of file class.ilCourseContentGUI.php.

◆ $lng

ilCourseContentGUI::$lng

◆ $tabs_gui

ilCourseContentGUI::$tabs_gui

Definition at line 25 of file class.ilCourseContentGUI.php.

◆ $tpl

ilCourseContentGUI::$tpl

Definition at line 22 of file class.ilCourseContentGUI.php.

Referenced by ilCourseContentGUI().


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