hypejunction/hypeicons 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hypejunction/hypeicons

最新稳定版本:7.0.2

Composer 安装命令:

composer require hypejunction/hypeicons

包简介

Interface for uploading and cropping entity icons and covers

README 文档

README

Interface for uploading and cropping entity icons and covers

Elgg 7.x

Features

  • Generic API for uploading, handling and cropping entity icons and covers
  • Admin settings to enable icons/covers for all entity types
  • Allows to crop file thumbnails
  • Allows to crop user and group avatars and cover images
  • An option switch between square, rounded and circle entity icons
  • An option to replace default entity icons with SVG
  • An option to replace default filetype icons with SVG
  • Responsive icon/cover cropping

Screenshots

Icon/Cover Cropper Layout with cover

Notes

Default entity type icons

To replace a default entity icon/cover, simply place an image in views/default/<icon_type>/<entity_type>/<entity_subtype>.<ext>, where:

  • ext is either svg, png, gif or jpg.
  • icon_type is either cover or icon

Add a cropper as a form input

// in your form
echo elgg_view('input/cropper', array(
	'src' => 'http://example.com/uri/image.jpg',
	'ratio' => 16/9,
	'name' => 'crop_coords',
));

// in your action
$coords = get_input('crop_coords');

Add cropper to a file input

This will allow users to crop an image before uploading it to the server.

// in your form
echo elgg_view('input/file', array(
    'name' => 'avatar',
    'use_cropper' => true,
));

// in your action
$coords = get_input('crop_coords');

You can as well pass preset coordinates and images source.

// in your form
echo elgg_view('input/file', array(
	'name' => 'cover',
	'use_cropper' => array(
		'name' => 'cover_crop_coords',
		'ratio' => 16/9,
		'src' => '/uri/image.jpg', // previously uploaded file
		'x1' => 100,
		'y1' => 100,
		'x2' => 260,
		'y2' => 190,
	),
));

// in your action
$coords = get_input('cover_crop_coords');

In your action, be sure to use the same image source for cropping. If you passed master image source to the file input, you will need to implement the logic for both new file upload and master image, as cropping coordinates may change even without new file upload.

Displaying a cover image

echo elgg_view('output/cover', [
   'entity' => $entity,
]);

Adding cover image in layout header

echo elgg_view_layout('one_sidebar', [
   'entity' => $entity,
   'show_cover' => true,
   'title' => 'Page with cover',
   'content' => 'Page content',
]);

## Compatibility

| Plugin version | Elgg version |
|---|---|
| 7.0.0   | 7.x  |
| 6.0.0   | 6.x  |
| 5.0.0   | 5.x  |
| 4.0.0   | 4.x  |
| 3.0.0   | 3.x  |

统计信息

  • 总下载量: 36
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2016-09-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固