├── db ├── install.xml └── install.php ├── lang └── en │ └── tool_newreservedwords.php ├── version.php └── index.php /db/install.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |
18 | -------------------------------------------------------------------------------- /lang/en/tool_newreservedwords.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * English language pack for New reserved words 19 | * 20 | * @package tool_newreservedwords 21 | * @category string 22 | * @copyright 2024 Marina Glancy 23 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 24 | */ 25 | 26 | defined('MOODLE_INTERNAL') || die(); 27 | 28 | $string['pluginname'] = 'New reserved words'; 29 | -------------------------------------------------------------------------------- /version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Version information for New reserved words 19 | * 20 | * @package tool_newreservedwords 21 | * @copyright 2024 Marina Glancy 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | 25 | defined('MOODLE_INTERNAL') || die(); 26 | 27 | $plugin->component = 'tool_newreservedwords'; 28 | $plugin->release = '1.0'; 29 | $plugin->version = 2024051400; 30 | $plugin->requires = 2022112800.00; 31 | $plugin->supported = [401, 405]; 32 | $plugin->maturity = MATURITY_STABLE; 33 | -------------------------------------------------------------------------------- /db/install.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Install script for New reserved words 19 | * 20 | * Documentation: {@link https://moodledev.io/docs/guides/upgrade} 21 | * 22 | * @package tool_newreservedwords 23 | * @copyright 2024 Marina Glancy 24 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 25 | */ 26 | 27 | /** 28 | * Executed on installation of New reserved words 29 | * 30 | * @return bool 31 | */ 32 | function xmldb_tool_newreservedwords_install() { 33 | global $DB; 34 | $dbman = $DB->get_manager(); 35 | 36 | $columncontenttype = $dbman->generator->getEncQuoted('content_type'); 37 | $DB->execute("INSERT INTO {tool_newreservedwords} ($columncontenttype) ". 38 | "VALUES (?)", [2, 3]); 39 | return true; 40 | } 41 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * TODO describe file index 19 | * 20 | * @package tool_newreservedwords 21 | * @copyright 2024 Marina Glancy 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | 25 | require('../../../config.php'); 26 | 27 | require_login(); 28 | 29 | $url = new moodle_url('/admin/tool/newreservedwords/index.php', []); 30 | $PAGE->set_url($url); 31 | $PAGE->set_context(context_system::instance()); 32 | 33 | $PAGE->set_heading($SITE->fullname); 34 | echo $OUTPUT->header(); 35 | print_object($DB->get_records('tool_newreservedwords')); 36 | $columncontenttype = $DB->get_manager()->generator->getEncQuoted('content_type'); 37 | print_object($DB->get_records_sql("SELECT id, $columncontenttype FROM {tool_newreservedwords} 38 | WHERE $columncontenttype IS NOT NULL")); 39 | echo $OUTPUT->footer(); 40 | --------------------------------------------------------------------------------