loadAcyMailing(); parent::__construct( 'acym_archive_widget', acym_translationSprintf('ACYM_MENU', acym_translation('ACYM_MENU_ARCHIVE')), ['description' => acym_translation('ACYM_MENU_ARCHIVE_DESC')] ); } public function form($instance) { $this->loadAcyMailing(); $params = [ 'title' => 'See all newsletters', 'lists' => '', 'popup' => '1', 'displayUserListOnly' => '1', 'nbNewslettersPerPage' => '10', ]; $listClass = new ListClass(); $lists = $listClass->getAllWithoutManagement(); foreach ($lists as $i => $oneList) { if ($oneList->active == 0) { unset($lists[$i]); } } foreach ($params as $keyParam => &$valueParam) { if (isset($instance[$keyParam])) { $valueParam = $instance[$keyParam]; } if (is_array($valueParam)) { $valueParam = implode(',', $valueParam); } $valueParam = esc_attr($valueParam); } echo '
'; echo '
'.acym_translationSprintf( 'ACYM_X_NEWSLETTERS_PER_PAGE', acym_select( [ '5' => '5', '10' => '10', '15' => '15', '20' => '20', '30' => '30', '50' => '50', '100' => '100', '200' => '200', ], $this->get_field_name('nbNewslettersPerPage'), $params['nbNewslettersPerPage'] ) ).'
'; echo ''; echo acym_selectMultiple( $lists, $this->get_field_name('lists'), explode(',', $params['lists']), [ 'style' => 'width:100%;', 'id' => $this->get_field_id('lists'), ], 'id', 'name' ); echo '
'; echo acym_boolean($this->get_field_name('popup'), $params['popup'], $this->get_field_id('popup')).'
'; echo ''; echo acym_boolean($this->get_field_name('displayUserListOnly'), $params['displayUserListOnly'], $this->get_field_id('displayUserListOnly')).'
'; echo '