Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

This file contains all the form definitions used by the portfolio code.

Copyright: 2008 Penny Leach <penny@catalyst.net.nz>,
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 328 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 4 classes

portfolio_export_form:: (2 methods):
  definition()
  validation()

portfolio_admin_form:: (2 methods):
  definition()
  validation()

portfolio_user_form:: (2 methods):
  definition()
  validation()

portfolio_instance_select:: (1 method):
  definition()


Class: portfolio_export_form  - X-Ref

During-export config form.

This is the form that is actually used while exporting.
Plugins and callers don't get to define their own class
as we have to handle form elements from both places
See the docs here for more information:
http://docs.moodle.org/dev/Writing_a_Portfolio_Plugin#has_export_config
http://docs.moodle.org/dev/Adding_a_Portfolio_Button_to_a_page#has_export_config

definition()   X-Ref
prepare form


validation($data, $files)   X-Ref
Validate portfolio export form

param: stdClass $data portfolio information from form data
return: array

Class: portfolio_admin_form  - X-Ref

Admin config form.

This form is extendable by plugins who want the admin to be able to configure more than just the name of the instance.
This is NOT done by subclassing this class, see the docs for portfolio_plugin_base for more information:
{@link http://docs.moodle.org/dev/Writing_a_Portfolio_Plugin#has_admin_config}

definition()   X-Ref
prepare form


validation($data, $files)   X-Ref
Validate admin config form

param: stdObject $data form data
return: array

Class: portfolio_user_form  - X-Ref

User config form.

This is the form for letting the user configure an instance of a plugin.
In order to extend this, you don't subclass this in the plugin..
see the docs in portfolio_plugin_base for more information:
{@link http://docs.moodle.org/dev/Writing_a_Portfolio_Plugin#has_user_config}

definition()   X-Ref
prepare form


validation($data, $files)   X-Ref
User user config form.

param: stdClass $data form data

Class: portfolio_instance_select  - X-Ref

Form that just contains the dropdown menu of available instances.

This is not used by portfolio_add_button, but on the first step of the export,
if the plugin instance has not yet been selected.

definition()   X-Ref
The required basic elements to the form.