Fix PHP warnings.

1.10.x
Julio Montoya 10 years ago
parent e326572e46
commit 954e7be989
  1. 16
      main/forum/forumfunction.inc.php
  2. 33
      main/gradebook/lib/fe/catform.class.php
  3. 3
      main/inc/lib/fileDisplay.lib.php
  4. 1
      main/inc/lib/formvalidator/Element/DatePicker.php

@ -2380,13 +2380,13 @@ function store_thread($current_forum, $values, $courseInfo = array(), $showMessa
'thread_title' => $clean_post_title,
'forum_id' => $values['forum_id'],
'thread_poster_id' => $_user['user_id'],
'thread_poster_name' => stripslashes(isset($values['poster_name']) ? $values['poster_name'] : null),
'thread_poster_name' => stripslashes(isset($values['poster_name']) ? $values['poster_name'] : ''),
'thread_date' => $post_date,
'thread_sticky' => isset($values['thread_sticky']) ? $values['thread_sticky'] : null,
'thread_title_qualify' => stripslashes($values['calification_notebook_title']),
'thread_qualify_max' => $values['numeric_calification'],
'thread_weight' => $values['weight_calification'],
'thread_peer_qualify' => $values['thread_peer_qualify'],
'thread_sticky' => isset($values['thread_sticky']) ? $values['thread_sticky'] : '',
'thread_title_qualify' => isset($values['calification_notebook_title']) ? $values['calification_notebook_title'] : '',
'thread_qualify_max' => isset($values['numeric_calification']) ? $values['numeric_calification'] : '',
'thread_weight' => isset($values['weight_calification']) ? $values['weight_calification'] : '',
'thread_peer_qualify' => isset($values['thread_peer_qualify']) ? $values['thread_peer_qualify'] : '',
'session_id' => api_get_session_id()
]
);
@ -2473,9 +2473,9 @@ function store_thread($current_forum, $values, $courseInfo = array(), $showMessa
'thread_id' => $last_thread_id,
'forum_id' => $values['forum_id'],
'poster_id' => $_user['user_id'],
'poster_name' => isset($values['poster_name']) ? $values['poster_name'] : null,
'poster_name' => isset($values['poster_name']) ? $values['poster_name'] : '',
'post_date' => $post_date,
'post_notification' => isset($values['post_notification']) ? $values['post_notification'] : null,
'post_notification' => isset($values['post_notification']) ? $values['post_notification'] : '',
'post_parent_id' => 0,
'visible' => $visible,
];

@ -321,19 +321,13 @@ class CatForm extends FormValidator
//Getting grade models
$obj = new GradeModel();
$obj->fill_grade_model_select_in_form($this, 'grade_model_id', $this->category_object->get_grade_model_id());
/*
$grade_models = $obj->get_all();
$options = array(-1 => get_lang('None'));
foreach ($grade_models as $item) {
$options[$item['id']] = $item['name'];
}
$this->addElement('select', 'grade_model_id', array(get_lang('GradeModel'), get_lang('OnlyActiveWhenThereAreAnyComponents')), $options);
*
*/
$obj->fill_grade_model_select_in_form(
$this,
'grade_model_id',
$this->category_object->get_grade_model_id()
);
//Freeze or not
// Freeze or not
$course_code = api_get_course_id();
$session_id = api_get_session_id();
$test_cats = Category :: load(
@ -357,7 +351,6 @@ class CatForm extends FormValidator
}
$generateCertificatesParams = array();
if ($this->category_object->getGenerateCertificates()) {
$generateCertificatesParams['checked'] = 'checked';
}
@ -371,7 +364,7 @@ class CatForm extends FormValidator
);
}
if (!empty(api_get_session_id())) {
if (!empty($session_id)) {
$isRequirementCheckbox = $this->addCheckBox(
'is_requirement',
[
@ -393,16 +386,13 @@ class CatForm extends FormValidator
$this->addButtonUpdate(get_lang('EditCategory'));
}
//if (!empty($grading_contents)) {
$this->addRule('weight', get_lang('OnlyNumbers'), 'numeric');
//$this->addRule('weight',get_lang('NoDecimals'),'nopunctuation');
$this->addRule(
array('weight', 'zero'),
get_lang('NegativeValue'),
'compare',
'>='
);
//}
$setting = api_get_setting('tool_visible_by_default_at_creation');
$visibility_default = 1;
@ -418,11 +408,16 @@ class CatForm extends FormValidator
*/
protected function build_select_course_form()
{
$select = $this->addElement('select','select_course',array(get_lang('PickACourse'),'test'), null);
$select = $this->addElement(
'select',
'select_course',
array(get_lang('PickACourse'), 'test'),
null
);
$coursecat = Category :: get_all_courses(api_get_user_id());
//only return courses that are not yet created by the teacher
foreach($coursecat as $row) {
foreach ($coursecat as $row) {
$select->addoption($row[1],$row[0]);
}
$this->setDefaults(array(

@ -21,8 +21,7 @@ function choose_image($file_name)
static $type, $image;
/* TABLES INITIALISATION */
if (!$type || !$image)
{
if (!$type || !$image) {
$type['word' ] = array('doc', 'dot', 'rtf', 'mcw', 'wps', 'psw', 'docm', 'docx', 'dotm', 'dotx');
$type['web' ] = array('htm', 'html', 'htx', 'xml', 'xsl', 'php', 'xhtml');
$type['image' ] = array('gif', 'jpg', 'png', 'bmp', 'jpeg', 'tif', 'tiff');

@ -196,5 +196,4 @@ class DatePicker extends HTML_QuickForm_text
break;
}
}
}

Loading…
Cancel
Save