3
* Xibo - Digital Signage - http://www.xibo.org.uk
4
* Copyright (C) 2006,2007,2008 Daniel Garner and James Packer
6
* This file is part of Xibo.
8
* Xibo is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU Affero General Public License as published by
10
* the Free Software Foundation, either version 3 of the License, or
13
* Xibo is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU Affero General Public License for more details.
18
* You should have received a copy of the GNU Affero General Public License
19
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
21
use Xibo\Helper\ApplicationState;
23
class video extends Module
26
* Return the Edit Form as HTML
28
public function EditForm()
30
$response = $this->getState();
31
$formFields = array();
32
$formFields[] = FormManager::AddCheckbox('loop', __('Loop?'),
33
$this->GetOption('loop', 0), __('Should the video loop if it finishes before the provided duration?'),
36
$formFields[] = FormManager::AddCheckbox('mute', __('Mute?'),
37
$this->GetOption('mute', 1), __('Should the video be muted?'),
40
$response->AddFieldAction('duration', 'init', '0', array('.loop-fields' => array('display' => 'none')));
41
$response->AddFieldAction('duration', 'change', '0', array('.loop-fields' => array('display' => 'none')));
42
$response->AddFieldAction('duration', 'init', '0', array('.loop-fields' => array('display' => 'block')), 'not');
43
$response->AddFieldAction('duration', 'change', '0', array('.loop-fields' => array('display' => 'block')), 'not');
46
$this->baseEditForm($formFields, $response);
50
* Edit Media in the Database
52
public function EditMedia()
54
// Set the properties specific to this module
55
$this->SetOption('loop', \Kit::GetParam('loop', _POST, _CHECKBOX));
56
$this->SetOption('mute', \Kit::GetParam('mute', _POST, _CHECKBOX));
62
* Preview code for a module
65
* @param int $scaleOverride The Scale Override
66
* @return string The Rendered Content
68
public function Preview($width, $height, $scaleOverride = 0)
70
// Videos are never previewed in the browser.
71
return $this->previewIcon();
76
* @param int $displayId
79
public function GetResource($displayId = 0)
86
* Is this module valid
89
public function IsValid()