Namespaces | Functions

modules/dateplaner/includes/inc.day.php File Reference

Go to the source code of this file.

Namespaces

namespace  dateplaner
 

dateplaner includes personal an group specific date management developt for ilias3 and adapted also to ilias2


Functions

 navigation ($timestamp)
 void function navigation($timestamp)
 getDateForDay ($timestamp)
 void function getDateForDay($timestamp) This function generates the day string for the day view and passes it to the GUI
 getWholeDay ($timestamp, $DB)
 void function getWholeDay($timestamp)
 generateDay ($timestamp, $DB)
 void function generateDay($timestamp)
 initTS ($timestamp, &$startshow, &$endshow)
 void function initTS($timestamp, &$startshow, &$endshow)
 initDisplayTime (&$startDisplayTimeInMinutes, &$endDisplayTimeInMinutes, $dates, $intervall)
 void function initDisplayTime(&$startDisplayTimeInMinutes, &$endDisplayTimeInMinutes, $dates)
 turnToMinutes (&$dateList, $startshow)
 void function turnToMinutes($dateList, $startshow)
 testOutput ($dim3)
 void function testoutput($dim3)
 testOutput2 ($dim2)
 void function testOutput2($dim2)
 padFront ($dateList, $stream, &$arrayPadded, $intervall, $startDisplayTimeInMinutes)
 void function padFront($dateList, $stream, $arrayPadded, $intervall, $startDisplayTimeInMinutes)
 padMiddle ($dateList, $counter, $stream, &$arrayPadded, $intervall)
 void function padMiddle($dateList, $counter, $stream, $arrayPadded, $intervall)
 padBack ($stream, &$arrayPadded, $intervall, $endDisplayTimeInMinutes)
 void function padBack($stream, $arrayPadded, $intervall, $endDisplayTimeInMinutes)
 generateOutput ($arrayPadded, $intervall, $startDisplayTimeInMinutes, $endDisplayTimeInMinutes, $startshow, $timestamp)
 void function generateOutput($arrayPadded, $intervall, $startDisplayTimeInMinutes, $endDisplayTimeInMinutes, $startshow)
 parseDataForOutput ($DateValues)
 void function parseData (Array DateValues)

Function Documentation

generateDay ( timestamp,
DB 
)

void function generateDay($timestamp)

this funktion calls the other relevant funktions to fetch dates, reformat them and to generate

Parameters:
$timestamp,a required timestamp of sometime during the current day.
$DB,a DB class object. $DP_UId , Session Variable of the User ID $_SESSION ( $DP_Keywords, array containing selected Keywords, time $DP_Endtime, user set display end time and time $DP_Starttime, user set display start time)
Returns:
$dayString output in HTML format

Definition at line 176 of file inc.day.php.

