-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod_cg_panorama.php
39 lines (33 loc) · 1.29 KB
/
mod_cg_panorama.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* CG Panorama - Joomla Module
* Version : 2.1.0
* Package : Joomla 4.x/5.x
* copyright : Copyright (C) 2023 ConseilGouz. All rights reserved.
* license : http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* From : https://www.cssscript.com/draggable-360-image-preview-threesixty/
*/
// no direct access
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Helper\ModuleHelper;
$document = Factory::getDocument();
$baseurl = URI::base();
$modulefield = 'media/mod_cg_panorama/';
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->registerAndUseStyle('cgpano', $modulefield.'css/cgpano.css');
$img = $baseurl.'/'.$params->get('pano_file','');
$height = $params->get('pano_height','300');
$speed = $params->get('pano_speed','2');
$img360= $params->get('pano_360','300');
$anim= $params->get('pano_anim','no');
$document->addScriptOptions('mod_cg_pano_'.$module->id,
array('id' => $module->id,
'img' => $img, 'height' => $height, 'speed' => $speed, 'img360' => $img360, 'anim' => $anim
)
);
$wa->registerAndUseScript('cgpano',$modulefield.'js/cgpano.js');
require ModuleHelper::getLayoutPath('mod_cg_panorama', $params->get('layout', 'default'));
?>