2 /************************************************************************/
\r
4 /************************************************************************/
\r
5 /* Copyright (c) 2010 */
\r
6 /* Inclusive Design Institute */
\r
8 /* This program is free software. You can redistribute it and/or */
\r
9 /* modify it under the terms of the GNU General Public License */
\r
10 /* as published by the Free Software Foundation. */
\r
11 /************************************************************************/
\r
14 * Courses Utility functions
\r
16 * @author Cindy Qi Li
\r
19 if (!defined('TR_INCLUDE_PATH')) exit;
\r
21 class CoursesUtility {
\r
24 * This function prints the drop down list box for course categories
\r
27 * @author Cindy Qi Li
\r
29 public static function printCourseCatsInDropDown($categoryID = 0) {
\r
30 require_once(TR_INCLUDE_PATH."classes/DAO/CourseCategoriesDAO.class.php");
\r
32 echo '<option value="'.TR_COURSECATEGORY_UNCATEGORIZED.'"';
\r
33 if ($categoryID == TR_COURSECATEGORY_UNCATEGORIZED) {
\r
34 echo ' selected="selected"';
\r
36 echo '>'._AT('cats_uncategorized').'</option>' . "\n";
\r
38 $courseCategoriesDAO = new CourseCategoriesDAO();
\r
39 $rows = $courseCategoriesDAO->getAll();
\r
41 if (is_array($rows)) {
\r
42 foreach ($rows as $row) {
\r
43 echo '<option value="'.$row['category_id'].'"';
\r
44 if ($row['category_id'] == $categoryID) {
\r
45 echo ' selected="selected"';
\r
47 echo '>'.$row['category_name'].'</option>'."\n";
\r