References $_SESSION, $counter, $DB, $DP_UId, generateOutput(), getDayList(), initDisplayTime(), initTS(), padBack(), padFront(), padMiddle(), and turnToMinutes().

                                     {
        global  $DP_UId, $_SESSION ;
        $startDisplayTimeInMinutes = 60 * $_SESSION[DP_Starttime]; // convert to minutes, cast time to int
        $endDisplayTimeInMinutes = 60 * $_SESSION[DP_Endtime]; // convert to minutes, cast time to int
        
        $intervall = 15; // intervall of dividers, e.g 15 (min)
        initTS($timestamp, $startshow, $endshow); // get start and end time for the day
        $table_sorted  = getDayList($DP_UId,$startshow , $endshow, $_SESSION[DP_Keywords], $DB); // get streamed dates
        if($table_sorted){ // check for existance of dates
                for($stream=0; $stream<count($table_sorted); $stream++){
                        turnToMinutes   ($table_sorted[$stream], $startshow); // convert timestamps to minutes and format date
                        
                }
                for($stream=0; $stream<count($table_sorted); $stream++){
                        initDisplayTime ($startDisplayTimeInMinutes, $endDisplayTimeInMinutes, $table_sorted[$stream], $intervall); //check if user set display time is sufficient
                        
                }
                for($stream=0; $stream<count($table_sorted); $stream++){
                        //$counter = 0;
                        padFront($table_sorted[$stream], $stream, $arrayPadded, $intervall, $startDisplayTimeInMinutes); // generate fields in $arrayPadded, that resemble the free time before the first date.
                        for($counter=1; $counter<count($table_sorted[$stream]); $counter++){
                                padMiddle($table_sorted[$stream], $counter, $stream, $arrayPadded, $intervall); // generate fields in $arrayPadded, that resemble the free time during dates.
                        }
                        padBack ($stream, $arrayPadded, $intervall, $endDisplayTimeInMinutes);// generate fields in $arrayPadded, that resemble the free time after the last date.
                }
                $dayString = generateOutput($arrayPadded, $intervall, $startDisplayTimeInMinutes, $endDisplayTimeInMinutes, $startshow, $timestamp);
                
        }
        else{   // in case that table_sorted is empty, create an NULL array_padded for blank rows
                $arrayPadded[0][0][0]="NULL";
                $arrayPadded[0][0][1]=$startDisplayTimeInMinutes;
                $arrayPadded[0][0][2]=$startDisplayTimeInMinutes+$intervall;
                $arrayPadded[0][0][5]=$intervall;
                $arrayPadded[0][0][6]=1;
                padBack(0, $arrayPadded, $intervall, $endDisplayTimeInMinutes);
                $dayString = generateOutput($arrayPadded, $intervall, $startDisplayTimeInMinutes, $endDisplayTimeInMinutes, $startshow, $timestamp);
                
        }
        return $dayString;

}// end func

Here is the call graph for this function:

generateOutput ( arrayPadded,
intervall,
startDisplayTimeInMinutes,
endDisplayTimeInMinutes,
startshow,
timestamp 
)

void function generateOutput($arrayPadded, $intervall, $startDisplayTimeInMinutes, $endDisplayTimeInMinutes, $startshow)

This function generates a HTML string. Basically it counts up the minutes from $startDisplayTime to $endDisplayTime. For each minute a new

is created. The starting times of dates and blanks in $arrayPadded are compared to the current time and if they match, a new

with a blank or a date is insterted. With dates, the date information is displayed and a link to date.php is provided as a javascript pop up.

Parameters:
array[][][] $arrayPadded , a 3-dimensional array holding the dates formated for output. The first dimension is used for distinguishing colliding dates. The second dimension holds a single date. The third dimesion holds the attributes of the date, which are ordered as followed: 0=> ID or NULL; 1=> startTimeInMinutes; 2=> endTimeInMinutes; 3=> shortText; 4=> longText; 5=> rowspan; 6=> colspan(not used); 7=> formated date&time of start for output; 8=> formated date&time of end for output;
int $startDisplayTimeInMinutes , start of display time
int $endDisplayTimeInMinutes , end of display time
int $intervall , the displayed subdivisions (i.e. 15)
int $startshow , a timestamp of the start of the day (00:00 hours)

string $templatefolder , holds the variable to the folder containing template files string $actualtemplate , defines the used template array[] $DP_CSS, an array containing CSS information $_SESSION ( bol $DP_JSscript is 1 if JavaScript disabled)

Returns:
$dayString , the output variable of the Gui

Definition at line 515 of file inc.day.php.

References $_SESSION, $actualtemplate, $DateValues, $DP_CSS, $DP_language, $templatefolder, and parseDataForOutput().

