|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace XoopsModules\Xoosocialnetwork; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Xoosocialnetwork module |
|
7
|
|
|
* |
|
8
|
|
|
* You may not change or alter any portion of this comment or credits |
|
9
|
|
|
* of supporting developers from this source code or any supporting source code |
|
10
|
|
|
* which is considered copyrighted (c) material of the original comment or credit authors. |
|
11
|
|
|
* This program is distributed in the hope that it will be useful, |
|
12
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
14
|
|
|
* |
|
15
|
|
|
* @copyright XOOPS Project (https://xoops.org) |
|
16
|
|
|
* @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) |
|
17
|
|
|
* @package Xoosocialnetwork |
|
18
|
|
|
* @since 2.6.0 |
|
19
|
|
|
* @author Laurent JEN (Aka DuGris) |
|
20
|
|
|
* @version $Id: xoosocialnetwork.php 1397 2012-12-30 07:36:56Z DuGris $ |
|
21
|
|
|
*/ |
|
22
|
|
|
class Helper extends \Xoops\Module\Helper\HelperAbstract |
|
23
|
|
|
{ |
|
24
|
|
|
/** |
|
25
|
|
|
* Init the module |
|
26
|
|
|
* |
|
27
|
|
|
* @return null|void |
|
28
|
|
|
*/ |
|
29
|
|
|
public function init() |
|
30
|
|
|
{ |
|
31
|
|
|
$this->setDirname(basename(dirname(__DIR__))); |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
/** |
|
35
|
|
|
* @return mixed |
|
36
|
|
|
*/ |
|
37
|
|
|
public function loadConfig() |
|
38
|
|
|
{ |
|
39
|
|
|
return \XoopsModules\Xoosocialnetwork\Preferences::getInstance()->getConfig(); |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* @param mixed $name |
|
44
|
|
|
* @return \Xoops\Module\Helper|\XoopsObjectHandler |
|
45
|
|
|
*/ |
|
46
|
|
|
// public function snHandler() |
|
47
|
|
|
// { |
|
48
|
|
|
// return $this->getHandler('Socialnetwork'); |
|
49
|
|
|
// } |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* Get an Object Handler |
|
53
|
|
|
* |
|
54
|
|
|
* @param string $name name of handler to load |
|
55
|
|
|
* |
|
56
|
|
|
* @return bool|\XoopsObjectHandler|\XoopsPersistableObjectHandler |
|
57
|
|
|
*/ |
|
58
|
|
|
public function getHandler($name) |
|
59
|
|
|
{ |
|
60
|
|
|
$ret = false; |
|
|
|
|
|
|
61
|
|
|
// /** @var Connection $db */ |
|
62
|
|
|
$db = \XoopsDatabaseFactory::getConnection(); |
|
63
|
|
|
$class = '\\XoopsModules\\' . ucfirst(mb_strtolower(basename(dirname(__DIR__)))) . '\\' . $name . 'Handler'; |
|
64
|
|
|
$ret = new $class($db); |
|
65
|
|
|
|
|
66
|
|
|
return $ret; |
|
67
|
|
|
} |
|
68
|
|
|
} |
|
69
|
|
|
|