Minor - format code

pull/3924/head
Julio Montoya 3 years ago
parent a19c736829
commit 1de8f15439
  1. 1
      public/main/inc/ajax/record_audio_rtc.ajax.php
  2. 4
      public/main/inc/lib/api.lib.php
  3. 1
      public/main/ticket/projects.php
  4. 95
      src/CoreBundle/Controller/ResourceController.php

@ -50,7 +50,6 @@ $audioDir = Security::remove_XSS($_REQUEST['audio_dir']);
switch ($type) {
case 'document':
if (empty($audioDir)) {
$audioDir = '/';
}

@ -5594,8 +5594,8 @@ function api_replace_dangerous_char($filename, $treat_spaces_as_hyphens = true)
// Replace multiple dots at the end.
$regex = "/\.+$/";
$url = preg_replace($regex, '', $url);
return $url;
return preg_replace($regex, '', $url);
}
/**

@ -170,7 +170,6 @@ $items = [
'content' => get_lang('Add project'),
];
$actions = Display::url(
Display::return_icon('back.png', get_lang('Tickets'), [], ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH).'ticket/tickets.php'

@ -59,9 +59,9 @@ class ResourceController extends AbstractResourceController implements CourseCon
* For the tool value check the Tool entity.
* For the type value check the ResourceType entity.
*/
public function indexAction(Request $request): Response
/*public function indexAction(Request $request): Response
{
/*$tool = $request->get('tool');
$tool = $request->get('tool');
$type = $request->get('type');
$parentResourceNode = $this->getParentResourceNode($request);
@ -81,8 +81,8 @@ class ResourceController extends AbstractResourceController implements CourseCon
'parent_resource_node' => $parentResourceNode,
'resource_settings' => $settings,
]
);*/
}
);
}*/
/**
* @deprecated Use Vue
@ -91,52 +91,52 @@ class ResourceController extends AbstractResourceController implements CourseCon
*
* If node has children show it
*/
public function listAction(Request $request): void
/*public function listAction(Request $request): void
{
/*$tool = $request->get('tool');
$tool = $request->get('tool');
$type = $request->get('type');
$resourceNodeId = $request->get('id');
$repository = $this->getRepositoryFromRequest($request);
$settings = $repository->getResourceSettings();*/
/*$grid = $this->getGrid($request, $repository, $grid, $resourceNodeId, 'chamilo_core_resource_list');
$parentResourceNode = $this->getParentResourceNode($request);
$this->setBreadCrumb($request, $parentResourceNode);*/
/*$grid = $this->getGrid($request, $repository, $grid, $resourceNodeId, 'chamilo_core_resource_list');
$parentResourceNode = $this->getParentResourceNode($request);
$this->setBreadCrumb($request, $parentResourceNode);*/
//return $grid->getGridResponse(
/*return $this->render(
$repository->getTemplates()->getFromAction(__FUNCTION__),
[
'parent_id' => $resourceNodeId,
'tool' => $tool,
'type' => $type,
'id' => $resourceNodeId,
'parent_resource_node' => $parentResourceNode,
'resource_settings' => $settings,
]
);*/
}
//return $grid->getGridResponse(
/*return $this->render(
$repository->getTemplates()->getFromAction(__FUNCTION__),
[
'parent_id' => $resourceNodeId,
'tool' => $tool,
'type' => $type,
'id' => $resourceNodeId,
'parent_resource_node' => $parentResourceNode,
'resource_settings' => $settings,
]
);
}*/
/**
* @deprecated Use Vue
*
* @Route("/{tool}/{type}/{id}/new_folder", methods={"GET", "POST"}, name="chamilo_core_resource_new_folder")
*/
public function newFolderAction(Request $request): Response
/*public function newFolderAction(Request $request): Response
{
//return $this->createResource($request, 'folder');
}
return $this->createResource($request, 'folder');
}*/
/**
* @deprecated Use Vue
*
* @Route("/{tool}/{type}/{id}/new", methods={"GET", "POST"}, name="chamilo_core_resource_new")
*/
public function newAction(Request $request): Response
/*public function newAction(Request $request): Response
{
//return $this->createResource($request, 'file');
}
return $this->createResource($request, 'file');
}*/
/**
* @Route("/{tool}/{type}/{id}/disk_space", methods={"GET", "POST"}, name="chamilo_core_resource_disk_space")
@ -301,9 +301,9 @@ class ResourceController extends AbstractResourceController implements CourseCon
*
* @Route("/{tool}/{type}/{id}/info", methods={"GET", "POST"}, name="chamilo_core_resource_info")
*/
public function infoAction(Request $request): Response
/*public function infoAction(Request $request): Response
{
/*$nodeId = $request->get('id');
$nodeId = $request->get('id');
$repository = $this->getRepositoryFromRequest($request);
$resource = $repository->getResourceFromResourceNode($nodeId);
@ -335,17 +335,17 @@ class ResourceController extends AbstractResourceController implements CourseCon
return $this->render(
$repository->getTemplates()->getFromAction(__FUNCTION__, $request->isXmlHttpRequest()),
$params
);*/
}
);
}*/
/**
* Preview a file. Mostly used when using a modal.
*
* @Route("/{tool}/{type}/{id}/preview", methods={"GET"}, name="chamilo_core_resource_preview")
*/
public function previewAction(Request $request): Response
/*public function previewAction(Request $request): Response
{
/*$nodeId = $request->get('id');
$nodeId = $request->get('id');
$repository = $this->getRepositoryFromRequest($request);
$resource = $repository->getResourceFromResourceNode($nodeId);
@ -369,11 +369,11 @@ class ResourceController extends AbstractResourceController implements CourseCon
'type' => $type,
];
return $this->render($repository->getTemplates()->getFromAction(__FUNCTION__), $params);*/
}
return $this->render($repository->getTemplates()->getFromAction(__FUNCTION__), $params);
}*/
/**
* @deprecated use vue.
* @deprecated use vue
*
* @Route("/{tool}/{type}/{id}/change_visibility", name="chamilo_core_resource_change_visibility")
*/
@ -493,13 +493,14 @@ class ResourceController extends AbstractResourceController implements CourseCon
/**
* Shows the associated resource file.
* @deprecated use vue.
*
* @deprecated use vue
*
* @Route("/{tool}/{type}/{id}/view_resource", methods={"GET"}, name="chamilo_core_resource_view_resource")
*/
public function viewResourceAction(Request $request, RouterInterface $router): Response
/*public function viewResourceAction(Request $request, RouterInterface $router): Response
{
/*$id = $request->get('id');
$id = $request->get('id');
$resourceNode = $this->getResourceNodeRepository()->find($id);
@ -527,8 +528,8 @@ class ResourceController extends AbstractResourceController implements CourseCon
'type' => $type,
];
return $this->render($repository->getTemplates()->getFromAction(__FUNCTION__), $params);*/
}
return $this->render($repository->getTemplates()->getFromAction(__FUNCTION__), $params);
}*/
/**
* View file of a resource node.
@ -658,14 +659,15 @@ class ResourceController extends AbstractResourceController implements CourseCon
/**
* Upload form.
* @deprecated use vue + api platform.
*
* @deprecated use vue + api platform
*
* @Route("/{tool}/{type}/{id}/upload", name="chamilo_core_resource_upload", methods={"GET", "POST"},
* options={"expose"=true})
*/
public function uploadAction(Request $request, $tool, $type, $id): Response
/*public function uploadAction(Request $request, $tool, $type, $id): Response
{
/*$repository = $this->getRepositoryFromRequest($request);
$repository = $this->getRepositoryFromRequest($request);
$resourceNode = $repository->getResourceNodeRepository()->find($id);
$this->denyAccessUnlessGranted(
@ -682,8 +684,7 @@ class ResourceController extends AbstractResourceController implements CourseCon
$routeParams['id'] = $id;
return $this->render($repository->getTemplates()->getFromAction(__FUNCTION__), $routeParams);
*/
}
}*/
/**
* @return mixed|StreamedResponse

Loading…
Cancel
Save