Referenced by generateDay().

                                                                                                                               {
        global $DP_CSS,$DP_language, $templatefolder, $actualtemplate, $_SESSION;
        
        $ttd            = new TimestampToDate;

                $stream=count($arrayPadded)-1;
        for($i=0; $i<=$stream; $i++){
                $streamCounter[$i]=0;
        }
        for($time=$startDisplayTimeInMinutes; $time< $endDisplayTimeInMinutes; $time++){
                $dayString=$dayString. "<TR >";
                if($time%15==0) {
                        $dayString=$dayString. "<TD valign='top' width='10' rowspan='".$intervall."'  ".$DP_CSS[tblrow2]."  style='border-style: solid; border-width: 1'  ".$DP_CSS[small]." ><span  ".$DP_CSS[small]." >";
                        $Stunde = ($time-$time%60)/60 ;
                        $Viertel= $time%60;
                        if ($Viertel==0) $Viertel="00";
                        $ttd->ttd($timestamp);
                        $new_ts = mktime ( $Stunde , $Viertel , 0, $ttd->monthnumber_long , $ttd->day_of_month, $ttd->year_long );
                        $dayString=$dayString."<a href=\"javascript:popup('dateplaner.php?app=date&timestamp=".$new_ts."&PHPSESSID=$PHPSESSID','Date','width=600,height=650,directories=no,toolbar=no,location=no,menubar=no,scrollbars=yes,status=yes,resizable=yes,dependent=no')\" TITLE=\"".$DP_language[new_doc]."\"  >".$Stunde.":".$Viertel."
                        </a>";  
                        $dayString=$dayString. "</span></TD>";  
                }
                for($i=0; $i<=$stream; $i++){
                        if($arrayPadded[$i][$streamCounter[$i]][1]==$time){
                                while($arrayPadded[$i][$streamCounter[$i]][1]==$time){
                                        if($arrayPadded[$i][$streamCounter[$i]][0]!="NULL"){
                                                $dayString=$dayString."<TD valign='top' rowspan=".$arrayPadded[$i][$streamCounter[$i]][5]." ".$DP_CSS[tblrow2]." style='border-style: solid; border-width: 1' ".$DP_CSS[small]." ><span ".$DP_CSS[small]." >";
                                                if($_SESSION[DP_JSscript] != 1) {
                                                        $dayString=$dayString."<a href=\"dateplaner.php?app=date&date_id=";
                                                        $dayString=$dayString.$arrayPadded[$i][$streamCounter[$i]][0];
                                                        $dayString=$dayString."&PHPSESSID=".$session_id."&timestamp=".$startshow."\" target=\"_blank\" >";
                                                }else {
                                                        $dayString=$dayString."<a href=\"javascript:popup('dateplaner.php?app=date&date_id=";
                                                        $dayString=$dayString.$arrayPadded[$i][$streamCounter[$i]][0];
                                                        $dayString=$dayString."&PHPSESSID=".$session_id."&timestamp=".$startshow."','Date','width=600,height=600,directories=no,toolbar=no,location=no,menubar=no,scrollbars=yes,status=yes,resizable=yes,dependent=no')\" >";
                                                }

                                                $dayString=$dayString.$arrayPadded[$i][$streamCounter[$i]][7];

                                                if($arrayPadded[$i][$streamCounter[$i]][7] != $arrayPadded[$i][$streamCounter[$i]][8] ) 
                                                {  
                                                        $dayString=$dayString." - ".$arrayPadded[$i][$streamCounter[$i]][8];
                                                }
                                                $DateValues[shorttext] = $arrayPadded[$i][$streamCounter[$i]][3] ;
                                                $DateValues[text] = $arrayPadded[$i][$streamCounter[$i]][4];

                                                $DateValues = parseDataForOutput ($DateValues);
                                                $dayString=$dayString."</a> - <b>".$DateValues[shorttext]."</b>";
                                                $dayString=$dayString."<BR>".$DateValues[text];
                                                $dayString=$dayString."</span></TD>";
                                                $streamCounter[$i]++;
                                        }else{
                                                $dayString=$dayString."<TD rowspan=".$arrayPadded[$i][$streamCounter[$i]][5]."  ".$DP_CSS[tblrow4]."style='border-style: solid; border-width: 1' ><span ".$DP_CSS[small]. " >";
                                                $dayString=$dayString."<img src='".$templatefolder."/".$actualtemplate."/images/blind.gif' height='1' width='1'>";
                                                $dayString=$dayString."</span></TD>";
                                                $streamCounter[$i]++;
                                        }
                                }
                        }
                }
                $dayString=$dayString. "</TR> \n";              
        }
        return $dayString;
}// end func

Here is the call graph for this function:

Here is the caller graph for this function:

getDateForDay ( timestamp  ) 

void function getDateForDay($timestamp) This function generates the day string for the day view and passes it to the GUI

Parameters:
$timestamp,a required timestamp of sometime during the current day. $DP_language , used by the Gui to determine the language of "today" as set in the language file.
Returns:
$showdate , the output variable of the Gui,

Definition at line 105 of file inc.day.php.

References $DP_language.

                                  {
        global $DP_language;
        $Date = new TimestampToDate();
        $Date->ttd($timestamp);
        $showdate = $Date->shorttime;
        
        Return $showdate;
        
        
}// end func

getWholeDay ( timestamp,
DB 
)

void function getWholeDay($timestamp)

This function queries for whole day dates and generates html code which is passed to the Gui

Parameters:
$timestamp,a required timestamp of sometime during the current day.
$DB,a DB class object. $DP_UId reads the User ID from the session array[] $DP_Keywords array containing selected Keywords $_SESSION ( bol $DP_JSscript is 1 if JavaScript disabled)
Returns:
$wholeDayDayDates , contains dates from 00:00:00 to 23:59:59 for the selected day as html, evaluated by the Gui.

Definition at line 132 of file inc.day.php.

References $_SESSION, $DB, $DP_UId, and getWholeDayDateList().

                                     {
        global $DP_UId, $_SESSION;
        $startshow = mktime(0, 0, 0, date("m", $timestamp), date ("d", $timestamp), date("Y", $timestamp));// don't edit
        $endshow   = mktime(23,59,59, date("m", $timestamp), date ("d", $timestamp), date("Y", $timestamp));// don't edit
        $dates = getWholeDayDateList($DP_UId, $startshow, $endshow, $_SESSION[DP_Keywords], $DB);
        if($dates){
                foreach($dates as $date){
                        if($_SESSION[DP_JSscript] != 1) {
                                $wholeDayDayDates=$wholeDayDayDates."<a href=\"dateplaner.php?app=date&date_id=";
                                $wholeDayDayDates=$wholeDayDayDates.$date[0];
                                $wholeDayDayDates=$wholeDayDayDates."&PHPSESSID=".$PHPSESSID."\" target=\"_blank\" >";
                        
                        }else {
                                $wholeDayDayDates=$wholeDayDayDates."<a href=\"javascript:popup('dateplaner.php?app=date&date_id=";
                                $wholeDayDayDates=$wholeDayDayDates.$date[0];
                                $wholeDayDayDates=$wholeDayDayDates."&PHPSESSID=".$PHPSESSID."','Date','width=600,height=600,directories=no,toolbar=no,location=no,menubar=no,scrollbars=yes,status=yes,resizable=yes,dependent=no')\" >";
                        }
                        $wholeDayDayDates=$wholeDayDayDates.$date[5]."</a> ";
                        $wholeDayDayDates=$wholeDayDayDates.$date[6]."<BR>";
                }
        }
        return $wholeDayDayDates;
        

}// end func

Here is the call graph for this function:

initDisplayTime ( &$  startDisplayTimeInMinutes,
&$  endDisplayTimeInMinutes,
dates,
intervall 
)

void function initDisplayTime(&$startDisplayTimeInMinutes, &$endDisplayTimeInMinutes, $dates)

this funktion goes through an 2dim array of dates and checks, if the passed start and end display time suffice, if not, they are ajusted

Parameters:
&$startDisplayTimeInMinutes,a required timestamp of sometime during the current day.
&$endDisplayTimeInMinutes,a required timestamp of sometime during the current day.
$dates,a 2-dimensional array of dates.

Definition at line 251 of file inc.day.php.

