You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							60 lines
						
					
					
						
							1.5 KiB
						
					
					
				
			
		
		
	
	
							60 lines
						
					
					
						
							1.5 KiB
						
					
					
				<?php
 | 
						|
/* For licensing terms, see /license.txt */
 | 
						|
 | 
						|
/**
 | 
						|
 * Class CoursesAndSessionsCatalog
 | 
						|
 */
 | 
						|
class CoursesAndSessionsCatalog
 | 
						|
{
 | 
						|
 | 
						|
    /**
 | 
						|
     * Check the configuration for the courses and sessions catalog
 | 
						|
     * @global array $_configuration Configuration
 | 
						|
     * @param int $value The value to check
 | 
						|
     *
 | 
						|
     * @return boolean Whether the configuration is $value
 | 
						|
     */
 | 
						|
    public static function is($value = CATALOG_COURSES)
 | 
						|
    {
 | 
						|
        $showCoursesSessions = intval(api_get_setting('catalog_show_courses_sessions'));
 | 
						|
        if ($showCoursesSessions == $value) {
 | 
						|
            return true;
 | 
						|
        }
 | 
						|
 | 
						|
        return false;
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Check whether to display the sessions list
 | 
						|
     * @global array $_configuration Configuration
 | 
						|
     *
 | 
						|
     * @return boolean whether to display
 | 
						|
     */
 | 
						|
    public static function showSessions()
 | 
						|
    {
 | 
						|
        $catalogShow = intval(api_get_setting('catalog_show_courses_sessions'));
 | 
						|
 | 
						|
        if ($catalogShow == CATALOG_SESSIONS || $catalogShow == CATALOG_COURSES_SESSIONS) {
 | 
						|
            return true;
 | 
						|
        }
 | 
						|
 | 
						|
        return false;
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Check whether to display the courses list
 | 
						|
     * @global array $_configuration Configuration
 | 
						|
     *
 | 
						|
     * @return boolean whether to display
 | 
						|
     */
 | 
						|
    public static function showCourses()
 | 
						|
    {
 | 
						|
        $catalogShow = intval(api_get_setting('catalog_show_courses_sessions'));
 | 
						|
 | 
						|
        if ($catalogShow == CATALOG_COURSES || $catalogShow == CATALOG_COURSES_SESSIONS) {
 | 
						|
            return true;
 | 
						|
        }
 | 
						|
 | 
						|
        return false;
 | 
						|
    }
 | 
						|
}
 | 
						|
 |