Location: PHPKode > projects > Epiware Document Management > Epiware_4.8.6/epi/content_bubbles_class.inc.php
<?
/******************************************************************************
Epiware: Project and Document Management
http://www.epiware.com
Copyright (C) 2006 James Kern

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 the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Epiware, Inc. and Praxis Inc, hereby disclaims all copyright
interest in the program 'Epiware' written
by James Kern, Edward Kline, Ryan Gilfether, Ray Gorospe, Patrick Waddingham

06 September 2006
James Kern, President of Epiware 
Jack Chapman, President of Praxis
*****************************************************************************/ 
/**
*	@package mrc
*/

/**
*	Class to output beginning and end of content bubbles
*	@package mrc
*
*/
class contentBubble
{
	/**
	*	Print beginning of content bubble
	*	@param string $title	Title of content bubble
	*	@param string $url	url which if supplied will be wrapped around the title as an anchor
	*	@return none
	*/
 

	function start($title,$url,$contentWidth="",$custom_gif='')
	{
		$useOld = false;

		$contentWidth = trim($contentWidth);
		if($contentWidth == "")
		{
			$contentWidth = "99%";
		}
		else
		{
			$contentWidth = rtrim($contentWidth,";");
			if(!eregi("(px)\$|(\%)\$",$contentWidth))
			{
				$contentWidth .= "px";
			}
		}
		if($url != "")
		{
			$title = "<a href=\"$url\">$title</a>";
		}

		if($useOld){
		echo "
		<div class=\"roundcont\" style=\"margin-bottom:5px;width:100%;overflow:hidden !important;\">
		   <div class=\"roundtop\">
			 <img src=\"./images/tl_bl.gif\" alt=\"\" width=\"15\" height=\"15\" class=\"corner\" style=\"display: none\" />
		    </div>
		    <div class=\"contentHeader\">$title</div>
			<div class=\"content\" style=\"width:$contentWidth;\">
			";
		} else { //new
			/* code for the shadow box */
			/*
			<div class="shadow_balloon" style="width:'.$contentWidth.';">
				<div class="shadow_right"><div class="shadow_topright">
			*/
			echo '
					<div class="balloon" style="width:'.$contentWidth.';">
						<div class="balloon_toprow">
							<div class="balloon_top"><div class="balloon_topleft"><div class="balloon_topright"></div></div></div>
						</div>
						<div class="balloon_center">
							<div class="balloon_left"><div class="balloon_right"><div class="balloon_content">
               ';

             //OK.. this will account for the diffence the paramter count that is being passed. in..
			 // Some place the percen_width in the fourth.. should be in thord..
			 // So If I see percent as last char.. THEN DO NOT print jk.

			 $last_char=substr($custom_gif,-1);
		 	 if($last_char!="%"){
			    print  $custom_gif;
			 }


			 

                echo '
								<h3>'.$title.'</h3>
				';
		}
	}//end of function start

	function start_with_minimize($title,$url,$contentWidth="")
	{
		$contentWidth = trim($contentWidth);
		if($contentWidth == "")
		{
			$contentWidth = "99%";
		}
		else
		{
			$contentWidth = rtrim($contentWidth,";");
			if(!eregi("(px)\$|(\%)\$",$contentWidth))
			{
				$contentWidth .= "px";
			}
		}
		if($url != "")
		{
			$title = "<a href=\"$url\">$title</a>";
		}
		//TODO - Make this work with new bubble/balloon!
		echo "
		<div class=\"roundcont\" style=\"margin-bottom:5px;width:100%\">
		   <div class=\"roundtop\">
			 <img src=\"images/tl_bl.gif\" alt=\"\" width=\"15\" height=\"15\" class=\"corner\" style=\"display: none\" />
		    </div>
		    <div class=\"contentHeader\">
		    <span style=\"float:left;clear:none;\">$title</span>
		    <img style=\"float:right;clear:none;margin-right:2px;\" src=\"images/winmax.gif\" height=\"14\" width=\"16\" border=\"0\" onmousedown=\"this.src='images/winmax_over.gif';this.parentNode.className='contentHeader';this.parentNode.nextSibling.className='content';\" onmouseup=\"this.src='images/winmax.gif';\"><img style=\"float:right;clear:none;margin-right:2px;\" src=\"images/winmin.gif\" height=\"14\" width=\"16\" border=\"0\" onmousedown=\"this.src='images/winmin_over.gif';this.parentNode.className='contentHeaderMargin'; this.parentNode.nextSibling.className='contentHidden';\" onmouseup=\"this.src='images/winmin.gif';\">
		    </div><div class=\"content\" style=\"clear:left;width:$contentWidth;\">
			";

	}//end of function start

	/**
	*	Print end of content bubble
	*/
	function end($contentWidth="")
	{
		$useOld = false;
		if($useOld){
		echo "
			</div><div class=\"roundbottom\">
			<img src=\"./images/bl_bl.gif\" alt=\"\" width=\"15\" height=\"15\" class=\"corner\" style=\"display: none\"/></div></div>
		";
		} else { //new
			echo '
							</div></div></div>
						</div>
						<div class="balloon_bottomrow">
							<div class="balloon_bottom"><div class="balloon_bottomleft"><div class="balloon_bottomright"></div></div></div>
						</div>
					</div>
			';
						
			/* Code for the shadow box */
			/*
			//add balloon_bottomright_shadow to the class of balloon_bottomright!!!
					</div>
				</div></div>
				<div class="shadow_bottom"><div class="shadow_bottomleft"><div class="shadow_bottomright"></div></div></div>
			</div>
			*/
		}
	}//end of function end
}//end of class contentBubble
?>
Return current item: Epiware Document Management