ILIAS  Release_4_2_x_branch Revision 61807
 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" => "showOverview", "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 MIN(time_stamp) mtime FROM exc_assignment WHERE exc_id = ".
47  $ilDB->quote($a_obj_id, "integer").
48  " AND time_stamp > ".$ilDB->quote(time(), "integer");
49  $set = $ilDB->query($q);
50  $rec = $ilDB->fetchAssoc($set);
51 
52 /* if ($rec["time_stamp"] - time() <= 0)
53  {
54  $time_str = $lng->txt("exc_time_over_short");
55  }
56  else
57  {*/
58  if ($rec["mtime"] > 0)
59  {
60  $time_diff = ilUtil::int2array($rec["mtime"] - time(), null);
61  $time_str = ilUtil::timearray2string($time_diff);
62  }
63  return $time_str;
64  }
65 
69  function _checkGoto($a_target)
70  {
71  global $ilAccess;
72 
73  $t_arr = explode("_", $a_target);
74 
75  if ($t_arr[0] != "exc" || ((int) $t_arr[1]) <= 0)
76  {
77  return false;
78  }
79 
80  if ($ilAccess->checkAccess("read", "", $t_arr[1]))
81  {
82  return true;
83  }
84  return false;
85  }
86 }
87 
88 ?>