From 1c47b10a5ee5821f4ed1dd9b52bef98a1764e8e4 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Fri, 14 Apr 2017 11:58:02 +0000 Subject: [PATCH] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- main/auth/external_login/login.ldap.php | 4 +- main/auth/lostPassword.php | 12 +- main/auth/my_progress.php | 12 +- main/course_info/delete_course.php | 2 +- main/course_info/tools.php | 16 +-- main/exercise/feedback.php | 26 ++-- main/forum/viewthread_nested.inc.php | 40 +++--- main/group/group_edit.php | 22 +-- main/inc/lib/CourseChatUtils.php | 130 +++++++++--------- main/inc/lib/extra_field_value.lib.php | 16 +-- main/mySpace/user_edit.php | 28 ++-- main/notebook/index.php | 6 +- main/session/add_students_to_session.php | 4 +- main/session/session_category_list.php | 4 +- main/session/session_list.php | 26 ++-- main/social/group_topics.php | 10 +- main/social/groups.php | 84 +++++------ main/ticket/report.php | 40 +++--- main/ticket/ticket_plugin.class.php | 4 +- main/work/download.php | 2 +- main/work/upload.php | 2 +- .../CkEditor/Toolbar/ProjectComment.php | 2 +- .../Component/Editor/Driver/CourseDriver.php | 10 +- 23 files changed, 251 insertions(+), 251 deletions(-) diff --git a/main/auth/external_login/login.ldap.php b/main/auth/external_login/login.ldap.php index ae54afab0a..2852ff7904 100755 --- a/main/auth/external_login/login.ldap.php +++ b/main/auth/external_login/login.ldap.php @@ -40,8 +40,8 @@ use ChamiloSession as Session; * * */ -require_once dirname(__FILE__) . '/ldap.inc.php'; -require_once dirname(__FILE__) . '/functions.inc.php'; +require_once dirname(__FILE__).'/ldap.inc.php'; +require_once dirname(__FILE__).'/functions.inc.php'; $debug = false; if ($debug) { diff --git a/main/auth/lostPassword.php b/main/auth/lostPassword.php index 8612c04cef..66007525a4 100755 --- a/main/auth/lostPassword.php +++ b/main/auth/lostPassword.php @@ -47,7 +47,7 @@ if ($reset && $userId) { Display::addFlash( Display::return_message($messageText, 'info', false) ); - header('Location: ' . api_get_path(WEB_PATH)); + header('Location: '.api_get_path(WEB_PATH)); exit; } @@ -74,7 +74,7 @@ if ($form->validate()) { Display::addFlash( Display::return_message($messageText, 'error', false) ); - header('Location: ' . api_get_self()); + header('Location: '.api_get_self()); exit; } @@ -94,7 +94,7 @@ if ($form->validate()) { Display::addFlash( Display::return_message($messageText, 'info', false) ); - header('Location: ' . api_get_path(WEB_PATH)); + header('Location: '.api_get_path(WEB_PATH)); exit; } @@ -102,7 +102,7 @@ if ($form->validate()) { Display::addFlash( Display::return_message(get_lang('CouldNotResetPasswordBecauseLDAP'), 'info', false) ); - header('Location: ' . api_get_path(WEB_PATH)); + header('Location: '.api_get_path(WEB_PATH)); exit; } @@ -121,7 +121,7 @@ if ($form->validate()) { exit; } - header('Location: ' . api_get_path(WEB_PATH)); + header('Location: '.api_get_path(WEB_PATH)); exit; } @@ -138,7 +138,7 @@ if ($form->validate()) { Display::addFlash( Display::return_message($messageText, 'info', false) ); - header('Location: ' . api_get_path(WEB_PATH)); + header('Location: '.api_get_path(WEB_PATH)); exit; } diff --git a/main/auth/my_progress.php b/main/auth/my_progress.php index 13ba3ade58..0f96a3c7ba 100755 --- a/main/auth/my_progress.php +++ b/main/auth/my_progress.php @@ -53,16 +53,16 @@ if (!empty($course_user_list)) { } $course_info = api_get_course_info_by_id($result['c_id']); $course_image = ''; - $dates .= '
  • ' . api_convert_and_format_date($login, DATE_FORMAT_SHORT) . '
  • '; + $dates .= '
  • '.api_convert_and_format_date($login, DATE_FORMAT_SHORT).'
  • '; $issues .= '
  • '; $issues .= '
    '.$course_image.'
    '; $issues .= '
    '; - $issues .= '

    ' . sprintf( + $issues .= '

    '.sprintf( get_lang('YouHaveEnteredTheCourseXInY'), - '" '. $courseInfo['name'] .' "', + '" '.$courseInfo['name'].' "', api_convert_and_format_date($login, DATE_TIME_FORMAT_LONG) - ) . '

    '; + ).'

    '; $issues .= '
    '; $issues .= '
  • '; $count++; @@ -80,8 +80,8 @@ if (!empty($dates)) { $content .= '
    '; $content .= '
    '; $content .= '
    '; - $content .= '
      ' . $dates . '
    '; - $content .= '
      ' . $issues . '
    '; + $content .= '
      '.$dates.'
    '; + $content .= '
      '.$issues.'
    '; $content .= '
    '; $content .= '
    '; $content .= ''; diff --git a/main/course_info/delete_course.php b/main/course_info/delete_course.php index 6c5224dbaa..56d0821304 100755 --- a/main/course_info/delete_course.php +++ b/main/course_info/delete_course.php @@ -36,7 +36,7 @@ if (isset($_GET['delete']) && $_GET['delete'] === 'yes') { Session::erase('_real_cid'); $noPHP_SELF = true; $message = '

    '.get_lang('Course').' : '.$current_course_name.' ('.$current_course_code.')

    '; - $message .=get_lang('HasDel'); + $message .= get_lang('HasDel'); $message .= '

    '.get_lang('BackHome').''; } else { $message = '

    '.get_lang('Course').' : '.$current_course_name.' ('.$current_course_code.')

    '; diff --git a/main/course_info/tools.php b/main/course_info/tools.php index 464feb4d06..0dfba5a29c 100644 --- a/main/course_info/tools.php +++ b/main/course_info/tools.php @@ -49,14 +49,14 @@ switch ($action) { ); $toolName = Security::remove_XSS(stripslashes($tool['name'])); - $currentUrl = api_get_self().'?action=edit_icon&id=' . $id.'&'.api_get_cidreq(); + $currentUrl = api_get_self().'?action=edit_icon&id='.$id.'&'.api_get_cidreq(); $form = new FormValidator('icon_edit', 'post', $currentUrl); $form->addHeader(get_lang('EditIcon')); $form->addHtml('
    '); $form->addText('name', get_lang('Name')); $form->addText('link', get_lang('Links')); - $allowed_picture_types = array ('jpg', 'jpeg', 'png'); + $allowed_picture_types = array('jpg', 'jpeg', 'png'); $form->addFile('icon', get_lang('CustomIcon')); $form->addRule('icon', get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')', 'filetype', $allowed_picture_types); $form->addSelect( @@ -117,7 +117,7 @@ switch ($action) { $iconsTools .= '
    '; foreach ($toolList as $tool) { $tool['name'] = Security::remove_XSS(stripslashes($tool['name'])); - $toolIconName = 'Tool' . api_underscore_to_camel_case($tool['name']); + $toolIconName = 'Tool'.api_underscore_to_camel_case($tool['name']); $toolIconName = isset($$toolIconName) ? get_lang($toolIconName) : $tool['name']; $iconsTools .= '
    '; @@ -139,13 +139,13 @@ switch ($action) { $delete = (!empty($tool['custom_icon'])) ? " + "')) return false;\" href=\"".api_get_self().'?action=delete_icon&id='.$tool['iid'].'&'.api_get_cidreq()."\"> " : ""; - $edit = ''; + $edit = ''; - $iconsTools .= '
    '. $icon . '
    '; - $iconsTools .= '
    ' . $toolIconName . '
    '; - $iconsTools .= '
    ' . $edit . $delete . '
    '; + $iconsTools .= '
    '.$icon.'
    '; + $iconsTools .= '
    '.$toolIconName.'
    '; + $iconsTools .= '
    '.$edit.$delete.'
    '; $iconsTools .= '
    '; $iconsTools .= '
    '; } diff --git a/main/exercise/feedback.php b/main/exercise/feedback.php index 6292a980d9..2f9ca29476 100755 --- a/main/exercise/feedback.php +++ b/main/exercise/feedback.php @@ -9,23 +9,23 @@ * @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $ */ require_once __DIR__.'/../inc/global.inc.php'; -$this_section=SECTION_COURSES; +$this_section = SECTION_COURSES; -$nameTools=get_lang('ExerciseManagement'); +$nameTools = get_lang('ExerciseManagement'); -if (isset($_SESSION['gradebook'])){ - $gradebook= $_SESSION['gradebook']; +if (isset($_SESSION['gradebook'])) { + $gradebook = $_SESSION['gradebook']; } -if (!empty($gradebook) && $gradebook=='view') { - $interbreadcrumb[]= array ( +if (!empty($gradebook) && $gradebook == 'view') { + $interbreadcrumb[] = array( 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('ToolGradebook') ); } -$interbreadcrumb[]=array("url" => "exercise.php","name" => get_lang('Exercises')); -Display::display_header($nameTools,"Exercises"); +$interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises')); +Display::display_header($nameTools, "Exercises"); ?>

    @@ -38,17 +38,17 @@ Display::display_header($nameTools,"Exercises"); echo $objQuestionTmp->selectTitle(); echo ""; echo "

    "; - $objAnswerTmp=new Answer($id); + $objAnswerTmp = new Answer($id); $num = $objAnswerTmp->selectNbrAnswers(); $objAnswerTmp->read(); - for($i=1;$i<=$num;$i++) + for ($i = 1; $i <= $num; $i++) { echo "

    ".get_lang('Answer')." :
    "; - $ans = $objAnswerTmp->answer[$i]; + $ans = $objAnswerTmp->answer[$i]; - $form = new FormValidator('feedbackform','post',api_get_self()."?".api_get_cidreq()."&modifyQuestion=".$modifyQuestion."&newQuestion=".$newQuestion); + $form = new FormValidator('feedbackform', 'post', api_get_self()."?".api_get_cidreq()."&modifyQuestion=".$modifyQuestion."&newQuestion=".$newQuestion); $obj_registration_form = new HTML_QuickForm('frmRegistration', 'POST'); - $renderer =& $obj_registration_form->defaultRenderer(); + $renderer = & $obj_registration_form->defaultRenderer(); $renderer->setCustomElementTemplate( '
    {label} diff --git a/main/forum/viewthread_nested.inc.php b/main/forum/viewthread_nested.inc.php index efbbfded39..b6debbfaea 100755 --- a/main/forum/viewthread_nested.inc.php +++ b/main/forum/viewthread_nested.inc.php @@ -52,7 +52,7 @@ foreach ($rows as $post) { $indent = $post['indent_cnt']; $html = ''; - $html .= '
    '; + $html .= '
    '; $html .= '
    '; $html .= '
    '; $html .= '
    '; @@ -67,7 +67,7 @@ foreach ($rows as $post) { if ($origin != 'learnpath') { if ($allowUserImageForum) { - $html .= '
    ' . display_user_image($post['user_id'], $name, $origin) . '
    '; + $html .= '
    '.display_user_image($post['user_id'], $name, $origin).'
    '; } $html .= Display::tag( @@ -77,7 +77,7 @@ foreach ($rows as $post) { ); } else { if ($allowUserImageForum) { - $html .= '
    ' . display_user_image($post['user_id'], $name, $origin) . '
    '; + $html .= '
    '.display_user_image($post['user_id'], $name, $origin).'
    '; } $html .= Display::tag( @@ -142,7 +142,7 @@ foreach ($rows as $post) { !(api_is_course_coach() && $current_forum['session_id'] != $sessionId) ) { if ($locked == false) { - $deleteUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ + $deleteUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ 'forum' => $clean_forum_id, 'thread' => $clean_thread_id, 'action' => 'delete', @@ -180,9 +180,9 @@ foreach ($rows as $post) { ); if ($count > 0) { - $iconEdit .= "" . Display::return_icon('move.png', get_lang('MovePost'), array(), ICON_SIZE_SMALL) . ""; + . "\">".Display::return_icon('move.png', get_lang('MovePost'), array(), ICON_SIZE_SMALL).""; } } @@ -203,11 +203,11 @@ foreach ($rows as $post) { $_GET['thread'] ); if ($locked == false) { - $iconEdit .= "" . Display::return_icon('quiz.png', get_lang('Qualify')) . ""; + . "\" >".Display::return_icon('quiz.png', get_lang('Qualify')).""; } } } @@ -215,7 +215,7 @@ foreach ($rows as $post) { $statusIcon = getPostStatus($current_forum, $post); if ($iconEdit != '') { - $html .= '
    ' . $iconEdit . ' '.$statusIcon.'
    '; + $html .= '
    '.$iconEdit.' '.$statusIcon.'
    '; } $buttonReply = ''; @@ -229,7 +229,7 @@ foreach ($rows as $post) { if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) { $buttonReply = Display::toolbarButton( get_lang('ReplyToMessage'), - 'reply.php?' . api_get_cidreq() . '&' . http_build_query([ + 'reply.php?'.api_get_cidreq().'&'.http_build_query([ 'forum' => $clean_forum_id, 'thread' => $clean_thread_id, 'post' => $post['post_id'], @@ -242,7 +242,7 @@ foreach ($rows as $post) { $buttonQuote = Display::toolbarButton( get_lang('QuoteMessage'), - 'reply.php?' . api_get_cidreq() . '&' . http_build_query([ + 'reply.php?'.api_get_cidreq().'&'.http_build_query([ 'forum' => $clean_forum_id, 'thread' => $clean_thread_id, 'post' => $post['post_id'], @@ -266,21 +266,21 @@ foreach ($rows as $post) { if ($current_forum_category && $current_forum_category['locked'] == 1) { $closedPost = Display::tag( 'div', - ' ' . get_lang('ForumcategoryLocked'), + ' '.get_lang('ForumcategoryLocked'), array('class' => 'alert alert-warning post-closed') ); } if ($current_forum['locked'] == 1) { $closedPost = Display::tag( 'div', - ' ' . get_lang('ForumLocked'), + ' '.get_lang('ForumLocked'), array('class' => 'alert alert-warning post-closed') ); } if ($current_thread['locked'] == 1) { $closedPost = Display::tag( 'div', - ' ' . get_lang('ThreadLocked'), + ' '.get_lang('ThreadLocked'), array('class' => 'alert alert-warning post-closed') ); } @@ -328,16 +328,16 @@ foreach ($rows as $post) { $html .= Display::return_icon('attachment.gif', get_lang('Attachment')); $html .= ' ' . $user_filename . ' '; - $html .= '' . $attachment['comment'] . ''; + $html .= ' "> '.$user_filename.' '; + $html .= ''.$attachment['comment'].''; if (($current_forum['allow_edit'] == 1 && $post['user_id'] == $userId) || (api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId)) ) { - $html .= '  ' - . Display::return_icon('delete.gif', get_lang('Delete')) . '
    '; + . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)).'\')) return false;">' + . Display::return_icon('delete.gif', get_lang('Delete')).'
    '; } } } diff --git a/main/group/group_edit.php b/main/group/group_edit.php index acf0c83213..b4db01df24 100755 --- a/main/group/group_edit.php +++ b/main/group/group_edit.php @@ -13,7 +13,7 @@ require_once __DIR__.'/../inc/global.inc.php'; $this_section = SECTION_COURSES; -$current_course_tool = TOOL_GROUP; +$current_course_tool = TOOL_GROUP; // Notice for unauthorized people. api_protect_course_script(true); @@ -22,8 +22,8 @@ $group_id = api_get_group_id(); $current_group = GroupManager :: get_group_properties($group_id); $nameTools = get_lang('EditGroup'); -$interbreadcrumb[] = array ('url' => 'group.php?'.api_get_cidreq(), 'name' => get_lang('Groups')); -$interbreadcrumb[] = array ('url' => 'group_space.php?'.api_get_cidreq(), 'name' => $current_group['name']); +$interbreadcrumb[] = array('url' => 'group.php?'.api_get_cidreq(), 'name' => get_lang('Groups')); +$interbreadcrumb[] = array('url' => 'group_space.php?'.api_get_cidreq(), 'name' => $current_group['name']); $is_group_member = GroupManager :: is_tutor_of_group(api_get_user_id(), $current_group); @@ -130,7 +130,7 @@ $form->addElement('hidden', 'referer'); $form->addText('name', get_lang('GroupName')); // Description -$form->addElement('textarea', 'description', get_lang('Description'), array ('rows' => 6)); +$form->addElement('textarea', 'description', get_lang('Description'), array('rows' => 6)); $complete_user_list = GroupManager :: fill_groups_list($current_group); usort($complete_user_list, 'sort_users'); @@ -159,7 +159,7 @@ $group_tutors_element = $form->addElement( // Group members $group_member_list = GroupManager::get_subscribed_users($current_group); -$selected_users = array (); +$selected_users = array(); foreach ($group_member_list as $index => $user) { $selected_users[] = $user['user_id']; } @@ -205,7 +205,7 @@ $group = array( $form->addGroup( $group, '', - Display::return_icon('user.png', get_lang('GroupSelfRegistration')) . ' ' . get_lang('GroupSelfRegistration'), + Display::return_icon('user.png', get_lang('GroupSelfRegistration')).' '.get_lang('GroupSelfRegistration'), null, false ); @@ -231,7 +231,7 @@ $group[] = $form->createElement('radio', 'work_state', null, get_lang('Private') $form->addGroup( $group, '', - Display::return_icon('work.png', get_lang('GroupWork')) . ' ' . get_lang('GroupWork'), + Display::return_icon('work.png', get_lang('GroupWork')).' '.get_lang('GroupWork'), null, false ); @@ -244,7 +244,7 @@ $group[] = $form->createElement('radio', 'calendar_state', null, get_lang('Priva $form->addGroup( $group, '', - Display::return_icon('agenda.png', get_lang('GroupCalendar')) . ' ' . get_lang('GroupCalendar'), + Display::return_icon('agenda.png', get_lang('GroupCalendar')).' '.get_lang('GroupCalendar'), null, false ); @@ -257,7 +257,7 @@ $group[] = $form->createElement('radio', 'announcements_state', null, get_lang(' $form->addGroup( $group, '', - Display::return_icon('announce.png', get_lang('GroupAnnouncements')) . ' ' . get_lang('GroupAnnouncements'), + Display::return_icon('announce.png', get_lang('GroupAnnouncements')).' '.get_lang('GroupAnnouncements'), null, false ); @@ -270,7 +270,7 @@ $group[] = $form->createElement('radio', 'forum_state', null, get_lang('Private' $form->addGroup( $group, '', - Display::return_icon('forum.png', get_lang('GroupForum')) . ' ' . get_lang('GroupForum'), + Display::return_icon('forum.png', get_lang('GroupForum')).' '.get_lang('GroupForum'), null, false ); @@ -284,7 +284,7 @@ $group = array( $form->addGroup( $group, '', - Display::return_icon('wiki.png', get_lang('GroupWiki')) . ' ' . get_lang('GroupWiki'), + Display::return_icon('wiki.png', get_lang('GroupWiki')).' '.get_lang('GroupWiki'), null, false ); diff --git a/main/inc/lib/CourseChatUtils.php b/main/inc/lib/CourseChatUtils.php index e6207192ae..29b8c3c62c 100644 --- a/main/inc/lib/CourseChatUtils.php +++ b/main/inc/lib/CourseChatUtils.php @@ -67,7 +67,7 @@ class CourseChatUtils return ''; } - Emojione\Emojione::$imagePathPNG = api_get_path(WEB_LIBRARY_PATH) . 'javascript/emojione/png/'; + Emojione\Emojione::$imagePathPNG = api_get_path(WEB_LIBRARY_PATH).'javascript/emojione/png/'; Emojione\Emojione::$ascii = true; $message = trim($message); @@ -113,15 +113,15 @@ class CourseChatUtils $user = $em->find('ChamiloUserBundle:User', $this->userId); $courseInfo = api_get_course_info_by_id($this->courseId); $isMaster = (bool) api_is_course_admin(); - $document_path = api_get_path(SYS_COURSE_PATH) . $courseInfo['path'] . '/document'; + $document_path = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document'; $basepath_chat = '/chat_files'; if (!$this->groupId) { $group_info = GroupManager::get_group_properties($this->groupId); - $basepath_chat = $group_info['directory'] . '/chat_files'; + $basepath_chat = $group_info['directory'].'/chat_files'; } - $chat_path = $document_path . $basepath_chat . '/'; + $chat_path = $document_path.$basepath_chat.'/'; if (!is_dir($chat_path)) { if (is_file($chat_path)) { @@ -131,25 +131,25 @@ class CourseChatUtils $date_now = date('Y-m-d'); $timeNow = date('d/m/y H:i:s'); - $basename_chat = 'messages-' . $date_now; + $basename_chat = 'messages-'.$date_now; if ($this->groupId && !$friendId) { - $basename_chat = 'messages-' . $date_now . '_gid-' . $this->groupId; + $basename_chat = 'messages-'.$date_now.'_gid-'.$this->groupId; } elseif ($this->sessionId && !$friendId) { - $basename_chat = 'messages-' . $date_now . '_sid-' . $this->sessionId; + $basename_chat = 'messages-'.$date_now.'_sid-'.$this->sessionId; } elseif ($friendId) { if ($this->userId < $friendId) { - $basename_chat = 'messages-' . $date_now . '_uid-' . $this->userId . '-' . $friendId; + $basename_chat = 'messages-'.$date_now.'_uid-'.$this->userId.'-'.$friendId; } else { - $basename_chat = 'messages-' . $date_now . '_uid-' . $friendId . '-' . $this->userId; + $basename_chat = 'messages-'.$date_now.'_uid-'.$friendId.'-'.$this->userId; } } $message = self::prepareMessage($message); - $fileTitle = $basename_chat . '.log.html'; - $filePath = $basepath_chat . '/' . $fileTitle; - $absoluteFilePath = $chat_path . $fileTitle; + $fileTitle = $basename_chat.'.log.html'; + $filePath = $basepath_chat.'/'.$fileTitle; + $absoluteFilePath = $chat_path.$fileTitle; if (!file_exists($absoluteFilePath)) { $doc_id = add_document($courseInfo, $filePath, 'file', 0, $fileTitle); @@ -182,23 +182,23 @@ class CourseChatUtils $fileContent = '
    -
    ' . $user->getCompleteName() . '
    -
    ' . $message . '
    -
    ' . $timeNow . '
    +
    ' . $user->getCompleteName().'
    +
    ' . $message.'
    +
    ' . $timeNow.'
    - +
    '; } else { $fileContent = '
    - +
    -
    ' . $user->getCompleteName() . '
    -
    ' . $message . '
    -
    ' . $timeNow . '
    +
    ' . $user->getCompleteName().'
    +
    ' . $message.'
    +
    ' . $timeNow.'
    '; @@ -293,9 +293,9 @@ class CourseChatUtils $extraCondition = null; if ($this->groupId) { - $extraCondition = 'AND ccc.toGroupId = ' . intval($this->groupId); + $extraCondition = 'AND ccc.toGroupId = '.intval($this->groupId); } else { - $extraCondition = 'AND ccc.sessionId = ' . intval($this->sessionId); + $extraCondition = 'AND ccc.sessionId = '.intval($this->sessionId); } $currentTime = new DateTime(api_get_utc_datetime(), new DateTimeZone('UTC')); @@ -1394,7 +1394,7 @@ class CourseChatUtils { return [ ':bowtie:', - ':smile:'| + ':smile:' | ':laughing:', ':blush:', ':smiley:', @@ -1467,17 +1467,17 @@ class CourseChatUtils public function getFileName($absolute = false, $friendId = 0) { $date = date('Y-m-d'); - $base = 'messages-' . $date . '.log.html'; + $base = 'messages-'.$date.'.log.html'; if ($this->groupId && !$friendId) { - $base = 'messages-' . $date . '_gid-' . $this->groupId . '.log.html'; + $base = 'messages-'.$date.'_gid-'.$this->groupId.'.log.html'; } elseif ($this->sessionId && !$friendId) { - $base = 'messages-' . $date . '_sid-' . $this->sessionId . '.log.html'; + $base = 'messages-'.$date.'_sid-'.$this->sessionId.'.log.html'; } elseif ($friendId) { if ($this->userId < $friendId) { - $base = 'messages-' . $date . '_uid-' . $this->userId . '-' . $friendId . '.log.html'; + $base = 'messages-'.$date.'_uid-'.$this->userId.'-'.$friendId.'.log.html'; } else { - $base = 'messages-' . $date . '_uid-' . $friendId . '-' . $this->userId . '.log.html'; + $base = 'messages-'.$date.'_uid-'.$friendId.'-'.$this->userId.'.log.html'; } } @@ -1486,16 +1486,16 @@ class CourseChatUtils } $courseInfo = api_get_course_info_by_id($this->courseId); - $document_path = api_get_path(SYS_COURSE_PATH) . $courseInfo['path'] . '/document'; + $document_path = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document'; - $chatPath = $document_path . '/chat_files/'; + $chatPath = $document_path.'/chat_files/'; if ($this->groupId) { $group_info = GroupManager::get_group_properties($this->groupId); - $chatPath = $document_path . $group_info['directory'] . '/chat_files/'; + $chatPath = $document_path.$group_info['directory'].'/chat_files/'; } - return $chatPath . $base; + return $chatPath.$base; } /** @@ -1508,16 +1508,16 @@ class CourseChatUtils { $courseInfo = api_get_course_info_by_id($this->courseId); $date_now = date('Y-m-d'); - $isMaster = (bool)api_is_course_admin(); + $isMaster = (bool) api_is_course_admin(); $basepath_chat = '/chat_files'; - $document_path = api_get_path(SYS_COURSE_PATH) . $courseInfo['path'] . '/document'; + $document_path = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document'; if ($this->groupId) { $group_info = GroupManager:: get_group_properties($this->groupId); - $basepath_chat = $group_info['directory'] . '/chat_files'; + $basepath_chat = $group_info['directory'].'/chat_files'; } - $chat_path = $document_path . $basepath_chat . '/'; + $chat_path = $document_path.$basepath_chat.'/'; if (!is_dir($chat_path)) { if (is_file($chat_path)) { @@ -1544,24 +1544,24 @@ class CourseChatUtils } } - $filename_chat = 'messages-' . $date_now . '.log.html'; + $filename_chat = 'messages-'.$date_now.'.log.html'; if ($this->groupId && !$friendId) { - $filename_chat = 'messages-' . $date_now . '_gid-' . $this->groupId . '.log.html'; + $filename_chat = 'messages-'.$date_now.'_gid-'.$this->groupId.'.log.html'; } else if ($this->sessionId && !$friendId) { - $filename_chat = 'messages-' . $date_now . '_sid-' . $this->sessionId . '.log.html'; + $filename_chat = 'messages-'.$date_now.'_sid-'.$this->sessionId.'.log.html'; } elseif ($friendId) { if ($this->userId < $friendId) { - $filename_chat = 'messages-' . $date_now . '_uid-' . $this->userId . '-' . $friendId . '.log.html'; + $filename_chat = 'messages-'.$date_now.'_uid-'.$this->userId.'-'.$friendId.'.log.html'; } else { - $filename_chat = 'messages-' . $date_now . '_uid-' . $friendId . '-' . $this->userId . '.log.html'; + $filename_chat = 'messages-'.$date_now.'_uid-'.$friendId.'-'.$this->userId.'.log.html'; } } - if (!file_exists($chat_path . $filename_chat)) { - @fclose(fopen($chat_path . $filename_chat, 'w')); + if (!file_exists($chat_path.$filename_chat)) { + @fclose(fopen($chat_path.$filename_chat, 'w')); if (!api_is_anonymous()) { - $doc_id = add_document($courseInfo, $basepath_chat . '/' . $filename_chat, 'file', 0, $filename_chat); + $doc_id = add_document($courseInfo, $basepath_chat.'/'.$filename_chat, 'file', 0, $filename_chat); api_item_property_update( $courseInfo, TOOL_DOCUMENT, @@ -1590,17 +1590,17 @@ class CourseChatUtils } } - $basename_chat = 'messages-' . $date_now; + $basename_chat = 'messages-'.$date_now; if ($this->groupId && !$friendId) { - $basename_chat = 'messages-' . $date_now . '_gid-' . $this->groupId; + $basename_chat = 'messages-'.$date_now.'_gid-'.$this->groupId; } else if ($this->sessionId && !$friendId) { - $basename_chat = 'messages-' . $date_now . '_sid-' . $this->sessionId; + $basename_chat = 'messages-'.$date_now.'_sid-'.$this->sessionId; } elseif ($friendId) { if ($this->userId < $friendId) { - $basename_chat = 'messages-' . $date_now . '_uid-' . $this->userId . '-' . $friendId; + $basename_chat = 'messages-'.$date_now.'_uid-'.$this->userId.'-'.$friendId; } else { - $basename_chat = 'messages-' . $date_now . '_uid-' . $friendId . '-' . $this->userId; + $basename_chat = 'messages-'.$date_now.'_uid-'.$friendId.'-'.$this->userId; } } @@ -1608,19 +1608,19 @@ class CourseChatUtils $i = 1; - while (file_exists($chat_path . $basename_chat . '-' . $i . '.log.html')) { + while (file_exists($chat_path.$basename_chat.'-'.$i.'.log.html')) { $i++; } - @rename($chat_path . $basename_chat . '.log.html', $chat_path . $basename_chat . '-' . $i . '.log.html'); - @fclose(fopen($chat_path . $basename_chat . '.log.html', 'w')); + @rename($chat_path.$basename_chat.'.log.html', $chat_path.$basename_chat.'-'.$i.'.log.html'); + @fclose(fopen($chat_path.$basename_chat.'.log.html', 'w')); $doc_id = add_document( $courseInfo, - $basepath_chat . '/' . $basename_chat . '-' . $i . '.log.html', + $basepath_chat.'/'.$basename_chat.'-'.$i.'.log.html', 'file', - filesize($chat_path . $basename_chat . '-' . $i . '.log.html'), - $basename_chat . '-' . $i . '.log.html' + filesize($chat_path.$basename_chat.'-'.$i.'.log.html'), + $basename_chat.'-'.$i.'.log.html' ); api_item_property_update( @@ -1651,7 +1651,7 @@ class CourseChatUtils $doc_id = DocumentManager::get_document_id( $courseInfo, - $basepath_chat . '/' . $basename_chat . '.log.html' + $basepath_chat.'/'.$basename_chat.'.log.html' ); update_existing_document($courseInfo, $doc_id, 0); @@ -1660,8 +1660,8 @@ class CourseChatUtils $remove = 0; $content = array(); - if (file_exists($chat_path . $basename_chat . '.log.html')) { - $content = file($chat_path . $basename_chat . '.log.html'); + if (file_exists($chat_path.$basename_chat.'.log.html')) { + $content = file($chat_path.$basename_chat.'.log.html'); $nbr_lines = sizeof($content); $remove = $nbr_lines - 100; } @@ -1674,7 +1674,7 @@ class CourseChatUtils if (isset($_GET['origin']) && $_GET['origin'] == 'whoisonline') { //the caller - $content[0] = get_lang('CallSent') . '
    ' . $content[0]; + $content[0] = get_lang('CallSent').'
    '.$content[0]; } $history = '
    '; @@ -1689,7 +1689,7 @@ class CourseChatUtils $history .= '
    '; @@ -1710,9 +1710,9 @@ class CourseChatUtils $extraCondition = null; if ($this->groupId) { - $extraCondition = 'AND ccc.toGroupId = ' . intval($this->groupId); + $extraCondition = 'AND ccc.toGroupId = '.intval($this->groupId); } else { - $extraCondition = 'AND ccc.sessionId = ' . intval($this->sessionId); + $extraCondition = 'AND ccc.sessionId = '.intval($this->sessionId); } $number = Database::getManager() @@ -1742,9 +1742,9 @@ class CourseChatUtils $extraCondition = null; if ($this->groupId) { - $extraCondition = 'AND ccc.toGroupId = ' . intval($this->groupId); + $extraCondition = 'AND ccc.toGroupId = '.intval($this->groupId); } else { - $extraCondition = 'AND ccc.sessionId = ' . intval($this->sessionId); + $extraCondition = 'AND ccc.sessionId = '.intval($this->sessionId); } $number = Database::getManager() @@ -1780,7 +1780,7 @@ class CourseChatUtils 'lastname' => $user->getLastname(), 'status' => !$this->sessionId ? $subscription->getStatus() : $user->getStatus(), 'image_url' => UserManager::getUserPicture($user->getId(), USER_IMAGE_SIZE_MEDIUM), - 'profile_url' => api_get_path(WEB_CODE_PATH) . 'social/profile.php?u=' . $user->getId(), + 'profile_url' => api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$user->getId(), 'complete_name' => $user->getCompleteName(), 'username' => $user->getUsername(), 'email' => $user->getEmail(), diff --git a/main/inc/lib/extra_field_value.lib.php b/main/inc/lib/extra_field_value.lib.php index 0c3b79b8b5..e1816449fc 100755 --- a/main/inc/lib/extra_field_value.lib.php +++ b/main/inc/lib/extra_field_value.lib.php @@ -218,7 +218,7 @@ class ExtraFieldValue extends Model break; } - $fileName = ExtraField::FIELD_TYPE_FILE_IMAGE . "_{$params['item_id']}.png"; + $fileName = ExtraField::FIELD_TYPE_FILE_IMAGE."_{$params['item_id']}.png"; if (!file_exists($fileDir)) { mkdir($fileDir, $dirPermissions, true); @@ -227,15 +227,15 @@ class ExtraFieldValue extends Model if ($value['error'] == 0) { //Crop the image to adjust 16:9 ratio $crop = new Image($value['tmp_name']); - $crop->crop($params['extra_' . $field_variable . '_crop_result']); + $crop->crop($params['extra_'.$field_variable.'_crop_result']); $imageExtraField = new Image($value['tmp_name']); $imageExtraField->resize(400); - $imageExtraField->send_image($fileDir . $fileName, -1, 'png'); + $imageExtraField->send_image($fileDir.$fileName, -1, 'png'); $newParams = array( 'item_id' => $params['item_id'], 'field_id' => $extraFieldInfo['id'], - 'value' => $fileDirStored . $fileName, + 'value' => $fileDirStored.$fileName, 'comment' => $comment ); self::save($newParams); @@ -260,18 +260,18 @@ class ExtraFieldValue extends Model } $cleanedName = api_replace_dangerous_char($value['name']); - $fileName = ExtraField::FIELD_TYPE_FILE . "_{$params['item_id']}_$cleanedName"; + $fileName = ExtraField::FIELD_TYPE_FILE."_{$params['item_id']}_$cleanedName"; if (!file_exists($fileDir)) { mkdir($fileDir, $dirPermissions, true); } if ($value['error'] == 0) { - moveUploadedFile($value, $fileDir . $fileName); + moveUploadedFile($value, $fileDir.$fileName); $new_params = array( 'item_id' => $params['item_id'], 'field_id' => $extraFieldInfo['id'], - 'value' => $fileDirStored . $fileName + 'value' => $fileDirStored.$fileName ); if ($this->type !== 'session' && $this->type !== 'course') { @@ -472,7 +472,7 @@ class ExtraFieldValue extends Model */ if (false) { global $app; - switch($this->type) { + switch ($this->type) { case 'question': $extraFieldValue = $app['orm.ems']['db_write']->getRepository('ChamiloLMS\Entity\QuestionFieldValues')->find($field_values['id']); $extraFieldValue->setUserId(api_get_user_id()); diff --git a/main/mySpace/user_edit.php b/main/mySpace/user_edit.php index 041e2d6b53..7ad87f0f8f 100644 --- a/main/mySpace/user_edit.php +++ b/main/mySpace/user_edit.php @@ -85,15 +85,15 @@ $auth_sources = 0; //make available wider as we need it in case of form reset (s $group[] =& $form->createElement('select', 'auth_source', null, $auth_sources); $group[] =& $form->createElement('static', '', '', '
    '); }*/ -$group[] =& $form->createElement('radio', 'password_auto', get_lang('Password'), get_lang('AutoGeneratePassword').'
    ', 1); -$group[] =& $form->createElement('radio', 'password_auto', 'id="radio_user_password"', null, 0); -$group[] =& $form->createElement('password', 'password', null, array('onkeydown' => 'javascript: password_switch_radio_button(document.user_add,"password[password_auto]");')); +$group[] = & $form->createElement('radio', 'password_auto', get_lang('Password'), get_lang('AutoGeneratePassword').'
    ', 1); +$group[] = & $form->createElement('radio', 'password_auto', 'id="radio_user_password"', null, 0); +$group[] = & $form->createElement('password', 'password', null, array('onkeydown' => 'javascript: password_switch_radio_button(document.user_add,"password[password_auto]");')); $form->addGroup($group, 'password', get_lang('Password')); // Send email $group = array(); -$group[] =& $form->createElement('radio', 'send_mail', null, get_lang('Yes'), 1); -$group[] =& $form->createElement('radio', 'send_mail', null, get_lang('No'), 0); +$group[] = & $form->createElement('radio', 'send_mail', null, get_lang('Yes'), 1); +$group[] = & $form->createElement('radio', 'send_mail', null, get_lang('No'), 0); $form->addGroup($group, 'mail', get_lang('SendMailToNewUser')); // Set default values @@ -104,7 +104,7 @@ $defaults['password']['password_auto'] = 1; $form->setDefaults($defaults); // Submit button -$select_level = array (); +$select_level = array(); $html_results_enabled[] = $form->addButtonUpdate(get_lang('Update'), 'submit', true); $form->addGroup($html_results_enabled); // Validate form @@ -165,17 +165,17 @@ if ($form->validate()) { } $emailbody = get_lang('Dear')." ".stripslashes(api_get_person_name($userInfo['firstname'], $userInfo['lastname'])).",\n\n". - get_lang('YouAreReg')." ". api_get_setting('siteName') ." ".get_lang('WithTheFollowingSettings')."\n\n". - get_lang('Username')." : ". $username ."\n". get_lang('Pass')." : ".stripslashes($password)."\n\n" . - get_lang('Address') ." ". api_get_setting('siteName') ." ". - get_lang('Is') ." : ".$portal_url."\n\n". - get_lang('Problem'). "\n\n". + get_lang('YouAreReg')." ".api_get_setting('siteName')." ".get_lang('WithTheFollowingSettings')."\n\n". + get_lang('Username')." : ".$username."\n".get_lang('Pass')." : ".stripslashes($password)."\n\n". + get_lang('Address')." ".api_get_setting('siteName')." ". + get_lang('Is')." : ".$portal_url."\n\n". + get_lang('Problem')."\n\n". get_lang('SignatureFormula').",\n\n". api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))."\n". - get_lang('Manager'). " ". + get_lang('Manager')." ". api_get_setting('siteName')."\nT. ". - api_get_setting('administratorTelephone')."\n" . - get_lang('Email') ." : ".api_get_setting('emailAdministrator'); + api_get_setting('administratorTelephone')."\n". + get_lang('Email')." : ".api_get_setting('emailAdministrator'); $emailbody = nl2br($emailbody); api_mail_html( diff --git a/main/notebook/index.php b/main/notebook/index.php index 1dd98ea116..89a1767edd 100755 --- a/main/notebook/index.php +++ b/main/notebook/index.php @@ -9,7 +9,7 @@ require_once __DIR__.'/../inc/global.inc.php'; -$current_course_tool = TOOL_NOTEBOOK; +$current_course_tool = TOOL_NOTEBOOK; // The section (tabs) $this_section = SECTION_COURSES; @@ -99,7 +99,7 @@ if ($action === 'addnote') { NotebookManager::display_notes(); } else { echo ''; $token = Security::get_token(); $form->addElement('hidden', 'sec_token'); @@ -153,7 +153,7 @@ if ($action === 'addnote') { } else { echo '
    '; echo ''. - Display::return_icon('back.png',get_lang('BackToNotesList'),'',ICON_SIZE_MEDIUM).''; + Display::return_icon('back.png', get_lang('BackToNotesList'), '', ICON_SIZE_MEDIUM).''; echo '
    '; $token = Security::get_token(); $form->addElement('hidden', 'sec_token'); diff --git a/main/session/add_students_to_session.php b/main/session/add_students_to_session.php index d8f1fbdf8a..0a0b544a31 100644 --- a/main/session/add_students_to_session.php +++ b/main/session/add_students_to_session.php @@ -13,12 +13,12 @@ require_once __DIR__.'/../inc/global.inc.php'; $this_section = SECTION_PLATFORM_ADMIN; // setting breadcrumbs -$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); // Setting the name of the tool $tool_name = get_lang('SubscribeStudentsToSession'); $add_type = 'multiple'; -if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') { +if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') { $add_type = Security::remove_XSS($_REQUEST['add_type']); } $form_sent = 0; diff --git a/main/session/session_category_list.php b/main/session/session_category_list.php index 7cf30edec4..7c09b125aa 100644 --- a/main/session/session_category_list.php +++ b/main/session/session_category_list.php @@ -41,7 +41,7 @@ if ($action == 'delete_on_session' || $action == 'delete_off_session') { exit(); } -$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); if (isset($_GET['search']) && $_GET['search'] == 'advanced') { $interbreadcrumb[] = array("url" => 'session_category_list.php', "name" => get_lang('ListSessionCategory')); @@ -74,7 +74,7 @@ if (isset($_GET['search']) && $_GET['search'] == 'advanced') { $where .= " AND access_url_id = ".api_get_current_access_url_id()." "; } - $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); + $table_access_url_rel_session = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); $query = "SELECT sc.*, ( SELECT count(id) FROM $tbl_session s INNER JOIN $table_access_url_rel_session us diff --git a/main/session/session_list.php b/main/session/session_list.php index 9f59d98a3a..c20a4a1a0d 100644 --- a/main/session/session_list.php +++ b/main/session/session_list.php @@ -55,14 +55,14 @@ $courseSelect = $sessionFilter->addElement( 'course_name', get_lang('SearchCourse'), null, - array('url' => api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=search_course') + array('url' => api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_course') ); if (!empty($courseId)) { $courseInfo = api_get_course_info_by_id($courseId); $parents = CourseCategory::getParentsToString($courseInfo['categoryCode']); - $courseSelect->addOption($parents . $courseInfo['title'], $courseInfo['code'], ['selected' => 'selected']); + $courseSelect->addOption($parents.$courseInfo['title'], $courseInfo['code'], ['selected' => 'selected']); } $url = api_get_self(); @@ -114,7 +114,7 @@ $extra_params['autowidth'] = 'true'; // height auto $extra_params['height'] = 'auto'; -$extra_params['postData'] =array( +$extra_params['postData'] = array( 'filters' => array( "groupOp" => "AND", "rules" => $result['rules'], @@ -128,11 +128,11 @@ $extra_params['postData'] =array( //With this function we can add actions to the jgrid (edit, delete, etc) $action_links = 'function action_formatter(cellvalue, options, rowObject) { - return \''.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).''. - ' '.Display::return_icon('user_subscribe_session.png',get_lang('SubscribeUsersToSession'),'',ICON_SIZE_SMALL).''. - ' '.Display::return_icon('courses_to_session.png',get_lang('SubscribeCoursesToSession'),'',ICON_SIZE_SMALL).''. - ' '.Display::return_icon('copy.png',get_lang('Copy'),'',ICON_SIZE_SMALL).''. - ' '.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).''. + return \''.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).''. + ' '.Display::return_icon('user_subscribe_session.png', get_lang('SubscribeUsersToSession'), '', ICON_SIZE_SMALL).''. + ' '.Display::return_icon('courses_to_session.png', get_lang('SubscribeCoursesToSession'), '', ICON_SIZE_SMALL).''. + ' '.Display::return_icon('copy.png', get_lang('Copy'), '', ICON_SIZE_SMALL).''. + ' '.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).''. '\'; }'; @@ -301,18 +301,18 @@ $urlAjaxExtraField = api_get_path(WEB_AJAX_PATH).'extra_field.ajax.php?1=1'; '. - Display::return_icon('new_session.png',get_lang('AddSession'),'',ICON_SIZE_MEDIUM).''; + Display::return_icon('new_session.png', get_lang('AddSession'), '', ICON_SIZE_MEDIUM).''; if (api_is_platform_admin()) { echo ''. - Display::return_icon('session_to_category.png',get_lang('AddSessionsInCategories'),'',ICON_SIZE_MEDIUM).''; + Display::return_icon('session_to_category.png', get_lang('AddSessionsInCategories'), '', ICON_SIZE_MEDIUM).''; echo ''. - Display::return_icon('folder.png',get_lang('ListSessionCategory'),'',ICON_SIZE_MEDIUM).''; + Display::return_icon('folder.png', get_lang('ListSessionCategory'), '', ICON_SIZE_MEDIUM).''; } if ($list_type == 'complete') { - echo ''.Display::return_icon('view_remove.png',get_lang('Simple'),'',ICON_SIZE_MEDIUM).''; + echo ''.Display::return_icon('view_remove.png', get_lang('Simple'), '', ICON_SIZE_MEDIUM).''; } else { - echo ''.Display::return_icon('view_text.png',get_lang('Complete'),'',ICON_SIZE_MEDIUM).''; + echo ''.Display::return_icon('view_text.png', get_lang('Complete'), '', ICON_SIZE_MEDIUM).''; } echo $actions; diff --git a/main/social/group_topics.php b/main/social/group_topics.php index 56095f13bf..6ccf6cc1ab 100755 --- a/main/social/group_topics.php +++ b/main/social/group_topics.php @@ -10,7 +10,7 @@ $cidReset = true; require_once __DIR__.'/../inc/global.inc.php'; api_block_anonymous_users(); -if (api_get_setting('allow_social_tool') !='true') { +if (api_get_setting('allow_social_tool') != 'true') { api_not_allowed(); } @@ -67,7 +67,7 @@ if (isset($_POST['action'])) { } if ($_POST['action'] == 'edit_message_group') { - $edit_message_id = intval($_POST['message_id']); + $edit_message_id = intval($_POST['message_id']); $res = MessageManager::send_message( 0, $title, @@ -99,7 +99,7 @@ if (isset($_POST['action'])) { // display error messages if (!$res) { - $social_right_content .= Display::return_message(get_lang('Error'),'error'); + $social_right_content .= Display::return_message(get_lang('Error'), 'error'); } $topic_id = isset($_GET['topic_id']) ? intval($_GET['topic_id']) : null; if ($_POST['action'] == 'add_message_group') { @@ -197,9 +197,9 @@ $(document).ready(function() { '; $this_section = SECTION_SOCIAL; -$interbreadcrumb[] = array('url' => 'groups.php', 'name' => get_lang('Groups')); +$interbreadcrumb[] = array('url' => 'groups.php', 'name' => get_lang('Groups')); $interbreadcrumb[] = array('url' => 'group_view.php?id='.$group_id, 'name' => Security::remove_XSS($group_info['name'])); -$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Discussions')); +$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Discussions')); $social_left_content = SocialManager::show_social_menu('member_list', $group_id); $show_message = null; diff --git a/main/social/groups.php b/main/social/groups.php index e209dcdc4a..60e0cb342b 100755 --- a/main/social/groups.php +++ b/main/social/groups.php @@ -17,24 +17,24 @@ if (api_get_setting('allow_social_tool') !== 'true') { $join_url = ''; $this_section = SECTION_SOCIAL; -$allowed_views = array('mygroups','newest','pop'); +$allowed_views = array('mygroups', 'newest', 'pop'); $content = null; if (isset($_GET['view']) && in_array($_GET['view'], $allowed_views)) { if ($_GET['view'] == 'mygroups') { - $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups')); - $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('MyGroups')); - } else if ( $_GET['view'] == 'newest') { - $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups')); - $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Newest')); - } else { - $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups')); - $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Popular')); + $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups')); + $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('MyGroups')); + } else if ($_GET['view'] == 'newest') { + $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups')); + $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('Newest')); + } else { + $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups')); + $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('Popular')); } } else { - $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups')); + $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups')); if (!isset($_GET['id'])) { - $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('GroupList')); + $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('GroupList')); } } @@ -71,7 +71,7 @@ if (is_array($results) && count($results) > 0) { } elseif ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) { $name .= ' '.Display::return_icon('social_group_moderator.png', get_lang('Moderator'), array('style'=>'vertical-align:middle')); } - $url = '' . $name . ''; + $url = ''.$name.''; $count_users_group = count( $usergroup->get_users_by_group( @@ -108,9 +108,9 @@ if (is_array($results) && count($results) > 0) { $html .= '
    '; $html .= Display::tag('h5', $url); $html .= '
    '; - $html .= '
    ' . $members . '
    '; + $html .= '
    '.$members.'
    '; if ($result['description'] != '') { - $html .= '
    ' . cut($result['description'],100,true) . '
    '; + $html .= '
    '.cut($result['description'], 100, true).'
    '; } else { $html .= ''; } @@ -118,12 +118,12 @@ if (is_array($results) && count($results) > 0) { $html .= '
    '; $grid_item_2 = $html; - $grid_my_groups[]= array($grid_item_2); + $grid_my_groups[] = array($grid_item_2); } } // Newest groups -$results = $usergroup->get_groups_by_age(4,false); +$results = $usergroup->get_groups_by_age(4, false); $grid_newest_groups = array(); foreach ($results as $result) { @@ -132,16 +132,16 @@ foreach ($results as $result) { $id = $result['id']; $name = cut($result['name'], GROUP_TITLE_LENGTH, true); - $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000)); - if ($count_users_group == 1 ) { + $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0, 1000)); + if ($count_users_group == 1) { $count_users_group = $count_users_group.' '.get_lang('Member'); } else { $count_users_group = $count_users_group.' '.get_lang('Members'); } - $url = '' . $name . ''; + $url = ''.$name.''; - $picture = $usergroup->get_picture_group($result['id'], $result['picture'],80); + $picture = $usergroup->get_picture_group($result['id'], $result['picture'], 80); $result['picture'] = ''; $members = Display::returnFontAwesomeIcon('user').$count_users_group; @@ -153,15 +153,15 @@ foreach ($results as $result) { $html .= '
    '; $html .= Display::tag('h5', $url); $html .= '
    '; - $html .= '
    ' . $members . '
    '; + $html .= '
    '.$members.'
    '; if ($result['description'] != '') { - $html .= '
    ' . cut($result['description'],100,true) . '
    '; + $html .= '
    '.cut($result['description'], 100, true).'
    '; } else { $html .= ''; } //Avoiding my groups - if (!in_array($id,$my_group_list)) { + if (!in_array($id, $my_group_list)) { $html .= ''.get_lang('JoinGroup').' '; } @@ -202,9 +202,9 @@ if (is_array($results) && count($results) > 0) { $count_users_group = $count_users_group.' '.get_lang('Members'); } - $url = '' . $name . ''; + $url = ''.$name.''; - $picture = $usergroup->get_picture_group($result['id'], $result['picture'],80); + $picture = $usergroup->get_picture_group($result['id'], $result['picture'], 80); $result['picture'] = ''; $html = '
    '; @@ -215,14 +215,14 @@ if (is_array($results) && count($results) > 0) { $html .= '
    '; $html .= Display::tag('h5', $url); $html .= '
    '; - $html .= '
    ' . $members . '
    '; + $html .= '
    '.$members.'
    '; if ($result['description'] != '') { - $html .= '
    ' . cut($result['description'],100,true) . '
    '; + $html .= '
    '.cut($result['description'], 100, true).'
    '; } else { $html .= ''; } //Avoiding my groups - if (!in_array($id,$my_group_list)) { + if (!in_array($id, $my_group_list)) { $html .= ''.get_lang('JoinGroup').' '; } @@ -231,7 +231,7 @@ if (is_array($results) && count($results) > 0) { $html .= '
    '; $grid_item_2 = $html; - $grid_pop_groups[]= array($grid_item_2); + $grid_pop_groups[] = array($grid_item_2); } } @@ -254,58 +254,58 @@ if (isset($_GET['view']) && in_array($_GET['view'], $allowed_views)) { ); } if (api_get_setting('allow_students_to_create_groups_in_social') == 'true') { - $create_group_item = ''. + $create_group_item = ''. get_lang('CreateASocialGroup').''; } else { - if (api_is_allowed_to_edit(null,true)) { - $create_group_item = ''. + if (api_is_allowed_to_edit(null, true)) { + $create_group_item = ''. get_lang('CreateASocialGroup').''; } } break; case 'newest': if (count($grid_newest_groups) > 0) { - $newest_content = Display::return_sortable_grid('newest', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false)); + $newest_content = Display::return_sortable_grid('newest', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, false)); } break; default: if (count($grid_pop_groups) > 0) { - $popular_content = Display::return_sortable_grid('popular', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,true,true)); + $popular_content = Display::return_sortable_grid('popular', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, true, true)); } break; } } else { $my_group_content = null; if (count($grid_my_groups) > 0) { - $my_group_content = Display::return_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true,false)); + $my_group_content = Display::return_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true, false)); } else { $my_group_content = ''.get_lang('GroupNone').''; } if (api_get_setting('allow_students_to_create_groups_in_social') == 'true') { - $create_group_item = ''. + $create_group_item = ''. get_lang('CreateASocialGroup').''; } else { - if (api_is_allowed_to_edit(null,true)) { - $create_group_item = ''.get_lang('CreateASocialGroup').''; + if (api_is_allowed_to_edit(null, true)) { + $create_group_item = ''.get_lang('CreateASocialGroup').''; } } if (count($grid_newest_groups) > 0) { - $newest_content = Display::return_sortable_grid('mygroups', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false)); + $newest_content = Display::return_sortable_grid('mygroups', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, false)); } else { $newest_content = '
    '.get_lang('GroupNone').'
    '; } if (count($grid_pop_groups) > 0) { - $popular_content = Display::return_sortable_grid('mygroups', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,true,true)); + $popular_content = Display::return_sortable_grid('mygroups', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, true, true)); } else { $popular_content = '
    '.get_lang('GroupNone').'
    '; } } if (!empty($create_group_item)) { - $social_right_content .= Display::page_subheader($create_group_item); + $social_right_content .= Display::page_subheader($create_group_item); } $headers = array(get_lang('Newest'), get_lang('Popular'), get_lang('MyGroups')); -$social_right_content .= Display::tabs($headers, array($newest_content, $popular_content, $my_group_content),'tab_browse'); +$social_right_content .= Display::tabs($headers, array($newest_content, $popular_content, $my_group_content), 'tab_browse'); $tpl = new Template(null); diff --git a/main/ticket/report.php b/main/ticket/report.php index 9768f7b493..d9c74b6aa9 100644 --- a/main/ticket/report.php +++ b/main/ticket/report.php @@ -18,8 +18,8 @@ unset($_SESSION['this_section']); $htmlHeadXtra[] = '"; + echo ""; } } } diff --git a/main/work/download.php b/main/work/download.php index 6d9e047a36..b9c591ffa3 100755 --- a/main/work/download.php +++ b/main/work/download.php @@ -12,7 +12,7 @@ require_once __DIR__.'/../inc/global.inc.php'; require_once 'work.lib.php'; -$current_course_tool = TOOL_STUDENTPUBLICATION; +$current_course_tool = TOOL_STUDENTPUBLICATION; $this_section = SECTION_COURSES; // Course protection diff --git a/main/work/upload.php b/main/work/upload.php index 2d0011aff1..f8480ec098 100755 --- a/main/work/upload.php +++ b/main/work/upload.php @@ -4,7 +4,7 @@ use ChamiloSession as Session; require_once __DIR__.'/../inc/global.inc.php'; -$current_course_tool = TOOL_STUDENTPUBLICATION; +$current_course_tool = TOOL_STUDENTPUBLICATION; api_protect_course_script(true); diff --git a/src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/ProjectComment.php b/src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/ProjectComment.php index 6f1d7ea6db..71d4971e44 100644 --- a/src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/ProjectComment.php +++ b/src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/ProjectComment.php @@ -89,7 +89,7 @@ class ProjectComment extends Basic return [ $this->getNewPageBlock(), ['Undo', 'Redo'], - ['Link', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath'], + ['Link', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath'], ['BulletedList', 'NumberedList', 'HorizontalRule'], ['JustifyLeft', 'JustifyCenter', 'JustifyBlock'], ['Format', 'Font', 'FontSize', 'Bold', 'Italic', 'TextColor'], diff --git a/src/Chamilo/CoreBundle/Component/Editor/Driver/CourseDriver.php b/src/Chamilo/CoreBundle/Component/Editor/Driver/CourseDriver.php index e443b36bc9..c95e07d92e 100644 --- a/src/Chamilo/CoreBundle/Component/Editor/Driver/CourseDriver.php +++ b/src/Chamilo/CoreBundle/Component/Editor/Driver/CourseDriver.php @@ -27,13 +27,13 @@ class CourseDriver extends Driver implements DriverInterface if (!empty($courseInfo)) { $coursePath = api_get_path(SYS_COURSE_PATH); - $courseDir = $courseInfo['directory'] . '/document'; - $baseDir = $coursePath . $courseDir; + $courseDir = $courseInfo['directory'].'/document'; + $baseDir = $coursePath.$courseDir; $this->coursePath = $baseDir; // Creates shared folder - if (!file_exists($baseDir . '/shared_folder')) { + if (!file_exists($baseDir.'/shared_folder')) { $title = get_lang('UserFolders'); $folderName = '/shared_folder'; //$groupId = 0; @@ -52,9 +52,9 @@ class CourseDriver extends Driver implements DriverInterface } // Creates user-course folder - if (!file_exists($baseDir . '/shared_folder/sf_user_' . $userId)) { + if (!file_exists($baseDir.'/shared_folder/sf_user_'.$userId)) { $title = $userInfo['complete_name']; - $folderName = '/shared_folder/sf_user_' . $userId; + $folderName = '/shared_folder/sf_user_'.$userId; $visibility = 1; create_unexisting_directory( $courseInfo,