• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Modules/Exercise/classes/class.ilObjExerciseAccess.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2006 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00024 include_once("classes/class.ilObjectAccess.php");
00025 
00035 class ilObjExerciseAccess extends ilObjectAccess
00036 {
00037 
00050         function _getCommands()
00051         {
00052                 $commands = array
00053                 (
00054                         array("permission" => "read", "cmd" => "infoScreen", "lang_var" => "show",
00055                                 "default" => true),
00056                         array("permission" => "write", "cmd" => "edit", "lang_var" => "edit")
00057                 );
00058                 
00059                 return $commands;
00060         }
00061         
00062         function _lookupRemainingWorkingTimeString($a_obj_id)
00063         {
00064                 global $ilDB, $lng;
00065                 
00066                 $q = "SELECT time_stamp FROM exc_data WHERE obj_id = ".
00067                         $ilDB->quote($a_obj_id);
00068                 $set = $ilDB->query($q);
00069                 $rec = $set->fetchRow(DB_FETCHMODE_ASSOC);
00070                 
00071                 if ($rec["time_stamp"] - time() <= 0)
00072                 {
00073                         $time_str = $lng->txt("exc_time_over_short");
00074                 }
00075                 else
00076                 {
00077                         $time_diff = ilUtil::int2array($rec["time_stamp"] - time(), null);
00078                         $time_str = ilUtil::timearray2string($time_diff);
00079                 }
00080                 return $time_str;
00081         }
00082         
00086         function _checkGoto($a_target)
00087         {
00088                 global $ilAccess;
00089                 
00090                 $t_arr = explode("_", $a_target);
00091 
00092                 if ($t_arr[0] != "exc" || ((int) $t_arr[1]) <= 0)
00093                 {
00094                         return false;
00095                 }
00096 
00097                 if ($ilAccess->checkAccess("read", "", $t_arr[1]))
00098                 {
00099                         return true;
00100                 }
00101                 return false;
00102         }
00103 }
00104 
00105 ?>

Generated on Fri Dec 13 2013 17:56:50 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1