diff --git a/src/NewsletterShortcodeProvider.php b/src/NewsletterShortcodeProvider.php index 8ef5715..806627d 100644 --- a/src/NewsletterShortcodeProvider.php +++ b/src/NewsletterShortcodeProvider.php @@ -5,29 +5,29 @@ use SilverStripe\Control\Controller; use SilverStripe\View\Parsers\ShortcodeParser; -class NewsletterShortcodeProvider extends ShortcodeParser{ +class NewsletterShortcodeProvider extends ShortcodeParser +{ /* [newsletterform,class="form newsletter-form"] */ - public static function handle_shortcode($args, $content, $parser, $shortcode, $extra = array()){ + public static function handle_shortcode($args, $content, $parser, $shortcode, $extra = array()) + { $PopupContent = ''; // Add Content before form - if ($content){ + if ($content) { $PopupContent = $parser->parse($content); } // If class add wrapper div - if (isset($args['class'])){ - $PopupContent .= '
'; + if (isset($args['class'])) { + $PopupContent .= '
'; } // Get Form HTML - if (Controller::curr()->owner->NewsletterShowHide){ - $PopupContent .= Controller::curr()->NewsletterForm() - ->setHTMLID("NewsletterForm".rand(0,100)) - ->setFormAction(Controller::join_links(Controller::curr()->owner->Link(), 'NewsletterForm')) - ->forTemplate(); - } + $PopupContent .= Controller::curr()->NewsletterForm() + ->setHTMLID("NewsletterForm" . rand(0, 100)) + ->setFormAction(Controller::join_links(Controller::curr()->owner->Link(), 'NewsletterForm')) + ->forTemplate(); // End wrapper div - if (isset($args['class'])){ + if (isset($args['class'])) { $PopupContent .= '
'; } // Return full html