ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjExerciseAccess.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("classes/class.ilObjectAccess.php");
5 
16 {
17 
30  function _getCommands()
31  {
32  $commands = array
33  (
34  array("permission" => "read", "cmd" => "infoScreen", "lang_var" => "show",
35  "default" => true),
36  array("permission" => "write", "cmd" => "edit", "lang_var" => "edit")
37  );
38 
39  return $commands;
40  }
41 
43  {
44  global $ilDB, $lng;
45 
46  $q = "SELECT time_stamp FROM exc_data WHERE obj_id = ".
47  $ilDB->quote($a_obj_id, "integer");
48  $set = $ilDB->query($q);
49  $rec = $ilDB->fetchAssoc($set);
50 
51  if ($rec["time_stamp"] - time() <= 0)
52  {
53  $time_str = $lng->txt("exc_time_over_short");
54  }
55  else
56  {
57  $time_diff = ilUtil::int2array($rec["time_stamp"] - time(), null);
58  $time_str = ilUtil::timearray2string($time_diff);
59  }
60  return $time_str;
61  }
62 
66  function _checkGoto($a_target)
67  {
68  global $ilAccess;
69 
70  $t_arr = explode("_", $a_target);
71 
72  if ($t_arr[0] != "exc" || ((int) $t_arr[1]) <= 0)
73  {
74  return false;
75  }
76 
77  if ($ilAccess->checkAccess("read", "", $t_arr[1]))
78  {
79  return true;
80  }
81  return false;
82  }
83 }
84 
85 ?>