| 1 |
efrain |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
*
|
|
|
4 |
* Controlador: Microlearning
|
|
|
5 |
*
|
|
|
6 |
*/
|
|
|
7 |
declare(strict_types=1);
|
|
|
8 |
|
|
|
9 |
namespace LeadersLinked\Controller;
|
|
|
10 |
|
|
|
11 |
use Laminas\Db\Adapter\AdapterInterface;
|
|
|
12 |
|
|
|
13 |
use Laminas\Mvc\Controller\AbstractActionController;
|
|
|
14 |
use Laminas\Log\LoggerInterface;
|
|
|
15 |
use Laminas\View\Model\ViewModel;
|
|
|
16 |
use Laminas\View\Model\JsonModel;
|
| 283 |
www |
17 |
use LeadersLinked\Mapper\MicrolearningUserLogMapper;
|
|
|
18 |
use LeadersLinked\Model\MicrolearningUserLog;
|
|
|
19 |
use LeadersLinked\Mapper\MicrolearningCapsuleUserMapper;
|
|
|
20 |
use LeadersLinked\Mapper\MicrolearningUserProgressMapper;
|
|
|
21 |
use LeadersLinked\Mapper\MicrolearningSlideMapper;
|
| 1 |
efrain |
22 |
|
|
|
23 |
class ProfileMicrolearningController extends AbstractActionController
|
|
|
24 |
{
|
|
|
25 |
/**
|
|
|
26 |
*
|
|
|
27 |
* @var \Laminas\Db\Adapter\AdapterInterface
|
|
|
28 |
*/
|
|
|
29 |
private $adapter;
|
|
|
30 |
|
|
|
31 |
/**
|
|
|
32 |
*
|
|
|
33 |
* @var \LeadersLinked\Cache\CacheInterface
|
|
|
34 |
*/
|
|
|
35 |
private $cache;
|
|
|
36 |
|
|
|
37 |
|
|
|
38 |
/**
|
|
|
39 |
*
|
|
|
40 |
* @var \Laminas\Log\LoggerInterface
|
|
|
41 |
*/
|
|
|
42 |
private $logger;
|
|
|
43 |
|
|
|
44 |
/**
|
|
|
45 |
*
|
|
|
46 |
* @var array
|
|
|
47 |
*/
|
|
|
48 |
private $config;
|
|
|
49 |
|
|
|
50 |
|
|
|
51 |
/**
|
|
|
52 |
*
|
|
|
53 |
* @var \Laminas\Mvc\I18n\Translator
|
|
|
54 |
*/
|
|
|
55 |
private $translator;
|
|
|
56 |
|
|
|
57 |
|
|
|
58 |
/**
|
|
|
59 |
*
|
|
|
60 |
* @param \Laminas\Db\Adapter\AdapterInterface $adapter
|
|
|
61 |
* @param \LeadersLinked\Cache\CacheInterface $cache
|
|
|
62 |
* @param \Laminas\Log\LoggerInterface LoggerInterface $logger
|
|
|
63 |
* @param array $config
|
|
|
64 |
* @param \Laminas\Mvc\I18n\Translator $translator
|
|
|
65 |
*/
|
|
|
66 |
public function __construct($adapter, $cache, $logger, $config, $translator)
|
|
|
67 |
{
|
|
|
68 |
$this->adapter = $adapter;
|
|
|
69 |
$this->cache = $cache;
|
|
|
70 |
$this->logger = $logger;
|
|
|
71 |
$this->config = $config;
|
|
|
72 |
$this->translator = $translator;
|
|
|
73 |
}
|
|
|
74 |
|
|
|
75 |
/**
|
|
|
76 |
*
|
|
|
77 |
* Generación del listado de perfiles
|
|
|
78 |
* {@inheritDoc}
|
|
|
79 |
* @see \Laminas\Mvc\Controller\AbstractActionController::indexAction()
|
|
|
80 |
*/
|
|
|
81 |
public function indexAction()
|
|
|
82 |
{
|
|
|
83 |
//$currentUserPlugin = $this->plugin('currentUserPlugin');
|
|
|
84 |
//$currentUser = $currentUserPlugin->getUser();
|
|
|
85 |
|
|
|
86 |
$request = $this->getRequest();
|
|
|
87 |
if($request->isGet()) {
|
|
|
88 |
|
|
|
89 |
|
|
|
90 |
return new JsonModel([
|
|
|
91 |
'activities' => [
|
| 283 |
www |
92 |
'ACTIVITY_SIGNIN' => MicrolearningUserLog::ACTIVITY_SIGNIN,
|
|
|
93 |
'ACTIVITY_SIGNOUT' => MicrolearningUserLog::ACTIVITY_SIGNOUT,
|
|
|
94 |
'ACTIVITY_START_TOPIC' => MicrolearningUserLog::ACTIVITY_START_TOPIC,
|
|
|
95 |
'ACTIVITY_START_CAPSULE' => MicrolearningUserLog::ACTIVITY_START_CAPSULE,
|
|
|
96 |
'ACTIVITY_VIEW_SLIDE' => MicrolearningUserLog::ACTIVITY_VIEW_SLIDE,
|
|
|
97 |
'ACTIVITY_TAKE_A_TEST' => MicrolearningUserLog::ACTIVITY_TAKE_A_TEST,
|
|
|
98 |
'ACTIVITY_RETAKE_A_TEST' => MicrolearningUserLog::ACTIVITY_RETAKE_A_TEST,
|
|
|
99 |
'ACTIVITY_APPROVED_TEST' => MicrolearningUserLog::ACTIVITY_APPROVED_TEST,
|
|
|
100 |
'ACTIVITY_COMPLETED_CAPSULE' => MicrolearningUserLog::ACTIVITY_COMPLETED_CAPSULE,
|
|
|
101 |
'ACTIVITY_COMPLETED_TOPIC' => MicrolearningUserLog::ACTIVITY_COMPLETED_TOPIC
|
| 1 |
efrain |
102 |
]
|
|
|
103 |
]);
|
|
|
104 |
|
|
|
105 |
|
|
|
106 |
|
|
|
107 |
} else {
|
|
|
108 |
return new JsonModel([
|
|
|
109 |
'success' => false,
|
|
|
110 |
'data' => 'ERROR_METHOD_NOT_ALLOWED'
|
|
|
111 |
]);
|
|
|
112 |
}
|
|
|
113 |
}
|
|
|
114 |
|
|
|
115 |
|
| 119 |
efrain |
116 |
|
| 1 |
efrain |
117 |
|
|
|
118 |
|
|
|
119 |
|
|
|
120 |
}
|