-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfulltrust.php
45 lines (33 loc) · 1.11 KB
/
fulltrust.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
40
41
42
43
44
45
<?php
/**
* @package Plugin Full Trust for Joomla! 3.8
* @version 1.0.0
* @author HikeOrders
* @copyright (C) 2019 - HikeOrders.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html; see LICENSE.txt
* @website https://hikeorders.com/trust/home
**/
// Check to ensure this file is included in Joomla!
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.plugin.plugin' );
class plgSystemFullTrust extends JPlugin
{
function __construct( &$subject, $params )
{
parent::__construct($subject, $params);
}
function onBeforeCompileHead()
{
$document = JFactory::getDocument();
// apply styles only to front-end
if (substr(JURI::base(), -15) != "/administrator/")
{
$widget_id = $this->params->get('widget_id');
$widget_id = trim($widget_id);
if(empty($widget_id) == false ) {
$url = "https://fulltrustcdn.hikeorders.com/widget/hko-full-trust.min.js?widgetId=".$widget_id;
$document->addScript($url, "text/javascript", false, true);
}
}
}
}