forked from Cook-Self-Service/JDom
-
Notifications
You must be signed in to change notification settings - Fork 3
/
jdom.php
66 lines (51 loc) · 1.92 KB
/
jdom.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* @copyright Copyright (C) 2013 Cook Self Service. All rights reserved.
* @author J. HUARD (http://j-cook.pro) - G. Tomaselli (http://bygiro.com)
* @license MIT License (MIT)
*/
defined('_JEXEC') or die;
defined('DS') or define('DS',DIRECTORY_SEPARATOR);
defined('BR') or define("BR", "<br />");
defined('LN') or define("LN", "\n");
if(!defined('PATH_LIBRARY_JDOM')) define('PATH_LIBRARY_JDOM', JPATH_SITE . DS . 'libraries' . DS . 'jdom');
jimport('joomla.version');
$version = new JVersion();
if (!class_exists('CkJLoader'))
{
// Joomla! 1.6 - 1.7
if (version_compare($version->RELEASE, '2.5', '<'))
{
// Load the missing class file
require_once(PATH_LIBRARY_JDOM .DS. 'legacy' .DS. 'loader.php');
// Register the autoloader functions.
CkJLoader::setup();
}
//Joomla! 2.5 and later
else
{
class CkJLoader extends JLoader{}
}
}
/**
* Jdom plugin class.
*
* @package Joomla.plugin
* @subpackage System.jdom
*/
class plgSystemJdom extends JPlugin
{
public function onAfterInitialise()
{
// load plugin language file
$language = JFactory::getLanguage();
$language->load('plg_system_jdom', JPATH_ADMINISTRATOR);
JLoader::register('JDom', JPATH_SITE . DS . 'libraries' . DS . 'jdom' . DS . 'dom.php');
JLoader::register('JdomHelperDates', JPATH_SITE . DS . 'libraries' . DS . 'jdom' . DS . 'helpers' . DS . 'dates.php');
JLoader::register('JdomHtmlValidator', JPATH_SITE . DS . 'libraries' . DS . 'jdom' . DS . 'jform' . DS . 'html' . DS . 'validator.php');
// form field class
JLoader::register('JdomClassFormField', JPATH_SITE . DS . 'libraries' . DS . 'jdom' . DS . 'jform' . DS . 'field.php');
JLoader::register('JdomClassFormFieldModal', JPATH_SITE . DS . 'libraries' . DS . 'jdom' . DS . 'jform' . DS . 'field' . DS . 'modal.php');
JLoader::register('JdomClassFormRule', JPATH_SITE . DS . 'libraries' . DS . 'jdom' . DS . 'jform' . DS . 'rule.php');
}
}