XOOPS  2.6.0
preload.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 */
11 
13 
22 {
31  public static function eventCoreIncludeCommonClassmaps($args)
32  {
33  $path = dirname(__DIR__);
34  XoopsLoad::addMap(array(
35  'comments' => $path . '/class/helper.php',
36  'commentscommentrenderer' => $path . '/class/commentrenderer.php'
37  ));
38  }
39 
40  public static function eventCoreFooterStart($args)
41  {
43  $helper->renderView();
44  }
45 
46  public static function eventOnModuleUpdateConfigs($args)
47  {
48  /* @var $module XoopsModule */
49  $module = $args[0];
50  $configs =& $args[1];
51  $helper = Comments::getInstance(); //init helper to load defines na language
52 
53  if ($plugin = \Xoops\Module\Plugin::getPlugin($module->getVar('dirname'), 'comments', true)) {
54  $commentsConfigs = $helper->getPluginableConfigs();
55  foreach ($commentsConfigs as $commentsConfig) {
56  array_push($configs, $commentsConfig);
57  }
58  }
59  }
60 
61  public static function eventOnModuleInstall($args)
62  {
63  /* @var $module XoopsModule */
64  $module = $args[0];
65  if ($plugin = \Xoops\Module\Plugin::getPlugin($module->getVar('dirname'), 'comments', true)) {
66  Comments::getInstance()->insertModuleRelations($module);
67  }
68  }
69 
70  public static function eventOnModuleUninstall($args)
71  {
72  /* @var $module XoopsModule */
73  $module = $args[0];
74  if ($plugin = \Xoops\Module\Plugin::getPlugin($module->getVar('dirname'), 'comments')) {
75  Comments::getInstance()->deleteModuleRelations($module);
76  }
77  }
78 
79  public static function eventOnSystemPreferencesForm($args)
80  {
81  /* @var $module XoopsModule */
82  $module = $args[0];
83  if ($plugin = \Xoops\Module\Plugin::getPlugin($module->getVar('dirname'), 'comments')) {
84  Comments::getInstance()->loadLanguage('main');
85  }
86  }
87 }
static eventOnModuleUpdateConfigs($args)
Definition: preload.php:46
$path
Definition: execute.php:31
static eventCoreFooterStart($args)
Definition: preload.php:40
static getInstance()
Definition: helper.php:46
static eventCoreIncludeCommonClassmaps($args)
Definition: preload.php:31
static eventOnModuleInstall($args)
Definition: preload.php:61
$module
Definition: main.php:52
$configs
Definition: config.php:27
$helper
static eventOnModuleUninstall($args)
Definition: preload.php:70
static eventOnSystemPreferencesForm($args)
Definition: preload.php:79
static addMap(array $map)
Definition: xoopsload.php:40