Exemplo n.º 1
0
 /**
  * @param IfwPsn_Wp_Options_Section $section
  */
 public function registerOptionsCallback(IfwPsn_Wp_Options_Section $section)
 {
     switch ($section->getId()) {
         case 'general':
             $options = $this->_generalOptions;
             break;
         case 'external':
             $options = $this->_externalOptions;
             break;
     }
     ksort($options);
     foreach ($options as $priority) {
         foreach ($priority as $option) {
             $section->addField($option);
         }
     }
 }
Exemplo n.º 2
0
 protected function _addOptions()
 {
     $this->_pm->getOptionsManager()->addGeneralOption(new IfwPsn_Wp_Options_Field_Checkbox('psn_ignore_status_inherit', __('Ignore post status "inherit"', 'psn'), __('Status "inherit" is used when post revisions get created by WordPress automatically', 'psn')));
     $this->_pm->getOptionsManager()->addGeneralOption(new IfwPsn_Wp_Options_Field_Checkbox('psn_hide_nonpublic_posttypes', __('Hide non-public post types', 'psn'), __('When selected, non-public post types will be excluded from rule settings form', 'psn')));
     if (!$this->_pm->isPremium()) {
         $smtpOptions = new IfwPsn_Wp_Options_Section('smtp', __('SMTP', 'psn_smtp'));
         $smtpOptions->addField(new IfwPsn_Wp_Options_Field_Checkbox('smtp_teaser', __('Activate SMTP', 'psn'), __('SMTP is a premium feature. You will get all configuration options to connect to your SMTP server.', 'psn')));
         $this->_pm->getBootstrap()->getOptions()->addSection($smtpOptions, 12);
     }
     $placeholderFilterOptions = new IfwPsn_Wp_Options_Section('placeholders', __('Placeholders', 'psn'));
     $placeholderFilterOptions->addField(new IfwPsn_Wp_Options_Field_Textarea('placeholders_filters', __('Placeholders filters', 'psn'), sprintf(__('Here you can define filters which will apply to the placeholders contents (One filter per line). You can use the <a href="%s" target="_blank">Twig filters</a>. Refer to the <a href="%s" target="_blank">documentation</a> for details.<br>Example: [post_date]|date("m/d/Y")', 'psn_smtp'), 'http://twig.sensiolabs.org/doc/filters/index.html', 'http://docs.ifeelweb.de/post-status-notifier/options.html#placeholders')));
     $this->_pm->getBootstrap()->getOptions()->addSection($placeholderFilterOptions, 300);
     // Advanced
     $advancedOptions = new IfwPsn_Wp_Options_Section('advanced', __('Advanced', 'psn'));
     do_action('psn_options_advanced', $advancedOptions);
     if (function_exists('apc_clear_cache')) {
         // APC 502 bad gateway workaround
         $advancedOptions->addField(new IfwPsn_Wp_Options_Field_Checkbox('apc_clear_cache', __('APC clear cache', 'psn'), __('In case you are facing issues when updating rules or email templates (blank page, 502 Bad Gateway on nginx), please activate this option and try again. Or ask your webhost to deactivate APC. This option will deactivate the APC cache on PSN admin pages.', 'psn')));
     }
     $this->_pm->getBootstrap()->getOptions()->addSection($advancedOptions, 400);
 }