Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/cake-2.0' into cake-2.1-ssmods
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Feb 13, 2012
2 parents 13eeec2 + e0df657 commit 31948f4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions View/Helper/MediaHelper.php
Expand Up @@ -229,8 +229,7 @@ function embed($paths, $options = array()) {
case 'image':
$attributes = $this->_addDimensions($sources[0]['file'], $attributes);

return sprintf(
$this->Html->tags['image'],
return $this->Html->useTag('image',
$sources[0]['url'],
$this->_parseAttributes($attributes)
);
Expand Down Expand Up @@ -559,10 +558,10 @@ protected function _addDimensions($file, $attributes) {
*/
function _parseAttributes($options) {
$attributes = array();
$minimizedAttributes = array('autoplay', 'controls', 'autobuffer', 'loop');
$this->_minimizedAttributes = array('autoplay', 'controls', 'autobuffer', 'loop');

foreach ($options as $key => $value) {
if (in_array($key, $minimizedAttributes)) {
if (in_array($key, $this->_minimizedAttributes)) {
if ($value === 1 || $value === true || $value === 'true' || $value == $key) {
$attributes[] = sprintf('%s="%s"', $key, $key);
unset($options[$key]);
Expand Down

0 comments on commit 31948f4

Please sign in to comment.