0byt3m1n1
Path:
/
data
/
applications
/
aps
/
tikiwiki
/
14.1-0
/
standard
/
htdocs
/
lib
/
smarty_tiki
/
[
Home
]
File: function.error_report.php
<?php // (c) Copyright 2002-2015 by authors of the Tiki Wiki CMS Groupware Project // // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. // $Id: function.error_report.php 53845 2015-02-08 19:31:05Z lindonb $ function smarty_function_error_report($params, $smarty) { $errorreportlib = TikiLib::lib('errorreport'); $errors = $errorreportlib->get_errors(); $pre = '<div id="error_report">'; $post = '</div>'; $repeat = false; $legacy = $smarty->getTemplateVars('display_msg'); if ($legacy) { // Handle reporting ofthe display_msg smarty variable $smarty->loadPlugin('smarty_block_remarksbox'); $post .= smarty_block_remarksbox(array( 'type' => 'note', 'title' => tr('Notice'), ), $legacy, $smarty, $repeat); } TikiLib::lib('header')->add_js( ' $(document).ajaxComplete(function (e, jqxhr) { var error = jqxhr.getResponseHeader("X-Tiki-Error"); if (error) { if ($("ul", "#error_report").length === 0) { $("#error_report").append($(error)[0].childNodes); } else { $("ul", "#error_report").append($(error).find("li")); } } $("#error_report .clear").on("click", function () { $("#error_report").empty(); return false; }); }); ' ); if (count($errors)) { $smarty->loadPlugin('smarty_block_remarksbox'); $repeat = false; return $pre . smarty_block_remarksbox( array( 'type' => 'errors', 'title' => tra('Error(s)'), ), '<ul><li>' . implode('</li><li>', $errors) . '</li></ul>', $smarty, $repeat ) . $post; } else { return $pre . $post; } }