foreach ($variablesArray as $variable) {
list ($name, $value) = explode('=', $variable);
$ItemAddEmbedVideo[$type][$name] = $value;
+ /* print "type: $type name: $name value: $value <br>"; */
}
}
}
/* Store any Parameters into some simpler, shorter, local variables */
- $debugOutput = $ItemAddEmbedVideo['default']['debugOutput'];
- $useInternalFlvPlayer = $ItemAddEmbedVideo['default']['useInternalFlvPlayer'];
- $youtubeDevId = $ItemAddEmbedVideo['default']['youtubeDevId'];
- $width=$ItemAddEmbedVideo['default']['width'];
- $height=$ItemAddEmbedVideo['default']['height'];
- $externalFlvPlayer = $ItemAddEmbedVideo['default']['externalFlvPlayer'];
- $externalFlvPlayerVars = $ItemAddEmbedVideo['default']['externalFlvPlayerVars'];
- $flvThumbnail = $ItemAddEmbedVideo['default']['flvThumbnail'];
+ global $debugOutput, $useInternalFlvPlayer, $youtubeDevId;
+ global $width, $height, $externalFlvPlayer, $externalFlvPlayerVars;
+ global $flvThumbnail;
+
+ $debugOutput = $this->getParameter($ItemAddEmbedVideo, 'debugOutput');
+ $useInternalFlvPlayer = $this->getParameter($ItemAddEmbedVideo, 'useInternalFlvPlayer');
+ $youtubeDevId = $this->getParameter($ItemAddEmbedVideo, 'youtubeDevId');
+ $width = $this->getParameter($ItemAddEmbedVideo, 'width');
+ $height = $this->getParameter($ItemAddEmbedVideo, 'height');
+ $externalFlvPlayer = $this->getParameter($ItemAddEmbedVideo, 'externalFlvPlayer');
+ $externalFlvPlayerVars = $this->getParameter($ItemAddEmbedVideo, 'externalFlvPlayerVars');
+ $flvThumbnail = $this->getParameter($ItemAddEmbedVideo, 'flvThumbnail');
/* Store other string constants we'll use later */
- $youtubeUrlPattern="www.youtube.com";
+ $youtubeUrlPattern="youtube.com";
$youtubeApiUrl="http://www.youtube.com/api2_rest";
$googleUrlPattern="video.google.com";
$googlePlayer="http://video.google.com/googleplayer.swf";
return array(null, $error, $status);
}
+ /**
+ * A simple function to resolve the value of a parameter from
+ * the default or override value if it exists.
+ */
+ function getParameter($params, $name) {
+ if(isset($params['override'][$name])) {
+ return($params['override'][$name]);
+ } else {
+ return($params['default'][$name]);
+ }
+ }
+
/**
* @see ItemAdd:loadTemplate
*/