diff --git a/main/admin/add_drh_to_user.php b/main/admin/add_drh_to_user.php index d78fe82d55..3db1d058bc 100644 --- a/main/admin/add_drh_to_user.php +++ b/main/admin/add_drh_to_user.php @@ -15,7 +15,7 @@ if (!isset($_REQUEST['u'])) { } $em = Database::getManager(); -$userRepository = $em->getRepository('ChamiloUserBundle:User'); +$userRepository = UserManager::getRepository(); /** @var UserEntity $user */ $user = UserManager::getManager()->find($_REQUEST['u']); diff --git a/main/admin/archive_cleanup.php b/main/admin/archive_cleanup.php index ebad2f5049..17b963fdec 100755 --- a/main/admin/archive_cleanup.php +++ b/main/admin/archive_cleanup.php @@ -36,6 +36,18 @@ if ($form->validate()) { opcache_reset(); } + $file = api_get_path(SYS_PUBLIC_PATH).'build/main.js'; + if (file_exists($file)) { + unlink($file); + } + $dir = api_get_path(SYS_PUBLIC_PATH).'build'; + $files = scandir($dir); + foreach ($files as $file) { + if (preg_match('/main\..*\.js/', $file)) { + unlink($dir.'/'.$file); + } + } + $archive_path = api_get_path(SYS_ARCHIVE_PATH); $htaccess = @file_get_contents($archive_path.'.htaccess'); $result = rmdirr($archive_path, true, true); diff --git a/main/admin/user_edit.php b/main/admin/user_edit.php index 7f2a505e5a..92a37d825d 100755 --- a/main/admin/user_edit.php +++ b/main/admin/user_edit.php @@ -388,7 +388,7 @@ if ($form->validate()) { $picture_uri = $user_data['picture_uri']; if (isset($user['delete_picture']) && $user['delete_picture']) { - $picture_uri = UserManager::delete_user_picture($user_id); + $picture_uri = UserManager::deleteUserPicture($user_id); } elseif (!empty($picture['name'])) { $picture_uri = UserManager::update_user_picture( $user_id, diff --git a/main/admin/user_information.php b/main/admin/user_information.php index 13998ba9cf..4863236ece 100755 --- a/main/admin/user_information.php +++ b/main/admin/user_information.php @@ -621,8 +621,7 @@ if ($studentBossList) { } $em = Database::getManager(); -/** @var \Chamilo\UserBundle\Entity\Repository\UserRepository $userRepository */ -$userRepository = $em->getRepository('ChamiloUserBundle:User'); +$userRepository = UserManager::getRepository(); $hrmList = $userRepository->getAssignedHrmUserList( $userEntity->getId(), diff --git a/main/announcements/announcements.php b/main/announcements/announcements.php index a48c9954a8..7374f82f18 100755 --- a/main/announcements/announcements.php +++ b/main/announcements/announcements.php @@ -378,7 +378,7 @@ switch ($action) { } // DISPLAY ADD ANNOUNCEMENT COMMAND - $id = isset($_GET['id']) ? intval($_GET['id']) : 0; + $id = isset($_GET['id']) ? (int) $_GET['id'] : 0; $url = api_get_self().'?action='.$action.'&id='.$id.'&'.api_get_cidreq(); $form = new FormValidator( @@ -389,15 +389,13 @@ switch ($action) { ['enctype' => 'multipart/form-data'] ); + $form_name = get_lang('ModifyAnnouncement'); if (empty($id)) { $form_name = get_lang('AddAnnouncement'); - } else { - $form_name = get_lang('ModifyAnnouncement'); } - $interbreadcrumb[] = [ - "url" => api_get_path(WEB_CODE_PATH)."announcements/announcements.php?".api_get_cidreq(), - "name" => $nameTools, + 'url' => api_get_path(WEB_CODE_PATH).'announcements/announcements.php?'.api_get_cidreq(), + 'name' => $nameTools, ]; $nameTools = $form_name; @@ -424,7 +422,7 @@ switch ($action) { } elseif (isset($_GET['remindallinactives']) && $_GET['remindallinactives'] === 'true') { // we want to remind inactive users. The $_GET['since'] parameter // determines which users have to be warned (i.e the users who have been inactive for x days or more - $since = isset($_GET['since']) ? intval($_GET['since']) : 6; + $since = isset($_GET['since']) ? (int) $_GET['since'] : 6; // Getting the users who have to be reminded $to = Tracking::getInactiveStudentsInCourse( @@ -477,7 +475,6 @@ switch ($action) { $announcementInfo = AnnouncementManager::get_by_id($courseId, $id); if (isset($announcementInfo) && !empty($announcementInfo)) { $to = AnnouncementManager::load_edit_users('announcement', $id); - $defaults = [ 'title' => $announcementInfo['title'], 'content' => $announcementInfo['content'], @@ -498,7 +495,6 @@ switch ($action) { if (!isset($parts[1]) || empty($parts[1])) { continue; } - $form->addHtml(" diff --git a/main/template/default/layout/head.tpl b/main/template/default/layout/head.tpl index a99e580783..b515a17056 100755 --- a/main/template/default/layout/head.tpl +++ b/main/template/default/layout/head.tpl @@ -19,42 +19,12 @@ {{ css_static_file_to_string }} {{ js_file_to_string }} {{ extra_headers }} - - -{% include 'layout/header.js.tpl'|get_template %} +{% if _s.language_interface %} + +{% else %}{# language_interface *should* always be defined, so we should never come here #} + +{% endif %} {{ css_custom_file_to_string }} {{ css_style_print }} diff --git a/main/template/default/layout/header.js.tpl b/main/template/default/layout/header.js.tpl index 603227b215..23462226d9 100644 --- a/main/template/default/layout/header.js.tpl +++ b/main/template/default/layout/header.js.tpl @@ -1,5 +1,37 @@ - diff --git a/main/template/default/layout/page.tpl b/main/template/default/layout/page.tpl index d1e5b406da..815ac0b0e2 100755 --- a/main/template/default/layout/page.tpl +++ b/main/template/default/layout/page.tpl @@ -58,8 +58,6 @@ {% if show_footer == true %} {% include 'layout/page_footer.tpl'|get_template %} {% endif %} - - {% include 'layout/footer.js.tpl'|get_template %} \ No newline at end of file diff --git a/main/template/default/layout/page_footer.tpl b/main/template/default/layout/page_footer.tpl index a0d6fb97ed..dd33dbb786 100755 --- a/main/template/default/layout/page_footer.tpl +++ b/main/template/default/layout/page_footer.tpl @@ -62,6 +62,23 @@ +{# Global modal, load content by AJAX call to href attribute on anchor tag with 'ajax' class #} + + +{# Expands an image modal #} -{# Global modal, load content by AJAX call to href attribute on anchor tag with 'ajax' class #} -