예제 #1
0
파일: Object.php 프로젝트: brussens/cogear2
 /**
  * Генерирует код для миниатюры
  *
  * @param string $file
  * @param string $preset
  */
 public static function getThumbCode($file, $preset = 'image.medium')
 {
     $file = UPLOADS . $file;
     $thumbnail = image_preset($preset, $file, TRUE);
     $preset = str_replace('.', '-', $preset);
     return HTML::a(File::pathToUri($file), self::getCode($thumbnail), array('class' => 'preset ' . $preset));
 }
예제 #2
0
파일: image.php 프로젝트: brussens/cogear2
<?php

$thumb = File::pathToUri(image_preset('image.thumb', UPLOADS . DS . $file->path));
?>
<a class="fancybox sh" href="<?php 
echo $file->getLink();
?>
" class="file-<?php 
echo $file->info->getExtension();
?>
">
    <img src="<?php 
echo $thumb;
?>
">
</a>
예제 #3
0
파일: Avatar.php 프로젝트: romartyn/cogear
 /**
  * Render avatar
  *  
  * @param string $file 
  */
 public function render($preset = 'avatar.small')
 {
     $file = UPLOADS . '/' . $this->file;
     return HTML::img(Url::toUri(image_preset($preset, $file)), $this->object->login, array('class' => 'avatar'));
 }
예제 #4
0
파일: Object.php 프로젝트: brussens/cogear2
 /**
  * Get HTML image avatar
  *
  * @param string $preset
  * @return string
  */
 public function getAvatarImage($preset = 'avatar.small')
 {
     return HTML::img(image_preset($preset, $this->getAvatar()->getFile(), TRUE), $this->login, array('class' => 'avatar', 'title' => $this->getName()));
 }
예제 #5
0
파일: Avatar.php 프로젝트: brussens/cogear2
 /**
  * Render avatar
  *
  * @param string $file
  */
 public function render($preset = 'avatar.small')
 {
     return HTML::img(Url::toUri(image_preset($preset, $this->getFile())), $this->object()->login, array('class' => 'avatar'));
 }
예제 #6
0
<?php

if ($value && file_exists(UPLOADS . $value)) {
    ?>
<div class="image-preview"><img src="<?php 
    echo File::pathToUri($element->options->preset ? image_preset($element->options->preset, UPLOADS . $value) : UPLOADS . $value);
    ?>
"></div>
<label class="checkbox"><input type="checkbox" name="<?php 
    echo $element->name;
    ?>
" value=""/> <?php 
    echo t('Удалить');
    ?>
</label>
<?php 
} else {
    echo HTML::input($element->options);
}
?>