Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
portfolio_format Class Reference

Base class to inherit from. More...

Inheritance diagram for portfolio_format:
portfolio_format_file portfolio_format_rich portfolio_format_document portfolio_format_image portfolio_format_pdf portfolio_format_plainhtml portfolio_format_presentation portfolio_format_spreadsheet portfolio_format_text portfolio_format_video portfolio_format_leap2a portfolio_format_richhtml

Static Public Member Functions

static conflicts ($format)
 Whether this format conflicts with the given format.
 
static file_output ($file, $options=null)
 Given a file, return a snippet of markup in whatever format to link to that file.
 
static get_file_directory ()
 For multipart formats, eg html with attachments, we need to have a directory to place associated files from inside the zip file.
 
static make_tag ($file, $path, $attributes)
 Create portfolio tag.
 
static mimetypes ()
 Array of mimetypes this format supports.
 

Detailed Description

Base class to inherit from.

Do not use this anywhere in supported_formats

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

Member Function Documentation

◆ conflicts()

static portfolio_format::conflicts ( $format)
static

Whether this format conflicts with the given format.

This is used for the case where an export location "generally" supports something like FORMAT_PLAINHTML but then in a specific export case, must add attachments, which means that FORMAT_RICHHTML is supported in that case, which implies removing support for FORMAT_PLAINHTML. Note that conflicts don't have to be bi-directional (eg FORMAT_PLAINHTML conflicts with FORMAT_RICHHTML but not the other way around) and things within the class hierarchy are resolved automatically anyway. This is really just between subclasses of format_rich and subclasses of format_file.

Parameters
string$formatone of the FORMAT_XX constants
Return values
bool

Reimplemented in portfolio_format_image, portfolio_format_plainhtml, portfolio_format_richhtml, and portfolio_format_text.

◆ file_output()

static portfolio_format::file_output ( $file,
$options = null )
static

Given a file, return a snippet of markup in whatever format to link to that file.

Usually involves the path given by get_file_directory. This is not supported in subclasses of portfolio_format_file since they're all just single files.

See also
get_file_directory
Parameters
stored_file$filefile information object
array$optionsarray of options to pass. can contain: attributes => hash of existing html attributes (eg title, height, width, etc)
Exceptions
coding_exception

Reimplemented in portfolio_format_file, portfolio_format_leap2a, and portfolio_format_richhtml.

◆ get_file_directory()

static portfolio_format::get_file_directory ( )
static

For multipart formats, eg html with attachments, we need to have a directory to place associated files from inside the zip file.

This is the name of that directory

Exceptions
coding_exception

Reimplemented in portfolio_format_file, portfolio_format_leap2a, and portfolio_format_richhtml.

◆ make_tag()

static portfolio_format::make_tag ( $file,
$path,
$attributes )
static

Create portfolio tag.

Parameters
stored_file$filefile information object
string$pathfile path
array$attributesportfolio attributes
Return values
string

◆ mimetypes()


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