Referenced by generateDay().

                                                                                                    {
                foreach($dates as $dim1){
                        if( $dim1[1]< $startDisplayTimeInMinutes){
                                $startDisplayTimeInMinutes = $dim1[1] - $dim1[1]%$intervall;
                                
                        }
                        
                        if( $dim1[2] > $endDisplayTimeInMinutes){
                                $endDisplayTimeInMinutes = $dim1[2] + $dim1[2]%$intervall;
                                if($endDisplayTimeInMinutes > 1440) $endDisplayTimeInMinutes  = 1440;
                        }       
                
                }
                
}// end func

Here is the caller graph for this function:

initTS ( timestamp,
&$  startshow,
&$  endshow 
)

void function initTS($timestamp, &$startshow, &$endshow)

This function generates the timestamps for the start and endtime of the day. using references (i.e &$var) the result is directly stored in the passed variables.

Parameters:
$timestamp,a required timestamp of sometime during the current day.
&$startshow,a required timestamp of the starttime of the day, will be generated an written to the variable.
&$endshow,a required timestamp of the end of the day, will be generated an written to the variable.

Definition at line 232 of file inc.day.php.

Referenced by generateDay().

                                                   {
        $startshow = mktime(0, 0, 0, date("m", $timestamp), date ("d", $timestamp), date("Y", $timestamp));// don't edit
        $endshow   = mktime(23,59,59, date("m", $timestamp), date ("d", $timestamp), date("Y", $timestamp)); //don't edit
}// end func

Here is the caller graph for this function:

navigation ( timestamp  ) 

void function navigation($timestamp)

This function generates the timestamps for the day navigation and passes them to the template day_navigation

Parameters:
$timestamp,a required timestamp of sometime during the current day. $DP_language , used by the Gui to determine the language of "today" as set in the language file.
Returns:
$day_navigation , the output variable of the Gui,

Definition at line 81 of file inc.day.php.

References $DP_language, and $Gui.

                               {
                        global $DP_language;
                        $Gui                            = new Gui();

                        $today          = mktime(0,0,0);
                        $lastday        = strtotime ("-1 day" , $timestamp) ;
                        $nextday        = strtotime ("+1 day" , $timestamp) ;
                        
                        eval ("\$day_navigation = \"".$Gui->getTemplate("day_navigation")."\";");
                        
                        return $day_navigation;

} // end func

padBack ( stream,
&$  arrayPadded,
intervall,
endDisplayTimeInMinutes 
)

void function padBack($stream, $arrayPadded, $intervall, $endDisplayTimeInMinutes)

This funktion inserts what will be displayed as blank "<TD></TD>" into $arrayPadded, starting from the last date untill $endDisplayTimeInMinutes is reached

Parameters:
int $stream , used to determine, in which part of the first dimension of $arrayPadded dates are inserted.
array[][][] $arrayPadded , it is the result array, which contains all data used for displaying and formating, to be passed as a reference
int $endDisplayTimeInMinutes , time when the padding has to stop
int $intervall , this value holds the size of the subdivisions (i.e. 15)

Definition at line 468 of file inc.day.php.

Referenced by generateDay().

                                                                              {
        $lastElement=count($arrayPadded[$stream])-1;
        $lastEnd=$arrayPadded[$stream][$lastElement][2]; // start padding here
        $nextStart=$lastEnd;
        $nextEnd = ($nextStart - $nextStart%$intervall)+$intervall;
        while($endDisplayTimeInMinutes+15>=$nextEnd){
                $lastElement++;
                $arrayPadded[$stream][$lastElement][0]="NULL";
                $arrayPadded[$stream][$lastElement][1]=$nextStart;
                $arrayPadded[$stream][$lastElement][2]=$nextEnd;
                $arrayPadded[$stream][$lastElement][5]=$nextEnd-$nextStart;
                $arrayPadded[$stream][$lastElement][6]=1;
                $nextStart=$nextEnd;
                $nextEnd=$nextEnd+$intervall;
        }
}// end func

