|
|
@ -133,7 +133,13 @@ class ResourceController extends AbstractResourceController implements CourseCon |
|
|
|
$translation = $this->translator; |
|
|
|
$translation = $this->translator; |
|
|
|
$courseIdentifier = $course->getCode(); |
|
|
|
$courseIdentifier = $course->getCode(); |
|
|
|
|
|
|
|
|
|
|
|
$routeParams = ['tool' => $tool, 'type' => $type, 'cidReq' => $courseIdentifier, 'id']; |
|
|
|
$routeParams = [ |
|
|
|
|
|
|
|
'tool' => $tool, |
|
|
|
|
|
|
|
'type' => $type, |
|
|
|
|
|
|
|
'cidReq' => $courseIdentifier, |
|
|
|
|
|
|
|
'id', |
|
|
|
|
|
|
|
'id_session' => $this->getSessionId(), |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
// Title link. |
|
|
|
// Title link. |
|
|
|
$grid->getColumn('title')->setTitle($this->trans('Name')); |
|
|
|
$grid->getColumn('title')->setTitle($this->trans('Name')); |
|
|
@ -210,7 +216,7 @@ class ResourceController extends AbstractResourceController implements CourseCon |
|
|
|
$grid->setHiddenColumns(['iid']); |
|
|
|
$grid->setHiddenColumns(['iid']); |
|
|
|
|
|
|
|
|
|
|
|
// Delete mass action. |
|
|
|
// Delete mass action. |
|
|
|
if ($this->isGranted(ResourceNodeVoter::ROLE_CURRENT_COURSE_TEACHER)) { |
|
|
|
if ($this->isGranted(ResourceNodeVoter::DELETE, $this->getCourse())) { |
|
|
|
$deleteMassAction = new MassAction( |
|
|
|
$deleteMassAction = new MassAction( |
|
|
|
'Delete', |
|
|
|
'Delete', |
|
|
|
'ChamiloCoreBundle:Resource:deleteMass', |
|
|
|
'ChamiloCoreBundle:Resource:deleteMass', |
|
|
@ -240,7 +246,7 @@ class ResourceController extends AbstractResourceController implements CourseCon |
|
|
|
$myRowAction->addManipulateRender($setNodeParameters); |
|
|
|
$myRowAction->addManipulateRender($setNodeParameters); |
|
|
|
$grid->addRowAction($myRowAction); |
|
|
|
$grid->addRowAction($myRowAction); |
|
|
|
|
|
|
|
|
|
|
|
if ($this->isGranted(ResourceNodeVoter::ROLE_CURRENT_COURSE_TEACHER)) { |
|
|
|
if ($this->isGranted(ResourceNodeVoter::EDIT, $this->getCourse())) { |
|
|
|
// Edit action. |
|
|
|
// Edit action. |
|
|
|
$myRowAction = new RowAction( |
|
|
|
$myRowAction = new RowAction( |
|
|
|
$translation->trans('Edit'), |
|
|
|
$translation->trans('Edit'), |
|
|
@ -728,8 +734,7 @@ class ResourceController extends AbstractResourceController implements CourseCon |
|
|
|
$this->setBreadCrumb( $request); |
|
|
|
$this->setBreadCrumb( $request); |
|
|
|
//$helper = $this->container->get('oneup_uploader.templating.uploader_helper'); |
|
|
|
//$helper = $this->container->get('oneup_uploader.templating.uploader_helper'); |
|
|
|
//$endpoint = $helper->endpoint('courses'); |
|
|
|
//$endpoint = $helper->endpoint('courses'); |
|
|
|
$session = $this->getSession(); |
|
|
|
$sessionId = $this->getSessionId(); |
|
|
|
$sessionId = $session ? $session->getId() : 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $this->render( |
|
|
|
return $this->render( |
|
|
|
'@ChamiloTheme/Resource/upload.html.twig', |
|
|
|
'@ChamiloTheme/Resource/upload.html.twig', |
|
|
@ -962,6 +967,7 @@ class ResourceController extends AbstractResourceController implements CourseCon |
|
|
|
'tool' => $tool, |
|
|
|
'tool' => $tool, |
|
|
|
'type' => $type, |
|
|
|
'type' => $type, |
|
|
|
'cidReq' => $this->getCourse()->getCode(), |
|
|
|
'cidReq' => $this->getCourse()->getCode(), |
|
|
|
|
|
|
|
'id_session' => $this->getSessionId(), |
|
|
|
] |
|
|
|
] |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|