dokeos-auth
[ class tree: dokeos-auth ] [ index: dokeos-auth ] [ all elements ]

Procedural File: courses.php

Source Location: /main/auth/courses.php



Page Details:



Tags:

todo:  constants are in uppercase, variables aren't
todo:  check if unsubscribing from a course WITH group memberships works as it should
filesource:  Source Code for this file


Includes:

include('../inc/global.inc.php') [line 41]


Tags:

todo:  constants are in uppercase, variables aren't
todo:  check if unsubscribing from a course WITH group memberships works as it should
filesource:  Source Code for this file
include_once(debug.lib.inc.php) [line 50]
include_once(course.lib.php) [line 51]






browse_courses [line 327]

void browse_courses( )

Allows you to browse through the course categories (faculties) and subscribe to the courses of

this category (faculty)




Tags:

author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


[ Top ]



browse_courses_in_category [line 396]

HTML browse_courses_in_category( )

Display all the courses in the given course category. I could have used a parameter here

but instead I use the already available $_GET['category']




Tags:

return:  code: a table with all the courses in a given category (title, code, tutor) and a subscription icon if applicable)
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


[ Top ]



browse_course_categories [line 353]

HTML browse_course_categories( )

displays the browsing of the course categories (faculties)



Tags:

return:  code containing a list with all the categories and subcategories and the navigation to go one category up(if needed)
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


[ Top ]



count_courses_in_category [line 339]

void count_courses_in_category( $category)

Counts the number of courses in a given course category



Parameters

   $category  
[ Top ]



courses_subscribing [line 316]

void courses_subscribing( )

handles the display of the courses to which the user can subscribe



Tags:

author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


[ Top ]



delete_course_category [line 536]

string delete_course_category( $id, int $id:)

deletes a course category and moves all the courses that were in this category to main category



Tags:

return:  a language variable saying that the deletion went OK.
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


Parameters

int   $id:   the id of the user_course_category
   $id  
[ Top ]



display_category_icons [line 987]

html: display_category_icons( $current_category $current_category, $all_user_categories)

displays the relevant icons for the category (if applicable):move up, move down, edit, delete



Tags:

return:  a small table containing the up/down icons and the edit icon (for moving to a different user course category)
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University
todo:  complete the comments on this function: the parameter section


Parameters

$current_category   $current_category   the id of the current category $allcategories an associative array containing all the categories.
   $all_user_categories  
[ Top ]



display_change_course_category_form [line 1036]

html display_change_course_category_form( $edit_course, string $edit_course:)

This function displays the form (dropdown list) to move a course to a

different course_category (after the edit icon has been changed)




Tags:

return:  a dropdown list containing all the user defined course categories and a submit button
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University
todo:  when editing (moving) a course inside a user defined course category to a different user defined category the dropdown list should have the current course category selected.


Parameters

string   $edit_course:  
   $edit_course  
[ Top ]



display_courses [line 744]

html display_courses( $user_id, $show_course_icons, $user_courses, int $user_id:)

displays everything that is needed when the user wants to manage his current courses (sorting, subscribing, unsubscribing, ...)



Tags:

return:  a table containing courses and the appropriate icons (sub/unsub/move)
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


Parameters

int   $user_id:   the user_id of the current user string $parameter: determines weither we are displaying for the sorting, subscribing or unsubscribin
   $user_id  
   $show_course_icons  
   $user_courses  
[ Top ]



display_courses_in_category [line 797]

string: display_courses_in_category( int $user_category_id, $showicons)

This function displays all the courses in the particular user category;



Tags:

return:  the name of the user defined course category
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


Parameters

int   $user_category_id   id: the id of the user defined course category
   $showicons  
[ Top ]



display_course_icons [line 927]

html display_course_icons( $key, $key: $number_of_courses, $course)

Displays the subscribe icon if the subscribing is allowed and if the user is not yet

subscribed to this course




Tags:

return:  a small table containing the up/down icons and the edit icon (for moving to a different user course category)
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University
todo:  complete the comments on this function: the parameter section


Parameters

$key:   $number_of_courses   $course $user_courses
   $key  
   $course  
[ Top ]



display_create_course_category_form [line 590]

HTML display_create_course_category_form( )

displays the form that is needed to create a course category.



Tags:

return:  the form (input field + submit button) to create a user course category
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


[ Top ]



display_edit_course_category_form [line 1178]

html display_edit_course_category_form( $edit_course_category, string $edit_course:)



Tags:

return:  output: the form
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


Parameters

string   $edit_course:  
   $edit_course_category  
[ Top ]



display_info_text [line 1167]

string: display_info_text( $text, string $text:)



Tags:

return:  the text with the grey formatting
author:  unknown
todo:  move this to a stylesheet Added id grey to CSS


Parameters

string   $text:   the text that has to be written in grey
   $text  
