|
|
|
@ -1,4 +1,5 @@ |
|
|
|
|
<?php |
|
|
|
|
|
|
|
|
|
/* For licensing terms, see /license.txt */ |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -68,7 +69,6 @@ class CourseCategory |
|
|
|
|
$tbl_category = Database::get_main_table(TABLE_MAIN_CATEGORY); |
|
|
|
|
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); |
|
|
|
|
$category = Database::escape_string($category); |
|
|
|
|
$conditions = null; |
|
|
|
|
|
|
|
|
|
$table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE_CATEGORY); |
|
|
|
|
$conditions = " INNER JOIN $table a ON (t1.id = a.course_category_id)"; |
|
|
|
@ -109,9 +109,8 @@ class CourseCategory |
|
|
|
|
ORDER BY t1.tree_pos"; |
|
|
|
|
|
|
|
|
|
$result = Database::query($sql); |
|
|
|
|
$categories = Database::store_result($result, 'ASSOC'); |
|
|
|
|
|
|
|
|
|
return $categories; |
|
|
|
|
return Database::store_result($result, 'ASSOC'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -713,6 +712,11 @@ class CourseCategory |
|
|
|
|
$conditions = " INNER JOIN $table a ON (c.id = a.course_category_id)"; |
|
|
|
|
$whereCondition = " AND a.access_url_id = ".api_get_current_access_url_id(); |
|
|
|
|
|
|
|
|
|
$allowBaseCategories = api_get_configuration_value('allow_base_course_category'); |
|
|
|
|
if ($allowBaseCategories) { |
|
|
|
|
$whereCondition = " AND (a.access_url_id = ".api_get_current_access_url_id()." OR a.access_url_id = 1) "; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$keyword = Database::escape_string($keyword); |
|
|
|
|
|
|
|
|
|
$sql = "SELECT c.*, c.name as text |
|
|
|
|