Here is the caller graph for this function:

padFront ( dateList,
stream,
&$  arrayPadded,
intervall,
startDisplayTimeInMinutes 
)

void function padFront($dateList, $stream, $arrayPadded, $intervall, $startDisplayTimeInMinutes)

This funktion inserts what will be displayed as blank "<TD></TD>" into $arrayPadded, until the first date is reached.

Parameters:
array[][] $dateList , a two dimensional array with ascending dates.
int $stream , used to determine, in which part of the first dimension of $arrayPadded dates are inserted.
array[][][] $arrayPadded , it is the result array, which contains all data used for displaying and formating, to be passed as a reference
string $intervall , this value holds the size of the subdivisions (i.e. 15)
$startDisplayTimeInMinutes,the display starting time in minutes

Definition at line 356 of file inc.day.php.

References $row, and $start.

Referenced by generateDay().

                                                                                            {
        $padStart= $startDisplayTimeInMinutes;
        $padEnd = $startDisplayTimeInMinutes + $intervall;
        $start=$dateList[0][1];
        $end=$dateList[0][2];
        $row=0;
        while($padEnd<=$start){ //while the padding of one subdivision (i.e length of $intervall) does not overlap a date, keep padding
                $arrayPadded[$stream][$row][0]="NULL";
                $arrayPadded[$stream][$row][1]=$padStart;
                $arrayPadded[$stream][$row][2]=$padEnd;
                $arrayPadded[$stream][$row][5]=$intervall;
                $arrayPadded[$stream][$row][6]=1;
                $padStart=$padEnd;
                $padEnd=$padEnd+$intervall;
                $row++; 
        }
        if($padStart < $start){ //try to fit part of an intervall as padding in front of the date.
                $arrayPadded[$stream][$row][0]="NULL";
                $arrayPadded[$stream][$row][1]=$padStart;
                $arrayPadded[$stream][$row][2]=$start;
                $arrayPadded[$stream][$row][5]=$start - $padStart;
                $arrayPadded[$stream][$row][6]=1;
                $padEnd=$padEnd+$intervall;
                $row++; 
        }
        //add the date itself
        $arrayPadded[$stream][$row][0]=$dateList[0][0];
        $arrayPadded[$stream][$row][1]=$dateList[0][1];
        $arrayPadded[$stream][$row][2]=$dateList[0][2];
        if($arrayPadded[$stream][$row][2]==$arrayPadded[$stream][$row][1])$arrayPadded[$stream][$row][2]++; // adjust dates with no length, otherwise HTML gets crazy
        $arrayPadded[$stream][$row][3]=$dateList[0][3];
        $arrayPadded[$stream][$row][4]=$dateList[0][4];
        $arrayPadded[$stream][$row][5]=$end - $start;
        $arrayPadded[$stream][$row][6]=1;
        $arrayPadded[$stream][$row][7]=$dateList[0][7];
        $arrayPadded[$stream][$row][8]=$dateList[0][8];
        $row++;
}// end func

Here is the caller graph for this function:

padMiddle ( dateList,
counter,
stream,
&$  arrayPadded,
intervall 
)

void function padMiddle($dateList, $counter, $stream, $arrayPadded, $intervall)

This funktion inserts what will be displayed as blank "<TD></TD>" into $arrayPadded, by trying to fill up untill the next intervall and consecutive intervalls untill and/or the next date.

Parameters:
array[][] $dateList , a two dimensional array with ascending dates.
int $counter , points at the current to be padded date in $dateList.
int $stream , used to determine, in which part of the first dimension of $arrayPadded dates are inserted.
array[][][] $arrayPadded , it is the result array, which contains all data used for displaying and formating, to be passed as a reference
int $intervall , this value holds the size of the subdivisions (i.e. 15)

Definition at line 412 of file inc.day.php.

References $counter.

