+ `
{{PLACEHOLDER}}
`,
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tempor odio vel turpis consequat sodales.",
variants: ["full-width"],
@@ -116,8 +116,8 @@ const components = [
imageClass: "c4l-example-icon",
code:
`
Lorem ipsum dolor sit amet
-
{{PLACEHOLDER}}
`,
+ aria-label="{{#example}}">
Lorem ipsum dolor sit amet
+
{{PLACEHOLDER}}
Any CSS code added here must be also included either to your theme or inside the style tags <style>...<style>
and saved into the additionalhtmlhead setting at {$a};
+ otherwise your styles will not be applied to your components when rendered.
';
$string['do-card'] = 'Do card';
$string['dodontcards'] = 'Do/don\'t cards';
$string['dont-card'] = 'Don\'t card';
@@ -50,6 +84,7 @@
$string['expectedfeedback'] = 'Expected feedback';
$string['figure'] = 'Figure';
$string['full-width'] = 'Full width';
+$string['generalsettings'] = 'General';
$string['gradingvalue'] = 'Grading value';
$string['helper'] = 'Helper';
$string['helplinktext'] = 'C4L helper';
@@ -71,4 +106,5 @@
$string['readingcontext'] = 'Reading context';
$string['reminder'] = 'Reminder';
$string['tag'] = 'Tag';
+$string['textplaceholder'] = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
$string['tip'] = 'Tip';
diff --git a/lib.php b/lib.php
index e85696d..5e4bfcf 100644
--- a/lib.php
+++ b/lib.php
@@ -32,11 +32,54 @@
function tiny_c4l_user_preferences() {
$preferences = [];
- $preferences['c4l_components_variants'] = array(
+ $preferences['c4l_components_variants'] = [
'type' => PARAM_RAW,
'null' => NULL_NOT_ALLOWED,
- 'default' => ''
- );
+ 'default' => '',
+ ];
return $preferences;
}
+
+/**
+ * Serves the tiny_c4l files.
+ *
+ * @param stdClass $course course object
+ * @param stdClass $cm course module object
+ * @param stdClass $context context object
+ * @param string $filearea file area
+ * @param array $args extra arguments
+ * @param bool $forcedownload whether or not force download
+ * @param array $options additional options affecting the file serving
+ * @return bool false if file not found, does not return if found - just send the file
+ */
+function tiny_c4l_pluginfile($course,
+ $cm,
+ $context,
+ $filearea,
+ $args,
+ $forcedownload,
+ array $options = []) {
+
+ $compicon = strpos($filearea, 'compicon') !== false;
+ $compimage = strpos($filearea, 'customimagesbank') !== false;
+
+ if ($context->contextlevel == CONTEXT_SYSTEM && ($compicon || $compimage)) {
+ // Get file.
+ $fs = get_file_storage();
+ $relativepath = implode('/', $args);
+ $fullpath = "/$context->id/tiny_c4l/$filearea/$relativepath";
+ $file = $fs->get_file_by_hash(sha1($fullpath));
+
+ if (!$file || $file->is_directory()) {
+ return false;
+ }
+
+ if (PHPUNIT_TEST) {
+ return $file;
+ }
+ send_stored_file($file, null, 0, false, $options);
+ } else {
+ send_file_not_found();
+ }
+}
diff --git a/pix/c4l_customcomponent_icon.svg b/pix/c4l_customcomponent_icon.svg
new file mode 100644
index 0000000..8df1452
--- /dev/null
+++ b/pix/c4l_customcomponent_icon.svg
@@ -0,0 +1,5 @@
+