Variables:
integer Schedule::width
integer Schedule::height
array Schedule::bg
array Schedule::grid
array Schedule::schedule
array Schedule::legend
array Schedule::block
array Schedule::struct
resource Schedule::im

Methods:
Schedule::Schedule()
Schedule::LoadXmlFile()
Schedule::LoadXmlData()
Schedule::Draw()
Schedule::DrawBackground()
Schedule::DrawGrid()
Schedule::DrawDays()
Schedule::UpdateSettings()
Schedule::UpdatePartSettings()
Schedule::SetVar()
Schedule::DrawBlocks()
Schedule::GetPercent()
Schedule::GetColor()
Schedule::GetCoords()
Schedule::GetAlign()
Schedule::DrawDescription()
Schedule::DrawText()
Schedule::DrawRectangle()
Schedule::AllocateColor()
Schedule::ReorganizeArray()
[ Top ] void Schedule::Schedule() [line 97]
Class constructor (can load a $xml data/file)

Parameters
string $xml XML file or data
boolean $file Indicates whether $xml is a file or not (data)
[ Top ] void Schedule::LoadXmlFile() [line 136]
Load data from file

Parameters
string $file Path to filename
[ Top ] void Schedule::LoadXmlData() [line 156]
Parse data

Parameters
string $data XML data
[ Top ] void Schedule::Draw() [line 205]
Draw schedule

Parameters
string $output_file File to output
integer $schedule Schedule pointer (usualy 0)
[ Top ] void Schedule::DrawBackground() [line 248]
Draw schedule background
[ Top ] void Schedule::DrawGrid() [line 261]
Draw schedule grid according to schedule pointer

Parameters
integer $schedule Schedule pointer
[ Top ] void Schedule::DrawDays() [line 344]
Draw schedule blocks for all days given the schedule pointer

Parameters
integer $schedule Schedule pointer
[ Top ] void Schedule::UpdateSettings() [line 364]
Updates settings from xml array

Parameters
array $settings Settings array
[ Top ] void Schedule::UpdatePartSettings() [line 382]
Updates settings to a part of the schedule class (block, legend, ..)

Parameters
array $settings Settings array
string $settings_part Settings section (block, legend, ..)
[ Top ] void Schedule::SetVar() [line 420]
Sets (depending on value) a variable or array position (given a key)

Parameters
string $varname Variable name
mixed $setting Setting value
string $array_key Array key (for $this->varname)
[ Top ] void Schedule::DrawBlocks() [line 448]
Draw a group of blocks in a given day

Parameters
integer $day Day where blocks should be drawed
array $blocks Array containing all blocks
integer $maxdays Total days of the schedule
integer $maxblocks Total blocks of the schedule
[ Top ] integer Schedule::GetPercent() [line 525]
Given a string and the max value to 100%, it will return the value corresponding to that percentage e.g.: GetPercent('25%', 40) = 10

Parameters
string $string String containing a percentage
integer $max Value corresponding to 100%
[ Top ] array Schedule::GetColor() [line 540]
Transforms an hex RGB string into a PHP RGB array

Parameters
string $string String containing the color in hex RGB format
[ Top ] array Schedule::GetCoords() [line 571]
Returns coordinates of the 4 corners of a block to draw in the image

Parameters
integer $x X
integer $y Y
integer $x_span X expansion (to other days)
integer $y_span Y expansion (to other blocks)
integer $x_max Total X (total days)
integer $y_max Total Y (total blocks)
integer $x_offset X offset
integer $y_offset Y offset
[ Top ] string Schedule::GetAlign() [line 591]
Returns the align if it's valid or the first valid align

Parameters
string $align String containing the desired align
array $possible_aligns Array containing all the possible aligns
[ Top ] void Schedule::DrawDescription() [line 611]
Draws the description of a block given the 4 corners of the block and some more settings

Parameters
integer $x1 X of top left corner
integer $y1 Y of top left corner
integer $x2 X of bottom right corner
integer $y2 Y of bottom right corner
integer $font Font
string $text Text to draw
integer $color Color
string $align Alignment (default is left)
[ Top ] void Schedule::DrawText() [line 667]
Draw text given (x,y) points, font, color, horizontal and vertical align

Parameters
integer $x X
integer $y Y
integer $font Font
string $text Text to draw
integer $color Color
string $align Horizontal alignment (default is center)
string $valign Vertical alignment (default is middle)
[ Top ] void Schedule::DrawRectangle() [line 690]
Draws a rectangle given the 4 corner points, border and background color

Parameters
integer $x1 X of top left corner
integer $y1 Y of top left corner
integer $x2 X of bottom right corner
integer $y2 Y of bottom right corner
integer $bordercolor Border color
integer $bgcolor Background color
[ Top ] void Schedule::AllocateColor() [line 706]
Allocates a color (if needed) and sets a variable with the index of that color (alpha is added if possible [GD2])

Parameters
string $varname Variable name
array $color Array containing RGB color
integer $alpha Transparency: (opaque) 0<->127 (transparent)
[ Top ] void Schedule::ReorganizeArray() [line 734]
Resets the indexes of an array

Parameters
array $array Array to reorganize

Schedule

[ Author: Jeph <a25617@alunos.det.ua.pt> ] [ Version: 0.1 ] [ Package: Schedule ] [ URL: <none> ]