removed mods directory from the ATutor codebase
[atutor.git] / mods / photo_album / classes / pa_mycomment.class.php
diff --git a/mods/photo_album/classes/pa_mycomment.class.php b/mods/photo_album/classes/pa_mycomment.class.php
deleted file mode 100644 (file)
index 84ec777..0000000
+++ /dev/null
@@ -1,141 +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 comment data for the mycomment mode\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/general_func.php');\r
-require_once ('include/data_func.php');\r
-\r
-/** \r
- * @desc       Mycomment class.  \r
- * @see                Pa\r
- */\r
\r
-class Mycomment extends Pa{\r
-       var $mode=POSTED_NEW;\r
-       var $comment_array=Array();\r
-       var $page_array=Array();\r
-       var $current_page=-1;\r
-       var $show_page_left_buttons=false;\r
-       var $show_page_right_buttons=false;\r
-       var $total=NOT_SET;\r
-       var $last_page=NOT_SET;\r
-       \r
-       /** \r
-        * @desc        constructor\r
-        */\r
-       function Mycomment(){\r
-               parent::init();\r
-               $this->setMode();\r
-               $this->checkCurrentPage();\r
-               $this->setComments();\r
-               $this->setPages();\r
-       \r
-       }\r
-       \r
-       /**\r
-        * @desc        This function decides whether to display left arrow and right arrow buttons in the page table\r
-        */\r
-       function setPages(){\r
-               $temp=get_page_array(MYCOMMENT_NUMBER_OF_COMMENT, MYCOMMENT_NUMBER_OF_COMMENT_PAGE, $this->getVariable('current_page'), $this->getVariable('last_page'));\r
-               $current=$this->getVariable('current_page');\r
-               if ($current > 1){\r
-                       $this->setVariable('show_page_left_buttons', true);\r
-               } \r
-               if ($current < $temp['last_page']){\r
-                       $this->setVariable('show_page_right_buttons', true);\r
-               }\r
-               $this->page_array=&$temp;\r
-               \r
-       }       \r
-       \r
-       /**\r
-        * @desc        This function sets the mode value for the comments displayed.  The mode value can be one of POSTED_NEW, APPROVED, DISAPPROVED\r
-        */\r
-       function setMode(){\r
-               if (isset($_GET['mode'])){\r
-                       $this->setVariable('mode', intval($_GET['mode']));\r
-               } \r
-       }\r
-       \r
-       /**\r
-        * @desc        This function checks the current page is valid.  Otherwise, the current page is 1\r
-        */\r
-       function checkCurrentPage(){\r
-               $total=get_total_comment_number(MY_COMMENT, $this->getVariable('course_id'), $this->getVariable('mode'));\r
-               $last_page=get_last_page(MYCOMMENT_NUMBER_OF_COMMENT, $total);\r
-               $this->setVariable('total', $total);\r
-               $this->setVariable('last_page', $last_page);\r
-               \r
-               if (!isset($_GET['current_page'])){\r
-                       $this->setVariable('current_page', FIRST_PAGE);\r
-               } else {\r
-                       $current_page=to_pos_int($_GET['current_page']);\r
-                       if ($current_page > $last_page){\r
-                               $this->setVariable('current_page',$last_page);\r
-                       } else {\r
-                               $this->setVariable('current_page', $current_page);\r
-                       }\r
-               }\r
-       }\r
-       \r
-       /**\r
-        * @desc        This function sets the comment array\r
-        */\r
-       function setComments(){\r
-               $array=get_comment_array(MY_COMMENT, parent::getVariable('course_id'), $this->getVariable('mode'), NOT_SET, MYCOMMENT_NUMBER_OF_COMMENT, $this->getVariable('current_page'));\r
-               $this->comment_array=&$array;\r
-       }\r
-                       \r
-       /**\r
-        * @desc        This function sets the given string value for the class object\r
-        * @param       String  $string         string name to set\r
-        * @param       mixed   $value          string value\r
-        */\r
-       function setVariable($string, $value){\r
-               switch ($string){\r
-                       case 'mode':\r
-                               if ($value==APPROVED || $value==DISAPPROVED || $value==POSTED_NEW){\r
-                                       $this->{$string}=$value;\r
-                               }\r
-                       break;\r
-                       case 'current_page':\r
-                       case 'last_page':\r
-                       case 'total':\r
-                               if (is_int($value)){\r
-                                       $this->{$string}=$value;\r
-                               } else {\r
-                                       parent::storeError("value ".$string." is not integer");\r
-                               }\r
-                       break;\r
-                       case 'show_page_left_buttons':\r
-                       case 'show_page_right_buttons':\r
-                               if (is_bool($value)){\r
-                                       $this->{$string}=$value;\r
-                               } else {\r
-                                       parent::storeError("value ".$string." is not boolean");\r
-                               }\r
-                       break;\r
-               }\r
-       }\r
-}
\ No newline at end of file