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

survey/classes/class.ilObjSurveyListGUI.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 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 
00036 include_once "classes/class.ilObjectListGUI.php";
00037 include_once "./survey/classes/inc.SurveyConstants.php";
00038 
00039 class ilObjSurveyListGUI extends ilObjectListGUI
00040 {
00045         function ilObjSurveyListGUI()
00046         {
00047                 $this->ilObjectListGUI();
00048                 $this->info_screen_enabled = true;
00049         }
00050 
00054         function init()
00055         {
00056                 $this->delete_enabled = true;
00057                 $this->cut_enabled = true;
00058                 $this->subscribe_enabled = true;
00059                 $this->link_enabled = true;
00060                 $this->payment_enabled = false;
00061                 $this->type = "svy";
00062                 $this->gui_class_name = "ilobjsurveygui";
00063 
00064                 // general commands array
00065                 include_once('./survey/classes/class.ilObjSurveyAccess.php');
00066                 $this->commands = ilObjSurveyAccess::_getCommands();
00067         }
00068 
00069 
00078         function initItem($a_ref_id, $a_obj_id, $a_title = "", $a_description = "")
00079         {
00080                 parent::initItem($a_ref_id, $a_obj_id, $a_title, $a_description);
00081         }
00082 
00083 
00091         function getCommandFrame($a_cmd)
00092         {
00093                 switch($a_cmd)
00094                 {
00095                         case "":
00096                         case "infoScreen":
00097                         case "evaluation":
00098                                 include_once "./classes/class.ilFrameTargetInfo.php";
00099                                 $frame = ilFrameTargetInfo::_getFrame("MainContent");
00100                                 break;
00101 
00102                         default:
00103                 }
00104 
00105                 return $frame;
00106         }
00107 
00108 
00109 
00118         function getProperties()
00119         {
00120                 global $lng, $ilUser, $rbacsystem;
00121 
00122                 $props = array();
00123 
00124                 if (!$rbacsystem->checkAccess("participate", $this->ref_id))
00125                 {
00126                         return $props;
00127                 }
00128 
00129                 include_once("./survey/classes/class.ilObjSurveyAccess.php");
00130                 if (!ilObjSurveyAccess::_lookupOnline($this->obj_id))
00131                 {
00132                         $props[] = array("alert" => true, "property" => $lng->txt("status"),
00133                                 "value" => $lng->txt("offline"));
00134                 }
00135                 else
00136                 {
00137                         if (!ilObjSurveyAccess::_lookupCreationComplete($this->obj_id))
00138                         {
00139                                 // no completion
00140                                 $props[] = array("alert" => true, "property" => $lng->txt("status"),
00141                                         "value" => $lng->txt("svy_warning_survey_not_complete"));
00142                         }
00143                         else
00144                         {
00145                                 if ($ilUser->getId() != ANONYMOUS_USER_ID)
00146                                 {
00147                                         $finished = ilObjSurveyAccess::_lookupFinished($this->obj_id, $ilUser->id);
00148                 
00149                                         // finished
00150                                         if ($finished === 1)
00151                                         {
00152                                                 $stat = $this->lng->txt("svy_finished");
00153                                         }
00154                                         // not finished
00155                                         else if ($finished === 0)
00156                                         {
00157                                                 $stat = $this->lng->txt("svy_not_finished");
00158                                         }
00159                                         // not started
00160                                         else
00161                                         {
00162                                                 $stat = $this->lng->txt("svy_not_started");
00163                                         }
00164                                         $props[] = array("alert" => false, "property" => $lng->txt("status"),
00165                                                 "value" => $stat);
00166                                 }
00167                         }
00168                 }
00169 
00170                 return $props;
00171         }
00172 
00173 
00181         function getCommandLink($a_cmd)
00182         {
00183                 $cmd_link = "";
00184                 switch ($a_cmd)
00185                 {
00186                         default:
00187                                 $cmd_link = "ilias.php?baseClass=ilObjSurveyGUI&amp;ref_id=" . $this->ref_id .
00188                                         "&amp;cmd=$a_cmd";
00189                                 break;
00190                 }
00191                 // separate method for this line
00192                 return $cmd_link;
00193         }
00194 
00195 
00196 
00197 } // END class.ilObjTestListGUI
00198 ?>

Generated on Fri Dec 13 2013 13:52:15 for ILIAS Release_3_7_x_branch .rev 46817 by  doxygen 1.7.1