[ Top ]



display_search_courses [line 426]

HTML display_search_courses( )

displays the form for searching for a course and the results if a query has been submitted.



Tags:

return:  code: the form for searching for a course
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


[ Top ]



display_subscribe_icon [line 887]

string display_subscribe_icon( $current_course, $user_coursecodes, string $current_course:)

displays the subscribe icon if the subscribing is allowed and if the user is not yet

subscribe to this course




Tags:

return:  a subscribe icon or the text that subscribing is not allowed or the user is already subscribed
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


Parameters

string   $current_course:   the course code of the course we need to display the subscribe icon for
   $current_course  
   $user_coursecodes  
[ Top ]



display_subscribe_to_courses [line 448]

void display_subscribe_to_courses( $courses)

This function displays the list of course that can be subscribed to.

This list can come from the search results or from the browsing of the platform course categories




Parameters

   $courses  
[ Top ]



display_unsubscribe_icons [line 1070]

html display_unsubscribe_icons( $course, array $course:)

This function displays the unsubscribe part which can be

  1. the unsubscribe link
  2. text: you are course admin of this course (=> unsubscription is not possible
  3. text: you are not allowed to unsubscribe from this course




Tags:

return:  a delete icon or a text that unsubscribing is not possible (course admin) or not allowed.
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


Parameters

array   $course:   the array with all the course & course_rel_user information
   $course  
[ Top ]



get_courses_of_user [line 1098]

array get_courses_of_user( $user_id, int $user_id:)

retrieves all the courses that the user has already subscribed to



Tags:

return:  an array containing all the information of the courses of the given user
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


Parameters

int   $user_id:   the id of the user
   $user_id  
[ Top ]



get_user_course_categories [line 1128]

array get_user_course_categories( )

retrieves the user defined course categories



Tags:

return:  containing all the IDs of the user defined courses categories, sorted by the "sort" field
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


[ Top ]



get_user_course_categories_info [line 1147]

array get_user_course_categories_info( )

Retrieves the user defined course categories and all the info that goes with it



Tags:

return:  containing all the info of the user defined courses categories with the id as key of the array
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


[ Top ]



get_user_course_category [line 867]

string: get_user_course_category( int $id)

gets the title of the user course category



Tags:

return:  the name of the user defined course category
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


Parameters

int   $id   id: the id of the user defined course category
[ Top ]



move_category [line 696]

string move_category( string $direction, $category2move)

Moves the course one place up or down



Tags:

return:  a language variable saying that the course was moved.
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


Parameters

string   $direction   : the direction we are moving the course to (up or down) string $course2move : the course we are moving
   $category2move  
[ Top ]



move_course [line 646]

string move_course( string $direction, $course2move, $category)

moves the course one place up or down



Tags:

return:  a language variable saying that the course was moved.
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


Parameters

string   $direction   : the direction we are moving the course to (up or down) string $course2move : the course we are moving
   $course2move  
   $category  
[ Top ]



remove_user_from_course [line 291]

string remove_user_from_course( int $user_id, string $course_code)

unsubscribe the user from a given course



Tags:

return:  we return the message that is displayed when the action is succesfull
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


Parameters

int   $user_id   The user id of the user that is performing the unsubscribe action
string   $course_code   the course code of the course the user wants to unsubscribe from
[ Top ]



search_courses [line 513]

array search_courses( $search_term, string $search_term:)

Search the courses database for a course that matches the search term.

The search is done on the code, title and tutor field of the course table.




Tags:

return:  an array containing a list of all the courses (the code, directory, dabase, visual_code, title, ... ) matching the the search term.
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


Parameters

string   $search_term:   the string that the user submitted, what we are looking for
   $search_term  
[ Top ]



store_changecoursecategory [line 626]

string store_changecoursecategory( string $course_code, $newcategory)

stores the changes in a course category (moving a course to a different course category)



Tags:

return:  a language variable saying that the course was moved.
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


Parameters

string   $course_code   : the course_code of the course we are moving int $newcategory : the id of the user course category we are moving the course to.
   $newcategory  
[ Top ]



store_course_category [line 557]

string store_course_category( )

stores the user course category in the dokeos_user database



Tags:

return:  a language variable saying that the user course category was stored
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


[ Top ]



store_edit_course_category [line 1195]

string store_edit_course_category( )

Updates the user course category in the dokeos_user database



Tags:

return:  a language variable saying that the user course category was stored
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


[ Top ]



subscribe_user [line 249]

string subscribe_user( string $course_code)

Subscribe the user to a given course



Tags:

return:  we return the message that is displayed when the action is succesfull
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


Parameters

string   $course_code   the code of the course the user wants to subscribe to
[ Top ]



Documentation generated on Thu, 12 Jun 2008 13:12:58 -0500 by phpDocumentor 1.4.1