Fix php warnings + format code #1714

remotes/angel/1.11.x
jmontoyaa 8 years ago
parent 05e2ea66d9
commit 0e29255d5f
  1. 5
      main/inc/ajax/exercise.ajax.php
  2. 2
      main/inc/lib/api.lib.php
  3. 11
      main/inc/lib/banner.lib.php
  4. 2
      main/inc/lib/course_home.lib.php
  5. 7
      main/inc/lib/display.lib.php
  6. 14
      main/inc/lib/template.lib.php

@ -140,7 +140,10 @@ switch ($action) {
GROUP by question_id
) as count_table";
$result_count = Database::query($sql);
$count_questions = Database::fetch_array($result_count,'ASSOC');
$count_questions = Database::fetch_array(
$result_count,
'ASSOC'
);
$count_questions = $count_questions['count_question_id'];
$row['count_questions'] = $count_questions;

@ -1459,8 +1459,10 @@ function api_get_user_info(
$apcVar = null;
$user = false;
$cacheAvailable = api_get_configuration_value('apc');
if (empty($user_id)) {
$userFromSession = Session::read('_user');
if (isset($userFromSession)) {
if (!empty($cacheAvailable)) {
$apcVar = api_get_configuration_value('apc_prefix') . 'userinfo_' . $userFromSession['user_id'];

@ -552,20 +552,19 @@ function return_breadcrumb($interbreadcrumb, $language_file, $nameTools)
switch (api_get_setting('breadcrumbs_course_homepage')) {
case 'get_lang':
$navigation_item['title'] = Display::return_icon('home.png', get_lang('CourseHomepageLink'), null, ICON_SIZE_TINY);
$navigation_item['title'] = Display::return_icon('home.png', get_lang('CourseHomepageLink'), [], ICON_SIZE_TINY);
break;
case 'course_code':
$navigation_item['title'] = Display::return_icon('home.png', $_course['official_code'], null, ICON_SIZE_TINY).' '.$_course['official_code'];
$navigation_item['title'] = Display::return_icon('home.png', $_course['official_code'], [], ICON_SIZE_TINY).' '.$_course['official_code'];
break;
case 'session_name_and_course_title':
$navigation_item['title'] = Display::return_icon('home.png', $_course['name'].$my_session_name, null, ICON_SIZE_TINY).' '.$course_title.$my_session_name;
$navigation_item['title'] = Display::return_icon('home.png', $_course['name'].$my_session_name, [], ICON_SIZE_TINY).' '.$course_title.$my_session_name;
break;
default:
if (api_get_session_id() != -1 ) {
$navigation_item['title'] = Display::return_icon('home.png', $_course['name'].$my_session_name, null, ICON_SIZE_TINY).' '.$course_title.$my_session_name;
$navigation_item['title'] = Display::return_icon('home.png', $_course['name'].$my_session_name, [], ICON_SIZE_TINY).' '.$course_title.$my_session_name;
} else {
$navigation_item['title'] = Display::return_icon('home.png', $_course['name'], null, ICON_SIZE_TINY).' '.$course_title;
$navigation_item['title'] = Display::return_icon('home.png', $_course['name'], [], ICON_SIZE_TINY).' '.$course_title;
}
break;
}

@ -1290,7 +1290,7 @@ class CourseHome
$html .= Display::return_icon(
substr($navigation_item['image'], 0, -3).'png',
$navigation_item['name'],
null,
[],
ICON_SIZE_MEDIUM
);
$html .= '</a> ';

@ -805,7 +805,6 @@ class Display
if ($return_only_path) {
return $icon;
}
$img = self::img($icon, $alt_text, $additional_attributes);
@ -827,7 +826,7 @@ class Display
* @param boolean $filterPath Optional. Whether filter the image path. Default is true
* @author Julio Montoya 2010
*/
public static function img($image_path, $alt_text = '', $additional_attributes = array(), $filterPath = true)
public static function img($image_path, $alt_text = '', $additional_attributes = null, $filterPath = true)
{
if (empty($image_path)) {
// For some reason, the call to img() happened without a proper
@ -848,6 +847,10 @@ class Display
$alt_text = basename($image_path);
}
if (empty($additional_attributes)) {
$additional_attributes = [];
}
$additional_attributes['src'] = $image_path;
if (empty($additional_attributes['alt'])) {

@ -801,8 +801,14 @@ class Template
}
}
$this->assign('online_button', Display::return_icon('statusonline.png', null, null, ICON_SIZE_ATOM));
$this->assign('offline_button',Display::return_icon('statusoffline.png', null, null, ICON_SIZE_ATOM));
$this->assign(
'online_button',
Display::return_icon('statusonline.png', null, [], ICON_SIZE_ATOM)
);
$this->assign(
'offline_button',
Display::return_icon('statusoffline.png', null, [], ICON_SIZE_ATOM)
);
// Get language iso-code for this page - ignore errors
$this->assign('document_language', api_get_language_isocode());
@ -894,7 +900,7 @@ class Template
//@todo move this in the template
$rightFloatMenu = '';
$iconBug = Display::return_icon('bug.png', get_lang('ReportABug'), null, ICON_SIZE_LARGE);
$iconBug = Display::return_icon('bug.png', get_lang('ReportABug'), [], ICON_SIZE_LARGE);
if (api_get_setting('show_link_bug_notification') == 'true' && $this->user_is_logged_in) {
$rightFloatMenu = '<div class="report">
<a href="https://github.com/chamilo/chamilo-lms/wiki/How-to-report-issues" target="_blank">
@ -905,7 +911,7 @@ class Template
if (api_get_setting('show_link_ticket_notification') == 'true' && $this->user_is_logged_in) {
// by default is project_id = 1
$iconTicket = Display::return_icon('bug.png', get_lang('Ticket'), null, ICON_SIZE_LARGE);
$iconTicket = Display::return_icon('bug.png', get_lang('Ticket'), [], ICON_SIZE_LARGE);
$courseInfo = api_get_course_info();
$courseParams = '';
if (!empty($courseInfo)) {

Loading…
Cancel
Save