CoursesAndSessionsCatalog.class.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * @todo change class name
  5. * Class CoursesAndSessionsCatalog
  6. */
  7. class CoursesAndSessionsCatalog
  8. {
  9. /**
  10. * Check the configuration for the courses and sessions catalog
  11. * @global array $_configuration Configuration
  12. * @param int $value The value to check
  13. *
  14. * @return boolean Whether the configuration is $value
  15. */
  16. public static function is($value = CATALOG_COURSES)
  17. {
  18. $showCoursesSessions = intval(api_get_setting('catalog_show_courses_sessions'));
  19. if ($showCoursesSessions == $value) {
  20. return true;
  21. }
  22. return false;
  23. }
  24. /**
  25. * Check whether to display the sessions list
  26. * @global array $_configuration Configuration
  27. *
  28. * @return boolean whether to display
  29. */
  30. public static function showSessions()
  31. {
  32. $catalogShow = intval(api_get_setting('catalog_show_courses_sessions'));
  33. if ($catalogShow == CATALOG_SESSIONS || $catalogShow == CATALOG_COURSES_SESSIONS) {
  34. return true;
  35. }
  36. return false;
  37. }
  38. /**
  39. * Check whether to display the courses list
  40. * @global array $_configuration Configuration
  41. *
  42. * @return boolean whether to display
  43. */
  44. public static function showCourses()
  45. {
  46. $catalogShow = intval(api_get_setting('catalog_show_courses_sessions'));
  47. if ($catalogShow == CATALOG_COURSES || $catalogShow == CATALOG_COURSES_SESSIONS) {
  48. return true;
  49. }
  50. return false;
  51. }
  52. }