commit 0236de8e9606d6f269ecec46aba47a8db2878a67 Author: Klaus-Uwe Mitterer Date: Tue Jul 6 16:08:32 2021 +0200 Current version diff --git a/db/access.php b/db/access.php new file mode 100644 index 0000000..f3c6f96 --- /dev/null +++ b/db/access.php @@ -0,0 +1,30 @@ + array( + 'riskbitmask' => RISK_XSS, + 'captype' => 'write', + 'contextlevel' => CONTEXT_COURSE, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ), + 'clonepermissionsfrom' => 'moodle/course:manageactivities' + ), + + 'mod/expcontent:view' => array( + 'captype' => 'read', + 'contextlevel' => CONTEXT_MODULE, + 'archetypes' => array( + 'guest' => CAP_ALLOW, + 'student' => CAP_ALLOW, + 'teacher' => CAP_ALLOW, + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) +) + +); \ No newline at end of file diff --git a/db/install.xml b/db/install.xml new file mode 100644 index 0000000..8d7cf51 --- /dev/null +++ b/db/install.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/index.php b/index.php new file mode 100644 index 0000000..a7a616f --- /dev/null +++ b/index.php @@ -0,0 +1,9 @@ +get_record('course', array('id'=> $id))) { + print_error('Course ID is incorrect'); +} \ No newline at end of file diff --git a/lang/en/expcontent.php b/lang/en/expcontent.php new file mode 100644 index 0000000..7e6c02c --- /dev/null +++ b/lang/en/expcontent.php @@ -0,0 +1,13 @@ +timemodified = time(); + $expcontent->introformat = FORMAT_MOODLE; + + $expcontent->id = $DB->insert_record('expcontent', $expcontent); + + return $expcontent->id; +} + +function expcontent_update_instance($expcontent) { + global $DB; + + $expcontent->timemodified = time(); + $expcontent->id = $expcontent->instance; + + if (! $DB->update_record('expcontent', $expcontent)) { + return false; + } + + return true; +} + +function expcontent_delete_instance($id) { + global $DB; + + if (! $expcontent = $DB->get_record('expcontent', array('id' => $id))) { + return false; + } + + $DB->delete_records('expcontent', array('id' => $id)); + + return true; +} \ No newline at end of file diff --git a/mod_form.php b/mod_form.php new file mode 100644 index 0000000..d2b0574 --- /dev/null +++ b/mod_form.php @@ -0,0 +1,28 @@ +dirroot.'/course/moodleform_mod.php'); +require_once($CFG->dirroot.'/mod/expcontent/lib.php'); + +class mod_expcontent_mod_form extends moodleform_mod { + + function definition() { + global $CFG, $DB, $OUTPUT; + + $mform =& $this->_form; + + $mform->addElement('text', 'name', get_string('name', 'expcontent'), array('size'=>'64')); + $mform->setType('name', PARAM_TEXT); + $mform->addRule('name', null, 'required', null, 'client'); + + $mform->addElement('text', 'contentid', get_string('contentid', 'expcontent'), array('size'=>'64')); + $mform->setType('contentid', PARAM_TEXT); + $mform->addRule('contentid', null, 'required', null, 'client'); + + $this->standard_coursemodule_elements(); + + $this->add_action_buttons(); + + } +} \ No newline at end of file diff --git a/pix/icon.gif b/pix/icon.gif new file mode 100644 index 0000000..9bb3832 Binary files /dev/null and b/pix/icon.gif differ diff --git a/settings.php b/settings.php new file mode 100644 index 0000000..2a8d552 --- /dev/null +++ b/settings.php @@ -0,0 +1,34 @@ +. + +/** + * Administration settings definitions for the Diary module. + * + * @package mod_diary + * @copyright 2019 AL Rachels (drachels@drachels.com) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later. + */ +defined('MOODLE_INTERNAL') || die(); + +if ($ADMIN->fulltree) { + + $settings->add(new admin_setting_heading('mod_expcontent/settings', get_string('settings'), '')); + + $settings->add(new admin_setting_configtext('mod_expcontent/baseurl', + get_string('baseurl', 'expcontent'), + get_string('baseurl_help', 'expcontent'), 'http://expcontent.ahsoka.kumi.systems:7000/', PARAM_TEXT, 15)); + +} \ No newline at end of file diff --git a/version.php b/version.php new file mode 100644 index 0000000..20b4e92 --- /dev/null +++ b/version.php @@ -0,0 +1,9 @@ +version = "2021070600"; +$plugin->component = 'mod_expcontent'; +$plugin->maturity = MATURITY_ALPHA; +$plugin->release = 'v0.0.1'; +$plugin->requires = '2019111800'; \ No newline at end of file diff --git a/view.php b/view.php new file mode 100644 index 0000000..2bb1e19 --- /dev/null +++ b/view.php @@ -0,0 +1,83 @@ +get_record('expcontent', array('id'=> $cm->instance), '*', MUST_EXIST); + +$expconfig = get_config('mod_expcontent'); +$baseurl = $expconfig->baseurl; + +if ($baseurl[-1] != "/") $baseurl += "/"; + +?> + + + + +<?php echo($expcontent->name); ?> + + + + + +