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

Class ilCourseContentGUI. More...

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

Public Member Functions

 ilCourseContentGUI (&$container_gui_obj)
 Constructor public. More...
 
executeCommand ()
 
 __getDefaultCommand ()
 
 __forwardToObjectivePresentation ()
 
 __forwardToArchivesGUI ()
 
 __checkStartObjects ()
 
 showStartObjects ()
 
 view ()
 Output course content. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings ($column_gui)
 
 __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 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 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...
 
 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 public More...
 
 setAdminTabs ()
 set admin tabs 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...
 
 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)
 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...
 

Detailed Description

Member Function Documentation

◆ __buildPath()

ilCourseContentGUI::__buildPath (   $a_ref_id)

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

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

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

◆ __checkStartObjects()

ilCourseContentGUI::__checkStartObjects ( )

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

References $ilUser.

Referenced by executeCommand().

167  {
168  include_once './Modules/Course/classes/class.ilCourseStart.php';
169 
170  global $ilAccess,$ilUser;
171 
172  if($ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
173  {
174  return true;
175  }
176  $this->start_obj = new ilCourseStart($this->course_obj->getRefId(),$this->course_obj->getId());
177  if(count($this->start_obj->getStartObjects()) and !$this->start_obj->allFullfilled($ilUser->getId()))
178  {
179  return false;
180  }
181  return true;
182  }
Class ilObj<module_name>
global $ilUser
Definition: imgupload.php:15
+ Here is the caller graph for this function:

◆ __editAdvancedUserTimings()

ilCourseContentGUI::__editAdvancedUserTimings ( )

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

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

Referenced by editUserTimings().

856  {
857  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.crs_usr_edit_timings_adv.html','Modules/Course');
858  $this->__showTimingsPanel();
859  $this->__showUserAcceptanceTable();
860 
861  $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
862  $this->tpl->setVariable("HEADER_IMG",ilUtil::getImagePath('icon_crs.png'));
863  $this->tpl->setVariable("HEADER_ALT",$this->lng->txt('obj_crs'));
864  $this->tpl->setVariable("BLOCK_HEADER_CONTENT",$this->lng->txt('timings_usr_edit'));
865 
866  if(!$_SESSION['crs_timings_user_hidden'])
867  {
868  $this->tpl->setVariable("SHOW_HIDE_TEXT",$this->lng->txt('show_details'));
869  $this->ctrl->setParameter($this,'show_details',1);
870  $this->tpl->setVariable("SHOW_HIDE_LINK",$this->ctrl->getLinkTarget($this,'editUserTimings'));
871  }
872  else
873  {
874  $this->tpl->setVariable("SHOW_HIDE_TEXT",$this->lng->txt('hide_details'));
875  $this->ctrl->setParameter($this,'show_details',0);
876  $this->tpl->setVariable("SHOW_HIDE_LINK",$this->ctrl->getLinkTarget($this,'editUserTimings'));
877  }
878  $this->ctrl->clearParameters($this);
879  $this->tpl->setVariable("TXT_TITLE",$this->lng->txt('title'));
880  $this->tpl->setVariable("TXT_START_END",$this->lng->txt('crs_timings_short_start_end'));
881  $this->tpl->setVariable("TXT_INFO_START_END",$this->lng->txt('crs_timings_start_end_info'));
882 
883  $this->tpl->setVariable("TXT_LIMIT",$this->lng->txt('crs_timings_short_limit_start_end'));
884  $this->tpl->setVariable("TXT_INFO_LIMIT",$this->lng->txt('crs_timings_from_until'));
885 
886  $this->tpl->setVariable("TXT_OWN_PRESETTING",$this->lng->txt('crs_timings_planed_start'));
887  $this->tpl->setVariable("TXT_INFO_OWN_PRESETTING",$this->lng->txt('crs_timings_start_end_info'));
888 
889  $this->tpl->setVariable("TXT_DURATION",$this->lng->txt('crs_timings_time_frame'));
890  $this->tpl->setVariable("TXT_INFO_DURATION",$this->lng->txt('crs_timings_in_days'));
891 
892  $this->tpl->setVariable("TXT_BTN_UPDATE",$this->lng->txt('save'));
893  $this->tpl->setVariable("TXT_CANCEL",$this->lng->txt('cancel'));
894 
895  include_once 'Services/Object/classes/class.ilObjectActivation.php';
896  $sorted_items = ilObjectActivation::getTimingsItems($this->course_obj->getRefId());
897 
898  $this->counter = 0;
899  foreach($sorted_items as $item)
900  {
901  switch($item['type'])
902  {
903  case 'itgr':
904  break;
905 
906  default:
907  $this->__renderItem($item,0);
908  break;
909  }
910  }
911  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static 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)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __editUserTimings()

ilCourseContentGUI::__editUserTimings ( )

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

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

Referenced by editUserTimings().

914  {
915  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.crs_usr_edit_timings.html','Modules/Course');
916 
917  $this->__showTimingsPanel();
918  $this->__showUserAcceptanceTable();
919 
920  $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
921  $this->tpl->setVariable("HEADER_IMG",ilUtil::getImagePath('icon_crs.png'));
922  $this->tpl->setVariable("HEADER_ALT",$this->lng->txt('obj_crs'));
923 
924  if(!$_SESSION['crs_timings_user_hidden'])
925  {
926  $this->tpl->setVariable("SHOW_HIDE_TEXT",$this->lng->txt('show_details'));
927  $this->ctrl->setParameter($this,'show_details',1);
928  $this->tpl->setVariable("SHOW_HIDE_LINK",$this->ctrl->getLinkTarget($this,'editUserTimings'));
929  }
930  else
931  {
932  $this->tpl->setVariable("SHOW_HIDE_TEXT",$this->lng->txt('hide_details'));
933  $this->ctrl->setParameter($this,'show_details',0);
934  $this->tpl->setVariable("SHOW_HIDE_LINK",$this->ctrl->getLinkTarget($this,'editUserTimings'));
935  }
936  $this->ctrl->clearParameters($this);
937 
938  $this->tpl->setVariable("BLOCK_HEADER_CONTENT",$this->lng->txt('timings_timings'));
939  $this->tpl->setVariable("TXT_TITLE",$this->lng->txt('title'));
940  $this->tpl->setVariable("TXT_START",$this->lng->txt('crs_timings_sug_begin'));
941  $this->tpl->setVariable("TXT_END",$this->lng->txt('crs_timings_sug_end'));
942 
943  include_once 'Services/Object/classes/class.ilObjectActivation.php';
944  $sorted_items = ilObjectActivation::getTimingsItems($this->course_obj->getRefId());
945 
946  $this->counter = 0;
947  foreach($sorted_items as $item)
948  {
949  switch($item['type'])
950  {
951  case 'itgr':
952  break;
953 
954  default:
955  $this->__renderItem($item,0);
956  break;
957  }
958  }
959  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static 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)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __forwardToArchivesGUI()

ilCourseContentGUI::__forwardToArchivesGUI ( )

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

Referenced by executeCommand().

153  {
154  include_once 'Modules/Course/classes/class.ilCourseArchivesGUI.php';
155 
156  $this->ctrl->setReturn($this,'');
157  $archives_gui = new ilCourseArchivesGUI($this->container_gui);
158  $this->ctrl->forwardCommand($archives_gui);
159 
160  $this->tabs_gui->setTabActive('view_content');
161  $this->tabs_gui->setSubTabActive('crs_archives');
162 
163  return true;
164  }
Class ilCourseArchivesGUI.
+ Here is the caller graph for this function:

◆ __forwardToColumnGUI()

ilCourseContentGUI::__forwardToColumnGUI ( )

Get columngui output.

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

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

421  {
422  global $ilCtrl, $ilAccess;
423 
424  include_once("Services/Block/classes/class.ilColumnGUI.php");
425 
426  $obj_id = ilObject::_lookupObjId($this->container_obj->getRefId());
427  $obj_type = ilObject::_lookupType($obj_id);
428 
429  if (!$ilCtrl->isAsynch())
430  {
431  //if ($column_gui->getScreenMode() != IL_SCREEN_SIDE)
433  {
434  // right column wants center
436  {
437  $column_gui = new ilColumnGUI($obj_type, IL_COL_RIGHT);
438  $this->setColumnSettings($column_gui);
439  $html = $ilCtrl->forwardCommand($column_gui);
440  }
441  // left column wants center
443  {
444  $column_gui = new ilColumnGUI($obj_type, IL_COL_LEFT);
445  $this->setColumnSettings($column_gui);
446  $html = $ilCtrl->forwardCommand($column_gui);
447  }
448  }
449  else
450  {
451  if ($_GET["col_return"] == "objectives")
452  {
453  //return $this->__forwardToObjectivePresentation();
454  include_once 'Modules/Course/classes/class.ilCourseObjectivePresentationGUI.php';
455  $this->ctrl->setReturn($this,'');
456  $objectives_gui = new ilCourseObjectivePresentationGUI($this->container_gui);
457  $this->ctrl->getHTML($objectives_gui);
458  }
459  else
460  {
461  $this->getDefaultView();
462  }
463  }
464  }
465 
466  return $html;
467  }
static getCmdSide()
Get Column Side of Current Command.
$_GET["client_id"]
const IL_COL_RIGHT
global $ilCtrl
Definition: ilias.php:18
Column user interface class.
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
static getScreenMode()
Get Screen Mode for current command.
Class ilCourseObjectivePresentationGUI.
const IL_SCREEN_SIDE
const IL_COL_LEFT
+ Here is the call graph for this function:

◆ __forwardToObjectivePresentation()

ilCourseContentGUI::__forwardToObjectivePresentation ( )

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

138  {
139  include_once 'Modules/Course/classes/class.ilCourseObjectivePresentationGUI.php';
140 
141  $this->ctrl->setReturn($this,'');
142  $objectives_gui = new ilCourseObjectivePresentationGUI($this->container_gui);
143 
144  if(!$this->ctrl->getNextClass())
145  {
146  $this->ctrl->setCmdClass(get_class($objectives_gui));
147  }
148  $this->ctrl->forwardCommand($objectives_gui);
149  return true;
150  }
Class ilCourseObjectivePresentationGUI.

◆ __getDefaultCommand()

ilCourseContentGUI::__getDefaultCommand ( )

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

References $_SESSION, and IL_CRS_VIEW_TIMING.

Referenced by executeCommand().

117  {
118  global $ilAccess;
119 
120  // edit timings if panel is on
121  if($_SESSION['crs_timings_panel'][$this->course_obj->getId()])
122  {
123  return 'editTimings';
124  }
125  if($ilAccess->checkAccess('write','',$this->container_obj->getRefId()))
126  {
127  return 'view';
128  }
129  if($this->container_obj->getType() == 'crs' and
130  $this->course_obj->getViewMode() == IL_CRS_VIEW_TIMING)
131  {
132  return 'editUserTimings';
133  }
134  return 'view';
135  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
const IL_CRS_VIEW_TIMING
+ Here is the caller graph for this function:

◆ __initCourseObject()

ilCourseContentGUI::__initCourseObject ( )

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

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

Referenced by ilCourseContentGUI().

1289  {
1290  global $tree;
1291 
1292  if($this->container_obj->getType() == 'crs')
1293  {
1294  // Container is course
1295  $this->course_obj =& $this->container_obj;
1296  }
1297  else
1298  {
1299 
1300  $course_ref_id = $tree->checkForParentType($this->container_obj->getRefId(),'crs');
1301  $this->course_obj =& ilObjectFactory::getInstanceByRefId($course_ref_id);
1302  }
1303  return true;
1304  }
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __loadFromPost()

& ilCourseContentGUI::__loadFromPost ( $item)

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

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

Referenced by editTimings().

1191  {
1192  $obj_id = $item['obj_id'];
1193 
1194  if(!isset($_POST['item'][$obj_id]))
1195  {
1196  return $item;
1197  }
1198  $item['suggestion_start'] = $this->__toUnix($_POST['item'][$obj_id]['sug_start']);
1199  if(isset($_POST['item'][$obj_id]['sug_end']))
1200  {
1201  // #9325
1202  $item['suggestion_end'] = $this->__toUnix($_POST['item'][$obj_id]['sug_end']);
1203  }
1204  $item['earliest_start'] = $this->__toUnix($_POST['item'][$obj_id]['lim_start']);
1205  $item['latest_end'] = $this->__toUnix($_POST['item'][$obj_id]['lim_end']);
1206  $item['changeable'] = $_POST['item'][$obj_id]['change'];
1207  $item['timing_type'] = $_POST['item'][$obj_id]['active'] ? ilObjectActivation::TIMINGS_PRESETTING : $item['timing_type'];
1208  $item['duration_a'] = $_POST['item'][$obj_id]['duration_a'];
1209  $item['duration_b'] = $_POST['item'][$obj_id]['duration_b'];
1210 
1211  return $item;
1212  }
__toUnix($date, $time=array())
$_POST['username']
Definition: cron.php:12
+ 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 1311 of file class.ilCourseContentGUI.php.

Referenced by __renderItem(), and editTimings().

1312  {
1313  return array('y' => date('Y',$a_unix_time),
1314  'm' => date('m',$a_unix_time),
1315  'd' => date('d',$a_unix_time));
1316  }
+ Here is the caller graph for this function:

◆ __prepareTimeSelect()

ilCourseContentGUI::__prepareTimeSelect (   $a_unix_time)

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

1319  {
1320  return array('h' => date('G',$a_unix_time),
1321  'm' => date('i',$a_unix_time),
1322  's' => date('s',$a_unix_time));
1323  }

◆ __renderItem()

ilCourseContentGUI::__renderItem (   $item,
  $level 
)

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

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

Referenced by __editAdvancedUserTimings(), and __editUserTimings().

962  {
963  global $ilUser,$ilAccess;
964 
965  include_once 'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
966  include_once './Services/Link/classes/class.ilLink.php';
967  include_once './Services/MetaData/classes/class.ilMDEducational.php';
968 
969  if(!$ilAccess->checkAccess('visible','',$item['ref_id']))
970  {
971  return false;
972  }
973 
974  $this->lng->loadLanguageModule('meta');
975 
976  $usr_planed = new ilTimingPlaned($item['ref_id'],$ilUser->getId());
977 
978  for($i = 0;$i < $level;$i++)
979  {
980  $this->tpl->touchBlock('start_indent');
981  $this->tpl->touchBlock('end_indent');
982  }
983  if(strlen($item['description']))
984  {
985  $this->tpl->setCurrentBlock("item_description");
986  $this->tpl->setVariable("DESC",$item['description']);
987  $this->tpl->parseCurrentBlock();
988  }
989  if($tlt = ilMDEducational::_getTypicalLearningTimeSeconds($item['obj_id']))
990  {
991  $this->tpl->setCurrentBlock("tlt");
992  $this->tpl->setVariable("TXT_TLT",$this->lng->txt('meta_typical_learning_time'));
993  $this->tpl->setVariable("TLT_VAL",ilFormat::_secondsToString($tlt));
994  $this->tpl->parseCurrentBlock();
995  }
996 
997  if($ilAccess->checkAccess('read','',$item['ref_id']))
998  {
999  $this->tpl->setCurrentBlock("title_as_link");
1000  $this->tpl->setVariable("TITLE_LINK",ilLink::_getLink($item['ref_id'],$item['type']));
1001  $this->tpl->setVariable("TITLE_NAME",$item['title']);
1002  $this->tpl->parseCurrentBlock();
1003  }
1004  else
1005  {
1006  $this->tpl->setCurrentBlock("title_plain");
1007  $this->tpl->setVariable("TITLE",$item['title']);
1008  $this->tpl->parseCurrentBlock();
1009  }
1010  $this->tpl->setCurrentBlock("container_standard_row");
1011 
1012  if(isset($this->invalid["$item[ref_id]"]))
1013  {
1014  $this->tpl->setVariable("ROWCLASS",'tblrowmarked');
1015  }
1016  else
1017  {
1018  $this->tpl->setVariable("ROWCLASS",ilUtil::switchColor($this->counter++,'tblrow1','tblrow2'));
1019  }
1020  #$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_'.$item['type'].'.png'));
1021  $this->tpl->setVariable('TYPE_IMG',ilUtil::getTypeIconPath($item['type'],$item['obj_id'],'small'));
1022  $this->tpl->setVariable("TYPE_ALT_IMG",$this->lng->txt('obj_'.$item['type']));
1023 
1024 
1025  if($item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING)
1026  {
1027  $this->tpl->setVariable('SUG_START',ilDatePresentation::formatDate(new ilDate($item['suggestion_start'],IL_CAL_UNIX)));
1028  $this->tpl->setVariable('SUG_END',ilDatePresentation::formatDate(new ilDate($item['suggestion_end'],IL_CAL_UNIX)));
1029  }
1030 
1031  if($item['changeable'])
1032  {
1033  $item_prefix = "item[".$item['ref_id'].']';
1034 
1035  if(is_array($_POST['item']["$item[ref_id]"]['own_start']))
1036  {
1037  #echo "Start post<br>";
1038  $start = $this->__toUnix($_POST['item']["$item[ref_id]"]['own_start']);
1039  }
1040  elseif($usr_planed->getPlanedStartingTime())
1041  {
1042  #echo "Own start<br>";
1043  $start = $usr_planed->getPlanedStartingTime();
1044  }
1045  else
1046  {
1047  #echo "Empfehlung start<br>";
1048  $start = $item['suggestion_start'];
1049  }
1050 
1051  $date = $this->__prepareDateSelect($start);
1052  $this->tpl->setVariable("OWN_START",
1053  ilUtil::makeDateSelect($item_prefix."[own_start]",
1054  $date['y'],$date['m'],$date['d'],date('Y',time()),false));
1055 
1056  if($usr_planed->getPlanedEndingTime())
1057  {
1058  #echo "Own End<br>";
1059  $end = $usr_planed->getPlanedEndingTime();
1060  }
1061  else
1062  {
1063  #echo "Empfehlung end<br>";
1064  $end = $item['suggestion_end'];
1065  }
1066  $this->tpl->setVariable('OWN_END',ilDatePresentation::formatDate(new ilDate($end,IL_CAL_UNIX)));
1067  $this->tpl->setVariable("NAME_DURATION",$item_prefix."[duration]");
1068 
1069  // Duration
1070  if(isset($_POST['item']["$item[ref_id]"]['duration']))
1071  {
1072  $this->tpl->setVariable("VAL_DURATION",$_POST['item']["$item[ref_id]"]['duration']);
1073  }
1074  else
1075  {
1076  $this->tpl->setVariable("VAL_DURATION",intval(($end - $start) / (60 * 60 * 24)));
1077  }
1078  $this->tpl->setVariable('LIM_START',ilDatePresentation::formatDate(new ilDate($item['earliest_start'],IL_CAL_UNIX)));
1079  $this->tpl->setVariable('LIM_END',ilDatePresentation::formatDate(new ilDate($item['latest_end'],IL_CAL_UNIX)));
1080  }
1081 
1082  $this->tpl->parseCurrentBlock();
1083 
1084  if(!$_SESSION['crs_timings_user_hidden'])
1085  {
1086  return true;
1087  }
1088 
1089  foreach(ilObjectActivation::getTimingsItems($item['ref_id']) as $item_data)
1090  {
1091  $this->__renderItem($item_data,$level+1);
1092  }
1093  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
__toUnix($date, $time=array())
$_POST['username']
Definition: cron.php:12
_getTypicalLearningTimeSeconds($a_rbac_id, $a_obj_id=0)
class ilTimingPlaned
static getTimingsItems($a_container_ref_id)
Get (sub) item data for timings view (no session material, no side blocks)
const IL_CAL_UNIX
_secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
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...
Class for single dates.
static formatDate(ilDateTime $date)
Format a date public.
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.
global $ilUser
Definition: imgupload.php:15
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __renderUserItem()

ilCourseContentGUI::__renderUserItem (   $item,
  $level 
)

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

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

Referenced by showUserTimings().

765  {
766  include_once 'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
767  include_once './Services/MetaData/classes/class.ilMDEducational.php';
768 
769  $this->lng->loadLanguageModule('meta');
770 
771  $usr_planed = new ilTimingPlaned($item['ref_id'],$_GET['member_id']);
772  for($i = 0;$i < $level;$i++)
773  {
774  $this->tpl->touchBlock('start_indent');
775  $this->tpl->touchBlock('end_indent');
776  }
777  if(strlen($item['description']))
778  {
779  $this->tpl->setCurrentBlock("item_description");
780  $this->tpl->setVariable("DESC",$item['description']);
781  $this->tpl->parseCurrentBlock();
782  }
783  if($tlt = ilMDEducational::_getTypicalLearningTimeSeconds($item['obj_id']))
784  {
785  $this->tpl->setCurrentBlock("tlt");
786  $this->tpl->setVariable("TXT_TLT",$this->lng->txt('meta_typical_learning_time'));
787  $this->tpl->setVariable("TLT_VAL",ilFormat::_secondsToString($tlt));
788  $this->tpl->parseCurrentBlock();
789  }
790 
791  $this->tpl->setCurrentBlock("title_plain");
792  $this->tpl->setVariable("TITLE",$item['title']);
793  $this->tpl->parseCurrentBlock();
794 
795  $this->tpl->setCurrentBlock("container_standard_row");
796 
797  $this->tpl->setVariable("ROWCLASS",ilUtil::switchColor($this->counter++,'tblrow1','tblrow2'));
798  #$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_'.$item['type'].'.png'));
799  $this->tpl->setVariable('TYPE_IMG',ilUtil::getTypeIconPath($item['type'],$item['obj_id'],'tiny'));
800  $this->tpl->setVariable("TYPE_ALT_IMG",$this->lng->txt('obj_'.$item['type']));
801 
802  if($item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING)
803  {
804  $this->tpl->setVariable('SUG_START',ilDatePresentation::formatDate(new ilDate($item['suggestion_start'],IL_CAL_UNIX)));
805  $this->tpl->setVariable('SUG_END',ilDatePresentation::formatDate(new ilDate($item['suggestion_end'],IL_CAL_UNIX)));
806  }
807 
808  if($item['changeable'] and $item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING)
809  {
810  if($usr_planed->getPlanedStartingTime())
811  {
812  $start = $usr_planed->getPlanedStartingTime();
813  }
814  else
815  {
816  $start = $item['suggestion_start'];
817  }
818  $this->tpl->setVariable('OWN_START',ilDatePresentation::formatDate(new ilDate($start,IL_CAL_UNIX)));
819 
820  if($usr_planed->getPlanedEndingTime())
821  {
822  $end = $usr_planed->getPlanedEndingTime();
823  }
824  else
825  {
826  $end = $item['suggestion_end'];
827  }
828  if($start != $item['suggestion_start'] or $end != $item['suggestion_end'])
829  {
830  $this->tpl->setVariable("OK_IMG",ilUtil::getImagePath('icon_ok.png'));
831  $this->tpl->setVariable("OK_ALT",$this->lng->txt('crs_timings_changed'));
832  }
833  else
834  {
835  $this->tpl->setVariable("OK_IMG",ilUtil::getImagePath('icon_not_ok.png'));
836  $this->tpl->setVariable("OK_ALT",$this->lng->txt('crs_timings_not_changed'));
837  }
838  $this->tpl->setVariable('OWN_END',ilDatePresentation::formatDate(new ilDate($end,IL_CAL_UNIX)));
839  }
840 
841  $this->tpl->parseCurrentBlock();
842 
843  foreach(ilObjectActivation::getTimingsAdministrationItems($item['ref_id']) as $item_data)
844  {
845  if(($item_data['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING) or
846  ilObjectActivation::hasChangeableTimings($item_data['ref_id']))
847  {
848  $this->__renderUserItem($item_data,$level+1);
849  }
850  }
851  }
_getTypicalLearningTimeSeconds($a_rbac_id, $a_obj_id=0)
$_GET["client_id"]
class ilTimingPlaned
const IL_CAL_UNIX
_secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
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...
Class for single dates.
static getTimingsAdministrationItems($a_parent_id)
Get (sub) item data for timings administration view (active/inactive)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static hasChangeableTimings($a_ref_id)
Check if there is any active changeable timing (in subtree)
static formatDate(ilDateTime $date)
Format a date public.
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __setSubTabs()

ilCourseContentGUI::__setSubTabs ( )

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

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

1281  {
1282  if($this->container_obj->getType() == 'crs')
1283  {
1284  $this->container_gui->setContentSubTabs();
1285  }
1286  }
+ Here is the caller graph for this function:

◆ __showTimingsPanel()

ilCourseContentGUI::__showTimingsPanel ( )

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

References $_SESSION.

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

1096  {
1097  global $ilAccess;
1098 
1099  if(!$ilAccess->checkAccess('write','',$this->container_obj->getRefId()))
1100  {
1101  return true;
1102  }
1103 
1104  if(!$_SESSION['crs_timings_panel'][$this->course_obj->getId()])
1105  {
1106  $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
1107  $this->tpl->setCurrentBlock("btn_cell");
1108  $this->tpl->setVariable("BTN_LINK",$this->ctrl->getLinkTarget($this,'timingsOn'));
1109  $this->tpl->setVariable("BTN_TXT",$this->lng->txt("timings_timings_on"));
1110  $this->tpl->parseCurrentBlock();
1111  }
1112  else
1113  {
1114  $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
1115  $this->tpl->setCurrentBlock("btn_cell");
1116  $this->tpl->setVariable("BTN_LINK",$this->ctrl->getLinkTarget($this,'timingsOff'));
1117  $this->tpl->setVariable("BTN_TXT",$this->lng->txt("timings_timings_off"));
1118  $this->tpl->parseCurrentBlock();
1119  }
1120  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the caller graph for this function:

◆ __showUserAcceptanceTable()

ilCourseContentGUI::__showUserAcceptanceTable ( )

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

References $ilUser.

Referenced by __editAdvancedUserTimings(), and __editUserTimings().

630  {
631  global $ilUser;
632 
633  include_once 'Modules/Course/classes/Timings/class.ilTimingAccepted.php';
634  $accept_obj = new ilTimingAccepted($this->course_obj->getId(),$ilUser->getId());
635 
636  $this->tpl->setVariable("REMARK",$accept_obj->getRemark());
637  $this->tpl->setVariable("ACCEPT_CHECKED",$accept_obj->isAccepted() ? 'checked="checked"' : '');
638  $this->tpl->setVariable("TUTOR_CHECKED",$accept_obj->isVisible() ? 'checked="checked"' : '');
639 
640  $this->tpl->setVariable("TIMING_ACCEPT",$this->lng->txt('timing_accept_table'));
641  $this->tpl->setVariable("TXT_ACCEPT",$this->lng->txt('timing_user_accept'));
642  $this->tpl->setVariable("TXT_REMARK",$this->lng->txt('timing_remark'));
643  $this->tpl->setVariable("TXT_TUTOR",$this->lng->txt('timing_tutor_visible'));
644  $this->tpl->setVariable("TXT_BTN_UPDATE",$this->lng->txt('save'));
645  }
class ilTimingAccepted
global $ilUser
Definition: imgupload.php:15
+ Here is the caller graph for this function:

◆ __toUnix()

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

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

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

1307  {
1308  return gmmktime($time['h'],$time['m'],0,$date['m'],$date['d'],$date['y']);
1309  }
+ Here is the caller graph for this function:

◆ editTimings()

ilCourseContentGUI::editTimings ( )

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

References $_POST, $ilErr, __loadFromPost(), __prepareDateSelect(), __showTimingsPanel(), __toUnix(), ilFrameTargetInfo\_getFrame(), ilLink\_getLink(), ilMDEducational\_getTypicalLearningTimeSeconds(), 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().

470  {
471  global $ilAccess,$ilErr;
472 
473  include_once 'Services/MetaData/classes/class.ilMDEducational.php';
474  include_once './Services/Link/classes/class.ilLink.php';
475 
476  $this->lng->loadLanguageModule('meta');
477 
478  if(!$ilAccess->checkAccess('write','',$this->container_obj->getRefId()))
479  {
480  $ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$ilErr->WARNING);
481  }
482  $this->__showTimingsPanel();
483  $this->tabs_gui->setSubTabActive('timings_timings');
484 
485  include_once 'Services/Object/classes/class.ilObjectActivation.php';
486  $this->cont_arr = ilObjectActivation::getTimingsAdministrationItems($this->container_obj->getRefId());
487 
488  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.crs_edit_items.html','Modules/Course');
489  $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
490  $this->tpl->setVariable("HEADER_IMG",ilUtil::getImagePath('icon_crs.png'));
491  $this->tpl->setVariable("HEADER_ALT",$this->lng->txt('crs_materials'));
492  $this->tpl->setVariable("BLOCK_HEADER_CONTENT",$this->lng->txt('edit_timings_list'));
493  $this->tpl->setVariable("TXT_TITLE",$this->lng->txt('title'));
494 
495 
496  $this->tpl->setVariable("TXT_DURATION",$this->lng->txt('crs_timings_time_frame'));
497  $this->tpl->setVariable("TXT_INFO_DURATION",$this->lng->txt('crs_timings_in_days'));
498 
499  $this->tpl->setVariable("TXT_START_END",$this->lng->txt('crs_timings_short_start_end'));
500  $this->tpl->setVariable("TXT_INFO_START_END",$this->lng->txt('crs_timings_start_end_info'));
501 
502  $this->tpl->setVariable("TXT_CHANGEABLE",$this->lng->txt('crs_timings_short_changeable'));
503 
504  $this->tpl->setVariable("TXT_INFO_LIMIT",$this->lng->txt('crs_timings_from_until'));
505  $this->tpl->setVariable("TXT_LIMIT",$this->lng->txt('crs_timings_short_limit_start_end'));
506  $this->tpl->setVariable("TXT_ACTIVE",$this->lng->txt('crs_timings_short_active'));
507  $this->tpl->setVariable("TXT_INFO_ACTIVE",$this->lng->txt('crs_timings_info_active'));
508 
509  $counter = 0;
510  foreach($this->cont_arr as $item)
511  {
512  if($item['type'] == 'itgr')
513  {
514  continue;
515  }
516  $item = $this->__loadFromPost($item);
517  $item_prefix = "item[$item[ref_id]]";
518  $item_change_prefix = "item_change[$item[ref_id]]";
519  $item_active_prefix = "item_active[$item[ref_id]]";
520 
521  if($item['type'] == 'grp' or
522  $item['type'] == 'fold')
523  {
524  $this->tpl->setVariable("TITLE_LINK",ilLink::_getLink($item['ref_id'],$item['type']));
525  $this->tpl->setVariable("TITLE_FRAME",ilFrameTargetInfo::_getFrame('MainContent',$item['type']));
526  $this->tpl->setVariable("TITLE_LINK_NAME",$item['title']);
527  }
528  else
529  {
530  $this->tpl->setVariable("TITLE",$item['title']);
531  }
532 
533  if(strlen($item['description']))
534  {
535  $this->tpl->setCurrentBlock("item_description");
536  $this->tpl->setVariable("DESC",$item['description']);
537  $this->tpl->parseCurrentBlock();
538  }
539 
540  if($tlt = ilMDEducational::_getTypicalLearningTimeSeconds($item['obj_id']))
541  {
542  $this->tpl->setCurrentBlock("tlt");
543  $this->tpl->setVariable("TXT_TLT",$this->lng->txt('meta_typical_learning_time'));
544  $this->tpl->setVariable("TLT_VAL",ilFormat::_secondsToString($tlt));
545  $this->tpl->parseCurrentBlock();
546  }
547 
548  $this->tpl->setCurrentBlock("container_standard_row");
549 
550  // Suggested
551  if(is_array($_POST['item']["$item[ref_id]"]['sug_start']))
552  {
553  $start = $this->__toUnix($_POST['item']["$item[ref_id]"]['sug_start']);
554  }
555  else
556  {
557  $start = $item['suggestion_start'];
558  }
559  $end = $item['suggestion_end'];
560  $date = $this->__prepareDateSelect($start);
561  $this->tpl->setVariable("SUG_START",
562  ilUtil::makeDateSelect($item_prefix."[sug_start]",
563  $date['y'],$date['m'],$date['d'],date('Y',time()),false));
564 
565  $this->tpl->setVariable("NAME_DURATION_A",$item_prefix."[duration_a]");
566  if(isset($_POST['item']["$item[ref_id]"]['duration_a']))
567  {
568  $this->tpl->setVariable("VAL_DURATION_A",abs($_POST['item']["$item[ref_id]"]['duration_a']));
569  }
570  else
571  {
572  $this->tpl->setVariable("VAL_DURATION_A",intval(($end-$start)/(60*60*24)));
573  }
574 
575  $this->tpl->setVariable('SUG_END',ilDatePresentation::formatDate(new ilDate($item['suggestion_end'],IL_CAL_UNIX)));
576 
577  // Limit
578  if(is_array($_POST['item']["$item[ref_id]"]['lim_end']))
579  {
580  $end = $this->__toUnix($_POST['item']["$item[ref_id]"]['lim_end']);
581  }
582  else
583  {
584  $end = $item['latest_end'];
585  }
586 
587  $date = $this->__prepareDateSelect($end);
588  $this->tpl->setVariable("LIM_END",
589  ilUtil::makeDateSelect($item_prefix."[lim_end]",
590  $date['y'],$date['m'],$date['d'],date('Y',time()),false));
591 
592  $this->tpl->setVariable("NAME_CHANGE",$item_change_prefix."[change]");
593  $this->tpl->setVariable("NAME_ACTIVE",$item_active_prefix."[active]");
594 
595  if(isset($_POST['item']))
596  {
597  $change = $_POST['item_change']["$item[ref_id]"]['change'];
598  $active = $_POST['item_active']["$item[ref_id]"]['active'];
599  }
600  else
601  {
602  $change = $item['changeable'];
603  $active = ($item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING);
604  }
605 
606  $this->tpl->setVariable("CHECKED_ACTIVE",$active ? 'checked="checked"' : '');
607  $this->tpl->setVariable("CHECKED_CHANGE",$change ? 'checked="checked"' : '');
608 
609  if(isset($this->failed["$item[ref_id]"]))
610  {
611  $this->tpl->setVariable("ROWCLASS",'tblrowmarked');
612  }
613  else
614  {
615  $this->tpl->setVariable("ROWCLASS",ilUtil::switchColor($counter++,'tblrow1','tblrow2'));
616  }
617  $this->tpl->parseCurrentBlock();
618  }
619 
620  // Select all
621  $this->tpl->setVariable("CHECKCLASS",ilUtil::switchColor($counter++,'tblrow1','tblrow2'));
622  $this->tpl->setVariable("SELECT_ALL",$this->lng->txt('select_all'));
623 
624  $this->tpl->setVariable("BTN_SAVE",$this->lng->txt('save'));
625  $this->tpl->setVariable("BTN_CANCEL",$this->lng->txt('cancel'));
626 
627  }
__toUnix($date, $time=array())
$_POST['username']
Definition: cron.php:12
_getTypicalLearningTimeSeconds($a_rbac_id, $a_obj_id=0)
const IL_CAL_UNIX
_secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
Class for single dates.
static getTimingsAdministrationItems($a_parent_id)
Get (sub) item data for timings administration view (active/inactive)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static formatDate(ilDateTime $date)
Format a date public.
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 _getFrame($a_class, $a_type='')
Get content frame name.
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editUserTimings()

ilCourseContentGUI::editUserTimings ( )

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

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

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

662  {
663  if($_SESSION['crs_timings_panel'][$this->course_obj->getId()])
664  {
665  return $this->editTimings();
666  }
667  global $ilAccess,$ilErr;
668 
669  if(!$ilAccess->checkAccess('read','',$this->container_obj->getRefId()))
670  {
671  $ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$ilErr->WARNING);
672  }
673  $this->tabs_gui->setSubTabActive('timings_timings');
674 
675  $_SESSION['crs_timings_user_hidden'] = isset($_GET['show_details']) ? $_GET['show_details'] : $_SESSION['crs_timings_user_hidden'];
676 
677  include_once 'Services/Object/classes/class.ilObjectActivation.php';
678  if(ilObjectActivation::hasChangeableTimings($this->course_obj->getRefId()))
679  {
680  $this->__editAdvancedUserTimings();
681  }
682  else
683  {
684  $this->__editUserTimings();
685  }
686  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_GET["client_id"]
static hasChangeableTimings($a_ref_id)
Check if there is any active changeable timing (in subtree)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

& ilCourseContentGUI::executeCommand ( )

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

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

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':
66  $this->__forwardToArchivesGUI();
67  break;
68 
69  case 'ilcourseobjectivepresentationgui':
70  $this->view(); // forwarding moved to getCenterColumnHTML()
71  break;
72 
73  case "ilcolumngui":
74  $ilCtrl->saveParameterByClass("ilcolumngui", "col_return");
75  $ilTabs->setSubTabActive("crs_content");
76  $this->view();
77  break;
78 
79  default:
80  if(!$this->__checkStartObjects())
81  {
82  $this->showStartObjects();
83  break;
84  }
85 
86  // forward if archives enabled and not tutor
87  if(!$this->is_tutor = $ilAccess->checkAccess('write','',$this->course_obj->getRefId()) and
88  $this->course_obj->isArchived())
89  {
90  $this->__forwardToArchivesGUI();
91  break;
92  }
93 
94  // forward to objective presentation
95  if((!$this->is_tutor and
96  $this->container_obj->getType() == 'crs' and
97  $this->container_obj->enabledObjectiveView()) ||
98  $_GET["col_return"] == "objectives")
99  {
100  $this->use_objective_presentation = true;
101  $this->view();
102  //$this->__forwardToObjectivePresentation();
103  break;
104  }
105 
106 
107  if(!$cmd)
108  {
109  $cmd = $this->__getDefaultCommand();
110  }
111  $this->$cmd();
112  break;
113  }
114  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
view()
Output course content.
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ getRightColumnHTML()

ilCourseContentGUI::getRightColumnHTML ( )

Display right column.

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

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

Referenced by view().

332  {
333  global $ilUser, $lng, $ilCtrl, $ilAccess;
334 
335  if ($ilCtrl->getNextClass() == "ilcourseobjectivepresentationgui")
336  {
337  $ilCtrl->setParameterByClass("ilcolumngui", "col_return", "objectives");
338  }
339  $ilCtrl->saveParameterByClass("ilcolumngui", "col_return");
340 
341  $obj_id = ilObject::_lookupObjId($this->container_obj->getRefId());
342  $obj_type = ilObject::_lookupType($obj_id);
343 
344  include_once("Services/Block/classes/class.ilColumnGUI.php");
345  $column_gui = new ilColumnGUI($obj_type, IL_COL_RIGHT);
346 
347  if ($column_gui->getScreenMode() == IL_SCREEN_FULL)
348  {
349  return "";
350  }
351 
352  $this->setColumnSettings($column_gui);
353 
354  if ($ilCtrl->getNextClass() == "ilcolumngui" &&
355  $column_gui->getCmdSide() == IL_COL_RIGHT &&
356  $column_gui->getScreenMode() == IL_SCREEN_SIDE)
357  {
358 
359  $html = $ilCtrl->forwardCommand($column_gui);
360  }
361  else
362  {
363  if (!$ilCtrl->isAsynch())
364  {
365  $html = $ilCtrl->getHTML($column_gui);
366  }
367  }
368 
369  return $html;
370  }
const IL_COL_RIGHT
global $ilCtrl
Definition: ilias.php:18
const IL_SCREEN_FULL
Column user interface class.
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
global $ilUser
Definition: imgupload.php:15
const IL_SCREEN_SIDE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilCourseContentGUI()

ilCourseContentGUI::ilCourseContentGUI ( $container_gui_obj)

Constructor public.

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

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

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  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ returnToMembers()

ilCourseContentGUI::returnToMembers ( )

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

689  {
690  $this->ctrl->returnToParent($this);
691  }

◆ saveAcceptance()

ilCourseContentGUI::saveAcceptance ( )

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

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

647  {
648  global $ilUser;
649 
650  include_once 'Modules/Course/classes/Timings/class.ilTimingAccepted.php';
651  $accept_obj = new ilTimingAccepted($this->course_obj->getId(),$ilUser->getId());
652 
653  $accept_obj->setRemark(ilUtil::stripSlashes($_POST['remark']));
654  $accept_obj->accept($_POST['accepted']);
655  $accept_obj->setVisible($_POST['tutor']);
656  $accept_obj->update();
657  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
658  $this->editUserTimings();
659  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
class ilTimingAccepted
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ setColumnSettings()

ilCourseContentGUI::setColumnSettings (   $column_gui)

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

References $lng, and ilObjectActivation\getItems().

Referenced by __forwardToColumnGUI(), and getRightColumnHTML().

373  {
374  global $ilAccess, $lng;
375 
376  $column_gui->setRepositoryMode(true);
377  $column_gui->setEnableEdit(false);
378  $column_gui->setBlockProperty("news", "title",
379  $lng->txt("crs_news"));
380 
381  include_once "Services/Object/classes/class.ilObjectActivation.php";
382  $grouped_items = array();
383  foreach(ilObjectActivation::getItems($this->container_obj->getRefId()) as $item)
384  {
385  $grouped_items[$item["type"]][] = $item;
386  }
387 
388  $column_gui->setRepositoryItems($grouped_items);
389  if ($ilAccess->checkAccess("write", "", $this->container_obj->getRefId()))
390  {
391  $column_gui->setEnableEdit(true);
392  }
393 
394  // Allow movement of blocks for tutors
395  if ($this->is_tutor &&
396  $this->container_gui->isActiveAdministrationPanel())
397  {
398  $column_gui->setEnableMovement(true);
399  }
400 
401  // Configure Settings, if administration panel is on
402  if ($this->is_tutor)
403  {
404  $column_gui->setBlockProperty("news", "settings", true);
405  //$column_gui->setBlockProperty("news", "public_notifications_option", true);
406  $column_gui->setBlockProperty("news", "default_visibility_option", true);
407  $column_gui->setBlockProperty("news", "hide_news_block_option", true);
408  }
409 
410  if ($this->container_gui->isActiveAdministrationPanel())
411  {
412  $column_gui->setAdminCommands(true);
413  }
414  }
static getItems($a_parent_id, $a_with_list_data=true)
Get sub item data.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showStartObjects()

ilCourseContentGUI::showStartObjects ( )

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

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

Referenced by executeCommand().

185  {
186  include_once './Modules/Course/classes/class.ilCourseLMHistory.php';
187  include_once './Services/Repository/classes/class.ilRepositoryExplorer.php';
188  include_once './Services/Link/classes/class.ilLink.php';
189 
190  global $rbacsystem,$ilias,$ilUser,$ilAccess,$ilObjDataCache;
191 
192  $this->tabs_gui->setSubTabActive('crs_content');
193 
194  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_start_view.html",'Modules/Course');
195  $this->tpl->setVariable("INFO_STRING",$this->lng->txt('crs_info_start'));
196  $this->tpl->setVariable("TBL_TITLE_START",$this->lng->txt('crs_table_start_objects'));
197  $this->tpl->setVariable("HEADER_NR",$this->lng->txt('crs_nr'));
198  $this->tpl->setVariable("HEADER_DESC",$this->lng->txt('description'));
199  $this->tpl->setVariable("HEADER_EDITED",$this->lng->txt('crs_objective_accomplished'));
200 
201 
202  $lm_continue =& new ilCourseLMHistory($this->course_obj->getRefId(),$ilUser->getId());
203  $continue_data = $lm_continue->getLMHistory();
204 
205  $counter = 0;
206  foreach($this->start_obj->getStartObjects() as $start)
207  {
208  $obj_id = $ilObjDataCache->lookupObjId($start['item_ref_id']);
209  $ref_id = $start['item_ref_id'];
210  $type = $ilObjDataCache->lookupType($obj_id);
211 
213 
214  $obj_link = ilLink::_getLink($ref_id,$type);
216  $obj_frame = $obj_frame ? $obj_frame : '';
217 
218  // Tmp fix for tests
219  $obj_frame = $type == 'tst' ? '' : $obj_frame;
220 
221  $contentObj = false;
222 
223  if($ilAccess->checkAccess('read','',$ref_id))
224  {
225  $this->tpl->setCurrentBlock("start_read");
226  $this->tpl->setVariable("READ_TITLE_START",$ilObjDataCache->lookupTitle($obj_id));
227  $this->tpl->setVariable("READ_TARGET_START",$obj_frame);
228  $this->tpl->setVariable("READ_LINK_START", $obj_link.'&crs_show_result='.$this->course_obj->getRefId());
229  $this->tpl->parseCurrentBlock();
230  }
231  else
232  {
233  $this->tpl->setCurrentBlock("start_visible");
234  $this->tpl->setVariable("VISIBLE_LINK_START",$ilObjDataCache->lookupTitle($obj_id));
235  $this->tpl->parseCurrentBlock();
236  }
237 
238  // CONTINUE LINK
239  if(isset($continue_data[$ref_id]))
240  {
241  $this->tpl->setCurrentBlock("link");
242  $this->tpl->setVariable("LINK_HREF",ilLink::_getLink($ref_id,'',array('obj_id',
243  $continue_data[$ref_id]['lm_page_id'])));
244  #$this->tpl->setVariable("CONTINUE_LINK_TARGET",$target);
245  $this->tpl->setVariable("LINK_NAME",$this->lng->txt('continue_work'));
246  $this->tpl->parseCurrentBlock();
247  }
248 
249  // add to desktop link
250  if(!$ilUser->isDesktopItem($ref_id,$type) and
251  $this->course_obj->getAboStatus())
252  {
253  if ($ilAccess->checkAccess('read','',$ref_id))
254  {
255  $this->tpl->setCurrentBlock("link");
256  $this->ctrl->setParameterByClass(get_class($this->container_gui),'item_ref_id',$ref_id);
257  $this->ctrl->setParameterByClass(get_class($this->container_gui),'item_id',$ref_id);
258  $this->ctrl->setParameterByClass(get_class($this->container_gui),'type',$type);
259 
260  $this->tpl->setVariable("LINK_HREF",$this->ctrl->getLinkTarget($this->container_gui,'addToDesk'));
261  $this->tpl->setVariable("LINK_NAME", $this->lng->txt("to_desktop"));
262  $this->tpl->parseCurrentBlock();
263  }
264  }
265  elseif($this->course_obj->getAboStatus())
266  {
267  $this->tpl->setCurrentBlock("link");
268  $this->ctrl->setParameterByClass(get_class($this->container_gui),'item_ref_id',$ref_id);
269  $this->ctrl->setParameterByClass(get_class($this->container_gui),'item_id',$ref_id);
270  $this->ctrl->setParameterByClass(get_class($this->container_gui),'type',$type);
271 
272  $this->tpl->setVariable("LINK_HREF",$this->ctrl->getLinkTarget($this->container_gui,'removeFromDesk'));
273  $this->tpl->setVariable("LINK_NAME", $this->lng->txt("unsubscribe"));
274  $this->tpl->parseCurrentBlock();
275  }
276 
277 
278  // Description
279  if(strlen($ilObjDataCache->lookupDescription($obj_id)))
280  {
281  $this->tpl->setCurrentBlock("start_description");
282  $this->tpl->setVariable("DESCRIPTION_START",$ilObjDataCache->lookupDescription($obj_id));
283  $this->tpl->parseCurrentBlock();
284  }
285 
286 
287  if($this->start_obj->isFullfilled($ilUser->getId(),$ref_id))
288  {
289  $accomplished = 'accomplished';
290  }
291  else
292  {
293  $accomplished = 'not_accomplished';
294  }
295  $this->tpl->setCurrentBlock("start_row");
296  $this->tpl->setVariable("EDITED_IMG",ilUtil::getImagePath('crs_'.$accomplished.'.png'));
297  $this->tpl->setVariable("EDITED_ALT",$this->lng->txt('crs_objective_'.$accomplished));
298  $this->tpl->setVariable("ROW_CLASS",'option_value');
299  $this->tpl->setVariable("ROW_CLASS_CENTER",'option_value_center');
300  $this->tpl->setVariable("OBJ_NR_START",++$counter.'.');
301  $this->tpl->parseCurrentBlock();
302  }
303  return true;
304  }
_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
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
STATIC, do not use $this inside!
global $ilUser
Definition: imgupload.php:15
class ilCourseLMHistory
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showUserTimings()

ilCourseContentGUI::showUserTimings ( )

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

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

694  {
695  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.crs_user_timings.html','Modules/Course');
696  $this->tabs_gui->clearSubTabs();
697  $this->tabs_gui->setTabActive('members');
698 
699  if(!$_GET['member_id'])
700  {
701  ilUtil::sendFailure($this->lng->txt('no_checkbox'),true);
702  $this->ctrl->returnToParent($this);
703  }
704 
705 
706  // Back button
707  $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
708  $this->tpl->setCurrentBlock("btn_cell");
709  $this->tpl->setVariable("BTN_LINK",$this->ctrl->getLinkTarget($this,'returnToMembers'));
710  $this->tpl->setVariable("BTN_TXT",$this->lng->txt("back"));
711  $this->tpl->parseCurrentBlock();
712 
713  include_once 'Modules/Course/classes/Timings/class.ilTimingAccepted.php';
714  $usr_accepted = new ilTimingAccepted($this->course_obj->getId(),(int) $_GET['member_id']);
715 
716  if($usr_accepted->isAccepted())
717  {
718  $this->tpl->setVariable("ACC_IMG",ilUtil::getImagePath('icon_ok.png'));
719  $this->tpl->setVariable("ACC_ALT",$this->lng->txt('timing_accepted'));
720  }
721  else
722  {
723  $this->tpl->setVariable("ACC_IMG",ilUtil::getImagePath('icon_not_ok.png'));
724  $this->tpl->setVariable("ACC_ALT",$this->lng->txt('timing_not_accepted'));
725  }
726  if($usr_accepted->isVisible() and strlen($usr_accepted->getRemark()))
727  {
728  $this->tpl->setVariable("REMARK",nl2br($usr_accepted->getRemark()));
729  }
730  else
731  {
732  $this->tpl->setVariable("REMARK",$this->lng->txt('not_available'));
733  }
734 
735  $this->tpl->setVariable("TIMING_ACCEPT",$this->lng->txt('timing_accept_table'));
736  $this->tpl->setVariable("TXT_ACCEPTED",$this->lng->txt('timing_user_accepted'));
737  $this->tpl->setVariable("TXT_REMARK",$this->lng->txt('timing_remark'));
738 
739  $this->tpl->setVariable("HEADER_IMG",ilUtil::getImagePath('icon_usr.png'));
740  $this->tpl->setVariable("HEADER_ALT",$this->lng->txt('obj_usr'));
741  $this->tpl->setVariable("TABLE_HEADER",$this->lng->txt('timings_of'));
742  $name = ilObjUser::_lookupName($_GET['member_id']);
743  $this->tpl->setVariable("USER_NAME",$name['lastname'].', '.$name['firstname']);
744 
745  $this->tpl->setVariable("TXT_TITLE",$this->lng->txt('title'));
746  $this->tpl->setVariable("TXT_START_END",$this->lng->txt('crs_timings_short_start_end'));
747  $this->tpl->setVariable("TXT_INFO_START_END",$this->lng->txt('crs_timings_start_end_info'));
748  $this->tpl->setVariable("TXT_CHANGED",$this->lng->txt('crs_timings_changed'));
749  $this->tpl->setVariable("TXT_OWN_PRESETTING",$this->lng->txt('crs_timings_planed_start'));
750  $this->tpl->setVariable("TXT_INFO_OWN_PRESETTING",$this->lng->txt('crs_timings_from_until'));
751 
752  include_once 'Services/Object/classes/class.ilObjectActivation.php';
753  $items = ilObjectActivation::getTimingsAdministrationItems($this->course_obj->getRefId());
754  foreach($items as $item)
755  {
756  if(($item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING) or
758  {
759  $this->__renderUserItem($item,0);
760  }
761  }
762  }
static _lookupName($a_user_id)
lookup user name
$_GET["client_id"]
static getTimingsAdministrationItems($a_parent_id)
Get (sub) item data for timings administration view (active/inactive)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static hasChangeableTimings($a_ref_id)
Check if there is any active changeable timing (in subtree)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
class ilTimingAccepted
+ Here is the call graph for this function:

◆ timingsOff()

ilCourseContentGUI::timingsOff ( )

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

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

1133  {
1134  global $ilTabs;
1135  $_SESSION['crs_timings_panel'][$this->course_obj->getId()] = 0;
1136 
1137  $ilTabs->clearSubTabs();
1138  $this->__setSubTabs();
1139  $this->editUserTimings();
1140  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the call graph for this function:

◆ timingsOn()

ilCourseContentGUI::timingsOn ( )

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

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

1123  {
1124  global $ilTabs;
1125  $_SESSION['crs_timings_panel'][$this->course_obj->getId()] = 1;
1126 
1127  $ilTabs->clearSubTabs();
1128  $this->__setSubTabs();
1129  $this->editTimings();
1130  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the call graph for this function:

◆ updateTimings()

ilCourseContentGUI::updateTimings ( )

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

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

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

◆ updateUserTimings()

ilCourseContentGUI::updateUserTimings ( )

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

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

1144  {
1145  global $ilUser,$ilObjDataCache;
1146  include_once 'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
1147 
1148  // Validate
1149  $this->invalid = array();
1150  foreach($_POST['item'] as $ref_id => $data)
1151  {
1152  $tmp_planed = new ilTimingPlaned($ref_id,$ilUser->getId());
1153 
1154  $tmp_planed->setPlanedStartingTime($this->__toUnix($data['own_start']));
1155  if(isset($data['duration']))
1156  {
1157  $data['own_start']['d'] += $data['duration'];
1158  $tmp_planed->setPlanedEndingTime($this->__toUnix($data['own_start'],array('h' => 23,'m' => 55)));
1159  }
1160  else
1161  {
1162  $tmp_planed->setPlanedEndingTime($this->__toUnix($data['own_start']),array('h' => 23,'m' => 55));
1163  }
1164  if(!$tmp_planed->validate())
1165  {
1166  $this->invalid[$ref_id] = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($ref_id));
1167  }
1168  $all_items[] = $tmp_planed;
1169  }
1170  if(count($this->invalid))
1171  {
1172  $message = $this->lng->txt('crs_timings_update_error');
1173  $message .= ("<br />".$this->lng->txt('crs_materials').': ');
1174  $message .= (implode(',',$this->invalid));
1175  ilUtil::sendFailure($message);
1176  $this->editUserTimings();
1177  return false;
1178  }
1179  foreach($all_items as $new_item_obj)
1180  {
1181  $new_item_obj->update();
1182  }
1183  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
1184  $this->editUserTimings();
1185  return true;
1186 
1187  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
__toUnix($date, $time=array())
$_POST['username']
Definition: cron.php:12
class ilTimingPlaned
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $ilUser
Definition: imgupload.php:15
setPlanedStartingTime($a_time)
+ Here is the call graph for this function:

◆ view()

ilCourseContentGUI::view ( )

Output course content.

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

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

Referenced by executeCommand().

310  {
311  // BEGIN ChangeEvent: record read event.
312  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
313  global $ilUser;
314  $obj_id = ilObject::_lookupObjId($this->container_obj->getRefId());
316  $this->container_obj->getType(), $this->container_obj->getRefId(),
317  $obj_id, $ilUser->getId());
318  // END ChangeEvent: record read event.
319 
320  $this->getCenterColumnHTML();
321 
322  if (!$this->no_right_column)
323  {
324  $this->tpl->setRightContent($this->getRightColumnHTML());
325  }
326  }
getRightColumnHTML()
Display right column.
getCenterColumnHTML()
Get center column.
static _lookupObjId($a_id)
_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.
global $ilUser
Definition: imgupload.php:15
+ 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: