Commit a58fedf0 authored by Aaron Wells's avatar Aaron Wells Committed by Gerrit Code Review
Browse files

Merge "Bug 1512897: Allowing introtext blocktype to record embedded image data"

parents 4933fce2 26deb57d
......@@ -183,13 +183,13 @@ function check_is_embedded_image_visible($fileid, $includeresourcetypes = null,
$isvisible = false;
// Check for resource types a file may be embeded in.
$resourcetypes = array(
'comment', 'annotation', 'annotationfeedback', 'blog', 'textbox', 'editnote', 'text',
'comment', 'annotation', 'annotationfeedback', 'blog', 'textbox', 'editnote', 'text', 'introtext'
);
if (!empty($includeresourcetypes)) {
if (!is_array($includeresourcetypes)) {
$includeresourcetypes = array($includeresourcetypes);
}
$resourcetypes = array_merge($defaultresourcetypes, $includeresourcetypes);
$resourcetypes = array_merge($resourcetypes, $includeresourcetypes);
}
if (!empty($excluderesourcetypes)) {
if (!is_array($excluderesourcetypes)) {
......
......@@ -206,6 +206,23 @@ class PluginBlocktypeProfileinfo extends PluginBlocktype {
return $form;
}
public static function instance_config_save($values, $instance) {
require_once('embeddedimage.php');
if (!empty($values['introtext'])) {
$newtext = EmbeddedImage::prepare_embedded_images($values['introtext'], 'introtext', $instance->get('id'));
$values['introtext'] = $newtext;
}
else {
EmbeddedImage::delete_embedded_images('introtext', $instance->get('id'));
}
return $values;
}
public static function delete_instance($instance) {
require_once('embeddedimage.php');
EmbeddedImage::delete_embedded_images('introtext', $instance->get('id'));
}
public static function artefactchooser_element($default=null) {
safe_require('artefact', 'internal');
$artefacttypes = array_diff(PluginArtefactInternal::get_profile_artefact_types(), array('email'));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment