$content->params->height = $content->image->height; } $url = $content->image->url; if (!preg_match('~^(https?://|/)~', $url)) { $url = '/' . $url; } if (!isset($content->alt)) { $content->alt = $content->image->caption; } $style = []; if (!empty($content->params->width)) { $measure = marshalMeasure($content->params->width); $style[] = "width: {$measure};"; } if (!empty($content->params->height)) { $measure = marshalMeasure($content->params->height); $style[] = "height: {$measure};"; } $inlineCSS = implode(' ', $style); if (!empty($inlineCSS)) { $inlineCSS = " style=\"{$inlineCSS}\""; } ?> <img class="<?php echo $content->params->class; ?> " src="<?php echo $url; ?> " alt="<?php echo $content->alt;
*/ require_once dirname(__DIR__) . '/functions.php'; $url = $content->image->url; if (!preg_match('~^(https?://|/)~', $url)) { $url = '/' . $url; } if (empty($content->alt)) { $content->alt = $content->image->caption; } $style = []; if (!empty($content->getParameters()->width)) { $measure = marshalMeasure($content->getParameters()->width); $style[] = "width: {$measure};"; } if (!empty($content->getParameters()->height)) { $measure = marshalMeasure($content->getParameters()->height); $style[] = "height: {$measure};"; } if (!empty($inlineCSS)) { $this->addCss($content->getId(), 'img {' . implode(' ', $style) . '}'); } ?> <!-- <?php echo __FILE__; ?> --> <figure id="<?php echo $content->getId(); ?> "> <img class="img-responsive <?php