Moodle  2.2.1
http://www.collinsharper.com
portfolio_caller_base Class Reference
Inheritance diagram for portfolio_caller_base:

Public Member Functions

 __construct ($callbackargs)
 export_config_form (&$mform, $instance)
 has_export_config ()
 export_config_validation ($data)
 expected_time ()
 expected_time_file ()
 get_navigation ()
 get_sha1 ()
 get_sha1_file ()
 get ($field)
 set ($field, &$value)
 set_export_config ($config)
 get_export_config ($key)
 get_allowed_export_config ()
 get_export_summary ()
 prepare_package ()
 prepare_package_file ()
 supported_formats ()
 get_return_url ()
 check_permissions ()
 heading_summary ()
 load_data ()
 set_file_and_format_data ($ids=null)
 set_formats_from_button ($formats)
 get_mimetype ()
 set_context ($PAGE)

Static Public Member Functions

static base_supported_formats ()
static display_name ()
static expected_callbackargs ()

Protected Member Functions

 add_format ($format)

Protected Attributes

 $course
 $exportconfig = array()
 $user
 $exporter
 $supportedformats
 $singlefile
 $multifiles
 $intendedmimetype

Detailed Description

base class for callers

See http://docs.moodle.org/dev/Adding_a_Portfolio_Button_to_a_page {

See also:
also portfolio_module_caller_base}

Definition at line 39 of file caller.php.


Constructor & Destructor Documentation

__construct ( callbackargs)

Reimplemented in portfolio_caller_test, data_portfolio_caller, and forum_portfolio_caller.

Definition at line 84 of file caller.php.


Member Function Documentation

add_format ( format) [protected]

adds a new format to the list of supported formats. handles removing conflicting and less specific formats at the same time.

Parameters:
string$formatone of PORTFOLIO_FORMAT_XX
Returns:
void

Definition at line 456 of file caller.php.

Here is the call graph for this function:

Here is the caller graph for this function:

check_permissions ( ) [abstract]

