Version: current

     1 <?php
     2 /**
     3  * Виджет "Подписка на рассылку" для боковой колонки
     4  * Позволяет добавить в боковой колонке форму подписки на рассылку
     5  *
     6  * @package widgets
     7  * @author  menedem
     8  */
     9 class SubscribeWidget extends SidebarWidget {
    10
    11     public $needObjects = array(
    12         'SubscribeForm' => 'Page'
    13     );
    14
    15     function SubscribeForm() {
    16         if (class_exists('SubscribeForm') && ($page = DataObject::get_one('SubscribeForm'))) {
    17             $controller = ModelAsController::controller_for($page);
    18             return $controller->Form();
    19         }
    20         return false;
    21     }
    22
    23     function hasContent() {
    24         if ($this->SubscribeForm()) {
    25             return true;
    26         }
    27         return false;
    28     }
    29 }
    30
    31

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -