XOOPS  2.6.0
preload.php
Go to the documentation of this file.
1 <?php
19 
21 {
22  public static function eventCoreIncludeFunctionsRedirectheader($args)
23  {
25  $url = $args[0];
26  if (preg_match("/[\\0-\\31]|about:|script:/i", $url)) {
27  if (!preg_match('/^\b(java)?script:([\s]*)history\.go\(-[0-9]*\)([\s]*[;]*[\s]*)$/si', $url)) {
28  $url = \XoopsBaseConfig::get('url');
29  }
30  }
31  if (!headers_sent() && $xoops->getConfig('redirect_message_ajax')
32  && $xoops->getConfig('redirect_message_ajax')
33  ) {
34  $_SESSION['redirect_message'] = $args[2];
35  header("Location: " . preg_replace("/[&]amp;/i", '&', $url));
36  exit();
37  }
38  }
39 
40  public static function eventCoreHeaderCheckcache($args)
41  {
42  if (!empty($_SESSION['redirect_message'])) {
44  $xoops->theme()->contentCacheLifetime = 0;
45  unset($_SESSION['redirect_message']);
46  }
47  }
48 
49  public static function eventCoreHeaderAddmeta($args)
50  {
51  if (!empty($_SESSION['redirect_message'])) {
53  $xoops->theme()->addBaseStylesheetAssets('xoops.css');
54  $xoops->theme()->addBaseScriptAssets('@jquery');
55  $xoops->theme()->addBaseScriptAssets('@jgrowl');
56  $xoops->theme()->addScript('', array('type' => 'text/javascript'), '
57  (function($){
58  $(document).ready(function(){
59  $.jGrowl("' . $_SESSION['redirect_message'] . '", { life:3000 , position: "center", speed: "slow" });
60  });
61  })(jQuery);
62  ');
63  }
64  }
65 
66  public static function eventSystemClassGuiHeader($args)
67  {
68  if (!empty($_SESSION['redirect_message'])) {
70  $xoops->theme()->addBaseStylesheetAssets('xoops.css');
71  $xoops->theme()->addBaseScriptAssets('@jquery');
72  $xoops->theme()->addBaseScriptAssets('@jgrowl');
73  $xoops->theme()->addScript('', array('type' => 'text/javascript'), '
74  (function($){
75  $(document).ready(function(){
76  $.jGrowl("' . $_SESSION['redirect_message'] . '", { life:3000 , position: "center", speed: "slow" });
77  });
78  })(jQuery);
79  ');
80  unset($_SESSION['redirect_message']);
81  }
82  }
83 
91  public static function eventCoreServiceLocateCountryflag(Provider $provider)
92  {
93  if (is_a($provider, '\Xoops\Core\Service\Provider')) {
94  $path = dirname(__DIR__) . '/class/CountryFlagProvider.php';
95  require $path;
96  $object = new CountryFlagProvider();
97  $provider->register($object);
98  }
99  }
100 }
$path
Definition: execute.php:31
$_SESSION['RF']["verify"]
Definition: dialog.php:4
static getInstance()
Definition: Xoops.php:160
exit
Definition: browse.php:104
static eventCoreHeaderCheckcache($args)
Definition: preload.php:40
$xoops
Definition: admin.php:25
static eventCoreHeaderAddmeta($args)
Definition: preload.php:49
static get($name)
static eventCoreIncludeFunctionsRedirectheader($args)
Definition: preload.php:22
$url
Definition: register.php:72
static eventCoreServiceLocateCountryflag(Provider $provider)
Definition: preload.php:91
static eventSystemClassGuiHeader($args)
Definition: preload.php:66