Drop the image description field
Slide images are shown on the presenter's screen, so a description for screen readers is not asked for any more. The column stays (always empty). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
33c75e504f
commit
4caff47a09
5 files changed
+7
-35
No files matched your search
@@ -415,12 +415,10 @@ class SlidesController extends AdminAppController
|
||||
|
||||
return $state;
|
||||
}
|
||||
// The description is optional (recommended for screen readers); empty means alt="" (skipped by them).
|
||||
// Never reject an upload for it: the file input cannot be refilled after a failed save.
|
||||
$alt = mb_substr(trim((string)($data['image_alt'] ?? '')), 0, Slide::IMAGE_ALT_MAX);
|
||||
$layout = $data['image_layout'] ?? null;
|
||||
$slide->patch([
|
||||
'image_alt' => $alt,
|
||||
// Presentation images are decoration: no description is asked for (alt="").
|
||||
'image_alt' => '',
|
||||
'image_layout' => in_array($layout, Slide::IMAGE_LAYOUTS, true) ? $layout : null,
|
||||
], ['guard' => false]);
|
||||
$this->setErrors($slide, $errors);
|
||||
|
||||
@@ -20,7 +20,7 @@ use Cake\ORM\Entity;
|
||||
* @property bool $is_hidden Prepared, but skipped in the presentation (never live)
|
||||
* @property array<string, mixed>|null $settings
|
||||
* @property string|null $image File name of the slide image in the poll's upload directory (see ImageService)
|
||||
* @property string|null $image_alt Alternative text of the image, '' = decorative
|
||||
* @property string|null $image_alt Always '' (decorative): images are shown on the stage, no description is asked for
|
||||
* @property string|null $image_layout top|side|full, null = default of the type (see imageLayout())
|
||||
* @property int|null $image_width Pixels of the stored (scaled) image
|
||||
* @property int|null $image_height
|
||||
@@ -149,11 +149,6 @@ class Slide extends Entity
|
||||
public const IMAGE_FULL = 'full';
|
||||
public const IMAGE_LAYOUTS = [self::IMAGE_TOP, self::IMAGE_SIDE, self::IMAGE_FULL];
|
||||
|
||||
/**
|
||||
* Longest alternative text.
|
||||
*/
|
||||
public const IMAGE_ALT_MAX = 255;
|
||||
|
||||
/**
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user