Skip to content

Commit

Permalink
feat(icons): icon cropping is now default enabled in entity/edit/icon
Browse files Browse the repository at this point in the history
fixes #14016
  • Loading branch information
jdalsem committed Aug 4, 2022
1 parent ddb2597 commit a845ce0
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions docs/guides/actions.rst
Expand Up @@ -403,6 +403,7 @@ The view supports some variables to control the output
* ``name`` - name of the input/file (default: icon)
* ``remove_name`` - name of the remove icon toggle (default: $vars['name'] . '_remove')
* ``required`` - is icon upload required (default: false)
* ``cropper_enabled`` - is icon cropping allowed (default: true)
* ``show_remove`` - show the remove icon option (default: true)
* ``show_thumb`` - show the thumb of the entity if available (default: true)
* ``thumb_size`` - the icon size to use as the thumb (default: medium)
Expand Down
1 change: 0 additions & 1 deletion mod/groups/views/default/groups/edit/profile.php
Expand Up @@ -17,7 +17,6 @@
'entity' => elgg_extract('entity', $vars),
'entity_type' => 'group',
'entity_subtype' => 'group',
'cropper_enabled' => true,
]);

// show the configured group profile fields
Expand Down
2 changes: 1 addition & 1 deletion views/default/entity/edit/icon.php
Expand Up @@ -12,7 +12,7 @@
* @uses $vars['show_remove'] show the remove icon option (default: true)
* @uses $vars['show_thumb'] show the thumb of the entity if available (default: true)
* @uses $vars['thumb_size'] the icon size to use as the thumb (default: medium)
* @uses $vars['cropper_enabled'] enable cropper features (default: false), see the view 'entity/edit/icon/crop' for more details
* @uses $vars['cropper_enabled'] enable cropper features (default: true), see the view 'entity/edit/icon/crop' for more details
*/

$entity = elgg_extract('entity', $vars);
Expand Down
4 changes: 2 additions & 2 deletions views/default/entity/edit/icon/crop.php
Expand Up @@ -5,15 +5,15 @@
* @uses $vars['entity'] the entity being edited
* @uses $vars['entity_type'] the type of the entity
* @uses $vars['entity_subtype'] the subtype of the entity
* @uses $vars['cropper_enabled'] enable cropper features (default: false)
* @uses $vars['cropper_enabled'] enable cropper features (default: true)
* @uses $vars['cropper_config'] configuration for CropperJS
* @uses $vars['cropper_aspect_ratio_size'] the icon size to use to detect cropping aspact ratio (default: master) pass 'false' to disable
* @uses $vars['cropper_show_messages'] show messages (default: true for icon_type = 'icon', false otherwise)
* @uses $vars['cropper_min_width'] the minimal width of the cropped image
* @uses $vars['cropper_min_height'] the minimal height of the cropped image
*/

if (elgg_extract('cropper_enabled', $vars, false) === false) {
if (elgg_extract('cropper_enabled', $vars, true) === false) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion views/default/entity/edit/icon/thumb.php
Expand Up @@ -9,7 +9,7 @@
* @uses $vars['cropper_enabled'] enable cropper features (default: false), when cropper is enabled thumbnail is disabled by default
*/

if (elgg_extract('show_thumb', $vars, !elgg_extract('cropper_enabled', $vars, false)) === false) {
if (elgg_extract('show_thumb', $vars, !elgg_extract('cropper_enabled', $vars, true)) === false) {
return;
}

Expand Down
1 change: 0 additions & 1 deletion views/default/forms/admin/site/icons.php
Expand Up @@ -4,7 +4,6 @@

$site_icon .= elgg_view('entity/edit/icon', [
'entity' => elgg_get_site_entity(),
'cropper_enabled' => true,
]);

echo elgg_view_module('info', elgg_echo('admin:site_icons:site_icon'), $site_icon);
Expand Down
1 change: 0 additions & 1 deletion views/default/forms/avatar/upload.php
Expand Up @@ -19,7 +19,6 @@
echo elgg_view('entity/edit/icon', [
'entity' => $entity,
'name' => 'avatar',
'cropper_enabled' => true,
]);

$footer = elgg_view_field([
Expand Down

0 comments on commit a845ce0

Please sign in to comment.