Exemple #1
0
 public function insertBrick(HTML_QuickForm2_Container $form)
 {
     if ($this->getConfig('type') == 'checkboxes') {
         $options = Am_Di::getInstance()->newsletterListTable->getUserOptions();
         if ($enabled = $this->getConfig('lists')) {
             $_ = $options;
             $options = array();
             foreach ($enabled as $id) {
                 $options[$id] = $_[$id];
             }
         }
         if (!$options) {
             return;
         }
         // no lists enabled
         $group = $form->addGroup('_newsletter')->setLabel($this->___('Subscribe to Site Newsletters'));
         $group->setSeparator("<br />\n");
         foreach ($options as $list_id => $title) {
             $c = $group->addAdvCheckbox($list_id)->setContent($title);
             if (!$this->getConfig('unchecked')) {
                 $c->setAttribute('checked');
             }
         }
     } else {
         $c = $form->addAdvCheckbox('_newsletter')->setLabel($this->___('Subscribe to Site Newsletters'));
         if (!$this->getConfig('unchecked')) {
             $c->setAttribute('checked');
         }
     }
 }
Exemple #2
0
 public function insertBrick(HTML_QuickForm2_Container $form)
 {
     $form->addAdvCheckbox('unsubscribed')->setLabel($this->___('Unsubscribe from all e-mail messages'));
 }