[ Index ]

PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008]

title

Body

[close]

/lib/ -> excellib.class.php (summary)

(no description)

File Size: 608 lines (22 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 3 classes

MoodleExcelWorkbook:: (5 methods):
  MoodleExcelWorkbook()
  add_worksheet()
  add_format()
  close()
  send()

MoodleExcelWorksheet:: (14 methods):
  MoodleExcelWorksheet()
  write_string()
  write_number()
  write_url()
  write_formula()
  write_blank()
  write()
  set_row()
  set_column()
  hide_gridlines()
  hide_screen_gridlines()
  insert_bitmap()
  merge_cells()
  MoodleExcelFormat2PearExcelFormat()

MoodleExcelFormat:: (23 methods):
  MoodleExcelFormat()
  set_size()
  set_bold()
  set_underline()
  set_italic()
  set_strikeout()
  set_outline()
  set_shadow()
  set_script()
  set_color()
  set_fg_color()
  set_bg_color()
  set_pattern()
  set_text_wrap()
  set_align()
  set_h_align()
  set_v_align()
  set_top()
  set_bottom()
  set_left()
  set_right()
  set_border()
  set_num_format()


Class: MoodleExcelWorkbook  - X-Ref

Define and operate over one Moodle Workbook.

A big part of this class acts as a wrapper over the PEAR
Spreadsheet_Excel_Writer_Workbook and OLE libraries
maintaining Moodle functions isolated from underlying code.
MoodleExcelWorkbook($filename)   X-Ref
Constructs one Moodle Workbook.

param: string $filename The name of the file

add_worksheet($name = '')   X-Ref
Create one Moodle Worksheet

param: string $name Name of the sheet

add_format($properties = array()   X-Ref
Create one Moodle Format

param: array $properties array of properties [name]=value;

close()   X-Ref
Close the Moodle Workbook


send($filename)   X-Ref
Write the correct HTTP headers

param: string $name Name of the downloaded file

Class: MoodleExcelWorksheet  - X-Ref

Define and operate over one Worksheet.

A big part of this class acts as a wrapper over the PEAR
Spreadsheet_Excel_Writer_Workbook and OLE libraries
maintaining Moodle functions isolated from underlying code.
MoodleExcelWorksheet($name, &$workbook, $latin_output=false)   X-Ref
Constructs one Moodle Worksheet.

param: string $filename The name of the file
param: object $workbook The internal PEAR Workbook onject we are creating

write_string($row, $col, $str, $format=null)   X-Ref
Write one string somewhere in the worksheet

param: integer $row    Zero indexed row
param: integer $col    Zero indexed column
param: string  $str    The string to write
param: mixed   $format The XF format for the cell

write_number($row, $col, $num, $format=null)   X-Ref
Write one number somewhere in the worksheet

param: integer $row    Zero indexed row
param: integer $col    Zero indexed column
param: float   $num    The number to write
param: mixed   $format The XF format for the cell

write_url($row, $col, $url, $format=null)   X-Ref
Write one url somewhere in the worksheet

param: integer $row    Zero indexed row
param: integer $col    Zero indexed column
param: string  $url    The url to write
param: mixed   $format The XF format for the cell

write_formula($row, $col, $formula, $format=null)   X-Ref
Write one formula somewhere in the worksheet

param: integer $row    Zero indexed row
param: integer $col    Zero indexed column
param: string  $formula The formula to write
param: mixed   $format The XF format for the cell

write_blank($row, $col, $format=null)   X-Ref
Write one blanck somewhere in the worksheet

param: integer $row    Zero indexed row
param: integer $col    Zero indexed column
param: mixed   $format The XF format for the cell

write($row, $col, $token, $format=null)   X-Ref
Write anything somewhere in the worksheet
Type will be automatically detected

param: integer $row    Zero indexed row
param: integer $col    Zero indexed column
param: mixed   $token  What we are writing
param: mixed   $format The XF format for the cell

set_row($row, $height, $format = null, $hidden = false, $level = 0)   X-Ref
Sets the height (and other settings) of one row

param: integer $row    The row to set
param: integer $height Height we are giving to the row (null to set just format withouth setting the height)
param: mixed   $format The optional XF format we are giving to the row
param: bool    $hidden The optional hidden attribute
param: integer $level  The optional outline level (0-7)

set_column($firstcol, $lastcol, $width, $format = null, $hidden = false, $level = 0)   X-Ref
Sets the width (and other settings) of one column

param: integer $firstcol first column on the range
param: integer $lastcol  last column on the range
param: integer $width    width to set
param: mixed   $format   The optional XF format to apply to the columns
param: integer $hidden   The optional hidden atribute
param: integer $level    The optional outline level (0-7)

hide_gridlines()   X-Ref
Set the option to hide gridlines on the printed page.


hide_screen_gridlines()   X-Ref
Set the option to hide gridlines on the worksheet (as seen on the screen).


insert_bitmap($row, $col, $bitmap, $x = 0, $y = 0, $scale_x = 1, $scale_y = 1)   X-Ref
Insert a 24bit bitmap image in a worksheet.

param: integer $row     The row we are going to insert the bitmap into
param: integer $col     The column we are going to insert the bitmap into
param: string  $bitmap  The bitmap filename
param: integer $x       The horizontal position (offset) of the image inside the cell.
param: integer $y       The vertical position (offset) of the image inside the cell.
param: integer $scale_x The horizontal scale
param: integer $scale_y The vertical scale

merge_cells($first_row, $first_col, $last_row, $last_col)   X-Ref
Merges the area given by its arguments.
This is an Excel97/2000 method. It is required to perform more complicated
merging than the normal setAlign('merge').

param: integer $first_row First row of the area to merge
param: integer $first_col First column of the area to merge
param: integer $last_row  Last row of the area to merge
param: integer $last_col  Last column of the area to merge

MoodleExcelFormat2PearExcelFormat($format)   X-Ref
Returns the PEAR Excel Format for one Moodle Excel Format

param: mixed MoodleExcelFormat object
return: mixed PEAR Excel Format object

Class: MoodleExcelFormat  - X-Ref

Define and operate over one Format.

A big part of this class acts as a wrapper over the PEAR
Spreadsheet_Excel_Writer_Workbook and OLE libraries
maintaining Moodle functions isolated from underlying code.
MoodleExcelFormat(&$workbook, $properties = array()   X-Ref
Constructs one Moodle Format.

param: object $workbook The internal PEAR Workbook onject we are creating

set_size($size)   X-Ref
Set the size of the text in the format (in pixels).
By default all texts in generated sheets are 10px.

param: integer $size Size of the text (in pixels)

set_bold($weight = 1)   X-Ref
Set weight of the format

param: integer $weight Weight for the text, 0 maps to 400 (normal text),

set_underline($underline)   X-Ref
Set underline of the format

param: integer $underline The value for underline. Possible values are:

set_italic()   X-Ref
Set italic of the format


set_strikeout()   X-Ref
Set strikeout of the format


set_outline()   X-Ref
Set outlining of the format


set_shadow()   X-Ref
Set shadow of the format


set_script($script)   X-Ref
Set the script of the text

param: integer $script The value for script type. Possible values are:

set_color($color)   X-Ref
Set color of the format. Used to specify the color of the text to be formatted.

param: mixed $color either a string (like 'blue'), or an integer (range is [8...63])

set_fg_color($color)   X-Ref
Set foreground color (top layer) of the format. About formatting colors note that cells backgrounds
have TWO layers, in order to support patterns and paint them with two diferent colors.
This method set the color of the TOP layer of the background format. So, when filling
cells with plain colors (no patterns) this is the method to use.

param: mixed $color either a string (like 'blue'), or an integer (range is [8...63])

set_bg_color($color)   X-Ref
Set background color (bottom layer) of the format. About formatting colors note that cells backgrounds
have TWO layers, in order to support patterns and paint them with two diferent colors.
This method set the color of the BOTTOM layer of the background format. So, the color
specified here only will be visible if using patterns. Use set_fg_color() to fill
cells with plain colors (no patterns).

param: mixed $color either a string (like 'blue'), or an integer (range is [8...63])

set_pattern($pattern=1)   X-Ref
Set the fill pattern of the format

param: integer Optional. Defaults to 1. Meaningful values are: 0-18

set_text_wrap()   X-Ref
Set text wrap of the format


set_align($location)   X-Ref
Set the cell alignment of the format

param: string $location alignment for the cell ('left', 'right', etc...)

set_h_align($location)   X-Ref
Set the cell horizontal alignment of the format

param: string $location alignment for the cell ('left', 'right', etc...)

set_v_align($location)   X-Ref
Set the cell vertical alignment of the format

param: string $location alignment for the cell ('top', 'vleft', etc...)

set_top($style)   X-Ref
Set the top border of the format

param: integer $style style for the cell. 1 => thin, 2 => thick

set_bottom($style)   X-Ref
Set the bottom border of the format

param: integer $style style for the cell. 1 => thin, 2 => thick

set_left($style)   X-Ref
Set the left border of the format

param: integer $style style for the cell. 1 => thin, 2 => thick

set_right($style)   X-Ref
Set the right border of the format

param: integer $style style for the cell. 1 => thin, 2 => thick

set_border($style)   X-Ref
Set cells borders to the same style

param: integer $style style to apply for all cell borders. 1 => thin, 2 => thick.

set_num_format($num_format)   X-Ref
Set the numerical format of the format
It can be date, time, currency, etc...

param: integer $num_format The numeric format



Generated: Wed Jan 14 11:33:29 2009 Cross-referenced by PHPXref 0.7