callback to do whatever capability checks required in the caller (called during the export process

Reimplemented in forum_portfolio_caller, glossary_entry_portfolio_caller, data_portfolio_caller, glossary_full_portfolio_caller, assignment_portfolio_caller, chat_portfolio_caller, and portfolio_caller_test.

static display_name ( ) [static]

nice name to display to the user about this caller location

Reimplemented in forum_portfolio_caller, glossary_entry_portfolio_caller, data_portfolio_caller, glossary_full_portfolio_caller, assignment_portfolio_caller, chat_portfolio_caller, and portfolio_caller_test.

Definition at line 357 of file caller.php.

Here is the caller graph for this function:

static expected_callbackargs ( ) [static]

array of arguments the caller expects to be passed through to it this must be keyed on the argument name, and the array value is a boolean, whether it is required, or just optional eg array( id => true, somethingelse => false, )

Returns:
array

Reimplemented in glossary_entry_portfolio_caller, portfolio_caller_test, data_portfolio_caller, assignment_portfolio_caller, forum_portfolio_caller, glossary_full_portfolio_caller, and chat_portfolio_caller.

Definition at line 482 of file caller.php.

expected_time ( ) [abstract]

how long does this reasonably expect to take.. should we offer the user the option to wait.. this is deliberately nonstatic so it can take filesize into account the portfolio plugin can override this. (so for example even if a huge file is being sent, the download portfolio plugin doesn't care )

Returns:
string (see PORTFOLIO_TIME_* constants)

Reimplemented in forum_portfolio_caller, glossary_entry_portfolio_caller, assignment_portfolio_caller, data_portfolio_caller, glossary_full_portfolio_caller, chat_portfolio_caller, and portfolio_caller_test.

helper method to calculate expected time for multi or single file exports

Definition at line 144 of file caller.php.

Here is the call graph for this function:

Here is the caller graph for this function:

export_config_form ( &$  mform,
instance 
)

if this caller wants any additional config items they should be defined here.

Parameters:
array$mformmoodleform object (passed by reference) to add elements to
object$instancesubclass of portfolio_plugin_base
integer$useridid of user exporting content

Reimplemented in data_portfolio_caller.

Definition at line 106 of file caller.php.

just like the moodle form validation function this is passed in the data array from the form and if a non empty array is returned, form processing will stop.

Parameters:
array$datadata from form.
Returns:
array keyvalue pairs - form element => error string

Definition at line 127 of file caller.php.

get ( field)

Reimplemented in portfolio_module_caller_base.

Definition at line 194 of file caller.php.

Here is the call graph for this function:

Similar to the other allowed_config functions if you need export config, you must provide a list of what the fields are.

even if you want to store stuff during export without displaying a form to the user, you can use this.

Returns:
array array of allowed keys

Reimplemented in data_portfolio_caller.

Definition at line 271 of file caller.php.

Here is the caller graph for this function:

get_export_config ( key) [final]

returns a particular export config value. subclasses shouldn't need to override this

Parameters:
stringkey the config item to fetch

Definition at line 245 of file caller.php.

Here is the call graph for this function:

Here is the caller graph for this function:

after the user submits their config they're given a confirm screen summarising what they've chosen.

this function should return a table of nice strings => values of what they've chosen to be displayed in a table.

Returns:
array array of config items.

Definition at line 286 of file caller.php.

Definition at line 463 of file caller.php.

Here is the caller graph for this function:

get_navigation ( ) [abstract]

used for displaying the navigation during the export screens.

this function must be implemented, but can really return anything. an Exporting.. string will be added on the end.

Returns:
array of $extranav and $cm

to pass to build_navigation

Reimplemented in portfolio_module_caller_base, forum_portfolio_caller, and portfolio_caller_test.

get_return_url ( ) [abstract]

this is the "return to where you were" url

Returns:
string url

Reimplemented in portfolio_module_caller_base, chat_portfolio_caller, forum_portfolio_caller, and portfolio_caller_test.

Here is the caller graph for this function:

helper function to calculate the sha1 for multi or single file exports

Definition at line 174 of file caller.php.

Here is the call graph for this function:

Here is the caller graph for this function:

whether this caller wants any additional config during export (eg options or metadata)

Returns:
boolean

Reimplemented in data_portfolio_caller.

Definition at line 115 of file caller.php.

return a string to put at the header summarising this export by default, just the display name (usually just 'assignment' or something unhelpful

Returns:
string

Reimplemented in portfolio_module_caller_base.

Definition at line 367 of file caller.php.

Here is the call graph for this function:

prepare_package ( ) [abstract]

called before the portfolio plugin gets control this function should copy all the files it wants to the temporary directory, using {

See also:
copy_existing_file} or {
write_new_file}

Reimplemented in glossary_entry_portfolio_caller, data_portfolio_caller, forum_portfolio_caller, chat_portfolio_caller, glossary_full_portfolio_caller, assignment_portfolio_caller, and portfolio_caller_test.

helper function to copy files into the temp area for single or multi file exports.

Definition at line 302 of file caller.php.

Here is the call graph for this function:

Here is the caller graph for this function:

set ( field,
&$  value 
) [final]

generic setter for properties belonging to this instance outside the subclass like name, visible, etc.

Definition at line 208 of file caller.php.

Here is the call graph for this function:

set_context ( PAGE) [abstract]

return the context for this export. used for $PAGE->set_context

Returns:
stdclass

Reimplemented in portfolio_module_caller_base, and portfolio_caller_test.

set_export_config ( config) [final]

stores the config generated at export time. subclasses can retrieve values using get_export_config

Parameters:
array$configformdata

Definition at line 225 of file caller.php.

Here is the call graph for this function:

set_file_and_format_data ( ids = null)

set up the required files for this export. this supports either passing files directly or passing area arguments directly through to the files api using file_storage::get_area_files

Parameters:
mixed$idsone of:
int$contextid(optional), passed to file_storage::get_area_files
string$component(optional), passed to file_storage::get_area_files
string$filearea(optional), passed to file_storage::get_area_files
int$itemid(optional), passed to file_storage::get_area_files
string$sort(optional), passed to file_storage::get_area_files
bool$includedirs(optional), passed to file_storage::get_area_files

Definition at line 391 of file caller.php.

Here is the call graph for this function:

Here is the caller graph for this function:

set_formats_from_button ( formats)

the button-location always knows best what the formats are... so it should be trusted.

Parameters:
array$formatsarray of PORTFOLIO_FORMAT_XX

Definition at line 434 of file caller.php.

Here is the call graph for this function:

supported_formats ( ) [final]

array of formats this caller supports the intersection of what this function returns and what the selected portfolio plugin supports will be used use the constants PORTFOLIO_FORMAT_*

Returns:
array list of formats

Definition at line 324 of file caller.php.

Here is the call graph for this function:


Field Documentation

$course [protected]

stdclass object course that was active during the caller

Reimplemented in portfolio_module_caller_base.

Definition at line 45 of file caller.php.

$exportconfig = array() [protected]

named array of export config useset_export_config and get_export_config to access

Definition at line 51 of file caller.php.

$exporter [protected]

a reference to the exporter object

Definition at line 62 of file caller.php.

$intendedmimetype [protected]

set this for generated-file exports

Definition at line 82 of file caller.php.

$multifiles [protected]

set this for multi file exports

Definition at line 77 of file caller.php.

$singlefile [protected]

set this for single file exports

Definition at line 72 of file caller.php.

$supportedformats [protected]

this can be overridden in subclasses constructors if they want

Definition at line 67 of file caller.php.

$user [protected]

stdclass object user currently exporting content

Definition at line 57 of file caller.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations