CoursesAndSessionsCatalog.class.php 1.5 KB

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