Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 401] [Versions 400 and 402] [Versions 400 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

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

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

return: array
param: stdObject $data form data

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.