removed mods directory from the ATutor codebase
[atutor.git] / mods / photo_album / classes / pa_view.class.php
diff --git a/mods/photo_album/classes/pa_view.class.php b/mods/photo_album/classes/pa_view.class.php
deleted file mode 100644 (file)
index 2c76d48..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-<?php\r
-/*==============================================================\r
-  Photo Album\r
- ==============================================================\r
-  Copyright (c) 2006 by Dylan Cheon & Kelvin Wong\r
-  Institute for Assistive Technology / University of Victoria\r
-  http://www.canassist.ca/                                    \r
-                                                               \r
-  This program is free software. You can redistribute it and/or\r
-  modify it under the terms of the GNU General Public License  \r
-  as published by the Free Software Foundation.                \r
- ==============================================================\r
- */\r
-// $Id:\r
-\r
-/**\r
- * @desc       This file generates the image data and comment data to be displayed in the view page\r
- * @author     Dylan Cheon & Kelvin Wong\r
- * @copyright  2006, Institute for Assistive Technology / University of Victoria \r
- * @link       http://www.canassist.ca/                                    \r
- * @license GNU\r
- */\r
\r
-require_once ('define.php');\r
-require_once ('classes/pa.class.php');\r
-require_once ('include/data_func.php');\r
-require_once ('include/general_func.php');\r
-\r
-/** \r
- * @desc       class View\r
- * @see                class Pa\r
- */\r
-class View extends Pa {\r
-       var $image_id=NOT_SET;\r
-       var $comment_array=Array();\r
-       var $image_array=Array();\r
-       \r
-       /**\r
-        * @desc        class constructor\r
-        */\r
-       function View (){\r
-               parent::init();\r
-               $this->checkImageId();  \r
-               $this->checkAuthority();\r
-               $this->setImage();\r
-               $this->setComments();\r
-       }\r
-       \r
-       /**\r
-        * @desc        This function checks if the image has approved status.  If the image is not set to approved and user is neither admin nor instructor, it redirects user to the index page\r
-        */\r
-       function checkAuthority(){\r
-               $image_array=get_single_data(IMAGE, $this->getVariable('image_id'), parent::getVariable('course_id'));\r
-               if (!(($_SESSION['is_admin']==true) || ($_SESSION['privileges'] > 0))){\r
-                       if ($image_array['status']!=APPROVED){\r
-                               global $msg;\r
-                               $msg->addError('pa_var_unauthorized');\r
-                               redirect('index.php');\r
-                       }\r
-               }\r
-       }\r
-       \r
-       /**\r
-        * @desc        This function checks whether the given image_id exists in the database\r
-        */\r
-       function checkImageId(){\r
-               global $msg;\r
-               if (isset($_GET['image_id'])){\r
-                       if (image_exist(intval($_GET['image_id']), parent::getVariable('course_id'))){\r
-                               $this->setVariable('image_id', intval($_GET['image_id']));\r
-                       } else {\r
-                               $msg->addError('pa_var_unauthorized');\r
-                               redirect('index.php');\r
-                       }\r
-               } else {\r
-                       $msg->addError('pa_var_unauthorized');\r
-                       redirect ('index.php');\r
-               }\r
-       }\r
-       \r
-       /**\r
-        * @desc        This function sets the string to a value\r
-        * @param       String  $string         string name to set up\r
-        * @param       mixed   $value          string value\r
-        */\r
-       function setVariable($string, $value){\r
-         switch ($string){\r
-           case 'image_id':\r
-                       if (is_int($value) && ($value > 0)){\r
-                          $this->{$string}=$value;\r
-                       } else {\r
-                         parent::storeError("string ".$string." is not integer");\r
-                       }\r
-               break;  \r
-         }\r
-       }\r
-       \r
-       /**\r
-        * @desc        This function sets the image array\r
-        */\r
-       function setImage(){\r
-               $this->image_array=&get_single_data(IMAGE, $this->getVariable('image_id'), parent::getVariable('course_id'));\r
-       }\r
-       \r
-       /**\r
-        * @desc        This function sets the comment array \r
-        */\r
-       function setComments(){\r
-               $this->comment_array=&get_comment_array(ADMIN_VIEW, $this->getVariable('course_id'), NOT_SET, $this->getVariable('image_id'));  \r
-       }       \r
-}
\ No newline at end of file