first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,116 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Customfields text field plugin
*
* @package customfield_text
* @copyright 2018 Daniel Neis Araujo <daniel@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace customfield_text;
defined('MOODLE_INTERNAL') || die;
use core_customfield\api;
/**
* Class data
*
* @package customfield_text
* @copyright 2018 Daniel Neis Araujo <daniel@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class data_controller extends \core_customfield\data_controller {
/**
* Return the name of the field where the information is stored
* @return string
*/
public function datafield(): string {
return 'charvalue';
}
/**
* Add fields for editing a text field.
*
* @param \MoodleQuickForm $mform
*/
public function instance_form_definition(\MoodleQuickForm $mform) {
$field = $this->get_field();
$config = $field->get('configdata');
$type = $config['ispassword'] ? 'password' : 'text';
$elementname = $this->get_form_element_name();
$mform->addElement($type, $elementname, $this->get_field()->get_formatted_name(), 'size=' . (int)$config['displaysize']);
$mform->setType($elementname, PARAM_TEXT);
if (!empty($config['defaultvalue'])) {
$mform->setDefault($elementname, $config['defaultvalue']);
}
if ($field->get_configdata_property('required')) {
$mform->addRule($elementname, null, 'required', null, 'client');
}
}
/**
* Validates data for this field.
*
* @param array $data
* @param array $files
* @return array
*/
public function instance_form_validation(array $data, array $files): array {
$errors = parent::instance_form_validation($data, $files);
$maxlength = $this->get_field()->get_configdata_property('maxlength');
$elementname = $this->get_form_element_name();
if (($maxlength > 0) && ($maxlength < \core_text::strlen($data[$elementname]))) {
$errors[$elementname] = get_string('errormaxlength', 'customfield_text', $maxlength);
}
return $errors;
}
/**
* Returns the default value as it would be stored in the database (not in human-readable format).
*
* @return mixed
*/
public function get_default_value() {
return $this->get_field()->get_configdata_property('defaultvalue');
}
/**
* Returns value in a human-readable format
*
* @return mixed|null value or null if empty
*/
public function export_value() {
$value = parent::export_value();
if ($value === null) {
return null;
}
$link = $this->get_field()->get_configdata_property('link');
if ($link) {
$linktarget = $this->get_field()->get_configdata_property('linktarget');
$url = str_replace('$$', urlencode($this->get_value()), $link);
$attributes = $linktarget ? ['target' => $linktarget] : [];
$value = \html_writer::link($url, $value, $attributes);
}
return $value;
}
}
@@ -0,0 +1,152 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Customfields text plugin
*
* @package customfield_text
* @copyright 2018 David Matamoros <davidmc@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace customfield_text;
defined('MOODLE_INTERNAL') || die;
/**
* Class field
*
* @copyright 2018 David Matamoros <davidmc@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package customfield_text
*/
class field_controller extends \core_customfield\field_controller {
/**
* Plugin type text
*/
const TYPE = 'text';
/**
* Add fields for editing a text field.
*
* @param \MoodleQuickForm $mform
*/
public function config_form_definition(\MoodleQuickForm $mform) {
$mform->addElement('header', 'header_specificsettings', get_string('specificsettings', 'customfield_text'));
$mform->setExpanded('header_specificsettings', true);
$mform->addElement('text', 'configdata[defaultvalue]', get_string('defaultvalue', 'core_customfield'),
['size' => 50]);
$mform->setType('configdata[defaultvalue]', PARAM_TEXT);
$mform->addElement('text', 'configdata[displaysize]', get_string('displaysize', 'customfield_text'), ['size' => 6]);
$mform->setType('configdata[displaysize]', PARAM_INT);
if (!$this->get_configdata_property('displaysize')) {
$mform->setDefault('configdata[displaysize]', 50);
}
$mform->addRule('configdata[displaysize]', null, 'numeric', null, 'client');
$mform->addElement('text', 'configdata[maxlength]', get_string('maxlength', 'customfield_text'), ['size' => 6]);
$mform->setType('configdata[maxlength]', PARAM_INT);
if (!$this->get_configdata_property('maxlength')) {
$mform->setDefault('configdata[maxlength]', 1333);
}
$mform->addRule('configdata[maxlength]', null, 'numeric', null, 'client');
$mform->addElement('selectyesno', 'configdata[ispassword]', get_string('ispassword', 'customfield_text'));
$mform->setType('configdata[ispassword]', PARAM_INT);
$mform->addElement('text', 'configdata[link]', get_string('islink', 'customfield_text'), ['size' => 50]);
$mform->setType('configdata[link]', PARAM_RAW_TRIMMED);
$mform->addHelpButton('configdata[link]', 'islink', 'customfield_text');
$mform->disabledIf('configdata[link]', 'configdata[ispassword]', 'eq', 1);
$linkstargetoptions = array(
'' => get_string('none', 'customfield_text'),
'_blank' => get_string('newwindow', 'customfield_text'),
'_self' => get_string('sameframe', 'customfield_text'),
'_top' => get_string('samewindow', 'customfield_text')
);
$mform->addElement('select', 'configdata[linktarget]', get_string('linktarget', 'customfield_text'),
$linkstargetoptions);
$mform->disabledIf('configdata[linktarget]', 'configdata[link]', 'eq', '');
}
/**
* Validate the data on the field configuration form
*
* @param array $data from the add/edit profile field form
* @param array $files
* @return array associative array of error messages
*/
public function config_form_validation(array $data, $files = array()): array {
global $CFG;
$errors = parent::config_form_validation($data, $files);
$maxlength = (int)$data['configdata']['maxlength'];
if ($maxlength < 1 || $maxlength > 1333) {
$errors['configdata[maxlength]'] = get_string('errorconfigmaxlen', 'customfield_text');
}
$displaysize = (int)$data['configdata']['displaysize'];
if ($displaysize < 1 || $displaysize > 200) {
$errors['configdata[displaysize]'] = get_string('errorconfigdisplaysize', 'customfield_text');
}
if (isset($data['configdata']['link'])) {
$link = $data['configdata']['link'];
if (strlen($link)) {
require_once($CFG->dirroot . '/lib/validateurlsyntax.php');
if (strpos($link, '$$') === false) {
$errors['configdata[link]'] = get_string('errorconfiglinkplaceholder', 'customfield_text');
} else if (!validateUrlSyntax(str_replace('$$', 'XYZ', $link), 's+H?S?F-E-u-P-a?I?p?f?q?r?')) {
// This validation is more strict than PARAM_URL - it requires the protocol and it must be either http or https.
$errors['configdata[link]'] = get_string('errorconfiglinksyntax', 'customfield_text');
}
}
}
return $errors;
}
/**
* Does this custom field type support being used as part of the block_myoverview
* custom field grouping?
* @return bool
*/
public function supports_course_grouping(): bool {
return true;
}
/**
* If this field supports course grouping, then this function needs overriding to
* return the formatted values for this.
* @param array $values the used values that need formatting
* @return array
*/
public function course_grouping_format_values($values): array {
$ret = [];
foreach ($values as $value) {
$ret[$value] = format_string($value);
}
$ret[BLOCK_MYOVERVIEW_CUSTOMFIELD_EMPTY] = get_string('nocustomvalue', 'block_myoverview',
$this->get_formatted_name());
return $ret;
}
}
@@ -0,0 +1,84 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Privacy Subsystem implementation for customfield_text.
*
* @package customfield_text
* @copyright 2018 Daniel Neis Araujo <danielneis@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace customfield_text\privacy;
use core_customfield\data_controller;
use core_customfield\privacy\customfield_provider;
use core_privacy\local\request\writer;
defined('MOODLE_INTERNAL') || die();
/**
* Privacy Subsystem for customfield_text implementing null_provider.
*
* @copyright 2018 Daniel Neis Araujo <danielneis@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements \core_privacy\local\metadata\null_provider, customfield_provider {
/**
* Get the language string identifier with the component's language
* file to explain why this plugin stores no data.
*
* @return string
*/
public static function get_reason(): string {
return 'privacy:metadata';
}
/**
* Preprocesses data object that is going to be exported
*
* @param data_controller $data
* @param \stdClass $exportdata
* @param array $subcontext
*/
public static function export_customfield_data(data_controller $data, \stdClass $exportdata, array $subcontext) {
$context = $data->get_context();
// For text fields we want to apply format_string even to raw value to avoid CSS.
$exportdata->{$data->datafield()} = $data->export_value();
writer::with_context($context)
->export_data($subcontext, $exportdata);
}
/**
* Allows plugins to delete everything they store related to the data (usually files)
*
* @param string $dataidstest
* @param array $params
* @param array $contextids
* @return mixed|void
*/
public static function before_delete_data(string $dataidstest, array $params, array $contextids) {
}
/**
* Allows plugins to delete everything they store related to the field configuration (usually files)
*
* @param string $fieldidstest
* @param array $params
* @param array $contextids
*/
public static function before_delete_fields(string $fieldidstest, array $params, array $contextids) {
}
}
@@ -0,0 +1,44 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Customfield text plugin
*
* @package customfield_text
* @copyright 2018 Toni Barbera <toni@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['displaysize'] = 'Form input size';
$string['errorconfigdisplaysize'] = 'The form input size must be between 1 and 200 characters.';
$string['errorconfiglinkplaceholder'] = 'The link must contain a placeholder $$.';
$string['errorconfiglinksyntax'] = 'The link must be a valid URL starting with either http:// or https://.';
$string['errorconfigmaxlen'] = 'The maximum number of characters allowed must be between 1 and 1333.';
$string['errormaxlength'] = 'The maximum number of characters allowed in this field is {$a}.';
$string['islink'] = 'Link field';
$string['islink_help'] = 'To transform the text into a link, enter a URL containing $$ as a placeholder, where $$ will be replaced with the text. For example, to transform a Twitter ID to a link, enter https://twitter.com/$$.';
$string['ispassword'] = 'Password field';
$string['linktarget'] = 'Link target';
$string['maxlength'] = 'Maximum number of characters';
$string['newwindow'] = 'New window';
$string['none'] = 'None';
$string['pluginname'] = 'Short text';
$string['privacy:metadata'] = 'The Short text field type plugin doesn\'t store any personal data; it uses tables defined in core.';
$string['sameframe'] = 'Same frame';
$string['samewindow'] = 'Same window';
$string['specificsettings'] = 'Short text field settings';
@@ -0,0 +1,140 @@
@customfield @customfield_text @javascript
Feature: Managers can manage course custom fields text
In order to have additional data on the course
As a manager
I need to create, edit, remove and sort custom fields
Background:
Given the following "custom field categories" exist:
| name | component | area | itemid |
| Category for test | core_course | course | 0 |
And I log in as "admin"
And I navigate to "Courses > Default settings > Course custom fields" in site administration
Scenario: Create a custom course text field
When I click on "Add a new custom field" "link"
And I click on "Short text" "link"
And I set the following fields to these values:
| Name | Test field |
| Short name | testfield |
And I click on "Save changes" "button" in the "Adding a new Short text" "dialogue"
Then I should see "Test field"
And I log out
Scenario: Edit a custom course text field
When I click on "Add a new custom field" "link"
And I click on "Short text" "link"
And I set the following fields to these values:
| Name | Test field |
| Short name | testfield |
And I click on "Save changes" "button" in the "Adding a new Short text" "dialogue"
And I click on "Edit" "link" in the "Test field" "table_row"
And I set the following fields to these values:
| Name | Edited field |
And I click on "Save changes" "button" in the "Updating Test field" "dialogue"
Then I should see "Edited field"
And I navigate to "Reports > Logs" in site administration
And I press "Get these logs"
And I log out
Scenario: Delete a custom course text field
When I click on "Add a new custom field" "link"
And I click on "Short text" "link"
And I set the following fields to these values:
| Name | Test field |
| Short name | testfield |
And I click on "Save changes" "button" in the "Adding a new Short text" "dialogue"
And I click on "Delete" "link" in the "Test field" "table_row"
And I click on "Yes" "button" in the "Confirm" "dialogue"
And I wait until the page is ready
And I wait until "Test field" "text" does not exist
Then I should not see "Test field"
And I log out
Scenario: A text field with a link setting must show link on course listing
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | Example 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I navigate to "Courses > Default settings > Course custom fields" in site administration
And I click on "Add a new custom field" "link"
And I click on "Short text" "link"
And I set the following fields to these values:
| Name | See more on website |
| Short name | testfield |
| Visible to | Everyone |
| Link | https://www.moodle.org/$$ |
And I click on "Save changes" "button" in the "Adding a new Short text" "dialogue"
And I log out
Then I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| See more on website | course/view.php?id=35 |
And I press "Save and display"
And I am on site homepage
Then I should see "course/view.php?id=35" in the ".customfields-container .customfieldvalue a" "css_element"
Then I should see "See more on website" in the ".customfields-container .customfieldname" "css_element"
Scenario: A text field with a max length must validate it on course edit form
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | Example 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I navigate to "Courses > Default settings > Course custom fields" in site administration
And I click on "Add a new custom field" "link"
And I click on "Short text" "link"
And I set the following fields to these values:
| Name | Test field |
| Short name | testfield |
| Maximum number of characters | 3 |
And I click on "Save changes" "button" in the "Adding a new Short text" "dialogue"
And I log out
Then I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Test field | 1234 |
And I press "Save and display"
Then I should see "The maximum number of characters allowed in this field is 3."
Scenario: A text field with a default value must be shown on listing but allow empty values that will not be shown
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | Example 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I navigate to "Courses > Default settings > Course custom fields" in site administration
And I click on "Add a new custom field" "link"
And I click on "Short text" "link"
And I set the following fields to these values:
| Name | Test field |
| Short name | testfield |
| Default value | testdefault |
And I click on "Save changes" "button" in the "Adding a new Short text" "dialogue"
And I log out
Then I log in as "teacher1"
When I am on site homepage
Then I should see "Test field: testdefault"
When I am on "Course 1" course homepage
And I navigate to "Settings" in current page administration
Then the "value" attribute of "#id_customfield_testfield" "css_element" should contain "testdefault"
When I set the following fields to these values:
| Test field | |
And I press "Save and display"
And I am on site homepage
And I should not see "Test field"
@@ -0,0 +1,169 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace customfield_text;
use core_customfield_generator;
use core_customfield_test_instance_form;
/**
* Functional test for customfield_text
*
* @package customfield_text
* @copyright 2019 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class plugin_test extends \advanced_testcase {
/** @var stdClass[] */
private $courses = [];
/** @var \core_customfield\category_controller */
private $cfcat;
/** @var \core_customfield\field_controller[] */
private $cfields;
/** @var \core_customfield\data_controller[] */
private $cfdata;
/**
* Tests set up.
*/
public function setUp(): void {
$this->resetAfterTest();
$this->cfcat = $this->get_generator()->create_category();
$this->cfields[1] = $this->get_generator()->create_field(
['categoryid' => $this->cfcat->get('id'), 'shortname' => 'myfield1', 'type' => 'text',
'configdata' => ['maxlength' => 30, 'displaysize' => 50], 'description' => null]);
$this->cfields[2] = $this->get_generator()->create_field(
['categoryid' => $this->cfcat->get('id'), 'shortname' => 'myfield2', 'type' => 'text',
'configdata' => ['required' => 1, 'maxlength' => 30, 'displaysize' => 50]]);
$this->cfields[3] = $this->get_generator()->create_field(
['categoryid' => $this->cfcat->get('id'), 'shortname' => 'myfield3', 'type' => 'text',
'configdata' => ['defaultvalue' => 'Defvalue', 'maxlength' => 30, 'displaysize' => 50]]);
$this->cfields[4] = $this->get_generator()->create_field(
['categoryid' => $this->cfcat->get('id'), 'shortname' => 'myfield4', 'type' => 'text',
'configdata' => ['link' => 'https://twitter.com/$$', 'maxlength' => 30, 'displaysize' => 50]]);
$this->courses[1] = $this->getDataGenerator()->create_course();
$this->courses[2] = $this->getDataGenerator()->create_course();
$this->courses[3] = $this->getDataGenerator()->create_course();
$this->cfdata[1] = $this->get_generator()->add_instance_data($this->cfields[1], $this->courses[1]->id,
'Value1');
$this->cfdata[2] = $this->get_generator()->add_instance_data($this->cfields[1], $this->courses[2]->id,
'Value2');
$this->setUser($this->getDataGenerator()->create_user());
}
/**
* Get generator
* @return core_customfield_generator
*/
protected function get_generator(): core_customfield_generator {
return $this->getDataGenerator()->get_plugin_generator('core_customfield');
}
/**
* Test for initialising field and data controllers
*/
public function test_initialise(): void {
$f = \core_customfield\field_controller::create($this->cfields[1]->get('id'));
$this->assertTrue($f instanceof field_controller);
$f = \core_customfield\field_controller::create(0, (object)['type' => 'text'], $this->cfcat);
$this->assertTrue($f instanceof field_controller);
$d = \core_customfield\data_controller::create($this->cfdata[1]->get('id'));
$this->assertTrue($d instanceof data_controller);
$d = \core_customfield\data_controller::create(0, null, $this->cfields[1]);
$this->assertTrue($d instanceof data_controller);
}
/**
* Test for configuration form functions
*
* Create a configuration form and submit it with the same values as in the field
*/
public function test_config_form(): void {
$this->setAdminUser();
$submitdata = (array)$this->cfields[1]->to_record();
$submitdata['configdata'] = $this->cfields[1]->get('configdata');
$submitdata = \core_customfield\field_config_form::mock_ajax_submit($submitdata);
$form = new \core_customfield\field_config_form(null, null, 'post', '', null, true,
$submitdata, true);
$form->set_data_for_dynamic_submission();
$this->assertTrue($form->is_validated());
$form->process_dynamic_submission();
}
/**
* Test for instance form functions
*/
public function test_instance_form(): void {
global $CFG;
require_once($CFG->dirroot . '/customfield/tests/fixtures/test_instance_form.php');
$this->setAdminUser();
$handler = $this->cfcat->get_handler();
// First try to submit without required field.
$submitdata = (array)$this->courses[1];
core_customfield_test_instance_form::mock_submit($submitdata, []);
$form = new core_customfield_test_instance_form('POST',
['handler' => $handler, 'instance' => $this->courses[1]]);
$this->assertFalse($form->is_validated());
// Now with required field.
$submitdata['customfield_myfield2'] = 'Some text';
core_customfield_test_instance_form::mock_submit($submitdata, []);
$form = new core_customfield_test_instance_form('POST',
['handler' => $handler, 'instance' => $this->courses[1]]);
$this->assertTrue($form->is_validated());
$data = $form->get_data();
$this->assertNotEmpty($data->customfield_myfield1);
$this->assertNotEmpty($data->customfield_myfield2);
$handler->instance_form_save($data);
}
/**
* Test for data_controller::get_value and export_value
*/
public function test_get_export_value(): void {
$this->assertEquals('Value1', $this->cfdata[1]->get_value());
$this->assertEquals('Value1', $this->cfdata[1]->export_value());
// Field without data but with a default value.
$d = \core_customfield\data_controller::create(0, null, $this->cfields[3]);
$this->assertEquals('Defvalue', $d->get_value());
$this->assertEquals('Defvalue', $d->export_value());
// Field with a link.
$d = $this->get_generator()->add_instance_data($this->cfields[4], $this->courses[1]->id, 'mynickname');
$this->assertEquals('mynickname', $d->get_value());
$this->assertEquals('<a href="https://twitter.com/mynickname">mynickname</a>', $d->export_value());
}
/**
* Deleting fields and data
*/
public function test_delete(): void {
$this->cfcat->get_handler()->delete_all();
}
}
+29
View File
@@ -0,0 +1,29 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Customfield text plugin
*
* @package customfield_text
* @copyright 2018 Toni Barbera <toni@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'customfield_text';
$plugin->version = 2024042200;
$plugin->requires = 2024041600;