PHP warning/notices avoided

skala
Julio Montoya 13 years ago
parent 1152da417d
commit 12bf5b6410
  1. 1
      main/admin/group_add.php
  2. 5
      main/admin/user_edit.php
  3. 3
      main/exercice/admin.php
  4. 3
      main/exercice/adminhp.php
  5. 4
      main/exercice/answer_admin.inc.php
  6. 2
      main/exercice/exercise.class.php
  7. 7
      main/exercice/hotspot_admin.inc.php

@ -71,6 +71,7 @@ $form->addRule('picture', get_lang('OnlyImagesAllowed').' ('.implode(',', $allow
$groups = array(); $groups = array();
$groups[0] = get_lang('NoParentship'); $groups[0] = get_lang('NoParentship');
$groups = $groups + GroupPortalManager::get_groups_list($group_id); $groups = $groups + GroupPortalManager::get_groups_list($group_id);
$group_data['parent_group'] = GroupPortalManager::get_parent_group($group_id); $group_data['parent_group'] = GroupPortalManager::get_parent_group($group_id);
$form->addElement('select', 'parent_group', get_lang('GroupParentship'), $groups, array()); $form->addElement('select', 'parent_group', get_lang('GroupParentship'), $groups, array());

@ -209,7 +209,7 @@ $status[SESSIONADMIN] = get_lang('SessionsAdmin');
$form->addElement('select', 'status', get_lang('Profile'), $status, array('id' => 'status_select', 'onchange' => 'javascript: display_drh_list();','class'=>'chzn-select')); $form->addElement('select', 'status', get_lang('Profile'), $status, array('id' => 'status_select', 'onchange' => 'javascript: display_drh_list();','class'=>'chzn-select'));
$display = $user_data['status'] == STUDENT || $_POST['status'] == STUDENT ? 'block' : 'none'; $display = isset($user_data['status']) && ($user_data['status'] == STUDENT || (isset($_POST['status']) && $_POST['status'] == STUDENT)) ? 'block' : 'none';
/* /*
$form->addElement('html', '<div id="drh_list" style="display:'.$display.';">'); $form->addElement('html', '<div id="drh_list" style="display:'.$display.';">');
@ -375,6 +375,7 @@ if ( $form->validate()) {
} }
} }
$message = null;
if ($error_drh) { if ($error_drh) {
$err_msg = get_lang('StatusCanNotBeChangedToHumanResourcesManager'); $err_msg = get_lang('StatusCanNotBeChangedToHumanResourcesManager');
$message = Display::return_message($err_msg, 'error'); $message = Display::return_message($err_msg, 'error');
@ -402,6 +403,7 @@ $big_image_width = $big_image_size['width'];
$big_image_height = $big_image_size['height']; $big_image_height = $big_image_size['height'];
$url_big_image = $big_image.'?rnd='.time(); $url_big_image = $big_image.'?rnd='.time();
$content = null;
if ($image == '') { if ($image == '') {
$content .= '<img '.$img_attributes.' />'; $content .= '<img '.$img_attributes.' />';
} else { } else {
@ -412,7 +414,6 @@ if ($image == '') {
$content .= $form->return_form(); $content .= $form->return_form();
$tpl = new Template($tool_name); $tpl = new Template($tool_name);
$tpl->assign('actions', $actions);
$tpl->assign('message', $message); $tpl->assign('message', $message);
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $tpl->display_one_col_template();

@ -71,9 +71,6 @@ if (!$is_allowedToEdit) {
api_not_allowed(true); api_not_allowed(true);
} }
// Allows script inclusions
define(ALLOWED_TO_INCLUDE,1);
require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php'; require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php'; require_once api_get_path(LIBRARY_PATH).'document.lib.php';
/* stripslashes POST data */ /* stripslashes POST data */

@ -30,9 +30,6 @@ if (isset($_REQUEST["cancel"])) {
$newName = (!empty($_REQUEST['newName'])?$_REQUEST['newName']:''); $newName = (!empty($_REQUEST['newName'])?$_REQUEST['newName']:'');
$hotpotatoesName = (!empty($_REQUEST['hotpotatoesName'])?$_REQUEST['hotpotatoesName']:''); $hotpotatoesName = (!empty($_REQUEST['hotpotatoesName'])?$_REQUEST['hotpotatoesName']:'');
// allows script inclusions
define(ALLOWED_TO_INCLUDE,1);
$is_allowedToEdit=api_is_allowed_to_edit(null,true); $is_allowedToEdit=api_is_allowed_to_edit(null,true);
// document path // document path

@ -13,10 +13,6 @@
*/ */
use \ChamiloSession as Session; use \ChamiloSession as Session;
// ALLOWED_TO_INCLUDE is defined in admin.php
if (!defined('ALLOWED_TO_INCLUDE')) {
exit();
}
if (!is_object($objQuestion)) { if (!is_object($objQuestion)) {
$objQuestion = Question :: read($_GET['modifyAnswers']); $objQuestion = Question :: read($_GET['modifyAnswers']);
} }

@ -152,7 +152,7 @@ class Exercise {
$this->exercise_was_added_in_lp = true; $this->exercise_was_added_in_lp = true;
} }
$this->force_edit_exercise_in_lp = isset($_configuration['force_edit_exercise_in_lp']) ? $_configuration['force_edit_exercise_in_lp'] : false; $this->force_edit_exercise_in_lp = isset($_configuration['force_edit_exercise_in_lp']) ? $_configuration['force_edit_exercise_in_lp'] : true;
if ($this->exercise_was_added_in_lp) { if ($this->exercise_was_added_in_lp) {
$this->edit_exercise_in_lp = $this->force_edit_exercise_in_lp == true; $this->edit_exercise_in_lp = $this->force_edit_exercise_in_lp == true;

@ -7,15 +7,8 @@
* @author Toon Keppens * @author Toon Keppens
*/ */
/**
* Code
* ALLOWED_TO_INCLUDE is defined in admin.php
*/
use \ChamiloSession as Session; use \ChamiloSession as Session;
if (!defined('ALLOWED_TO_INCLUDE')) {
exit();
}
$modifyAnswers = intval($_GET['hotspotadmin']); $modifyAnswers = intval($_GET['hotspotadmin']);
if (!is_object($objQuestion)) { if (!is_object($objQuestion)) {

Loading…
Cancel
Save