1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* **************************************************************************** |
4
|
|
|
* references - MODULE FOR XOOPS |
5
|
|
|
* Copyright (c) Hervé Thouzard of Instant Zero (http://www.instant-zero.com) |
6
|
|
|
* |
7
|
|
|
* You may not change or alter any portion of this comment or credits |
8
|
|
|
* of supporting developers from this source code or any supporting source code |
9
|
|
|
* which is considered copyrighted (c) material of the original comment or credit authors. |
10
|
|
|
* This program is distributed in the hope that it will be useful, |
11
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
12
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
13
|
|
|
* |
14
|
|
|
* @copyright Hervé Thouzard of Instant Zero (http://www.instant-zero.com) |
15
|
|
|
* @license http://www.fsf.org/copyleft/gpl.html GNU public license |
16
|
|
|
* @package references |
17
|
|
|
* @author Hervé Thouzard of Instant Zero (http://www.instant-zero.com) |
18
|
|
|
* |
19
|
|
|
* **************************************************************************** |
20
|
|
|
*/ |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Chargement des handlers utilisés par le module |
24
|
|
|
*/ |
25
|
|
|
class references_handler |
26
|
|
|
{ |
27
|
|
|
public $h_references_articles = null; |
28
|
|
|
public $h_references_categories = null; |
29
|
|
|
private static $instance = false; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* Singleton |
33
|
|
|
*/ |
34
|
|
|
private function __construct() |
35
|
|
|
{ |
36
|
|
|
$handlersNames = array('references_articles', 'references_categories'); |
37
|
|
|
foreach ($handlersNames as $handlerName) { |
38
|
|
|
$internalName = 'h_' . $handlerName; |
39
|
|
|
$this->$internalName = xoops_getModuleHandler($handlerName, REFERENCES_DIRNAME); |
40
|
|
|
} |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Retourne l'instance unique de la clanss |
45
|
|
|
* |
46
|
|
|
* @return object |
47
|
|
|
*/ |
48
|
|
|
public static function getInstance() |
49
|
|
|
{ |
50
|
|
|
static $instance; |
51
|
|
|
if (null === $instance) { |
52
|
|
|
$instance = new static(); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
return $instance; |
56
|
|
|
} |
57
|
|
|
} |
58
|
|
|
|