XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
core.php
Go to the documentation of this file.
1 <?php
19 defined('XOOPS_ROOT_PATH') or die('Restricted access');
20 
22 {
23  function eventCoreIncludeFunctionsRedirectheader($args)
24  {
25  global $xoopsConfig;
26  $url = $args[0];
27  if (preg_match("/[\\0-\\31]|about:|script:/i", $url)) {
28  if (!preg_match('/^\b(java)?script:([\s]*)history\.go\(-[0-9]*\)([\s]*[;]*[\s]*)$/si', $url)) {
29  $url = XOOPS_URL;
30  }
31  }
32  if (!headers_sent() && isset($xoopsConfig['redirect_message_ajax']) && $xoopsConfig['redirect_message_ajax']) {
33  $_SESSION['redirect_message'] = $args[2];
34  header("Location: " . preg_replace("/[&]amp;/i", '&', $url));
35  exit();
36  }
37  }
38 
39  function eventCoreHeaderCheckcache($args)
40  {
41  if (!empty($_SESSION['redirect_message'])) {
42  $GLOBALS['xoTheme']->contentCacheLifetime = 0;
43  unset($_SESSION['redirect_message']);
44  }
45  }
46 
47  function eventCoreHeaderAddmeta($args)
48  {
49  if (!empty($_SESSION['redirect_message'])) {
50  $GLOBALS['xoTheme']->addStylesheet('xoops.css');
51  $GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/jquery.js');
52  $GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.jgrowl.js');
53  $GLOBALS['xoTheme']->addScript('', array('type' => 'text/javascript'), '
54  (function($){
55  $(document).ready(function(){
56  $.jGrowl("' . $_SESSION['redirect_message'] . '", { life:3000 , position: "center", speed: "slow" });
57  });
58  })(jQuery);
59  ');
60  }
61  }
62 
63  function eventSystemClassGuiHeader($args)
64  {
65  if (!empty($_SESSION['redirect_message'])) {
66  $GLOBALS['xoTheme']->addStylesheet('xoops.css');
67  $GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/jquery.js');
68  $GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.jgrowl.js');
69  $GLOBALS['xoTheme']->addScript('', array('type' => 'text/javascript'), '
70  (function($){
71  $(document).ready(function(){
72  $.jGrowl("' . $_SESSION['redirect_message'] . '", { life:3000 , position: "center", speed: "slow" });
73  });
74  })(jQuery);
75  ');
76  unset($_SESSION['redirect_message']);
77  }
78  }
79 }
80 
81 ?>