本文整理汇总了PHP中thebuggenie\core\framework\Settings::isCommentImagePreviewEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::isCommentImagePreviewEnabled方法的具体用法?PHP Settings::isCommentImagePreviewEnabled怎么用?PHP Settings::isCommentImagePreviewEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thebuggenie\core\framework\Settings
的用法示例。
在下文中一共展示了Settings::isCommentImagePreviewEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _parse_internallink
//.........这里部分代码省略.........
$type = $type_matches[1][0];
}
}
}
if ($type == 'object') {
$code = object_tag($href, $width, $height);
} else {
$code = iframe_tag($href, $width, $height);
}
return $code;
}
if (in_array(mb_strtolower($namespace), array('image', 'file'))) {
$retval = $namespace . ':' . $href;
if (!framework\Context::isCLI()) {
$options = explode('|', $title);
$filename = $href;
$issuemode = (bool) (isset($this->options['issue']) && $this->options['issue'] instanceof \thebuggenie\core\entities\Issue);
$articlemode = (bool) (isset($this->options['article']) && $this->options['article'] instanceof Article);
$file = null;
$file_link = $filename;
$caption = $filename;
if ($issuemode) {
$file = $this->options['issue']->getFileByFilename($filename);
} elseif ($articlemode) {
$file = $this->options['article']->getFileByFilename($filename);
}
if ($file instanceof \thebuggenie\core\entities\File) {
$caption = !empty($options) ? array_pop($options) : htmlentities($file->getDescription(), ENT_COMPAT, framework\Context::getI18n()->getCharset());
$caption = $caption != '' ? $caption : htmlentities($file->getOriginalFilename(), ENT_COMPAT, framework\Context::getI18n()->getCharset());
$file_link = make_url('showfile', array('id' => $file->getID()));
} else {
$caption = !empty($options) ? array_pop($options) : false;
}
if (($file instanceof \thebuggenie\core\entities\File && $file->isImage() || $articlemode) && (mb_strtolower($namespace) == 'image' || $issuemode) && \thebuggenie\core\framework\Settings::isCommentImagePreviewEnabled()) {
$divclasses = array('image_container');
$style_dimensions = '';
foreach ($options as $option) {
$optionlen = mb_strlen($option);
if (mb_substr($option, $optionlen - 2) == 'px') {
if (is_numeric($option[0])) {
$style_dimensions = ' width: ' . $option . ';';
break;
} else {
$style_dimensions = ' height: ' . mb_substr($option, 1) . ';';
break;
}
}
}
if (in_array('thumb', $options)) {
$divclasses[] = 'thumb';
}
if (in_array('left', $options)) {
$divclasses[] = 'icleft';
}
if (in_array('center', $options)) {
$divclasses[] = 'iccenter';
}
if (in_array('right', $options)) {
$divclasses[] = 'icright';
}
$retval = '<div class="' . join(' ', $divclasses) . '"';
if ($issuemode) {
$retval .= ' style="float: left; clear: left;"';
}
$retval .= '>';
$retval .= image_tag($file_link, array('alt' => $caption, 'title' => $caption, 'style' => $style_dimensions, 'class' => 'image'), true);
示例2: __
disabled<?php
}
?>
>
<option value=0<?php
if (!\thebuggenie\core\framework\Settings::isCommentImagePreviewEnabled()) {
?>
selected<?php
}
?>
><?php
echo __("Don't show image previews of attached images in comments");
?>
</option>
<option value=1<?php
if (\thebuggenie\core\framework\Settings::isCommentImagePreviewEnabled()) {
?>
selected<?php
}
?>
><?php
echo __('Show image previews of attached images in comments');
?>
</option>
</select>
<?php
echo config_explanation(__('If you have problems with spam images, turn this off'));
?>
</td>
</tr>
<tr>