Scrutinizer Auto-Fixes (#1170)

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
1.10.x
Angel Fernando Quiroz Campos 9 years ago
parent 9d8f25d91a
commit 0ad4eaee3c
  1. 5
      main/auth/external_login/ldap.inc.php
  2. 2
      main/auth/shibboleth/db/shibboleth_upgrade.class.php
  3. 3
      main/auth/shibboleth/lib/store.class.php
  4. 2
      main/auth/sso/sso.Drupal.class.php
  5. 2
      main/coursecopy/classes/Course.class.php
  6. 2
      main/coursecopy/classes/CourseBuilder.class.php
  7. 10
      main/coursecopy/classes/CourseRestorer.class.php
  8. 4
      main/coursecopy/classes/CourseSelectForm.class.php
  9. 3
      main/coursecopy/classes/Event.class.php
  10. 3
      main/coursecopy/classes/QuizQuestion.class.php
  11. 2
      main/coursecopy/classes/Resource.class.php
  12. 3
      main/coursecopy/copy_course_session_selected.php
  13. 3
      main/cron/create_course_sessions.php
  14. 4
      main/cron/import_csv.php
  15. 1
      main/dropbox/dropbox_class.inc.php
  16. 15
      main/dropbox/dropbox_functions.inc.php
  17. 5
      main/exercice/TestCategory.php
  18. 7
      main/exercice/answer.class.php
  19. 21
      main/exercice/exercise.class.php
  20. 4
      main/exercice/export/aiken/aiken_classes.php
  21. 7
      main/exercice/export/aiken/aiken_import.inc.php
  22. 8
      main/exercice/export/exercise_import.inc.php
  23. 15
      main/exercice/export/qti2/qti2_export.php
  24. 9
      main/exercice/export/scorm/scorm_classes.php
  25. 29
      main/exercice/fill_blanks.class.php
  26. 6
      main/exercice/hotpotatoes.lib.php
  27. 1
      main/exercice/hotpotatoes_exercise_result.class.php
  28. 2
      main/exercice/hotspot.class.php
  29. 13
      main/exercice/question.class.php
  30. 4
      main/exercice/unique_answer.class.php
  31. 23
      main/forum/forumfunction.inc.php
  32. 9
      main/gradebook/lib/GradebookUtils.php
  33. 19
      main/gradebook/lib/be/abstractlink.class.php
  34. 32
      main/gradebook/lib/be/category.class.php
  35. 6
      main/gradebook/lib/be/evaluation.class.php
  36. 2
      main/gradebook/lib/be/exerciselink.class.php
  37. 2
      main/gradebook/lib/be/forumthreadlink.class.php
  38. 3
      main/gradebook/lib/be/result.class.php
  39. 4
      main/gradebook/lib/fe/linkform.class.php
  40. 4
      main/gradebook/lib/flatview_data_generator.class.php
  41. 3
      main/gradebook/lib/gradebook_data_generator.class.php
  42. 2
      main/gradebook/lib/gradebook_result.class.php
  43. 2
      main/gradebook/lib/results_data_generator.class.php
  44. 8
      main/gradebook/lib/scoredisplay.class.php
  45. 2
      main/group/group_space.php
  46. 2
      main/inc/ajax/admin.ajax.php
  47. 4
      main/inc/lib/AnnouncementEmail.php
  48. 2
      main/inc/lib/access_url_edit_courses_to_url_functions.lib.php
  49. 2
      main/inc/lib/access_url_edit_users_to_url_functions.lib.php
  50. 5
      main/inc/lib/add_course.lib.inc.php
  51. 2
      main/inc/lib/add_courses_to_session_functions.lib.php
  52. 2
      main/inc/lib/add_many_session_to_category_functions.lib.php
  53. 11
      main/inc/lib/agenda.lib.php
  54. 75
      main/inc/lib/api.lib.php
  55. 3
      main/inc/lib/app_view.php
  56. 6
      main/inc/lib/banner.lib.php
  57. 18
      main/inc/lib/blog.lib.php
  58. 4
      main/inc/lib/browser/Browser.php
  59. 2
      main/inc/lib/chat.lib.php
  60. 54
      main/inc/lib/course.lib.php
  61. 9
      main/inc/lib/course_category.lib.php
  62. 2
      main/inc/lib/course_description.lib.php
  63. 6
      main/inc/lib/course_request.lib.php
  64. 1
      main/inc/lib/dashboard.lib.php
  65. 8
      main/inc/lib/database.lib.php

@ -28,7 +28,7 @@ function extldap_purify_string($string)
/**
* Establishes a connection to the LDAP server and sets the protocol version
*
* @return resource ldap link identifier or false
* @return boolean ldap link identifier or false
* @author ndiechburg <noel@cblue.be>
* */
function extldap_connect()
@ -77,6 +77,7 @@ function extldap_connect()
/**
* Authenticate user on external ldap server and return user ldap entry if that succeeds
*
* @param string $password
* @return mixed false if user cannot authenticate on ldap, user ldap entry if tha succeeds
* @author ndiechburg <noel@cblue.be>
* Modified by hubert.borderiou@grenet.fr
@ -237,7 +238,7 @@ function extldap_get_user_search_string($username)
/**
* Imports all LDAP users into Chamilo
* @return bool false on error, true otherwise
* @return false|null false on error, true otherwise
*/
function extldap_import_all_users()
{

@ -35,7 +35,7 @@ class ShibbolethUpgrade
* Creates the 'shibb_unique_id' field in the table 'user' of the main Chamilo database if it doesn't exist yet
*
* @author Nicolas Rod
* @return void
* @return false|null
*/
public static function create_shibb_unique_id_field_if_missing()
{

@ -346,6 +346,9 @@ class Store
return $result;
}
/**
* @param string $sql
*/
protected function execute($sql)
{
return Database::query($sql, null, __FILE__);

@ -90,7 +90,7 @@ class ssoDrupal
/**
* Validates the received active connection data with the database
* @return bool Return the loginFailed variable value to local.inc.php
* @return null|false Return the loginFailed variable value to local.inc.php
*/
public function check_user()
{

@ -327,6 +327,7 @@ class Course
/**
* Serialize the course with the best serializer available
* @return string
*/
public static function serialize($course)
{
@ -339,6 +340,7 @@ class Course
/**
* Unserialize the course with the best serializer available
* @param string $course
*/
public static function unserialize($course)
{

@ -123,7 +123,7 @@ class CourseBuilder
* @param string $courseCode
* @param bool true if you want to get the elements that exists in the course and
* in the session, (session_id = 0 or session_id = X)
* @return object The course object structure
* @return Course The course object structure
*/
public function build(
$session_id = 0,

@ -84,7 +84,7 @@ class CourseRestorer
/**
* CourseRestorer constructor.
* @param array $course
* @param Course $course
*/
public function __construct($course)
{
@ -133,7 +133,7 @@ class CourseRestorer
* @param int $session_id
* @param bool $update_course_settings Course settings are going to be restore?
* @param bool $respect_base_content
* @return bool
* @return false|null
*/
public function restore(
$destination_course_code = '',
@ -1154,6 +1154,7 @@ class CourseRestorer
/**
* Restore a forum-topic
* @param false|string $forum_id
*/
public function restore_topic($thread_id, $forum_id, $sessionId = 0)
{
@ -1210,6 +1211,7 @@ class CourseRestorer
/**
* Restore a forum-post
* @TODO Restore tree-structure of posts. For example: attachments to posts.
* @param false|string $topic_id
*/
public function restore_post($id, $topic_id, $forum_id, $sessionId = 0)
{
@ -2306,6 +2308,7 @@ class CourseRestorer
/**
* Check availability of a survey code
* @param string $survey_code
*/
public function is_survey_code_available($survey_code)
{
@ -2320,6 +2323,7 @@ class CourseRestorer
/**
* Restore survey-questions
* @param string $survey_id
*/
public function restore_survey_question($id, $survey_id)
{
@ -2776,6 +2780,8 @@ class CourseRestorer
* @param string The path origin
* @param string The path destination
* @param boolean Option Overwrite
* @param string $source
* @param string $dest
* @return void()
* @deprecated
*/

@ -13,7 +13,7 @@ class CourseSelectForm
{
/**
* Display the form
* @param array $hidden_fiels Hidden fields to add to the form.
* @param array $hidden_fields Hidden fields to add to the form.
* @param boolean the document array will be serialize. This is used in the course_copy.php file
*/
static function display_form($course, $hidden_fields = null, $avoid_serialize = false)
@ -570,7 +570,7 @@ class CourseSelectForm
/**
* Display the form session export
* @param array $hidden_fiels Hidden fields to add to the form.
* @param array $hidden_fields Hidden fields to add to the form.
* @param boolean the document array will be serialize. This is used in the course_copy.php file
*/
public static function display_form_session_export($list_course, $hidden_fields = null, $avoid_serialize = false)

@ -50,9 +50,6 @@ class CalendarEvent extends Coursecopy\Resource
* @param int $id
* @param string $title
* @param string $content
* @param string $date
* @param string $hour
* @param int $duration
*/
public function __construct(
$id,

@ -115,6 +115,9 @@ class QuizQuestion extends Coursecopy\Resource
$this->answers[] = $answer;
}
/**
* @param QuizQuestionOption $option_obj
*/
public function add_option($option_obj)
{
$this->question_options[$option_obj->obj->id] = $option_obj;

@ -128,7 +128,7 @@ class Resource
/**
* Resturns the type of this resource
* @return constant The type.
* @return integer The type.
*/
public function get_type()
{

@ -65,6 +65,9 @@ $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
/* FUNCTIONS */
/**
* @param string $name
*/
function make_select_session_list($name, $sessions, $attr = array())
{

@ -50,6 +50,7 @@ function getQuarterFirstAndLastDates($initialDate = null)
/**
* Returns a quarter from a month
* @param string The month (digit), with or without leading 0
* @param string $month
* @return int The yearly quarter (1, 2, 3 or 4) in which this month lies
*/
function getQuarter($month)
@ -96,6 +97,7 @@ function getQuarter($month)
/**
* Returns the first month of the quarter
* @param int Quarter
* @param integer $quarter
* @return string Number of the month, with leading 0
*/
function getQuarterFirstMonth($quarter)
@ -116,6 +118,7 @@ function getQuarterFirstMonth($quarter)
/**
* Get the quarter in Roman letters
* @param int Quarter
* @param integer $quarter
* @return string Roman letters
*/
function getQuarterRoman($quarter)

@ -48,7 +48,7 @@ class ImportCsv
public $conditions;
/**
* @param Logger $logger
* @param Monolog\Logger $logger
* @param array
*/
public function __construct($logger, $conditions)
@ -66,7 +66,7 @@ class ImportCsv
}
/**
* @return mixed
* @return boolean
*/
public function getDumpValues()
{

@ -587,6 +587,7 @@ class Dropbox_Person
/**
* Deletes all the received categories and work of this person
* @param integer $id
*/
function deleteReceivedWorkFolder($id)
{

@ -22,7 +22,7 @@ $(document).ready(function () {
/**
* This function is a wrapper function for the multiple actions feature.
* @return Mixed If there is a problem, return a string message, otherwise nothing
* @return string|null If there is a problem, return a string message, otherwise nothing
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @version march 2006
*/
@ -209,9 +209,9 @@ function display_move_form($part, $id, $target = array(), $extra_params = array(
*
* @param $id the id of the file we are moving
* @param $target the id of the folder we are moving to
* @param $part are we moving a received file or a sent file?
* @param string $part are we moving a received file or a sent file?
*
* @return language string
* @return string string
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @version march 2006
@ -290,7 +290,7 @@ function display_action_options($part, $categories, $current_category = 0)
* @param $id the unique id of the file
* @param $part are we dealing with a sent or with a received file?
*
* @return html code
* @return string code
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @version march 2006
@ -771,6 +771,7 @@ function getLoginFromId($id)
}
/**
* @param string $user_id
* @return boolean indicating if user with user_id=$user_id is a course member
* @todo check if this function is still necessary. There might be a library function for this.
*/
@ -1132,7 +1133,7 @@ function feedback($array) {
/**
* This function returns the html code to display the feedback messages on a given dropbox file
* @param $feedback_array an array that contains all the feedback messages about the given document.
* @return html code
* @return string code
* @todo add the form for adding new comment (if the other party has not deleted it yet).
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
@ -1149,7 +1150,7 @@ function format_feedback($feedback)
/**
* this function returns the code for the form for adding a new feedback message to a dropbox file.
* @return html code
* @return string code
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @version march 2006
@ -1210,7 +1211,7 @@ function check_if_file_exist($id)
}
/**
* @return a language string (depending on the success or failure.
* @return string language string (depending on the success or failure.
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @version march 2006

@ -367,7 +367,7 @@ class TestCategory
* Return the list of differents categories NAME for a test
* @param int exercise id
* @param bool
* @return array of string
* @return integer of string
*
* @author function rewrote by jmontoya
*/
@ -990,7 +990,6 @@ class TestCategory
/**
* Return the id of the test category with title = $in_title
* @param $in_title
* @param int $in_c_id
*
* @return int is id of test category
*/
@ -1018,7 +1017,7 @@ class TestCategory
* @param int $questionId
* @param int $courseId
*
* @return int
* @return string|false
*/
public static function add_category_for_question_id($categoryId, $questionId, $courseId)
{

@ -188,6 +188,7 @@ class Answer
* Reads answer information from the data base ordered by parameter
* @param string Field we want to order by
* @param string DESC or ASC
* @param string $field
* @author Frederic Vauthier
*/
public function readOrderedBy($field, $order='ASC')
@ -309,6 +310,7 @@ class Answer
* returns the question ID of the destination question
*
* @author Julio Montoya
* @param integer $id
* @return integer - the question ID
*/
public function selectDestination($id)
@ -330,6 +332,7 @@ class Answer
/**
* return array answer by id else return a bool
* @param integer $auto_id
*/
public function selectAnswerByAutoId($auto_id)
{
@ -468,6 +471,7 @@ class Answer
*
* @author Olivier Brouckaert
* @param - integer $id - answer ID
* @param integer $id
* @return integer - answer weighting
*/
public function selectWeighting($id)
@ -492,6 +496,7 @@ class Answer
*
* @author Olivier Brouckaert
* @param integer Answer ID
* @param integer $id
* @return integer Answer position
*/
public function selectHotspotCoordinates($id)
@ -504,6 +509,7 @@ class Answer
*
* @author Toon Keppens
* @param integer Answer ID
* @param integer $id
* @return integer Answer position
*/
public function selectHotspotType($id)
@ -730,6 +736,7 @@ class Answer
* @author Olivier Brouckaert
* @param int question id
* @param array destination course info (result of the function api_get_course_info() )
* @param string $newQuestionId
*/
public function duplicate($newQuestionId, $course_info = null)
{

@ -355,7 +355,7 @@ class Exercise
}
/**
* @return int
* @return string
*/
public function selectPassPercentage()
{
@ -474,7 +474,7 @@ class Exercise
* tells if questions are selected randomly, and if so returns the draws
*
* @author Olivier Brouckaert
* @return integer - 0 if not random, otherwise the draws
* @return boolean - 0 if not random, otherwise the draws
*/
public function isRandom()
{
@ -2863,7 +2863,7 @@ class Exercise
* @param int int lp id
* @param int int lp item id
* @param int int lp item_view id
* @param float $weight
* @param integer $weight
* @param array question list
*/
public function save_stat_track_exercise_info(
@ -5167,6 +5167,7 @@ class Exercise
/**
* Sends a notification when a user ends an examn
*
* @param integer $exe_id
*/
public function send_mail_notification_for_exam($question_list_answers, $origin, $exe_id)
{
@ -5247,6 +5248,7 @@ class Exercise
/**
* Sends a notification when a user ends an examn
*
* @param integer $exe_id
*/
function send_notification_for_open_questions($question_list_answers, $origin, $exe_id)
{
@ -5344,6 +5346,9 @@ class Exercise
}
}
/**
* @param integer $exe_id
*/
function send_notification_for_oral_questions($question_list_answers, $origin, $exe_id)
{
if (api_get_course_setting('email_alert_manager_on_new_quiz') != 1 ) {
@ -5437,7 +5442,7 @@ class Exercise
/**
* @param array $user_data result of api_get_user_info()
* @param null $start_date
* @param string $start_date
* @param null $duration
* @param string $ip Optional. The user IP
* @return string
@ -5495,7 +5500,7 @@ class Exercise
* @param int Maximum number of attempts (0 if no limit)
* @param int Feedback type
* @todo this was function was added due the import exercise via CSV
* @return int New exercise ID
* @return string New exercise ID
*/
public function createExercise(
$title,
@ -6845,7 +6850,7 @@ class Exercise
* @param bool $show_comment
* @param null $exercise_feedback
* @param bool $show_answers
* @param null $modelType
* @param integer $modelType
* @param bool $categoryMinusOne
* @return bool|null|string
*/
@ -8010,8 +8015,8 @@ class Exercise
/**
* Returns an HTML ribbon to show on top of the exercise result, with
* colouring depending on the success or failure of the student
* @param $score
* @param $weight
* @param integer $score
* @param integer $weight
* @param bool $check_pass_percentage
* @return string
*/

@ -10,6 +10,10 @@
if ( count( get_included_files() ) == 1 ) die( '---' );
if (!function_exists('mime_content_type')) {
/**
* @param string $filename
*/
function mime_content_type($filename) {
return DocumentManager::file_get_mime_type((string)$filename);
}

@ -55,6 +55,8 @@ function aiken_display_form($msg = '') {
* Gets the uploaded file (from $_FILES) and unzip it to the given directory
* @param string The directory where to do the work
* @param string The path of the temporary directory where the exercise was uploaded and unzipped
* @param string $baseWorkDir
* @param string $uploadPath
* @return bool True on success, false on failure
*/
function get_and_unzip_uploaded_exercise($baseWorkDir, $uploadPath) {
@ -229,7 +231,10 @@ function aiken_import_exercise($file)
* @param string Path to the directory with the file to be parsed (without final /)
* @param string Name of the last directory part for the file (without /)
* @param string Name of the file to be parsed (including extension)
* @return mixed True on success, error message on error
* @param string $exercisePath
* @param string $file
* @param string $questionFile
* @return string|boolean True on success, error message on error
* @assert ('','','') === false
*/
function aiken_parse_file(&$exercise_info, $exercisePath, $file, $questionFile) {

@ -30,6 +30,8 @@ function tempdir($dir, $prefix = 'tmp', $mode = 0777)
* Unzip the exercise in the temp folder
* @param string The path of the temporary directory where the exercise was uploaded and unzipped
* @param string
* @param string $baseWorkDir
* @param string $uploadPath
* @return bool
*/
function get_and_unzip_uploaded_exercise($baseWorkDir, $uploadPath)
@ -217,9 +219,9 @@ function formatText($text)
/**
* Parses a given XML file and fills global arrays with the elements
* @param $exercisePath
* @param $file
* @param $questionFile
* @param string $exercisePath
* @param string $file
* @param string $questionFile
* @return bool
*/
function parse_file($exercisePath, $file, $questionFile)

@ -32,7 +32,7 @@ class ImsAssessmentItem
/**
* Constructor.
*
* @param $question Ims2Question object we want to export.
* @param Ims2Question $question Ims2Question object we want to export.
*/
function ImsAssessmentItem($question)
{
@ -101,7 +101,7 @@ class ImsAssessmentItem
* This is a default behaviour, some classes may want to override this.
*
* @param $standalone: Boolean stating if it should be exported as a stand-alone question
* @return A string, the XML flow for an Item.
* @return string string, the XML flow for an Item.
*/
function export($standalone = false)
{
@ -154,7 +154,7 @@ class ImsSection
/**
* Constructor.
* @param $exe The Exercise instance to export
* @param Exercise $exe The Exercise instance to export
* @author Amand Tihon <amand@alrj.org>
*/
function ImsSection($exe)
@ -239,7 +239,7 @@ class ImsSection
* Export the exercise in IMS/QTI.
*
* @param bool $standalone Wether it should include XML tag and DTD line.
* @return a string containing the XML flow
* @return string string containing the XML flow
* @author Amand Tihon <amand@alrj.org>
*/
function export($standalone)
@ -383,7 +383,7 @@ class ImsItem
* This is a default behaviour, some classes may want to override this.
*
* @param $standalone: Boolean stating if it should be exported as a stand-alone question
* @return A string, the XML flow for an Item.
* @return string string, the XML flow for an Item.
* @author Amand Tihon <amand@alrj.org>
*/
function export($standalone = False)
@ -417,7 +417,7 @@ class ImsItem
*
* @param int $exerciseId The exercise to export
* @param boolean $standalone Wether it should include XML tag and DTD line.
* @return The XML as a string, or an empty string if there's no exercise with given ID.
* @return string XML as a string, or an empty string if there's no exercise with given ID.
*/
function export_exercise_to_qti($exerciseId, $standalone = true)
{
@ -474,6 +474,9 @@ function formatExerciseQtiTitle($text)
return htmlspecialchars($text);
}
/**
* @param string $text
*/
function cleanAttribute($text)
{
return $text;

@ -27,6 +27,7 @@ class ScormQuestion extends Question
* @param int The JavaScript ID for this question.
* Due to the nature of interactions, we must have a natural sequence for
* questions in the generated JavaScript.
* @param integer $js_id
*/
public static function export_question($questionId, $standalone = true, $js_id)
{
@ -687,7 +688,7 @@ class ScormAssessmentItem
/**
* Constructor.
*
* @param $question The Question object we want to export.
* @param ScormQuestion $question The Question object we want to export.
*/
public function ScormAssessmentItem($question, $standalone = false)
{
@ -915,7 +916,7 @@ class ScormSection
*
* @param int $exerciseId The exercise to exporte
* @param boolean $standalone Wether it should include XML tag and DTD line.
* @return The XML as a string, or an empty string if there's no exercise with given ID.
* @return string XML as a string, or an empty string if there's no exercise with given ID.
*/
public static function export_exercise_to_scorm($exerciseId, $standalone=true) {
$exercise = new Exercise();
@ -930,7 +931,7 @@ class ScormSection
/**
* Constructor.
* @param $exe The Exercise instance to export
* @param Exercise $exe The Exercise instance to export
* @author Amand Tihon <amand@alrj.org>
*/
function ScormSection($exe) {
@ -1091,7 +1092,7 @@ class ScormSection
* This is a default behaviour, some classes may want to override this.
*
* @param $standalone: Boolean stating if it should be exported as a stand-alone question
* @return A string, the XML flow for an Item.
* @return string string, the XML flow for an Item.
*/
function export()
{

@ -413,7 +413,7 @@ class FillBlanks extends Question
* @param null $feedback_type
* @param null $counter
* @param null $score
* @return null|string
* @return string
*/
public function return_header($feedback_type = null, $counter = null, $score = null)
{
@ -427,15 +427,16 @@ class FillBlanks extends Question
}
/**
* @param $separatorStartRegexp
* @param $separatorEndRegexp
* @param $correctItemRegexp
* @param $questionId
* @param string $separatorStartRegexp
* @param string $separatorEndRegexp
* @param string $correctItemRegexp
* @param integer $questionId
* @param $correctItem
* @param $attributes
* @param $answer
* @param string $answer
* @param $listAnswersInfo
* @param $displayForStudent
* @param boolean $displayForStudent
* @param integer $inBlankNumber
* @return string
*/
public static function getFillTheBlankHtml(
@ -734,11 +735,11 @@ class FillBlanks extends Question
* 0 : student answer is correct
* >0 : for fill the blank question with choice menu, is the index of the student answer (right answer indice is 0)
*
* @param $testId
* @param $questionId
* @param integer $testId
* @param integer $questionId
* @param $studentsIdList
* @param $startDate
* @param $endDate
* @param string $startDate
* @param string $endDate
* @param bool $useLastAnswerredAttempt
* @return array
* (
@ -915,7 +916,7 @@ class FillBlanks extends Question
* return $text protected for use in regexp
* @param string $text
*
* @return mixed
* @return string
*/
public static function getRegexpProtected($text)
{
@ -973,7 +974,7 @@ class FillBlanks extends Question
* return the start separator for answer
* @param string $number
*
* @return mixed
* @return string
*/
public static function getStartSeparator($number)
{
@ -986,7 +987,7 @@ class FillBlanks extends Question
* return the end separator for answer
* @param string $number
*
* @return mixed
* @return string
*/
public static function getEndSeparator($number)
{

@ -94,7 +94,7 @@ function GetComment($path, $course_code = '')
* Sets the comment in the database for a particular path.
* @param string File path
* @param string Comment to set
* @return string Result of the database operation (Database::query will output some message directly on error anyway)
* @return Doctrine\DBAL\Driver\Statement|null Result of the database operation (Database::query will output some message directly on error anyway)
*/
function SetComment($path, $comment)
{
@ -112,6 +112,7 @@ function SetComment($path, $comment)
/**
* Reads the file contents into a string.
* @param string Urlencoded path
* @param string $full_file_path
* @return string The file contents or false on security error
*/
function ReadFileCont($full_file_path)
@ -257,6 +258,7 @@ function GenerateHiddenList($imgparams)
* Searches for a node in the given array.
* @param reference Reference to the array to search
* @param string Node we are looking for in the array
* @param string $node
* @return mixed Node name or false if not found
*/
function myarraysearch(&$array, $node)
@ -316,6 +318,8 @@ function ReplaceImgTag($content)
* Fills the folder name up to a certain length with "0".
* @param string Original folder name
* @param integer Length to reach
* @param integer $name
* @param integer $nsize
* @return string Modified folder name
*/
function FillFolderName($name, $nsize)

@ -18,6 +18,7 @@ class HotpotatoesExerciseResult
* Gets the results of all students (or just one student if access is limited)
* @param string The document path (for HotPotatoes retrieval)
* @param integer User ID. Optional. If no user ID is provided, we take all the results. Defauts to null
* @param string $document_path
*/
public function getExercisesReporting($document_path, $hotpotato_name)
{

@ -52,7 +52,7 @@ class HotSpot extends Question
/**
* @param FormValidator $form
* @param null $objExercise
* @return bool
* @return null|false
*/
public function processCreation($form, $objExercise = null)
{

@ -264,7 +264,7 @@ abstract class Question
}
/**
* @return bool|string
* @return string|false
*/
public function selectPicturePath()
{
@ -589,7 +589,7 @@ abstract class Question
* @param string $Dimension - Resizing happens proportional according to given dimension: height|width|any
* @param integer $Max - Maximum size
*
* @return boolean - true if success, false if failed
* @return boolean|null - true if success, false if failed
*
* @author Toon Keppens
*/
@ -750,6 +750,7 @@ abstract class Question
/**
* Sets extra info
* @param string $extra
*/
public function setExtra($extra)
{
@ -1273,7 +1274,7 @@ abstract class Question
*
* @author Olivier Brouckaert
* @param array $course_info Course info of the destination course
* @return int ID of the new question
* @return false|string ID of the new question
*/
public function duplicate($course_info = [])
{
@ -1649,7 +1650,7 @@ abstract class Question
* @param string $name
* @param int $course_id
* @param int $position
* @return bool|int
* @return false|string
*/
static function saveQuestionOption($question_id, $name, $course_id, $position = 0)
{
@ -1788,6 +1789,7 @@ abstract class Question
* @param int Maximum result for the question
* @param int Type of question (see constants at beginning of question.class.php)
* @param int Question level/category
* @param string $quiz_id
*/
public function create_question(
$quiz_id,
@ -1870,6 +1872,7 @@ abstract class Question
/**
* Get course medias
* @param int course id
* @param integer $course_id
*/
static function get_course_medias(
$course_id,
@ -1935,7 +1938,7 @@ abstract class Question
}
/**
* @return array
* @return integer[]
*/
public static function get_default_levels()
{

@ -417,8 +417,8 @@ class UniqueAnswer extends Question
* @param int $question_id The question ID (to which the answer is attached)
* @param string $title The text of the answer
* @param string $comment The feedback for the answer
* @param float|null $score The score you get when picking this answer
* @param int|null $correct Whether this answer is considered *the* correct one (this is the unique answer type)
* @param double $score The score you get when picking this answer
* @param integer $correct Whether this answer is considered *the* correct one (this is the unique answer type)
*/
public function addAnswer(
$id,

@ -1048,7 +1048,7 @@ function return_lock_unlock_icon($content, $id, $current_lock_status, $additiona
* an up and down icon except for the first (no up icon) and the last (no down icon)
* The key of this $list array is the id of the item.
*
* @return void HTML
* @return string HTML
**/
function return_up_down_icon($content, $id, $list)
{
@ -2008,7 +2008,7 @@ function get_thread_information($thread_id)
* This function retrieves forum thread users details
* @param int Thread ID
* @param string Course DB name (optional)
* @return resource array Array of type ([user_id=>w,lastname=>x,firstname=>y,thread_id=>z],[])
* @return Doctrine\DBAL\Driver\Statement|null array Array of type ([user_id=>w,lastname=>x,firstname=>y,thread_id=>z],[])
* @author Christian Fasanando <christian.fasanando@dokeos.com>,
* @todo this function need to be improved
* @version octubre 2008, dokeos 1.8
@ -2063,7 +2063,7 @@ function get_thread_users_details($thread_id)
* This function retrieves forum thread users qualify
* @param int Thread ID
* @param string Course DB name (optional)
* @return array Array of type ([user_id=>w,lastname=>x,firstname=>y,thread_id=>z],[])
* @return Doctrine\DBAL\Driver\Statement|null Array of type ([user_id=>w,lastname=>x,firstname=>y,thread_id=>z],[])
* @author Jhon Hinojosa
* @todo this function need to be improved
*/
@ -2130,7 +2130,7 @@ function get_thread_users_qualify($thread_id)
* This function retrieves forum thread users not qualify
* @param int Thread ID
* @param string Course DB name (optional)
* @return array Array of type ([user_id=>w,lastname=>x,firstname=>y,thread_id=>z],[])
* @return Doctrine\DBAL\Driver\Statement|null Array of type ([user_id=>w,lastname=>x,firstname=>y,thread_id=>z],[])
* @author Jhon Hinojosa<jhon.hinojosa@dokeos.com>,
* @version oct 2008, dokeos 1.8
*/
@ -3155,6 +3155,10 @@ function getThreadScoreHistory($user_id, $thread_id, $opt)
* @param integer contains the information the current user id
* @param integer contains the information the current thread id
* @param integer contains the information the current qualify
* @param string $option
* @param integer $course_id
* @param integer $user_id
* @param integer $thread_id
* @return void
* <code>$option=1 obtained the qualification of the current thread</code>
* @author Isaac Flores <isaac.flores@dokeos.com>, U.N.A.S University
@ -3712,6 +3716,8 @@ function increase_thread_view($thread_id)
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @version february 2006, dokeos 1.8
* @param string $last_post_id
* @param string $post_date
*/
function updateThreadInfo($thread_id, $last_post_id, $post_date)
{
@ -4015,6 +4021,8 @@ function send_notification_mails($thread_id, $reply_info)
*
* @param string Content type (post, thread, forum, forum_category)
* @param int Item DB ID
* @param string $content
* @param integer $id
* @return string language variable
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @version february 2006, dokeos 1.8
@ -4492,6 +4500,7 @@ function forum_search()
/**
* Display the search results
* @param string
* @param string $search_term
* @return void display the results
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
* @version march 2008, dokeos 1.8.5
@ -4621,7 +4630,7 @@ function search_link()
* This function adds an attachment file into a forum
* @param string $file_comment a comment about file
* @param int $last_id from forum_post table
* @return int|bool
* @return false|null
*/
function add_forum_attachment_file($file_comment, $last_id)
{
@ -4832,7 +4841,7 @@ function getAllAttachment($postId)
* @param post id
* @param int $id_attach
* @param bool $display to show or not result message
* @return void
* @return integer
* @author Julio Montoya Dokeos
* @version october 2014, chamilo 1.9.8
*/
@ -5114,7 +5123,7 @@ function get_notifications($content, $id)
* @param integer $forum_id the id of the forum
* @param integer $thread_id the id of the thread
* @param integer $post_id the id of the post
* @return bool
* @return false|null
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
* @version May 2008, dokeos 1.8.5

@ -19,6 +19,7 @@ class GradebookUtils
* @param int Visibility (0 hidden, 1 shown)
* @param int Session ID (optional or 0 if not defined)
* @param int
* @param integer $resource_type
* @return boolean True on success, false on failure
*/
public static function add_resource_to_course_gradebook(
@ -117,7 +118,6 @@ class GradebookUtils
/**
* Builds an img tag for a gradebook item
* @param string $type value returned by a gradebookitem's get_icon_name()
*/
public static function build_type_icon_tag($kind, $attributes = array())
{
@ -572,6 +572,9 @@ class GradebookUtils
* @param int The user id
* @param float The score obtained for certified
* @param Datetime The date when you obtained the certificate
* @param integer $cat_id
* @param integer $user_id
* @param string $date_certificate
* @return void()
*/
public static function register_user_info_about_certificate($cat_id, $user_id, $score_certificate, $date_certificate)
@ -951,7 +954,7 @@ class GradebookUtils
}
/**
* @param array $list_values
* @param string[] $list_values
* @return string
*/
public static function score_badges($list_values)
@ -1011,7 +1014,7 @@ class GradebookUtils
}
/**
* @param $result
* @param Doctrine\DBAL\Driver\Statement|null $result
* @return array
*/
public static function get_user_array_from_sql_result($result)

@ -193,6 +193,9 @@ abstract class AbstractLink implements GradebookItem
$this->visible = $visible;
}
/**
* @param integer $id
*/
public function set_session_id($id)
{
$this->session_id = $id;
@ -217,6 +220,12 @@ abstract class AbstractLink implements GradebookItem
/**
* Retrieve links and return them as an array of extensions of AbstractLink.
* To keep consistency, do not call this method but LinkFactory::load instead.
* @param integer $id
* @param integer $type
* @param integer $user_id
* @param string $course_code
* @param integer $category_id
* @param integer $visible
*/
public static function load(
$id = null,
@ -288,7 +297,7 @@ abstract class AbstractLink implements GradebookItem
}
/**
* @param $result
* @param Doctrine\DBAL\Driver\Statement|null $result
* @return array
*/
private static function create_objects_from_sql_result($result)
@ -463,6 +472,7 @@ abstract class AbstractLink implements GradebookItem
/**
* Internal function used by get_target_categories()
* @param integer $level
*/
private function add_target_subcategories($targets, $level, $catid)
{
@ -492,6 +502,7 @@ abstract class AbstractLink implements GradebookItem
* Find links by name
* To keep consistency, do not call this method but LinkFactory::find_links instead.
* @todo can be written more efficiently using a new (but very complex) sql query
* @param string $name_mask
*/
public function find_links ($name_mask,$selectcat)
{
@ -559,21 +570,21 @@ abstract class AbstractLink implements GradebookItem
}
/**
* @param $name
* @param string $name
*/
public function set_name($name)
{
}
/**
* @param $description
* @param string $description
*/
public function set_description($description)
{
}
/**
* @param $max
* @param integer $max
*/
public function set_max($max)
{

@ -77,7 +77,7 @@ class Category implements GradebookItem
}
/**
* @return float
* @return integer|null
*/
public function get_certificate_min_score()
{
@ -97,7 +97,7 @@ class Category implements GradebookItem
}
/**
* @return mixed
* @return integer
*/
public function get_parent_id()
{
@ -105,7 +105,7 @@ class Category implements GradebookItem
}
/**
* @return mixed
* @return integer
*/
public function get_weight()
{
@ -121,7 +121,7 @@ class Category implements GradebookItem
}
/**
* @return mixed
* @return boolean
*/
public function is_visible()
{
@ -244,7 +244,7 @@ class Category implements GradebookItem
}
/**
* @return null
* @return null|integer
*/
public function get_grade_model_id()
{
@ -487,7 +487,7 @@ class Category implements GradebookItem
}
/**
* @param $result
* @param Doctrine\DBAL\Driver\Statement|null $result
*
* @return array
*/
@ -863,7 +863,8 @@ class Category implements GradebookItem
/**
* Calculate the score of this category
* @param $stud_id student id (default: all students - then the average is returned)
* @param integer $stud_id student id (default: all students - then the average is returned)
* @param integer $session_id
* @return array (score sum, weight sum)
* or null if no scores available
*/
@ -1124,6 +1125,9 @@ class Category implements GradebookItem
* @param int student id
* @param string Course code
* @param int Session id
* @param integer $stud_id
* @param string $course_code
* @param integer $session_id
*/
public function get_root_categories_for_student($stud_id, $course_code = null, $session_id = null)
{
@ -1204,6 +1208,9 @@ class Category implements GradebookItem
* @param int user id (to return everything, use 'null' here)
* @param string course code (optional)
* @param int session id (optional)
* @param integer $user_id
* @param string $course_code
* @param integer $session_id
*/
public function get_root_categories_for_teacher($user_id, $course_code = null, $session_id = null)
{
@ -1302,6 +1309,7 @@ class Category implements GradebookItem
/**
* Internal function used by get_target_categories()
* @param integer $level
*/
private function add_target_subcategories($targets, $level, $catid)
{
@ -1401,6 +1409,8 @@ class Category implements GradebookItem
/**
* Internal function used by get_tree()
* @param integer $level
* @param null|integer $visible
*/
private function add_subtree ($targets, $level, $catid, $visible)
{
@ -1418,6 +1428,7 @@ class Category implements GradebookItem
/**
* Generate an array of courses that a teacher hasn't created a category for.
* @param integer $user_id
* @return array 2-dimensional array - every element contains 2 subelements (code, title)
*/
public function get_not_created_course_categories ($user_id)
@ -1452,6 +1463,7 @@ class Category implements GradebookItem
/**
* Generate an array of all courses that a teacher is admin of.
* @param integer $user_id
* @return array 2-dimensional array - every element contains 2 subelements (code, title)
*/
public function get_all_courses ($user_id)
@ -1532,7 +1544,7 @@ class Category implements GradebookItem
/**
* Retrieve all categories inside a course independent category
* that should be visible to a student.
* @param $cat_id parent category
* @param integer $cat_id parent category
* @param $stud_id student id
* @param $cats optional: if defined, the categories will be added to this array
*/
@ -1853,7 +1865,7 @@ class Category implements GradebookItem
* the platform administrator.
* @param int locked 1 or unlocked 0
* @return bool
* @return boolean|null
* */
public function lock($locked)
{
@ -2270,7 +2282,7 @@ class Category implements GradebookItem
* @param float $score The achieved score
* @param int $userId The user id
* @param int $categoryId The gradebook category
* @return int The insert id
* @return false|string The insert id
*/
public static function registerCurrentScore($score, $userId, $categoryId)
{

@ -81,6 +81,9 @@ class Evaluation implements GradebookItem
return $this->name;
}
/**
* @return string
*/
public function get_description()
{
return $this->description;
@ -208,7 +211,7 @@ class Evaluation implements GradebookItem
* @param int $user_id user id (evaluation owner)
* @param string $course_code course code
* @param int $category_id parent category
* @param $visible visible
* @param integer $visible visible
*/
public static function load(
$id = null,
@ -658,6 +661,7 @@ class Evaluation implements GradebookItem
/**
* Internal function used by get_target_categories()
* @param integer $level
*/
private function add_target_subcategories($targets, $level, $catid)
{

@ -373,7 +373,7 @@ class ExerciseLink extends AbstractLink
}
/**
* @return array|string
* @return string
*/
public function get_type_name()
{

@ -121,7 +121,7 @@ class ForumThreadLink extends AbstractLink
/**
* Has anyone done this exercise yet ?
* @return int
* @return boolean
*/
public function has_results()
{

@ -59,6 +59,9 @@ class Result
$this->evaluation = $evaluation_id;
}
/**
* @param string $creation_date
*/
public function set_date($creation_date)
{
$this->created_at = $creation_date;

@ -124,8 +124,8 @@ class LinkForm extends FormValidator
}
/**
* @param $link
* @param $courseCode
* @param integer $link
* @param null|string $courseCode
* @return AttendanceLink|DropboxLink|ExerciseLink|ForumThreadLink|LearnpathLink|null|StudentPublicationLink|SurveyLink
*/
private function createLink($link, $courseCode)

@ -30,7 +30,7 @@ class FlatViewDataGenerator
* @param array $evals
* @param array $links
* @param array $params
* @param null $mainCourseCategory
* @param Category|null $mainCourseCategory
*/
public function FlatViewDataGenerator(
$users = array(),
@ -276,6 +276,8 @@ class FlatViewDataGenerator
/**
* Get actual array data
* @param integer $users_count
* @param integer $items_count
* @return array 2-dimensional array - each array contains the elements:
* 0: user id
* 1: user lastname

@ -71,6 +71,7 @@ class GradebookDataGenerator
/**
* Get actual array data
* @param integer $count
* @return array 2-dimensional array - each array contains the elements:
* 0: cat/eval/link object
* 1: item name
@ -304,7 +305,7 @@ class GradebookDataGenerator
/**
* @param int $userId
* @param GradebookItem $item
* @param $ignore_score_color
* @param boolean $ignore_score_color
* @return null|string
*/
private function build_result_column(

@ -76,7 +76,7 @@ class GradeBookResult
/**
* Exports the complete report as an XLS file
* @return boolean False on error
* @return boolean|null False on error
*/
public function exportCompleteReportXLS($data)
{

@ -45,6 +45,7 @@ class ResultsDataGenerator
/**
* Get actual array data
* @param integer $count
* @return array 2-dimensional array - each array contains the elements:
* 0 ['id'] : user id
* 1 ['result_id'] : result id
@ -130,6 +131,7 @@ class ResultsDataGenerator
* @param float Current absolute score (max score is taken from $this->evaluation->get_max()
* @param bool Whether we want the real score (2/4 (50 %)) or the transformation (A, B, C, etc)
* @param bool Whether we want to ignore the score color
* @param boolean $realscore
* @result string The score as we want to show it
*/
private function get_score_display ($score, $realscore, $ignore_score_color = false)

@ -233,7 +233,7 @@ class ScoreDisplay
/**
* @param int $category_id
* @return bool
* @return false|null
*/
public function insert_defaults($category_id)
{
@ -264,7 +264,7 @@ class ScoreDisplay
}
/**
* @return int|null|string
* @return integer
*/
public function get_number_decimals()
{
@ -338,8 +338,8 @@ class ScoreDisplay
/**
* @param $score
* @param $type
* @return float|string
* @param integer $type
* @return string
*/
private function display_default($score, $type)
{

@ -491,7 +491,7 @@ function email_filter($email)
* Display a user icon that links to the user page
*
* @param integer $user_id the id of the user
* @return html code
* @return string code
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
* @version April 2008

@ -189,6 +189,8 @@ function check_system_version()
* @param float Timeout
* @param bool Include HTTP Request headers?
* @param bool Include HTTP Response headers?
* @param string $ip
* @return string
*/
function _http_request($ip, $port = 80, $uri = '/', $getdata = array(), $timeout = 5, $req_hdr = false, $res_hdr = false)
{

@ -16,7 +16,7 @@ class AnnouncementEmail
/**
*
* @param int|array $course
* @param int|array $annoucement
* @param integer $announcement
*
* @return AnnouncementEmail
*/
@ -50,7 +50,7 @@ class AnnouncementEmail
*
* @param string $key
*
* @return array
* @return string|null
*/
public function course($key = '')
{

@ -22,7 +22,7 @@ class Accessurleditcoursestourl
* a given string
* @param string String to search for
* @param int Deprecated param
* @return string A formatted, xajax answer block
* @return xajaxResponse A formatted, xajax answer block
* @assert () === false
*/
function search_courses($needle, $id)

@ -23,7 +23,7 @@ class Accessurledituserstourl
* search string
* @param string Search string
* @param int Deprecated param
* @return string Xajax response block
* @return xajaxResponse Xajax response block
* @assert () === false
*/
function search_users($needle, $id)

@ -189,7 +189,7 @@ class AddCourse
/**
* Gets an array with all the course tables (deprecated?)
* @return array
* @return string[]
* @assert (null) !== null
*/
public static function get_course_tables()
@ -310,6 +310,8 @@ class AddCourse
* @param string Complete path to directory we want to list
* @param array A list of files to which we want to add the files found
* @param string Type of base directory from which we want to recover the files
* @param string $path
* @param string $media
* @return array
* @assert (null,null,null) === false
* @assert ('abc',array(),'') === array()
@ -371,6 +373,7 @@ class AddCourse
* Sorts pictures by type (used?)
* @param array List of files (sthg like array(0=>array('png'=>1)))
* @param string File type
* @param string $type
* @return array The received array without files not matching type
* @assert (array(),null) === array()
*/

@ -10,7 +10,7 @@ class AddCourseToSession
* Searches a course, given a search string and a type of search box
* @param string $needle Search string
* @param string $type Type of search box ('single' or anything else)
* @return string XajaxResponse
* @return xajaxResponse XajaxResponse
* @assert ('abc', 'single') !== null
* @assert ('abc', 'multiple') !== null
*/

@ -17,7 +17,7 @@ class AddManySessionToCategoryFunctions
* Search for a session based on a given search string
* @param string A search string
* @param string A search box type (single or anything else)
* @return string XajaxResponse
* @return xajaxResponse XajaxResponse
* @assert () !== ''
* @assert ('abc','single') !== ''
*/

@ -565,7 +565,7 @@ class Agenda
* @param string $color
* @param bool $addAnnouncement
*
* @return bool
* @return null|false
*/
public function editEvent(
$id,
@ -1308,6 +1308,7 @@ class Agenda
*
* @param int $eventId
* @param int $courseId
* @param integer $sessionId
* @paraù int $sessionId
*
* @return array
@ -2469,6 +2470,7 @@ class Agenda
* Adds x weeks to a UNIX timestamp
* @param int The timestamp
* @param int The number of weeks to add
* @param integer $timestamp
* @return int The new timestamp
*/
function addWeek($timestamp, $num = 1)
@ -2480,6 +2482,7 @@ class Agenda
* Adds x months to a UNIX timestamp
* @param int The timestamp
* @param int The number of years to add
* @param integer $timestamp
* @return int The new timestamp
*/
function addMonth($timestamp, $num = 1)
@ -2498,6 +2501,7 @@ class Agenda
* Adds x years to a UNIX timestamp
* @param int The timestamp
* @param int The number of years to add
* @param integer $timestamp
* @return int The new timestamp
*/
function addYear($timestamp, $num = 1)
@ -2697,7 +2701,7 @@ class Agenda
/**
* @param array $courseInfo
* @param $file
* @return array|bool|string
* @return false|string
*/
public function importEventFile($courseInfo, $file)
{
@ -2810,7 +2814,7 @@ class Agenda
/**
* Parse filter turns USER:12 to ['users' => [12])] or G:1 ['groups' => [1]]
* @param $filter
* @param integer $filter
* @return array
*/
public function parseAgendaFilter($filter)
@ -3324,6 +3328,7 @@ class Agenda
* @param int user ID of the user
* @param string Optional start date in datetime format (if no start date is given, uses today)
* @param string Optional end date in datetime format (if no date is given, uses one year from now)
* @param integer $user_id
* @return array Array of events ordered by start date, in
* [0]('datestart','dateend','title'),[1]('datestart','dateend','title','link','coursetitle') format,
* where datestart and dateend are in yyyyMMddhhmmss format.

@ -592,7 +592,6 @@ require_once __DIR__.'/internationalization.lib.php';
* Also, this function provides conversion between path types, in this case the input path points inside the Chamilo area too.
*
* See $_configuration['course_folder'] in the configuration.php to alter the WEB_COURSE_PATH and SYS_COURSE_PATH parameters.
* @param string $type The requested path type (a defined constant), see the examples.
* @param string $path (optional) A path which type is to be converted. Also, it may be a defined constant for a path.
* This parameter has meaning when $type parameter has one of the following values: TO_WEB, TO_SYS, TO_REL. Otherwise it is ignored.
* @return string The requested path or the converted path.
@ -1087,7 +1086,7 @@ function api_remove_trailing_slash($path) {
* Checks the RFC 3986 syntax of a given URL.
* @param string $url The URL to be checked.
* @param bool $absolute Whether the URL is absolute (beginning with a scheme such as "http:").
* @return bool Returns the URL if it is valid, FALSE otherwise.
* @return string|false Returns the URL if it is valid, FALSE otherwise.
* This function is an adaptation from the function valid_url(), Drupal CMS.
* @link http://drupal.org
* Note: The built-in function filter_var($urs, FILTER_VALIDATE_URL) has a bug for some versions of PHP.
@ -1666,6 +1665,7 @@ function api_get_course_path($course_code = null)
* Gets a course setting from the current course_setting table. Try always using integer values.
* @param string The name of the setting we want from the table
* @param string Optional: course code
* @param string $setting_name
* @return mixed The value of that setting in that table. Return -1 if not found.
*/
function api_get_course_setting($setting_name, $course_code = null)
@ -1973,7 +1973,7 @@ function api_generate_password($length = 8) {
/**
* Checks a password to see wether it is OK to use.
* @param string $password
* @return true if the password is acceptable, false otherwise
* @return boolean if the password is acceptable, false otherwise
* Notes about what a password "OK to use" is:
* 1. The password should be at least 5 characters long.
* 2. Only English letters (uppercase or lowercase, it doesn't matter) and digits are allowed.
@ -2145,7 +2145,7 @@ class api_failure {
* @author Hugues Peeters <peeters@ipm.ucl.ac.be>
* @param string $failure_type - the type of failure
* @global array $api_failureList
* @return bolean false to stay consistent with the main script
* @return boolean false to stay consistent with the main script
*/
static function set_failure($failure_type) {
global $api_failureList;
@ -3212,8 +3212,8 @@ function api_is_allowed_to_session_edit($tutor = false, $coach = false)
/**
* Checks whether the user is allowed in a specific tool for a specific action
* @param $tool the tool we are checking if the user has a certain permission
* @param $action the action we are checking (add, edit, delete, move, visibility)
* @param string $tool the tool we are checking if the user has a certain permission
* @param string $action the action we are checking (add, edit, delete, move, visibility)
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @author Julio Montoya
* @version 1.0
@ -3512,7 +3512,7 @@ function api_not_allowed($print_headers = false, $message = null)
/**
* Gets a UNIX timestamp from a database (MySQL) datetime format string
* @param $last_post_datetime standard output date in a sql query
* @return unix timestamp
* @return integer timestamp
* @author Toon Van Hoecke <Toon.VanHoecke@UGent.be>
* @version October 2003
* @desc convert sql date to unix timestamp
@ -3545,6 +3545,9 @@ function api_get_datetime($time = null) {
* @param string Tool (learnpath, document, etc)
* @param int The item ID in the given tool
* @param int The session ID (optional)
* @param string $tool
* @param integer $user_id
* @param string $type
* @return int -1 on error, 0 if invisible, 1 if visible
*/
function api_get_item_visibility(
@ -3613,7 +3616,7 @@ function api_get_item_visibility(
* @param int $userId
* @param int $groupId
* @param int $sessionId
* @return void
* @return false|null
*/
function api_item_property_delete(
$courseInfo,
@ -3668,7 +3671,7 @@ function api_item_property_delete(
* @param array $_course array with course properties
* @param string $tool tool id, linked to 'rubrique' of the course tool_list (Warning: language sensitive !!)
* @param int $item_id id of the item itself, linked to key of every tool ('id', ...), "*" = all items of the tool
* @param string $lastedit_type add or update action
* @param string $last_edit_type add or update action
* (1) message to be translated (in trad4all) : e.g. DocumentAdded, DocumentUpdated;
* (2) "delete"
* (3) "visible"
@ -3951,6 +3954,8 @@ function api_item_property_update(
* @param string tool name, linked to 'rubrique' of the course tool_list (Warning: language sensitive !!)
* @param int id of the item itself, linked to key of every tool ('id', ...), "*" = all items of the tool
* @param int $session_id
* @param string $tool
* @param string $course_code
* @return array All fields from c_item_property (all rows found) or empty array
*/
function api_get_item_property_by_tool($tool, $course_code, $session_id = null)
@ -4213,7 +4218,7 @@ function api_get_languages_combo($name = 'language')
* Displays a form (drop down menu) so the user can select his/her preferred language.
* The form works with or without javascript
* @param boolean Hide form if only one language available (defaults to false = show the box anyway)
* @return void Display the box directly
* @return null|string Display the box directly
*/
function api_display_language_form($hide_if_no_choice = false)
{
@ -4493,6 +4498,7 @@ function api_get_themes() {
* and also when a user subscribes to courses (the new course is added at the end of the main category
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @param int $user_course_category: the id of the user_course_category
* @param integer $user_id
* @return int the value of the highest sort of the user_course_category
*/
function api_max_sort_value($user_course_category, $user_id)
@ -4686,6 +4692,8 @@ function rmdirr($dirname, $delete_only_content_in_folder = false, $strict = fals
* @param the dest folder
* @param an array of excluded file_name (without extension)
* @param copied_files the returned array of copied files
* @param string $source
* @param string $dest
*/
function copyr($source, $dest, $exclude = array(), $copied_files = array()) {
if (empty($dest)) { return false; }
@ -4725,6 +4733,11 @@ function copyr($source, $dest, $exclude = array(), $copied_files = array()) {
}
// TODO: Using DIRECTORY_SEPARATOR is not recommended, this is an obsolete approach. Documentation header to be added here.
/**
* @param string $pathname
* @param string $base_path_document
* @param integer $session_id
*/
function copy_folder_course_session(
$pathname,
$base_path_document,
@ -4810,6 +4823,9 @@ function copy_folder_course_session(
}
// TODO: chmodr() is a better name. Some corrections are needed. Documentation header to be added here.
/**
* @param string $path
*/
function api_chmod_R($path, $filemode) {
if (!is_dir($path)) {
return chmod($path, $filemode);
@ -4892,7 +4908,7 @@ function api_chmod_R($path, $filemode) {
* version = VERSION
* @endverbatim
* </code>
* @param $filename
* @param string $filename
* The file we are parsing. Accepts file with relative or absolute path.
* @return
* The info array.
@ -4984,7 +5000,7 @@ function api_get_software_name() {
/**
* Checks whether status given in parameter exists in the platform
* @param mixed the status (can be either int either string)
* @return true if the status exists, else returns false
* @return boolean if the status exists, else returns false
*/
function api_status_exists($status_asked) {
global $_status_list;
@ -5006,7 +5022,7 @@ function api_status_key($status) {
/**
* Gets the status langvars list
* @return array the list of status with their translations
* @return string[] the list of status with their translations
*/
function api_get_status_langvars() {
return array(
@ -5082,6 +5098,7 @@ function api_delete_setting_option($id) {
* @param string The sub-variable if any (in most cases, this will remain null)
* @param string The category if any (in most cases, this will remain null)
* @param int The access_url for which this parameter is valid
* @param string $cat
*/
function api_set_setting($var, $value, $subvar = null, $cat = null, $access_url = 1)
{
@ -5179,6 +5196,8 @@ function api_set_setting($var, $value, $subvar = null, $cat = null, $access_url
* @param string Value
* @param int Access URL. Optional. Defaults to 1
* @param array Optional array of filters on field type
* @param string $category
* @param string $value
*/
function api_set_settings_category($category, $value = null, $access_url = 1, $fieldtype = array())
{
@ -5422,6 +5441,10 @@ function api_delete_category_settings_by_subkey($subkey, $access_url_id = 1) {
* @param string The subkey text
* @param int The access_url for which this parameter is valid
* @param int The changeability of this setting for non-master urls
* @param string $val
* @param string $var
* @param string $sk
* @param string $c
* @return boolean true on success, false on failure
*/
function api_add_setting($val, $var, $sk = null, $type = 'textfield', $c = null, $title = '', $com = '', $sc = null, $skt = null, $a = 1, $v = 0) {
@ -5687,6 +5710,7 @@ function api_is_course_visible_for_user($userid = null, $cid = null) {
* @param String the tool of the element
* @param int the element id in database
* @param int the session_id to compare with element session id
* @param string $tool
* @return boolean true if the element is in the session, false else
*/
function api_is_element_in_the_session($tool, $element_id, $session_id = null) {
@ -5732,8 +5756,6 @@ function api_is_element_in_the_session($tool, $element_id, $session_id = null) {
* Replaces "forbidden" characters in a filename string.
*
* @param string $filename
* @param int $length
* @param bool $file_name
*
* @return string
*/
@ -5975,6 +5997,7 @@ function api_is_xml_http_request() {
* @link http://php.net/manual/en/function.getimagesize.php
* @link http://www.dokeos.com/forum/viewtopic.php?t=12345
* @link http://www.dokeos.com/forum/viewtopic.php?t=16355
* @return integer
*/
function api_getimagesize($path) {
$image = new Image($path);
@ -6135,6 +6158,7 @@ function shorten($input, $length = 15, $encoding = null) {
* with his user id and the access_url_id=1
*
* @author Julio Montoya
* @param integer $user_id
*/
function api_is_global_platform_admin($user_id = null)
{
@ -6196,7 +6220,7 @@ function api_global_admin_can_edit_admin($admin_id_to_check, $my_user_id = null,
* @param int $admin_id_to_check
* @param int $my_user_id
* @param bool $allow_session_admin
* @return bool
* @return boolean|null
*/
function api_protect_super_admin($admin_id_to_check, $my_user_id = null, $allow_session_admin = false)
{
@ -6438,6 +6462,7 @@ function api_get_asset($file) {
/**
* Returns the <link> HTML tag
* @param string $file
*/
function api_get_css($file, $media = 'screen') {
return '<link href="'.$file.'" rel="stylesheet" media="'.$media.'" type="text/css" />'."\n";
@ -6575,7 +6600,8 @@ function api_get_jquery_libraries_js($libraries) {
* This function relies on api_get_course_info()
* @param string The course code - optional (takes it from session if not given)
* @param int The session id - optional (takes it from session if not given)
* @return mixed The URL of the course or null if something does not work
* @param integer $session_id
* @return string|null The URL of the course or null if something does not work
* @author Julio Montoya <gugli100@gmail.com>
*/
function api_get_course_url($course_code = null, $session_id = null)
@ -6689,7 +6715,7 @@ function api_resource_is_locked_by_gradebook($item_id, $link_type, $course_code
* @param int LINK_EXERCISE, LINK_STUDENTPUBLICATION, LINK_LEARNPATH LINK_FORUM_THREAD, LINK_ATTENDANCE
* see gradebook/lib/be/linkfactory
* @param string course code
* @return boolean
* @return false|null
*/
function api_block_course_item_locked_by_gradebook($item_id, $link_type, $course_code = null) {
if (api_is_platform_admin()) {
@ -6773,7 +6799,7 @@ function api_get_locked_settings() {
* false if he isn't. If the user ID is given and is an integer, then the same
* ID is simply returned
* @param integer User ID
* @return mixed Integer User ID is logged in, or false otherwise
* @return boolean Integer User ID is logged in, or false otherwise
*/
function api_user_is_login($user_id = null) {
$user_id = empty($user_id) ? api_get_user_id() : intval($user_id);
@ -6808,6 +6834,7 @@ function api_get_real_ip(){
* Checks whether an IP is included inside an IP range
* @param string IP address
* @param string IP range
* @param string $ip
* @return bool True if IP is in the range, false otherwise
* @author claudiu at cnixs dot com on http://www.php.net/manual/fr/ref.network.php#55230
* @author Yannick Warnier for improvements and managment of multiple ranges
@ -7192,6 +7219,7 @@ function api_set_setting_last_update()
/**
* Tries to set memory limit, if authorized and new limit is higher than current
* @param string New memory limit
* @param string $mem
* @return bool True on success, false on failure or current is higher than suggested
* @assert (null) === false
* @assert (-1) === false
@ -7248,7 +7276,6 @@ function api_get_bytes_memory_limit($mem){
/**
* Finds all the information about a user from username instead of user id
* @param string $username
*
* @return array $user_info user_id, lastname, firstname, username, email, ...
* @author Yannick Warnier <yannick.warnier@beeznest.com>
@ -7270,7 +7297,6 @@ function api_get_user_info_from_official_code($official_code = '')
/**
*
* @param string $inputId the jquery id example: #password
*
* @return string
*/
@ -7395,6 +7421,7 @@ function api_get_user_blocked_by_captcha($username)
/**
* Remove tags from HTML anf return the $in_number_char first non-HTML char
* Postfix the text with "..." if it has been truncated.
* @param integer $in_number_char
* @return string
* @author hubert borderiou
*/
@ -7439,7 +7466,7 @@ function api_drh_can_access_all_session_content()
/**
* @param string $tool
* @param string $setting
* @param mixed $defaultValue
* @param integer $defaultValue
* @return string
*/
function api_get_default_tool_setting($tool, $setting, $defaultValue)
@ -7564,7 +7591,7 @@ function api_delete_firstpage_parameter()
}
/**
* @return true if course_code for direct course access after login is set
* @return boolean if course_code for direct course access after login is set
*/
function exist_firstpage_parameter()
{
@ -7856,7 +7883,7 @@ function api_create_protected_dir($name, $parentDirectory)
* @param array data file (path and filename)
* @param bool True for attaching a embedded file inside content html (optional)
* @param array Additional parameters
* @return returns true if mail was sent
* @return integer true if mail was sent
* @see class.phpmailer.php
*/
function api_mail_html(

@ -18,6 +18,7 @@ class View
/**
* Constructor, init tool path for rendering
* @param string tool name (optional)
* @param string $template_path
*/
public function __construct($toolname = '', $template_path=null)
{
@ -50,6 +51,7 @@ class View
/**
* Set layout view sent from a controller
* @param string layout view
* @param string $layout
*/
public function set_layout( $layout )
{
@ -59,6 +61,7 @@ class View
/**
* Set template view sent from a controller
* @param string template view
* @param string $template
*/
public function set_template($template)
{

@ -147,6 +147,9 @@ function getCustomTabs()
return $customTabs;
}
/**
* @param string $theme
*/
function return_logo($theme)
{
$_course = api_get_course_info();
@ -508,6 +511,9 @@ function return_menu()
return $menu;
}
/**
* @param string $nameTools
*/
function return_breadcrumb($interbreadcrumb, $language_file, $nameTools)
{
$session_id = api_get_session_id();

@ -96,9 +96,7 @@ class Blog
/**
* Creates a new blog in the given course
* @author Toon Keppens
* @param int $course_id Id
* @param string $title
* @param Text $description
*/
public static function create_blog($title, $subtitle)
{
@ -185,9 +183,7 @@ class Blog
/**
* Update title and subtitle of a blog in the given course
* @author Toon Keppens
* @param int $course_id Id
* @param string $title
* @param string $description
*/
public static function edit_blog($blog_id, $title, $subtitle)
{
@ -711,7 +707,6 @@ class Blog
/**
* Deletes an assigned task from a blog
* @param Integer $blog_id
* @param Integer $assignment_id
*/
public static function delete_assigned_task($blog_id, $task_id, $user_id)
{
@ -1129,9 +1124,7 @@ class Blog
*
* @param String $type
* @param Integer $blog_id
* @param Integer $item_id
*
*@return String
* @param integer $post_id
*/
public static function display_rating_form ($type, $blog_id, $post_id, $comment_id = NULL)
{
@ -2136,7 +2129,7 @@ class Blog
*
* @param Integer $blog_id
*
* @return Html Form with sortable table with users to unsubcribe from a blog.
* @return false|null Form with sortable table with users to unsubcribe from a blog.
*/
public static function display_form_user_unsubscribe ($blog_id)
{
@ -2257,6 +2250,7 @@ class Blog
* @author Toon Keppens
*
* @param Integer $blog_id
* @param integer $post_id
*/
public static function display_new_comment_form($blog_id, $post_id, $title)
{
@ -2305,10 +2299,8 @@ class Blog
* @author Patrick Cool
* @author Toon Keppens
*
* @param Array $blogitems an array containing all the blog items for the given month
* @param Integer $month: the integer value of the month we are viewing
* @param Integer $year: the 4-digit year indication e.g. 2005
* @param String $monthName: the language variable for the mont name
*
* @return html code
*/
@ -2597,6 +2589,7 @@ class Blog
* @param the blog's id
* @param the post's id
* @param the comment's id
* @param integer $blog_id
* @return array with the post info according the parameters
* @author Julio Montoya Dokeos
* @version avril 2008, dokeos 1.8.5
@ -2638,6 +2631,9 @@ function get_blog_attachment($blog_id, $post_id=null,$comment_id=null)
* @param the blog's id
* @param the post's id
* @param the comment's id
* @param integer $blog_id
* @param integer $post_id
* @param integer $comment_id
* @author Julio Montoya Dokeos
* @version avril 2008, dokeos 1.8.5
*/

@ -158,7 +158,7 @@ class Browser
/**
* Set the name of the browser
* @param $browser string The name of the Browser
* @param string $browser string The name of the Browser
*/
public function setBrowser($browser)
{
@ -266,7 +266,7 @@ class Browser
/**
* Set the browser to be from AOL
* @param $isAol
* @param boolean $isAol
*/
public function setAol($isAol)
{

@ -41,6 +41,7 @@ class Chat extends Model
/**
* Set user chat status
* @param int 0 if disconnected, 1 if connected
* @param integer $status
*
* @return void
*/
@ -164,6 +165,7 @@ class Chat extends Model
/**
* Saves into session the fact that a chat window exists with the given user
* @param int The ID of the user with whom the current user is chatting
* @param integer $user_id
* @return void
*/
public function save_window($user_id)

@ -719,7 +719,7 @@ class CourseManager
* @param int $status (optional) The user's status in the course
* @param int The user category in which this subscription will be classified
*
* @return boolean true if subscription succeeds, boolean false otherwise.
* @return false|string true if subscription succeeds, boolean false otherwise.
* @assert ('', '') === false
*/
public static function add_user_to_course($user_id, $courseCode, $status = STUDENT, $userCourseCategoryId = 0)
@ -791,7 +791,7 @@ class CourseManager
* Checks wether a parameter exists.
* If it doesn't, the function displays an error message.
*
* @return true if parameter is set and not empty, false otherwise
* @return boolean if parameter is set and not empty, false otherwise
* @todo move function to better place, main_api ?
*/
public static function check_parameter($parameter, $error_message)
@ -815,7 +815,7 @@ class CourseManager
}
/**
* @return true if there already are one or more courses
* @return boolean if there already are one or more courses
* with the same code OR visual_code (visualcode), false otherwise
*/
public static function course_code_exists($wanted_course_code)
@ -988,7 +988,7 @@ class CourseManager
/**
* @param int $userId
* @param array $courseInfo
* @return bool
* @return boolean|null
*/
public static function isUserSubscribedInCourseAsDrh($userId, $courseInfo)
{
@ -1094,10 +1094,10 @@ class CourseManager
/**
* Is the user a teacher in the given course?
*
* @param $user_id , the id (int) of the user
* @param integer $user_id , the id (int) of the user
* @param $course_code , the course code
*
* @return true if the user is a teacher in the course, false otherwise
* @return boolean if the user is a teacher in the course, false otherwise
*/
public static function is_course_teacher($user_id, $course_code)
{
@ -1126,7 +1126,7 @@ class CourseManager
* @param int the id of the user
* @param int $courseId
* @deprecated linked_courses definition doesn't exists
* @return true if the user is registered in the real course or linked courses, false otherwise
* @return boolean if the user is registered in the real course or linked courses, false otherwise
*/
public static function is_user_subscribed_in_real_or_linked_course($user_id, $courseId, $session_id = '')
{
@ -1197,9 +1197,9 @@ class CourseManager
* @param string $order_by the field to order the users by.
* Valid values are 'lastname', 'firstname', 'username', 'email', 'official_code' OR a part of a SQL statement
* that starts with ORDER BY ...
* @param null $filter_by_status if using the session_id: 0 or 2 (student, coach),
* @param integer|null $filter_by_status if using the session_id: 0 or 2 (student, coach),
* if using session_id = 0 STUDENT or COURSEMANAGER
* @param null $return_count
* @param boolean|null $return_count
* @param bool $add_reports
* @param bool $resumed_report
* @param array $extra_field
@ -1946,7 +1946,7 @@ class CourseManager
* @param int $courseId
* @param string $separator
* @param bool $add_link_to_profile
* @return null|string
* @return string
*/
public static function get_coachs_from_course_to_string(
$session_id = 0,
@ -2019,7 +2019,7 @@ class CourseManager
* Get the list of groups from the course
* @param string $course_code
* @param int $session_id Session ID (optional)
* @param boolean $in_get_empty_group get empty groups (optional)
* @param integer $in_get_empty_group get empty groups (optional)
* @return array List of groups info
*/
public static function get_group_list_of_course($course_code, $session_id = 0, $in_get_empty_group = 0)
@ -2075,6 +2075,7 @@ class CourseManager
* course.
*
* @param string The code of the course to delete
* @param string $code
* @todo When deleting a virtual course: unsubscribe users from that virtual
* course from the groups in the real course if they are not subscribed in
* that real course.
@ -2286,6 +2287,7 @@ class CourseManager
* Sort courses for a specific user ??
* @param int User ID
* @param string Course code
* @param integer $user_id
* @return int Minimum course order
* @todo Review documentation
*/
@ -2363,7 +2365,7 @@ class CourseManager
* check if course exists
* @param string course_code
* @param string whether to accept virtual course codes or not
* @return true if exists, false else
* @return integer if exists, false else
*/
public static function course_exists($course_code, $accept_virtual = false)
{
@ -2382,9 +2384,9 @@ class CourseManager
* Send an email to tutor after the auth-suscription of a student in your course
* @author Carlos Vargas <carlos.vargas@dokeos.com>, Dokeos Latino
* @param int $user_id the id of the user
* @param string $course_code the course code
* @param string $courseId the course code
* @param bool $send_to_tutor_also
* @return string we return the message that is displayed when the action is successful
* @return false|null we return the message that is displayed when the action is successful
*/
public static function email_to_tutor($user_id, $courseId, $send_to_tutor_also = false)
{
@ -2627,6 +2629,7 @@ class CourseManager
/**
* Get emails of tutors to course
* @param string Visual code
* @param integer $courseId
* @return array List of emails of tutors to course
* @author @author Carlos Vargas <carlos.vargas@dokeos.com>, Dokeos Latino
* */
@ -2650,6 +2653,7 @@ class CourseManager
* Get coaches emails by session
* @param int session id
* @param int $courseId
* @param integer $session_id
* @return array array(email => name_tutor) by coach
* @author Carlos Vargas <carlos.vargas@dokeos.com>
*/
@ -2698,7 +2702,9 @@ class CourseManager
* @param string Field's internal variable name
* @param int Field's type
* @param string Field's language var name
* @return int new extra field id
* @param integer $fieldType
* @param string $default
* @return boolean new extra field id
*/
public static function create_course_extra_field($variable, $fieldType, $displayText, $default)
{
@ -2720,7 +2726,7 @@ class CourseManager
* @param int Course id
* @param string Attribute name
* @param string Attribute value
* @return bool True if attribute was successfully updated,
* @return Doctrine\DBAL\Driver\Statement|null True if attribute was successfully updated,
* false if course was not found or attribute name is invalid
*/
public static function update_attribute($id, $name, $value)
@ -2738,7 +2744,7 @@ class CourseManager
*
* @param int Course id
* @param array Associative array with field names as keys and field values as values
* @return bool True if update was successful, false otherwise
* @return Doctrine\DBAL\Driver\Statement|null True if update was successful, false otherwise
*/
public static function update_attributes($id, $attributes)
{
@ -2764,7 +2770,7 @@ class CourseManager
* @param integer Course ID
* @param string Field variable name
* @param string Field value
* @return boolean true if field updated, false otherwise
* @return boolean|null true if field updated, false otherwise
*/
public static function update_course_extra_field_value($course_code, $variable, $value = '')
{
@ -3486,6 +3492,7 @@ class CourseManager
* @uses displayCoursesInCategory() to display the courses themselves
* @param int user id
* @param bool Whether to show the document quick-loader or not
* @param integer $user_id
* @return string
*/
public static function display_courses($user_id, $load_dirs = false)
@ -4060,6 +4067,8 @@ class CourseManager
* @param int source session id
* @param string destination course code
* @param int destination session id
* @param integer $source_session_id
* @param integer $destination_session_id
* @return bool
*/
public static function copy_course(
@ -4094,6 +4103,7 @@ class CourseManager
* @param int source session id
* @param int destination session id
* @param bool new copied tools (Exercises and LPs)will be set to invisible by default?
* @param string $new_title
*
* @return array
*/
@ -4347,6 +4357,7 @@ class CourseManager
* @param int course id
* @param int session id
* @param id url id
* @param integer $session_id
* @return array
**/
public static function update_course_ranking(
@ -4429,7 +4440,7 @@ class CourseManager
* @param int course id
* @param int session id
* @param int url id (access_url_id)
* @return mixed 'added', 'updated' or 'nothing'
* @return false|string 'added', 'updated' or 'nothing'
*/
public static function add_course_vote($user_id, $vote, $course_id, $session_id = null, $url_id = null)
{
@ -4684,6 +4695,7 @@ class CourseManager
* Get courses count
* @param int Access URL ID (optional)
* @param int $visibility
* @param integer $access_url_id
*
* @return int Number of courses
*/
@ -4740,6 +4752,7 @@ class CourseManager
/**
* Get available le courses count
* @param int Access URL ID (optional)
* @param integer $accessUrlId
* @return int Number of courses
*/
public static function countAvailableCourses($accessUrlId = null)
@ -4784,6 +4797,7 @@ class CourseManager
* @param int User ID
* @param array Course details array
* @param array List of courses to which the user is subscribed (if not provided, will be generated)
* @param integer $uid
* @return mixed 'enter' for a link to go to the course or 'register' for a link to subscribe, or false if no access
*/
static function get_access_link_by_user($uid, $course, $user_courses = array())
@ -4854,7 +4868,7 @@ class CourseManager
* @param bool $deleteTeachersNotInList
* @param bool $editTeacherInSessions
* @param bool $deleteSessionTeacherNotInList
* @return bool
* @return false|null
*/
public static function updateTeachers(
$courseId,

@ -111,7 +111,7 @@ function getCategories($category)
* @param string $canHaveCourses
* @param int $parent_id
*
* @return bool
* @return false|string
*/
function addNode($code, $name, $canHaveCourses, $parent_id)
{
@ -306,8 +306,7 @@ function moveNodeUp($code, $tree_pos, $parent_id)
/**
* Counts the number of children categories a category has
* @param int $categoryId The ID of the category of which we want to count the children
* @param int $count The number of subcategories we counted this far
* @return mixed The number of subcategories this category has
* @return integer The number of subcategories this category has
*/
function courseCategoryChildrenCount($categoryId)
{
@ -474,7 +473,7 @@ function getCategoriesToDisplayInHomePage()
/**
* @param int $id
*
* @return bool
* @return false|null
*/
function addToUrl($id)
{
@ -970,7 +969,7 @@ function getLimitFilterFromArray($limit)
* Get Pagination HTML div
* @param $pageCurrent
* @param $pageLength
* @param $pageTotal
* @param integer $pageTotal
* @return string
*/
function getCataloguePagination($pageCurrent, $pageLength, $pageTotal)

@ -95,7 +95,7 @@ class CourseDescription
* Get all data by description and session id,
* first you must set session_id property with the object CourseDescription
* @param int $description_type Description type
* @param string $course_code Course code (optional)
* @param string $courseId Course code (optional)
* @param int $session_id Session id (optional)
* @return array List of fields from the descriptions found of the given type
*/

@ -18,7 +18,7 @@ class CourseRequestManager
/**
* Checks whether a given course code has been already occupied.
* @param string $wanted_course_code The code to be checked.
* @return string
* @return boolean
* Returns TRUE if there is created:
* - a course with the same code OR visual_code (visualcode).
* - a course request with the same code as the given one, or
@ -368,7 +368,7 @@ class CourseRequestManager
}
/**
* @param null $status
* @param integer $status
* @return bool
*/
public static function count_course_requests($status = null)
@ -390,7 +390,7 @@ class CourseRequestManager
/**
* Gets all the information about a course request using its database id as an access key.
* @param int/string $id The id (an integer number) of the corresponding database record.
* @param integer $id The id (an integer number) of the corresponding database record.
* @return array/bool Returns the requested data as an array or FALSE on failure.
*/
public static function get_course_request_info($id)

@ -493,6 +493,7 @@ class DashboardManager
* This function update extra user blocks data after closing a dashboard block
* @param int User id
* @param string plugin path
* @param integer $user_id
* @return bool
*/
public static function close_user_block($user_id, $path)

@ -66,7 +66,7 @@ class Database
*
* @param string $table
*
* @return mixed
* @return string
*/
public static function get_main_table($table)
{
@ -265,7 +265,7 @@ $connection->executeQuery('set sql_mode=""');
/**
* Frees all the memory associated with the provided result identifier.
* @return bool Returns TRUE on success or FALSE on failure.
* @return boolean|null Returns TRUE on success or FALSE on failure.
* Notes: Use this method if you are concerned about how much memory is being used for queries that return large result sets.
* Anyway, all associated result memory is automatically freed at the end of the script's execution.
*/
@ -381,7 +381,7 @@ $connection->executeQuery('set sql_mode=""');
* @param array $attributes
* @param bool $show_query
*
* @return bool|int
* @return false|string
*/
public static function insert($table_name, $attributes, $show_query = false)
{
@ -674,7 +674,7 @@ $connection->executeQuery('set sql_mode=""');
}
/**
* @param $table
* @param string $table
* @return \Doctrine\DBAL\Schema\Column[]
*/
public static function listTableColumns($table)

Loading…
Cancel
Save