Minor - add phpdocs, format code.

pull/3064/head
Julio Montoya 5 years ago
parent d99999f0ec
commit bb1d39d87c
  1. 8
      src/CoreBundle/Controller/ResourceController.php
  2. 21
      src/CourseBundle/Controller/Home/CourseHomeController.php
  3. 2
      src/CourseBundle/Entity/CExerciseCategory.php
  4. 1
      src/ThemeBundle/Resources/views/Resource/index.html.twig

@ -95,6 +95,7 @@ class ResourceController extends AbstractResourceController implements CourseCon
{
$tool = $request->get('tool');
$type = $request->get('type');
$id = (int) $request->get('id');
$repository = $this->getRepositoryFromRequest($request);
$class = $repository->getRepository()->getClassName();
@ -129,16 +130,16 @@ class ResourceController extends AbstractResourceController implements CourseCon
'type' => $type,
'cidReq' => $this->getCourse()->getCode(),
'id_session' => $this->getSessionId(),
'id' => $request->get('id'),
'id' => $id,
]
)
);
$title = $grid->getColumn('title');
$title->setSafe(false);
$title->setSafe(false); // allows links in the title
//$grid->hideFilters();
$grid->setLimits(20);
//$grid->setLimits(20);
//$grid->isReadyForRedirect();
//$grid->setMaxResults(1);
//$grid->setLimits(2);
@ -160,7 +161,6 @@ class ResourceController extends AbstractResourceController implements CourseCon
$grid->getColumn('title')->manipulateRenderCell(
function ($value, Row $row, $router) use ($routeParams) {
/** @var Router $router */
/** @var CDocument $entity */
$entity = $row->getEntity();

@ -35,25 +35,22 @@ class CourseHomeController extends ToolBaseController
*/
public function indexAction(Request $request)
{
$session = $this->getSession();
$course = $this->getCourse();
$courseCode = $course->getId();
$result = $this->autoLaunch();
$js = '<script>'.api_get_language_translate_html().'</script>';
$htmlHeadXtra[] = $js;
$user_id = api_get_user_id();
$course_code = api_get_course_id();
$courseId = api_get_course_int_id();
$sessionId = api_get_session_id();
$courseCode = $course->getCode();
$courseId = $course->getId();
$sessionId = $this->getSessionId();
$show_message = '';
if (api_is_invitee()) {
$isInASession = $sessionId > 0;
$isSubscribed = CourseManager::is_user_subscribed_in_course(
$user_id,
$course_code,
$courseCode,
$isInASession,
$sessionId
);
@ -71,7 +68,7 @@ class CourseHomeController extends ToolBaseController
if ($isSpecialCourse) {
if (isset($_GET['autoreg']) && $_GET['autoreg'] == 1) {
if (CourseManager::subscribeUser($user_id, $course_code, STUDENT)) {
if (CourseManager::subscribeUser($user_id, $courseCode, STUDENT)) {
Session::write('is_allowed_in_course', true);
}
}
@ -82,9 +79,9 @@ class CourseHomeController extends ToolBaseController
if ($action == 'subscribe') {
if (Security::check_token('get')) {
Security::clear_token();
$result = CourseManager::autoSubscribeToCourse($course_code);
$result = CourseManager::autoSubscribeToCourse($courseCode);
if ($result) {
if (CourseManager::is_user_subscribed_in_course($user_id, $course_code)) {
if (CourseManager::is_user_subscribed_in_course($user_id, $courseCode)) {
Session::write('is_allowed_in_course', true);
}
}
@ -97,9 +94,9 @@ class CourseHomeController extends ToolBaseController
api_protect_course_script(true);
/* STATISTICS */
if (!isset($coursesAlreadyVisited[$course_code])) {
if (!isset($coursesAlreadyVisited[$courseCode])) {
Event::accessCourse();
$coursesAlreadyVisited[$course_code] = 1;
$coursesAlreadyVisited[$courseCode] = 1;
Session::write('coursesAlreadyVisited', $coursesAlreadyVisited);
}

@ -18,7 +18,7 @@ use Gedmo\Timestampable\Traits\TimestampableEntity;
*
* @ORM\Entity(repositoryClass="Gedmo\Sortable\Entity\Repository\SortableRepository")
*
* @GRID\Source(columns="id, name")
* @GRID\Source(columns="id, name", filterable=false)
*/
class CExerciseCategory extends AbstractResource implements ResourceInterface
{

@ -31,6 +31,7 @@
"thumbs",
"close"
],
// https://github.com/fancyapps/fancybox/issues/2009
video: {
autoStart: false
}

Loading…
Cancel
Save