Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
MoodleODSFormat Class Reference

ODS cell format abstraction. More...

Public Member Functions

 __construct ($properties=array())
 Constructs one Moodle Format. More...
 
 set_align ($location)
 Set the cell alignment of the format. More...
 
 set_bg_color ($color)
 Set background color of the cell. More...
 
 set_bold ($weight=1)
 Set weight of the format. More...
 
 set_border ($style)
 Set cells borders to the same style. More...
 
 set_bottom ($style)
 Set the bottom border of the format. More...
 
 set_color ($color)
 Set color of the format. More...
 
 set_fg_color ($color)
 Not used. More...
 
 set_h_align ($location)
 Set the cell horizontal alignment of the format. More...
 
 set_italic ()
 Set italic of the format.
 
 set_left ($style)
 Set the left border of the format. More...
 
 set_num_format ($num_format)
 Set the numerical format of the format. More...
 
 set_outline ()
 Set outlining of the format.
 
 set_pattern ($pattern=1)
 Set the cell fill pattern. More...
 
 set_right ($style)
 Set the right border of the format. More...
 
 set_script ($script)
 Set the script of the text. More...
 
 set_shadow ()
 Set shadow of the format.
 
 set_size ($size)
 Set the size of the text in the format (in pixels). More...
 
 set_strikeout ()
 Set strikeout of the format.
 
 set_text_wrap ()
 Set text wrap of the format.
 
 set_top ($style)
 Set the top border of the format. More...
 
 set_underline ($underline=1)
 Set underline of the format. More...
 
 set_v_align ($location)
 Set the cell vertical alignment of the format. More...
 

Public Attributes

 $id
 
 $properties = array()
 

Protected Member Functions

 parse_color ($color)
 Standardise colour name. More...
 

Detailed Description

ODS cell format abstraction.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

MoodleODSFormat::__construct (   $properties = array())

Constructs one Moodle Format.

Parameters
array$properties

Member Function Documentation

◆ parse_color()

MoodleODSFormat::parse_color (   $color)
protected

Standardise colour name.

Parameters
mixed$colorname of the color (i.e.: 'blue', 'red', etc..), or an integer (range is [8...63]).
Return values
stringthe RGB color value

◆ set_align()

MoodleODSFormat::set_align (   $location)

Set the cell alignment of the format.

Parameters
string$locationalignment for the cell ('left', 'right', 'justify', etc...)

◆ set_bg_color()

MoodleODSFormat::set_bg_color (   $color)

Set background color of the cell.

Parameters
mixed$coloreither a string (like 'blue'), or an integer (range is [8...63])

◆ set_bold()

MoodleODSFormat::set_bold (   $weight = 1)

Set weight of the format.

Parameters
integer$weightWeight for the text, 0 maps to 400 (normal text), 1 maps to 700 (bold text). Valid range is: 100-1000. It's Optional, default is 1 (bold).

◆ set_border()

MoodleODSFormat::set_border (   $style)

Set cells borders to the same style.

Parameters
integer$stylestyle to apply for all cell borders. 1 => thin, 2 => thick.

◆ set_bottom()

MoodleODSFormat::set_bottom (   $style)

Set the bottom border of the format.

Parameters
integer$stylestyle for the cell. 1 => thin, 2 => thick

◆ set_color()

MoodleODSFormat::set_color (   $color)

Set color of the format.

Parameters
mixed$coloreither a string (like 'blue'), or an integer (range is [8...63])

◆ set_fg_color()

MoodleODSFormat::set_fg_color (   $color)

Not used.

Parameters
mixed$color

◆ set_h_align()

MoodleODSFormat::set_h_align (   $location)

Set the cell horizontal alignment of the format.

Parameters
string$locationalignment for the cell ('left', 'right', 'justify', etc...)

◆ set_left()

MoodleODSFormat::set_left (   $style)

Set the left border of the format.

Parameters
integer$stylestyle for the cell. 1 => thin, 2 => thick

◆ set_num_format()

MoodleODSFormat::set_num_format (   $num_format)

Set the numerical format of the format.

It can be date, time, currency, etc...

Parameters
mixed$num_formatThe numeric format

◆ set_pattern()

MoodleODSFormat::set_pattern (   $pattern = 1)

Set the cell fill pattern.

Deprecated:
use set_bg_color() instead.
Parameters
integer

◆ set_right()

MoodleODSFormat::set_right (   $style)

Set the right border of the format.

Parameters
integer$stylestyle for the cell. 1 => thin, 2 => thick

◆ set_script()

MoodleODSFormat::set_script (   $script)

Set the script of the text.

Parameters
integer$scriptThe value for script type. Possible values are: 1 => superscript, 2 => subscript

◆ set_size()

MoodleODSFormat::set_size (   $size)

Set the size of the text in the format (in pixels).

By default all texts in generated sheets are 10pt.

Parameters
integer$sizeSize of the text (in points)

◆ set_top()

MoodleODSFormat::set_top (   $style)

Set the top border of the format.

Parameters
integer$stylestyle for the cell. 1 => thin, 2 => thick

◆ set_underline()

MoodleODSFormat::set_underline (   $underline = 1)

Set underline of the format.

Parameters
integer$underlineThe value for underline. Possible values are: 1 => underline, 2 => double underline

◆ set_v_align()

MoodleODSFormat::set_v_align (   $location)

Set the cell vertical alignment of the format.

Parameters
string$locationalignment for the cell ('top', 'bottom', 'center', 'justify')

The documentation for this class was generated from the following file: