forked from ZwiiCMS-Team/ZwiiCampus
Statistiques nombre de pages vues okay
This commit is contained in:
parent
1cac48fd10
commit
d5d001d2b4
@ -622,6 +622,7 @@ class common
|
||||
'dir' => self::DATA_DIR . $path . '/',
|
||||
'backup' => file_exists('site/data/.backup')
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -704,7 +705,6 @@ class common
|
||||
|
||||
/**
|
||||
* Fonction pour construire le tableau des pages
|
||||
* Appelée par le core uniquement
|
||||
*/
|
||||
|
||||
private function buildHierarchy()
|
||||
|
@ -419,8 +419,9 @@ class course extends common
|
||||
// Statistiques du cours sélectionné calcul du nombre de pages
|
||||
$sumPages = 0;
|
||||
$data = json_decode(file_get_contents(self::DATA_DIR . $courseId . '/page.json'), true);
|
||||
// Exclure les barres et les pages masquées
|
||||
foreach ($data['page'] as $pageId => $pageData) {
|
||||
if ($pageData['block'] !== 'bar') {
|
||||
if ($pageData['position'] > 0) {
|
||||
$sumPages++;
|
||||
}
|
||||
}
|
||||
@ -471,7 +472,8 @@ class course extends common
|
||||
|
||||
// Construction du tableau
|
||||
self::$courseUsers[] = [
|
||||
$userId,
|
||||
//$userId,
|
||||
$viewPages . '=' . $sumPages,
|
||||
$this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']),
|
||||
$pageId,
|
||||
helper::dateUTF8('%d %B %Y - %H:%M', $maxTime),
|
||||
@ -673,10 +675,12 @@ class course extends common
|
||||
$userId = $this->getUrl(3);
|
||||
$history = $this->getData(['enrolment', $courseId, $userId]);
|
||||
$pages = json_decode(file_get_contents(self::DATA_DIR . $courseId . '/page.json'), true);
|
||||
$pages = $pages ['page'];
|
||||
|
||||
foreach ($history['history'] as $pageId => $time) {
|
||||
self::$userHistory[$pageId] = [
|
||||
helper::dateUTF8('%d %B %Y - %H:%M:%S', $time),
|
||||
$pages['page'][$pageId]['title'],
|
||||
$pages[$pageId]['title'],
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
<?php if ($module::$userHistory): ?>
|
||||
<div class="row textAlignCenter">
|
||||
<div class="col8">
|
||||
<?php echo template::table([6, 6], $module::$userHistory, ['Dernière consultation de cette page', 'Titre de la page'], ['id' => 'dataTables']); ?>
|
||||
<?php echo template::table([1, 6, 5], $module::$userHistory, ['Ordre', 'Titre de la page', 'Dernière consultation de cette page'], ['id' => 'dataTables']); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
|
Loading…
Reference in New Issue
Block a user