Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [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: 322 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

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.

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.

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.