changelog version 1.0.1 1/17/2002 Tim - Added a way to print the syntax of the function from code. pass in a variable named $PRINT_SYNTAX and the function will print the usage instructions on the webpage you're working on.
version 1.0.0 1/15/2002 released
todo: cross-browser html code needed
Developers who worked on this tool: Andrew Nelson - Initial concept, coding, and development. Tim Gallagher - minor change - see change log
----------------------------------------------------------------------------------------------------------------------------- Copyright (C) 2002 by the PHPocket Knife development team: -------- Tim Gallagher -------- Andrew Nelson ----------------------------------------------------------------------------------------------------------------------------- USE OF THIS SOFTWARE, CODE, OR ANY PORTION THEREOF IS BOUND BY THE TERMS AND CONDITIONS LISTED IN LICENSE.TXT, DISTRIBUTED WITH THIS FILE. ----------------------------------------------------------------------------------------------------------------------------- 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; either version 2 of the License, or (at your option) any later version.
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; if not, write to Free Software Foundation, Inc. 59 Temple Place, Suite 330 Boston, MA 02111-1307 USA ----------------------------------------------------------------------------------------------------------------------------- SEE LICENSE.TXT FOR FULL DETAILS -----------------------------------------------------------------------------------------------------------------------------
documentation (of a sort) include the function in your file, or put it in your auto_prepend file
when programming, to view the structure of a variable, simply pass it to rprint; example: rprint($variable)
the html prints, and is returned by the function
- timmyg
*/ // ------------------------------------------------------------------------------------------------------------------------------------------------ // replacement for print_r ------------------------------------------------------------------------------------------------------------------- // ------------------------------------------------------------------------------------------------------------------------------------------------
function rprint($object,$expanded=FALSE,$advanced=TRUE,$border=TRUE,$first=TRUE,$level=0) { if ($object == $PRINT_SYNTAX) { echo "<pre>"; ?>version 1.0.1 1/17/2002 Copyright (C) 2002 by the PHPocket Knife development team rprint ($object=TRUE,$expanded=FALSE,$advanced=TRUE,$border=TRUE) default values: $object Always required $expanded: FALSE (setting this to true automatically expands all branches) $advanced: TRUE (setting to false displays a simpler structure) $border: TRUE (setting to false turns the outside border off of the advanced view) <?
echo "</pre>"; return NULL; }; // end if // $advanced=FALSE; if ($advanced) { $view_string = "[ view ]"; $hide_string = "[ hide ]"; } else { $view_string = "view"; $hide_string = "hide"; }; // end if
if (!is_object($object) && !is_array($object)) { $temp->ZqQ5ya = $object; return rprint($temp,$expanded,$advanced); }; // end if
if ($level == 0) { ?> <style type="text/css"><!-- .cell {font-family:verdana;border-style:solid;border-width:1px 3px 2px 0px;border-color:FFFFFF;}; <?= (!$advanced ? "a {color:0000FF;text-decoration:none;font-weight:bold;};" : ""); ?> .subobject {border-width:1px 3px 1px 0px;}; .topobject {border-top-width:3px;}; .bottomobject {border-bottom-width:3px;}; //--></style> <? }; // end if
global $divid; $object_methods=array(); $html=""; $the_level = $level; $depth_limit = 7;
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.