/* Enjoy!!! Dino Ciuffetti - dam2k@users.sourceforge.net
*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program (COPYING); if not, go to http://www.fsf.org/ or write
* to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*
*/
/* DEBUG CLASS */
/**
* This is the cmsdAm debug class. You can use it in your templates to print a debug line
* with a level of debuging. If the debuging level is less or equal to the configuration parameter
* LOG_debuglevel then the line is printed. You can use the CSS class .debug to make changes to
* the format of the text.
* Class instance: $cms->debug
* @author dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>
*/
class cmsdam_debug
{
/**
* You should not use this variable from your section.
* @access private
*/
var $conf;
/**
* This api method write debug strings on html.
* You can use $level for the debuging level and $test for the string to print.
* If the debug is off it returns false. To set debugging off please take a look at the
* cmsdam_conf class for the correct parameter to set in the configuration file.
*
* @param int level This is the debuging level of your string
* @param str text This is the debuging string you want to print to your section
* @return boolean True on debugging actions, False if debug is off
* @author dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>
*/
function debug_write($level, $text) {
if ($this->conf->LOG_debuglevel < $level) { // debug level low, please don't debug!
return false;
}
if ($this->conf->LOG_debug == "YES") { // Debug is ON
echo "