1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-09 16:26:59 +02:00
This commit is contained in:
Ryan Cramer
2020-07-28 15:29:56 -04:00
parent a852f74641
commit 95203ac8f2
3 changed files with 20 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@@ -821,6 +821,8 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu
*
*/
protected function renderFileActionSelect(Pagefile $pagefile, $id) {
if(!$this->useImageEditor) return '';
static $hooked = null;
@@ -1309,6 +1311,11 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu
/** @var Sanitizer $sanitizer */
$sanitizer = $this->wire('sanitizer');
$page = $this->hasPage;
if($page && $page->id) {
if(!$this->wire()->user->hasPermission('page-edit-images', $page)) $this->useImageEditor = 0;
}
parent::___processInput($input);
@@ -1387,6 +1394,8 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu
*
*/
protected function processFileAction(Pageimage $pagefile, $action, $label) {
if(!$this->useImageEditor) return null;
$success = null;
$showSuccess = true;

View File

@@ -70,6 +70,16 @@ $focusPointCircleSize: 40px;
list-style: none;
}
.gridImage .gridImage__overflow, // grid view(s)
.InputfieldImageEditAll .gridImage .gridImage__overflow img, // list view
.InputfieldImageEdit__image { // clicked image in editor in grid view
// the following creates a checkerboard pattern (for seeing transparency)
background-color: #fefefe;
background-image: linear-gradient(45deg, #cbcbcb 25%, transparent 25%, transparent 75%, #cbcbcb 75%, #cbcbcb), linear-gradient(45deg, #cbcbcb 25%, transparent 25%, transparent 75%, #cbcbcb 75%, #cbcbcb);
background-size: 16px 16px;
background-position: 0 0, 8px 8px;
}
// An individual image grid item
.gridImage {
list-style: none;
@@ -95,11 +105,6 @@ $focusPointCircleSize: 40px;
height: 100%;
overflow: hidden;
position: relative;
// the following creates a checkerboard pattern (for seeing transparency)
background-color: #fefefe;
background-image: linear-gradient(45deg, #cbcbcb 25%, transparent 25%, transparent 75%, #cbcbcb 75%, #cbcbcb), linear-gradient(45deg, #cbcbcb 25%, transparent 25%, transparent 75%, #cbcbcb 75%, #cbcbcb);
background-size: 16px 16px;
background-position: 0 0, 8px 8px;
& > img {
position: absolute;