<?php

class NewsletterSubscribeWidget extends ShortCodeWidget {

    public $layout = 'default';
    public $shortCode = 'newsletter';
    public $subscribeAction = 'site/newsletter.Subscribe';

    public static function actions() {
        return array(
            // naming the action and pointing to the location
            // where the external action class is
            'Subscribe' => array(
                'class' => 'application.components.actions.Subscribe',
                'layout' => 'shortcodes.views.newsletter.default',
            ),
            'CompleteSubscription' => array(
                'class' => 'application.components.actions.CompleteSubscription',
                'layout' => 'shortcodes.views.newsletter.default',
            ),
        );
    }

    public function run() {
        $this->controller->forward($this->subscribeAction, false);
    }

}
