ILIAS  release_4-3 Revision
 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("./Services/Object/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" => "listAssignments", "lang_var" => "edit_assignments"),
37  array("permission" => "write", "cmd" => "edit", "lang_var" => "settings")
38  );
39 
40  return $commands;
41  }
42 
44  {
45  global $ilDB, $lng;
46 
47  $q = "SELECT MIN(time_stamp) mtime FROM exc_assignment WHERE exc_id = ".
48  $ilDB->quote($a_obj_id, "integer").
49  " AND time_stamp > ".$ilDB->quote(time(), "integer");
50  $set = $ilDB->query($q);
51  $rec = $ilDB->fetchAssoc($set);
52 
53 /* if ($rec["time_stamp"] - time() <= 0)
54  {
55  $time_str = $lng->txt("exc_time_over_short");
56  }
57  else
58  {*/
59  if ($rec["mtime"] > 0)
60  {
61  $time_diff = ilUtil::int2array($rec["mtime"] - time(), null);
62  $time_str = ilUtil::timearray2string($time_diff);
63  }
64  return $time_str;
65  }
66 
70  function _checkGoto($a_target)
71  {
72  global $ilAccess;
73 
74  $t_arr = explode("_", $a_target);
75 
76  if ($t_arr[0] != "exc" || ((int) $t_arr[1]) <= 0)
77  {
78  return false;
79  }
80 
81  if ($ilAccess->checkAccess("read", "", $t_arr[1]))
82  {
83  return true;
84  }
85  return false;
86  }
87 }
88 
89 ?>