Referenced by generateDay().

                                                                           {
        $lastElement=count($arrayPadded[$stream])-1;
        $lastEnd=$arrayPadded[$stream][$lastElement][2];
        if($dateList[$counter]){ // is not last date
                $nextStart = $dateList[$counter][1]; //start time in minutes
                $nextIntervall=$lastEnd+$intervall-$lastEnd%$intervall; // calculate next interval
                while($nextIntervall < $nextStart){ // insert blank until next interval
                        $lastElement++;
                        $arrayPadded[$stream][$lastElement][0]="NULL";
                        $arrayPadded[$stream][$lastElement][1]=$lastEnd;
                        $arrayPadded[$stream][$lastElement][2]=$nextIntervall;
                        $arrayPadded[$stream][$lastElement][5]=$nextIntervall-$lastEnd;
                        $arrayPadded[$stream][$lastElement][6]=1;
                        $lastEnd = $nextIntervall; // inc $lastEnd
                        $nextIntervall = $nextIntervall + $intervall; // inc $nextInterval
                }
                if($nextStart-$lastEnd>0){ // pad between intervalls
                        $lastElement++;
                        $arrayPadded[$stream][$lastElement][0]="NULL";
                        $arrayPadded[$stream][$lastElement][1]=$lastEnd;
                        $arrayPadded[$stream][$lastElement][2]=$nextStart;
                        $arrayPadded[$stream][$lastElement][5]=$nextStart-$lastEnd;
                        $arrayPadded[$stream][$lastElement][6]=1;
                }
                $lastElement++; // insert date
                $arrayPadded[$stream][$lastElement][0]=$dateList[$counter][0];
                $arrayPadded[$stream][$lastElement][1]=$dateList[$counter][1];
                $arrayPadded[$stream][$lastElement][2]=$dateList[$counter][2];
                if($arrayPadded[$stream][$lastElement][1]==$arrayPadded[$stream][$lastElement][2])$arrayPadded[$stream][$lastElement][2]++; // adjust dates with no length,  otherwise HTML gets crazy
                $arrayPadded[$stream][$lastElement][3]=$dateList[$counter][3];
                $arrayPadded[$stream][$lastElement][4]=$dateList[$counter][4];
                $arrayPadded[$stream][$lastElement][5]=$dateList[$counter][2] - $nextStart;
                $arrayPadded[$stream][$lastElement][6]=1;
                $arrayPadded[$stream][$lastElement][7]=$dateList[$counter][7];
                $arrayPadded[$stream][$lastElement][8]=$dateList[$counter][8];
                
        }
}// end func back to loop

Here is the caller graph for this function:

parseDataForOutput ( DateValues  ) 

void function parseData (Array DateValues)

Formate the user Date Date for the html Output.

Parameters:
array $DateValues
Returns:
string $Valid

Definition at line 588 of file inc.day.php.

