';
46 |
47 | $args = $config['message']['parameters'];
48 |
49 | array_unshift($args, $config['message']['text']);
50 |
51 | $message = call_user_func_array(array('JText', 'sprintf'), $args);
52 |
53 | $output .= $message;
54 |
55 | if (isset($config['new']))
56 | {
57 | if ($config['new']) {
58 | $output .= '
' . JText::_('LIB_CATCHER_ITEM_NEW');
59 | } else {
60 | $output .= '
' . JText::_('LIB_CATCHER_ITEM_NOT_NEW');
61 | }
62 | }
63 |
64 | if ($this->params->get('show_data') && ($data = $this->_renderData($config['data'])))
65 | {
66 | $signature = sprintf('%s_%s', $event, md5($data . microtime()));
67 |
68 | $output .= '
69 |
70 |
78 |
79 |
';
80 |
81 | $output .= $data;
82 |
83 | $output .= '
';
84 | }
85 |
86 | $output .= '
';
87 |
88 | JFactory::getApplication()->enqueueMessage($output, 'warning');
89 |
90 | // Add a log entry.
91 | jimport('joomla.log.log');
92 | JLog::addLogger(array('text_file' => 'catcher.php'), JLog::ALL, array('catcher'));
93 | JLog::add(strip_tags($message), JLog::DEBUG, 'catcher');
94 | }
95 | }
96 |
97 | /**
98 | * Renders event data
99 | *
100 | * @param array $data An associative array containing data
101 | * @param int $level Indentation level
102 | * @return string The rendered data
103 | */
104 | protected function _renderData($data, $level = 0)
105 | {
106 | $data = (array) $data;
107 | $output = '';
108 |
109 | if ($data)
110 | {
111 | foreach($data as $key => $value)
112 | {
113 | for ($i = 0; $i < 3*$level; $i++) {
114 | $output .= ' ';
115 | }
116 |
117 | $output .= "