moodle_local_treestudyplan/classes/local/forms/studyplan_editform.php

59 lines
No EOL
1.7 KiB
PHP

<?php
namespace local_treestudyplan\local\forms;
/**
* Moodleform class for the studyplan editor. A Moodleform is used here to facilitate a rich editor
* in the studyplan description
*/
class studyplan_editform extends formbase {
/**
* Validate security access for this form based on the provided parameters
* Return true if validation passes, false or throw an exception if it does not.
*
* @param array $params The parameters for form initialization
* @return bool True if security validation passes.
* @throws \moodle_exception if access denied for a specific reason.
*/
public static function check_security(array $params) {
}
/**
* Generate form data from parameters
* Also validate parameters and access permissions here
*
* @param array $params The parameters for form initialization
* @return array Form data based on parameters
*/
public static function init_data(array $params) {
}
/**
* Set up the form definition
*/
public function definition() {
$mform = $this->_form;
// Define the form
$mform->addElement('editor', 'activityeditor',
get_string('activityeditor', 'assign'), array('rows' => 10), array('maxfiles' => EDITOR_UNLIMITED_FILES,
'noclean' => true, 'context' => $this->context, 'subdirs' => true));
$mform->addHelpButton('activityeditor', 'activityeditor', 'assign');
$mform->setType('activityeditor', PARAM_RAW);
}
/**
* Process the submission and perform necessary actions
* @throws \moodle_exception if an error must be given for a specific reason.
*/
public function process_submission()
{
}
}