From 70ff0883e854c4f28c461b99b922a54f2c03d37b Mon Sep 17 00:00:00 2001 From: Scott Hutchinson Date: Tue, 16 Apr 2019 14:56:55 +1200 Subject: [PATCH 1/3] FIX move legacy.yml to _config folder to be picked up correctly --- _config.php | 1 - legacy.yml => _config/legacy.yml | 0 2 files changed, 1 deletion(-) delete mode 100644 _config.php rename legacy.yml => _config/legacy.yml (100%) diff --git a/_config.php b/_config.php deleted file mode 100644 index b3d9bbc..0000000 --- a/_config.php +++ /dev/null @@ -1 +0,0 @@ - Date: Fri, 17 May 2019 11:29:25 +1200 Subject: [PATCH 2/3] FIX Add CMS configurable title for iframe to tell screenreaders it contains frame content --- src/IFramePage.php | 9 ++++++++- templates/SilverStripe/IFrame/Layout/IFramePage.ss | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/IFramePage.php b/src/IFramePage.php index fffe512..6a64a2f 100644 --- a/src/IFramePage.php +++ b/src/IFramePage.php @@ -8,6 +8,8 @@ use SilverStripe\Forms\CheckboxField; use SilverStripe\Forms\NumericField; use SilverStripe\Forms\HTMLEditor\HtmlEditorField; use SilverStripe\ORM\FieldType\DBField; +use SilverStripe\ORM\ValidationException; +use SilverStripe\ORM\ValidationResult; /** * Iframe page type embeds an iframe of URL of choice into the page. @@ -18,6 +20,7 @@ class IFramePage extends Page { private static $db = array( 'IFrameURL' => 'Text', + 'IFrameTitle' => 'Varchar', 'AutoHeight' => 'Boolean(1)', 'AutoWidth' => 'Boolean(1)', 'FixedHeight' => 'Int(500)', @@ -45,7 +48,11 @@ class IFramePage extends Page $fields = parent::getCMSFields(); $fields->removeFieldFromTab('Root.Main', 'Content'); - $fields->addFieldToTab('Root.Main', $url = new TextField('IFrameURL', 'Iframe URL')); + $fields->addFieldsToTab('Root.Main', [ + $url = TextField::create('IFrameURL', 'Iframe URL'), + TextField::create('IFrameTitle', 'Iframe Title') + ->setDescription(_t(__CLASS__ . '.TITLE_DESCRIPTION', 'Used to identify the contents of the Iframe')), + ]); $url->setRightTitle( DBField::create_field( 'HTMLText', diff --git a/templates/SilverStripe/IFrame/Layout/IFramePage.ss b/templates/SilverStripe/IFrame/Layout/IFramePage.ss index 3a4fe24..e132d50 100644 --- a/templates/SilverStripe/IFrame/Layout/IFramePage.ss +++ b/templates/SilverStripe/IFrame/Layout/IFramePage.ss @@ -9,7 +9,7 @@
<%t SilverStripe\\IFrame\\IFramePage.ExternalNote "Please note the following section of content is possibly being delivered from an external source (IFRAME in HTML terms), and may present unusual experiences for screen readers." %>
- + <% end_if %> $BottomContent From 097edbc9c2b6d58ac358b655fe36750fa285cff3 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Fri, 17 May 2019 14:35:01 +1200 Subject: [PATCH 3/3] Update title and description of IFrameTitle field --- src/IFramePage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/IFramePage.php b/src/IFramePage.php index 6a64a2f..b8ed365 100644 --- a/src/IFramePage.php +++ b/src/IFramePage.php @@ -50,8 +50,8 @@ class IFramePage extends Page $fields->removeFieldFromTab('Root.Main', 'Content'); $fields->addFieldsToTab('Root.Main', [ $url = TextField::create('IFrameURL', 'Iframe URL'), - TextField::create('IFrameTitle', 'Iframe Title') - ->setDescription(_t(__CLASS__ . '.TITLE_DESCRIPTION', 'Used to identify the contents of the Iframe')), + TextField::create('IFrameTitle', 'Description of contents (title)') + ->setDescription(_t(__CLASS__ . '.TITLE_DESCRIPTION', 'Used by screen readers')), ]); $url->setRightTitle( DBField::create_field(