/** * Builds the preferences pane, shown in the symphony backend. * * @return XMLElement */ public function getPreferencesPane() { parent::getPreferencesPane(); $group = new XMLElement('fieldset'); $group->setAttribute('class', 'settings pickable'); $group->setAttribute('id', 'sendmail'); $group->appendChild(new XMLElement('legend', __('Email: Sendmail'))); $div = new XMLElement('div'); $div->setAttribute('class', 'group'); $label = Widget::Label(__('From Name')); $label->appendChild(Widget::Input('settings[email_sendmail][from_name]', $this->_sender_name)); $div->appendChild($label); $label = Widget::Label(__('From Email Address')); $label->appendChild(Widget::Input('settings[email_sendmail][from_address]', $this->_sender_email_address)); $div->appendChild($label); $group->appendChild($div); return $group; }
/** * Builds the preferences pane, shown in the symphony backend. * * @return XMLElement */ public function getPreferencesPane() { parent::getPreferencesPane(); $group = new XMLElement('fieldset'); $group->setAttribute('class', 'settings pickable'); $group->setAttribute('id', 'smtp'); $group->appendChild(new XMLElement('legend', __('Email: SMTP'))); $div = new XMLElement('div'); $div->setAttribute('class', 'group'); $label = Widget::Label(__('From Name')); $label->appendChild(Widget::Input('settings[email_smtp][from_name]', $this->_sender_name)); $div->appendChild($label); $label = Widget::Label(__('From Email Address')); $label->appendChild(Widget::Input('settings[email_smtp][from_address]', $this->_sender_email_address)); $div->appendChild($label); $group->appendChild($div); $div = new XMLElement('div'); $div->setAttribute('class', 'group'); $label = Widget::Label(__('Host')); $label->appendChild(Widget::Input('settings[email_smtp][host]', $this->_host)); $div->appendChild($label); $label = Widget::Label(__('Port')); $label->appendChild(Widget::Input('settings[email_smtp][port]', $this->_port)); $div->appendChild($label); $group->appendChild($div); $label = Widget::Label(); // To fix the issue with checkboxes that do not send a value when unchecked. $options = array(array('no', $this->_secure == 'no', __('No encryption')), array('ssl', $this->_secure == 'ssl', __('SSL encryption')), array('tls', $this->_secure == 'tls', __('TLS encryption'))); $select = Widget::Select('settings[email_smtp][secure]', $options); $label->appendChild($select); $group->appendChild($label); $group->appendChild(new XMLElement('p', __('For a secure connection, SSL and TLS are supported. Please check the manual of your email provider for more details.'), array('class' => 'help'))); $label = Widget::Label(); // To fix the issue with checkboxes that do not send a value when unchecked. $group->appendChild(Widget::Input('settings[email_smtp][auth]', '0', 'hidden')); $input = Widget::Input('settings[email_smtp][auth]', '1', 'checkbox'); if ($this->_auth == true) { $input->setAttribute('checked', 'checked'); } $label->setValue(__('%s Requires authentication', array($input->generate()))); $group->appendChild($label); $group->appendChild(new XMLElement('p', __('Some SMTP connections require authentication. If that is the case, enter the username/password combination below.'), array('class' => 'help'))); $div = new XMLElement('div'); $div->setAttribute('class', 'group'); $label = Widget::Label(__('Username')); $label->appendChild(Widget::Input('settings[email_smtp][username]', $this->_user)); $div->appendChild($label); $label = Widget::Label(__('Password')); $label->appendChild(Widget::Input('settings[email_smtp][password]', $this->_pass, 'password')); $div->appendChild($label); $group->appendChild($div); return $group; }
/** * Builds the preferences pane, shown in the Symphony backend. * * @throws InvalidArgumentException * @return XMLElement */ public function getPreferencesPane() { parent::getPreferencesPane(); $group = new XMLElement('fieldset'); $group->setAttribute('class', 'settings condensed pickable'); $group->setAttribute('id', 'smtp'); $group->appendChild(new XMLElement('legend', __('Email: SMTP'))); $div = new XMLElement('div'); $label = Widget::Label(__('HELO Hostname')); $label->appendChild(Widget::Input('settings[email_smtp][helo_hostname]', $this->_helo_hostname)); $div->appendChild($label); $group->appendChild($div); $group->appendChild(new XMLElement('p', __('A fully qualified domain name (FQDN) of your server, e.g. "www.example.com". If left empty, Symphony will attempt to find an IP address for the EHLO/HELO greeting.'), array('class' => 'help'))); $div = new XMLElement('div'); $div->setAttribute('class', 'two columns'); $label = Widget::Label(__('From Name')); $label->setAttribute('class', 'column'); $label->appendChild(Widget::Input('settings[email_smtp][from_name]', $this->_sender_name)); $div->appendChild($label); $label = Widget::Label(__('From Email Address')); $label->setAttribute('class', 'column'); $label->appendChild(Widget::Input('settings[email_smtp][from_address]', $this->_sender_email_address)); $div->appendChild($label); $group->appendChild($div); $div = new XMLElement('div'); $div->setAttribute('class', 'two columns'); $label = Widget::Label(__('Host')); $label->setAttribute('class', 'column'); $label->appendChild(Widget::Input('settings[email_smtp][host]', $this->_host)); $div->appendChild($label); $label = Widget::Label(__('Port')); $label->setAttribute('class', 'column'); $label->appendChild(Widget::Input('settings[email_smtp][port]', (string) $this->_port)); $div->appendChild($label); $group->appendChild($div); $label = Widget::Label(); $label->setAttribute('class', 'column'); // To fix the issue with checkboxes that do not send a value when unchecked. $options = array(array('no', $this->_secure == 'no', __('No encryption')), array('ssl', $this->_secure == 'ssl', __('SSL encryption')), array('tls', $this->_secure == 'tls', __('TLS encryption'))); $select = Widget::Select('settings[email_smtp][secure]', $options); $label->appendChild($select); $group->appendChild($label); $group->appendChild(new XMLElement('p', __('For a secure connection, SSL and TLS are supported. Please check the manual of your email provider for more details.'), array('class' => 'help'))); $label = Widget::Label(); $label->setAttribute('class', 'column'); // To fix the issue with checkboxes that do not send a value when unchecked. $group->appendChild(Widget::Input('settings[email_smtp][auth]', '0', 'hidden')); $input = Widget::Input('settings[email_smtp][auth]', '1', 'checkbox'); if ($this->_auth === true) { $input->setAttribute('checked', 'checked'); } $label->setValue(__('%s Requires authentication', array($input->generate()))); $group->appendChild($label); $group->appendChild(new XMLElement('p', __('Some SMTP connections require authentication. If that is the case, enter the username/password combination below.'), array('class' => 'help'))); $div = new XMLElement('div'); $div->setAttribute('class', 'two columns'); $label = Widget::Label(__('Username')); $label->setAttribute('class', 'column'); $label->appendChild(Widget::Input('settings[email_smtp][username]', $this->_user, 'text', array('autocomplete' => 'off'))); $div->appendChild($label); $label = Widget::Label(__('Password')); $label->setAttribute('class', 'column'); $label->appendChild(Widget::Input('settings[email_smtp][password]', $this->_pass, 'password', array('autocomplete' => 'off'))); $div->appendChild($label); $group->appendChild($div); return $group; }