com web/pres2: Better position control on the image tag: display.php

From: Date: Sat, 24 Mar 2012 00:24:14 +0000
Subject: com web/pres2: Better position control on the image tag: display.php
Groups: php.pres 
Request: Send a blank email to pres+get-1786@lists.php.net to get a copy of this message
Commit: cf120a2273cf1854580d7b86e338063cd78a1d67 Author: Rasmus Lerdorf <rasmus@php.net> Sat, 24 Mar 2012 05:54:14 +0530 Parents: c90178685c44aef3218b05ce94c44f7fe6ccc681 Branches: master Link: http://git.php.net/?p=web/pres2.git;a=commitdiff;h=cf120a2273cf1854580d7b86e338063cd78a1d67 Log: Better position control on the image tag Changed paths: M display.php Diff: cf120a2273cf1854580d7b86e338063cd78a1d67 diff --git a/display.php b/display.php index 5ca30fd..c5e24da 100644 --- a/display.php +++ b/display.php @@ -387,9 +387,25 @@ ENDD; if (isset($image->class)) { $class=" class='{$image->class}'"; } + $style = ''; + if (isset($image->margintop)) { + $style.="margin-top: {$image->margintop};"; + } + if (isset($image->marginbottom)) { + $style.="margin-bottom: {$image->marginbottom};"; + } + if (isset($image->marginleft)) { + $style.="margin-left: {$image->marginleft};"; + } + if (isset($image->marginright)) { + $style.="margin-right: {$image->marginright};"; + } + if(!empty($style)) { + $style="style=\"$style\""; + } ?> <div <?php echo $effect?> align="<?php echo $image->align?>" style="margin-left: <?php echo $image->marginleft?>; margin-right: <?php echo $image->marginright?>;"> -<img align="<?php echo $image->align?>" src="<?php echo $this->slideDir.$image->filename?>" <?php echo $size?><?php echo $class?><?php echo $alt?>/> +<img align="<?php echo $image->align?>" src="<?php echo $this->slideDir.$image->filename?>" <?php echo $size?> <?php echo $class?> <?php echo $style?> <?php echo $alt?>/> </div> <?php if(isset($image->clear)) echo "<br clear=\"".$image->clear."\"/>\n";

« previous php.pres (#1786) next »