Commit e01e1ef9 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Avoid warning in logs caused by unset variable (bug #513331)


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 22a7fa71
......@@ -58,11 +58,11 @@ class PluginBlocktypeExternalvideo extends SystemBlocktype {
public static function render_instance(BlockInstance $instance, $editing=false) {
$configdata = $instance->get('configdata');
$result = '';
$url = hsc(self::make_video_url($configdata['videoid']));
$width = (!empty($configdata['width'])) ? hsc($configdata['width']) : self::$default_width;
$height = (!empty($configdata['height'])) ? hsc($configdata['height']) : self::$default_height;
if (isset($configdata['videoid'])) {
$url = hsc(self::make_video_url($configdata['videoid']));
$result .= '<div class="mediaplayer-container center"><div class="mediaplayer">';
$result .= '<object width="' . $width . '" height="' . $height . '">';
$result .= '<param name="movie" value="' . $url . '"></param>';
......@@ -89,7 +89,7 @@ class PluginBlocktypeExternalvideo extends SystemBlocktype {
'title' => get_string('videourl','blocktype.externalvideo'),
'description' => get_string('videourldescription2','blocktype.externalvideo') . self::get_html_of_supported_websites(),
'width' => '90%',
'defaultvalue' => $configdata['videoid'],
'defaultvalue' => isset($configdata['videoid']) ? $configdata['videoid'] : null,
'rules' => array(
'required' => true
),
......
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