Minor - format code, comment error_log

pull/3904/head
Julio Montoya 4 years ago
parent f48fe093c8
commit 0cac960663
  1. 2
      public/main/social/group_view.php
  2. 8
      src/CoreBundle/Controller/Api/BaseResourceFileAction.php
  3. 5
      src/CoreBundle/Controller/CourseHomeController.php

@ -117,7 +117,7 @@ if (0 != $group_id) {
$user_leaved = intval($_GET['u']);
// I can "leave me myself"
if (api_get_user_id() == $user_leaved) {
if (UserGroup::canLeave($groupInfo)) {
if (UserGroupModel::canLeave($groupInfo)) {
$usergroup->delete_user_rel_group($user_leaved, $group_id);
Display::addFlash(
Display::return_message(get_lang('User is not subscribed to this group'), 'confirmation', false)

@ -19,7 +19,7 @@ class BaseResourceFileAction
{
protected function handleCreateRequest(AbstractResource $resource, Request $request): void
{
error_log('handleCreateRequest');
//error_log('handleCreateRequest');
$contentData = $request->getContent();
if (!empty($contentData)) {
$contentData = json_decode($contentData, true);
@ -48,7 +48,7 @@ class BaseResourceFileAction
$resource->setParentResourceNode($nodeId);
error_log("fileType: $fileType");
//error_log("fileType: $fileType");
switch ($fileType) {
case 'file':
$content = '';
@ -97,11 +97,11 @@ class BaseResourceFileAction
protected function handleUpdateRequest(AbstractResource $resource, $repo, Request $request)
{
error_log('handleUpdateRequest');
//error_log('handleUpdateRequest');
$contentData = $request->getContent();
$resourceLinkList = [];
if (!empty($contentData)) {
error_log('contentData');
//error_log('contentData');
$contentData = json_decode($contentData, true);
$title = $contentData['title'];
$content = $contentData['contentFile'];

@ -57,9 +57,6 @@ class CourseHomeController extends ToolBaseController
$session = $request->getSession();
/*$js = '<script>'.api_get_language_translate_html().'</script>';
$htmlHeadXtra[] = $js;*/
$userId = 0;
$user = $this->getUser();
if (null !== $user) {
@ -114,6 +111,7 @@ class CourseHomeController extends ToolBaseController
Event::registerLog($logInfo);
$qb = $toolRepository->getResourcesByCourse($course, $this->getSession());
$qb->addSelect('tool');
$qb->innerJoin('resource.tool', 'tool');
@ -193,7 +191,6 @@ class CourseHomeController extends ToolBaseController
$shortcutQuery = $shortcutRepository->getResources($user, $course->getResourceNode(), $course);
$shortcuts = $shortcutQuery->getQuery()->getResult();
}
$responseData = [
'course' => $course,
'shortcuts' => $shortcuts,

Loading…
Cancel
Save