Skip to content

Commit

Permalink
LTI: Add namespace in classes for forms
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Aug 12, 2021
1 parent 4d8435a commit db0d61c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 deletions.
4 changes: 2 additions & 2 deletions plugin/ims_lti/configure.php
Expand Up @@ -35,7 +35,7 @@

switch ($action) {
case 'add':
$form = new FrmAdd('ims_lti_add_tool', [], $baseTool);
$form = new \Chamilo\PluginBundle\ImsLti\Form\FrmAdd('ims_lti_add_tool', [], $baseTool);
$form->build();

if ($baseTool) {
Expand Down Expand Up @@ -173,7 +173,7 @@
break;
}

$form = new FrmEdit('ims_lti_edit_tool', [], $tool);
$form = new \Chamilo\PluginBundle\Form\FrmEdit('ims_lti_edit_tool', [], $tool);
$form->build(false);

if ($form->validate()) {
Expand Down
1 change: 1 addition & 0 deletions plugin/ims_lti/create.php
@@ -1,6 +1,7 @@
<?php
/* For license terms, see /license.txt */
use Chamilo\PluginBundle\Entity\ImsLti\ImsLtiTool;
use Chamilo\PluginBundle\ImsLti\Form\FrmAdd;

$cidReset = true;

Expand Down
1 change: 1 addition & 0 deletions plugin/ims_lti/edit.php
@@ -1,6 +1,7 @@
<?php
/* For license terms, see /license.txt */
use Chamilo\PluginBundle\Entity\ImsLti\ImsLtiTool;
use Chamilo\PluginBundle\Form\FrmEdit;

$cidReset = true;

Expand Down
13 changes: 11 additions & 2 deletions plugin/ims_lti/src/Form/FrmAdd.php
@@ -1,7 +1,16 @@
<?php
/* For licensing terms, see /license.txt */

namespace Chamilo\PluginBundle\ImsLti\Form;

use Category;
use Chamilo\PluginBundle\Entity\ImsLti\ImsLtiTool;
use Display;
use FormValidator;
use ImsLti;
use ImsLtiPlugin;
use LtiAssignmentGradesService;
use LtiNamesRoleProvisioningService;

/**
* Class FrmAdd.
Expand All @@ -15,7 +24,7 @@ class FrmAdd extends FormValidator
/**
* @var bool
*/
private $toolIsV1p3 = false;
private $toolIsV1p3;

/**
* FrmAdd constructor.
Expand Down Expand Up @@ -194,7 +203,7 @@ public function setDefaultValues()
$this->setDefaults($defaults);
}

public function returnForm()
public function returnForm(): string
{
$js = "<script>
\$(function () {
Expand Down
13 changes: 10 additions & 3 deletions plugin/ims_lti/src/Form/FrmEdit.php
@@ -1,7 +1,16 @@
<?php
/* For licensing terms, see /license.txt */

namespace Chamilo\PluginBundle\Form;

use Category;
use Chamilo\PluginBundle\Entity\ImsLti\ImsLtiTool;
use Display;
use FormValidator;
use ImsLti;
use ImsLtiPlugin;
use LtiAssignmentGradesService;
use LtiNamesRoleProvisioningService;

/**
* Class FrmAdd.
Expand Down Expand Up @@ -34,8 +43,6 @@ public function __construct(
* Build the form.
*
* @param bool $globalMode
*
* @throws Exception
*/
public function build($globalMode = true)
{
Expand Down Expand Up @@ -179,7 +186,7 @@ public function build($globalMode = true)
}

/**
* @throws Exception
* @throws \Exception
*/
public function setDefaultValues()
{
Expand Down

0 comments on commit db0d61c

Please sign in to comment.