src/UI/HTML/MonthCalendar.php
public function buildCalendar( $cell_class = NULL, $heading_span = NULL )
	{
		$time	= mktime( 0, 0, 0, $this->getOption( 'show_month'), 1, $this->getOption( 'show_year' ) );
		$offset	= date( 'w', $time )-1;
		if( $offset < 0 )
			$offset += 7;
		$days	= date( "t", $time );
		$weeks	= ceil( ( $days + $offset ) / 7 );
		$d	= 1;
		$lines	= array();
		for( $w=0; $w<$weeks; $w++ )
		{
			$cells	= array();
			for( $i=0; $i<7; $i++ )
			{
				if( $offset )
				{
					$cells[]	= $this->buildCell( 0, $cell_class );
					$offset --;
				}
				else if( $d > $days )
					$cells[]	= $this->buildCell( 0, $cell_class );
				else
				{
					$cells[]	= $this->buildCell( $d, $cell_class );
					$d++;
				}
				$line	= implode( "", $cells );
			}
			$lines[]	= UI_HTML_Tag::create( "div", $line, array( 'class' => 'day-week' ) );
		}
		$lines		= implode( "\n\t  ", $lines );
		$days		= UI_HTML_Tag::create( "div", $lines, array( 'class' => "days" ) );
		$heading	= $this->buildHeading( $heading_span );
		$weekdays	= $this->buildWeekDays();
		$code		= $this->getCode( $heading, $weekdays, $days );
		return $code;
	}
public function buildCalendar( $cell_class = NULL, $heading_span = NULL )
	{
		$time	= mktime( 0, 0, 0, $this->getOption( 'show_month'), 1, $this->getOption( 'show_year' ) );
		$offset	= date( 'w', $time )-1;
		if( $offset < 0 )
			$offset += 7;
		$days	= date( "t", $time );
		$weeks	= ceil( ( $days + $offset ) / 7 );
		$d	= 1;
		$lines	= array();
		for( $w=0; $w<$weeks; $w++ )
		{
			$cells	= array();
			for( $i=0; $i<7; $i++ )
			{
				if( $offset )
				{
					$cells[]	= $this->buildCell( 0, $cell_class );
					$offset --;
				}
				else if( $d > $days )
					$cells[]	= $this->buildCell( 0, $cell_class );
				else
				{
					$cells[]	= $this->buildCell( $d, $cell_class );
					$d++;
				}
				$line	= implode( "", $cells );
			}
			$lines[]	= UI_HTML_Tag::create( "div", $line, array( 'class' => 'day-week' ) );
		}
		$lines		= implode( "\n\t  ", $lines );
		$days		= UI_HTML_Tag::create( "div", $lines, array( 'class' => "days" ) );
		$heading	= $this->buildHeading( $heading_span );
		$weekdays	= $this->buildWeekDays();
		$code		= $this->getCode( $heading, $weekdays, $days );
		return $code;
	}
public function buildCalendar ( $ cell_class = NULL , $ heading_span = NULL ) { $ time = mktime ( 0 , 0 , 0 , $ this -> getOption ( 'show_month' ) , 1 , $ this -> getOption ( 'show_year' ) ) ; $ offset = date ( 'w' , $ time ) - 1 ; if ( $ offset < 0 ) $ offset += 7 ; $ days = date ( "t" , $ time ) ; $ weeks = ceil ( ( $ days + $ offset ) / 7 ) ; $ d = 1 ; $ lines = array ( ) ; for ( $ w = 0 ; $ w < $ weeks ; $ w ++ ) { $ cells = array ( ) ; for ( $ i = 0 ; $ i < 7 ; $ i ++ ) { if ( $ offset ) { $ cells [ ] = $ this -> buildCell ( 0 , $ cell_class ) ; $ offset -- ; } else if ( $ d > $ days ) $ cells [ ] = $ this -> buildCell ( 0 , $ cell_class ) ; else { $ cells [ ] = $ this -> buildCell ( $ d , $ cell_class ) ; $ d ++ ; } $ line = implode ( "" , $ cells ) ; } $ lines [ ] = UI_HTML_Tag :: create ( "div" , $ line , array ( 'class' => 'day-week' ) ) ; } $ lines = implode ( "\n\t  " , $ lines ) ; $ days = UI_HTML_Tag :: create ( "div" , $ lines , array ( 'class' => "days" ) ) ; $ heading = $ this -> buildHeading ( $ heading_span ) ; $ weekdays = $ this -> buildWeekDays ( ) ; $ code = $ this -> getCode ( $ heading , $ weekdays , $ days ) ; return $ code ; }
Builds Output of Month Calendar.
@access		public
@param		string		$cell_class		CSS Class of Cell
@param		bool		$heading_span	Flag: Span Heading over whole Table
@return		string
Builds Output of Month Calendar .