public function initConfigForm(Am_Form $form) { $el = $form->addSelect('type', array('id' => 'newsletter-type-select'))->setLabel(___('Type')); $el->addOption(___('Single Checkbox'), 'checkbox'); $el->addOption(___('Checkboxes for Selected Lists'), 'checkboxes'); $form->addAdvCheckbox('no_label', array('id' => 'newsletter-no-label'))->setLabel(___("Hide Label")); $form->addScript()->setScript(<<<CUT \$(function(){ \$('#newsletter-type-select').change(function(){ \$('#newsletter-no-label').closest('.row').toggle(\$(this).val() == 'checkbox') }).change(); }) CUT ); $lists = $form->addSortableMagicSelect('lists', array('id' => 'newsletter-lists-select'))->setLabel(___("Lists\n" . 'All List will be displayed if none selected')); $lists->loadOptions(Am_Di::getInstance()->newsletterListTable->getAdminOptions()); $form->addScript()->setScript(<<<CUT jQuery(document).ready(function(\$) { \$("#newsletter-type-select").change(function(){ var val = \$(this).val(); \$("#row-newsletter-lists-select").toggle(val == 'checkboxes'); }).change(); }); CUT ); $form->addAdvCheckbox('unchecked')->setLabel(___("Default unchecked\n" . 'Leave unchecked if you want newsletter default to be checked')); }
public function initConfigForm(Am_Form $form) { Am_Di::getInstance()->plugins_payment->loadEnabled(); $ps = $form->addSortableMagicSelect('paysystems')->setLabel(___("Payment Options\n" . 'if none selected, all enabled will be displayed'))->loadOptions(Am_Di::getInstance()->paysystemList->getOptionsPublic()); $form->addAdvCheckbox('hide_if_one')->setLabel(___("Hide Select\n" . 'if there is only one choice')); }