References $DateValues.

                                           {
        
        // parse text for html links and e-mail adresses
        $text = $DateValues[text];
        $urlsearch[]="/([^]_a-z0-9-=\"'\/])((https?|ftp):\/\/|www\.)([^ \r\n\(\)\*\^\$!`\"'\|\[\]\{\};<>]*)/si";
        $urlsearch[]="/^((https?|ftp):\/\/|www\.)([^ \r\n\(\)\*\^\$!`\"'\|\[\]\{\};<>]*)/si";
        $urlreplace[]="\\1<A HREF='\\2\\4' target='_blank'>\\2\\4</A>";
        $urlreplace[]="<A HREF='\\1\\3' target='_blank'>\\1\\3</A>";
        $emailsearch[]="/([\s])([_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,}))/si";
        $emailsearch[]="/^([_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,}))/si";
        $emailreplace[]="\\1<a href='mailto:\\2'>\\2</a>";
        $emailreplace[]="<a href='mailto:\\0'>\\0</a>";
        $text = preg_replace($urlsearch, $urlreplace, $text);
        if (strpos($text, "@")) $text = preg_replace($emailsearch, $emailreplace, $text);
        // parse text for line breaks
        $text = str_replace("\r\n","<br>" , $text);
        // parse text for images links
        $text = preg_replace("!\[img\](.*)\[/img\]!U","<img alt='\\1' src='\\1'>",$text);
        $DateValues[text] = $text;
        // parse text for html links and e-mail adresses

        $text = $DateValues[shorttext];
        // parse shorttext for html links and e-mail adresses
        $urlsearch[]="/([^]_a-z0-9-=\"'\/])((https?|ftp):\/\/|www\.)([^ \r\n\(\)\*\^\$!`\"'\|\[\]\{\};<>]*)/si";
        $urlsearch[]="/^((https?|ftp):\/\/|www\.)([^ \r\n\(\)\*\^\$!`\"'\|\[\]\{\};<>]*)/si";
        $urlreplace[]="\\1<A HREF='\\2\\4' target='_blank'>\\2\\4</A>";
        $urlreplace[]="<A HREF='\\1\\3' target='_blank'>\\1\\3</A>";
        $emailsearch[]="/([\s])([_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,}))/si";
        $emailsearch[]="/^([_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,}))/si";
        $emailreplace[]="\\1<a href='mailto:\\2'>\\2</a>";
        $emailreplace[]="<a href='mailto:\\0'>\\0</a>";
        $text = preg_replace($urlsearch, $urlreplace, $text);
        if (strpos($text, "@")) $text = preg_replace($emailsearch, $emailreplace, $text);
        $text = str_replace("\r\n","<br>" , $text);
        $DateValues[shorttext] = $text;

        Return $DateValues;

}// end func

testOutput ( dim3  ) 

void function testoutput($dim3)

echos a 3 dimensional array to the screen, used for debug purposes, might distort normal table output if existent

Parameters:
array[][][] $dim3 , a 3 dimensional array with data

Definition at line 305 of file inc.day.php.

                          {
        foreach($dim3 as $key => $dim2){
                echo "Stream: ".$key."<br>";
                foreach($dim2 as $dim1){
                        foreach($dim1 as $v){
                                echo ":".$v." ";
                        }
                echo "<br>";    
                }
                echo "<br>";
        }
}// end func

testOutput2 ( dim2  ) 

void function testOutput2($dim2)

echos a 2 dimensional array to the screen, used for debug purposes, might distort normal table output if existent

Parameters:
array[][] $dim2 , a 2 dimensional array with data

Definition at line 329 of file inc.day.php.

                           {
                foreach($dim2 as $dim1){
                        foreach($dim1 as $v){
                                echo ":".$v." ";
                        }
                echo "<br>";    
                }
                echo "<br>";
}// end func

turnToMinutes ( &$  dateList,
startshow 
)

void function turnToMinutes($dateList, $startshow)

This function reformats the timestamps of start and end to minutes of the day. Additionally, the timestamps are formated as a date string, as to prepare data for output

Parameters:
array[][] $dateList , a 2-dimensional array of dates
int $startshow , timestamp of the start of the day

array[] $DP_language , an array containung language dependant information

Definition at line 281 of file inc.day.php.

References $DP_language.

Referenced by generateDay().

                                              {
        global $DP_language;
        $format = $DP_language[date_format];
        for($date=0; $date<count($dateList); $date++){
                $dateList[$date][7]= date($format, $dateList[$date][1]); // save the date and start time readeable
                $dateList[$date][8]= date($format, $dateList[$date][2]); // save the date and end time readeable
                $dateList[$date][1]= ($dateList[$date][1]-$startshow)/60; // (1)calculate timelength of beginning of from start of day in seconds and divide my 60 to acquire minutes
                if($dateList[$date][1]< 0){$dateList[$date][1]=0;}        // (2) if date started previous to this day, set start display time to start of day   
                $dateList[$date][2]= ($dateList[$date][2]-$startshow)/60; // analogous to (1) for end of date
                if($dateList[$date][2]> 1440){$dateList[$date][2]=1440;} // analogous to (2) for subsequent end of date, set to end of day
        }
}// end func

Here is the caller graph for this function: