Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php
Show First 20 Lines • Show All 155 Lines • ▼ Show 20 Lines | if ($use_size) { | ||||
list($x, $y) = $dimensions; | list($x, $y) = $dimensions; | ||||
$attrs['width'] = $x; | $attrs['width'] = $x; | ||||
$attrs['height'] = $y; | $attrs['height'] = $y; | ||||
} | } | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
$alt = null; | |||||
if (isset($options['alt'])) { | if (isset($options['alt'])) { | ||||
$attrs['alt'] = $options['alt']; | $alt = $options['alt']; | ||||
} | } | ||||
if (!strlen($alt)) { | |||||
$alt = $file->getAltText(); | |||||
} | |||||
$attrs['alt'] = $alt; | |||||
$img = phutil_tag('img', $attrs); | $img = phutil_tag('img', $attrs); | ||||
$embed = javelin_tag( | $embed = javelin_tag( | ||||
'a', | 'a', | ||||
array( | array( | ||||
'href' => $file->getBestURI(), | 'href' => $file->getBestURI(), | ||||
'class' => $image_class, | 'class' => $image_class, | ||||
'sigil' => 'lightboxable', | 'sigil' => 'lightboxable', | ||||
'meta' => array( | 'meta' => array( | ||||
'phid' => $file->getPHID(), | 'phid' => $file->getPHID(), | ||||
'uri' => $file->getBestURI(), | 'uri' => $file->getBestURI(), | ||||
'dUri' => $file->getDownloadURI(), | 'dUri' => $file->getDownloadURI(), | ||||
'alt' => $alt, | |||||
'viewable' => true, | 'viewable' => true, | ||||
'monogram' => $file->getMonogram(), | 'monogram' => $file->getMonogram(), | ||||
), | ), | ||||
), | ), | ||||
$img); | $img); | ||||
switch ($options['layout']) { | switch ($options['layout']) { | ||||
case 'right': | case 'right': | ||||
▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines |