Passed
Pull Request — master (#81)
by Michael
02:51
created
Severity
1
<?php declare(strict_types=1);
2
3
/*
4
 You may not change or alter any portion of this comment or credits
5
 of supporting developers from this source code or any supporting source code
6
 which is considered copyrighted (c) material of the original comment or credit authors.
7
8
 This program is distributed in the hope that it will be useful,
9
 but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
*/
12
13
/**
14
 * @copyright    XOOPS Project https://xoops.org/
15
 * @license      GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
16
 * @author       Marcello Brandão aka  Suico
17
 * @author       XOOPS Development Team
18
 * @since
19
 */
20
21
use Xmf\Request;
22
use XoopsModules\Yogurt;
23
24
$GLOBALS['xoopsOption']['template_main'] = 'yogurt_video.tpl';
25
require __DIR__ . '/header.php';
26
27
$controller = new Yogurt\VideoController($xoopsDB, $xoopsUser);
28
29
/**
30
 * Fetching numbers of groups friends videos pictures etc...
31
 */
32
$nbSections = $controller->getNumbersSections();
33
34
$start = Request::getInt('start', 0, 'GET');
35
36
/**
37
 * Criteria for Videos
38
 */
39
$criteriaUidVideo = new Criteria('uid_owner', $controller->uidOwner);
40
$criteriaUidVideo->setStart($start);
41
$criteriaUidVideo->setLimit($helper->getConfig('videosperpage'));
42
43
/**
44
 * Get all videos of this user and assign them to template
45
 */
46
$videos       = $controller->getVideos($criteriaUidVideo);
47
$videos_array = '';
48
$pageNav = '';
49
if (isset($nbSections['nbVideos'])) {
50
    $videos_array = $controller->assignVideoContent($nbSections['nbVideos'], $videos);
51
}
52
53
if (is_array($videos_array)) {
0 ignored issues
show
The condition is_array($videos_array) is always false.
Loading history...
54
    $xoopsTpl->assign('videos', $videos_array);
55
} else {
56
    $xoopsTpl->assign('lang_novideoyet', _MD_YOGURT_NOVIDEOSYET);
57
}
58
$xoopsTpl->assign('lang_selectmainvideo', _MD_YOGURT_SELECTMAINVIDEO);
59
60
if (isset($nbSections['nbVideos']) && $nbSections['nbVideos'] > 0) {
61
    $pageNav = $controller->VideosNavBar($nbSections['nbVideos'], $helper->getConfig('videosperpage'), $start, 2);
62
}
63
//form actions
64
$xoopsTpl->assign('lang_delete', _MD_YOGURT_DELETE);
65
$xoopsTpl->assign('lang_editdesc', _MD_YOGURT_EDIT_DESC);
66
$xoopsTpl->assign('lang_makemain', _MD_YOGURT_MAKEMAIN);
67
68
//FORM SUBMIT
69
$xoopsTpl->assign('lang_addvideos', _MD_YOGURT_ADDFAVORITEVIDEOS);
70
$xoopsTpl->assign('lang_youtubecodeLabel', _MD_YOGURT_YOUTUBECODE);
71
$xoopsTpl->assign('lang_captionLabel', _MD_YOGURT_CAPTION);
72
$xoopsTpl->assign('lang_submitValue', _MD_YOGURT_ADDVIDEO);
73
74
$xoopsTpl->assign('width', $helper->getConfig('width_tube'));
75
$xoopsTpl->assign('height', $helper->getConfig('height_tube'));
76
$xoopsTpl->assign('lang_videohelp', _MD_YOGURT_ADDVIDEOSHELP);
77
78
$xoopsTpl->assign('lang_mysection', _MD_YOGURT_MYVIDEOS);
79
$xoopsTpl->assign('section_name', _MD_YOGURT_VIDEOS);
80
81
//Navigation
82
$xoopsTpl->assign('pageNav', $pageNav);
83
84
require __DIR__ . '/footer.php';
85
require dirname(__DIR__, 2) . '/footer.php';
86