function resolveConflicts() { $modelConfig =& WYSIJA::get('config', 'model'); $possibleConflictiveThemes = $modelConfig->getValue('conflictiveThemes'); $conflictingTheme = null; $currentTheme = strtolower(get_current_theme()); foreach ($possibleConflictiveThemes as $keyTheme => $conflictTheme) { if ($keyTheme === $currentTheme) { $conflictingTheme = $keyTheme; } } if ($conflictingTheme !== null) { $helperConflicts =& WYSIJA::get('conflicts', 'helper'); $helperConflicts->resolve(array($possibleConflictiveThemes[$conflictingTheme])); } $possibleConflictivePlugins = $modelConfig->getValue("conflictivePlugins"); $conflictingPlugins = array(); foreach ($possibleConflictivePlugins as $keyPlg => $conflictPlug) { if (WYSIJA::is_plugin_active($conflictPlug['file'])) { $conflictingPlugins[$keyPlg] = $conflictPlug; } } if ($conflictingPlugins) { $helperConflicts =& WYSIJA::get("conflicts", "helper"); $helperConflicts->resolve($conflictingPlugins); } }
function WYSIJA_help_front() { parent::WYSIJA_help(); if (isset($_REQUEST['wysija-page']) || isset($_REQUEST['wysija-launch'])) { if (defined('DOING_AJAX')) { add_action('wp_ajax_nopriv_wysija_ajax', array($this, 'ajax')); } else { $paramscontroller = $_REQUEST['controller']; if ($paramscontroller == 'stat') { $paramscontroller = 'stats'; } $this->controller =& WYSIJA::get($paramscontroller, 'controller'); if (method_exists($this->controller, $_REQUEST['action'])) { add_action('init', array($this->controller, $_REQUEST['action'])); } else { $this->error('Action does not exist.'); } if (isset($_REQUEST['wysija-page'])) { add_filter('wp_title', array($this, 'meta_page_title')); add_filter('the_title', array($this, 'scan_title')); add_filter('the_content', array($this, 'scan_content'), 98); if (isset($_REQUEST['message_success'])) { add_filter('the_content', array($this, 'scan_content_NLform'), 99); } } if (isset($_REQUEST['wysija-page'])) { add_filter('wp_title', array($this, 'meta_page_title')); add_filter('the_title', array($this, 'scan_title')); add_filter('the_content', array($this, 'scan_content'), 98); if (isset($_REQUEST['message_success'])) { add_filter('the_content', array($this, 'scan_content_NLform'), 99); } } } } else { add_filter('the_content', array($this, 'scan_content_NLform'), 99); add_shortcode('wysija_form', array($this, 'scan_form_shortcode')); $mConfig =& WYSIJA::get('config', 'model'); if ($mConfig->getValue('commentform')) { add_action('comment_form', array($this, 'comment_form_extend')); add_action('comment_post', array($this, 'comment_posted'), 60, 2); } if ($mConfig->getValue('registerform')) { if (is_multisite()) { add_action('signup_extra_fields', array($this, 'register_form_extend')); add_filter('wpmu_validate_user_signup', array($this, 'registerms_posted'), 60, 3); } else { add_action('register_form', array($this, 'register_form_extend')); add_action('register_post', array($this, 'register_posted'), 60, 3); } if (WYSIJA::is_plugin_active('buddypress/bp-loader.php')) { add_action('bp_after_signup_profile_fields', array($this, 'register_form_bp_extend')); add_action('bp_signup_validate', array($this, 'register_bp'), 60, 3); } } } }
function basics() { $step = array(); $step['company_address'] = array('type' => 'textarea', 'label' => __("Your company's address", WYSIJA), 'desc' => __("The address will be added to your newsletter's footer. This helps avoid spam filters.", WYSIJA), 'rows' => "3", 'cols' => "40"); $step['emails_notified'] = array('type' => 'email_notifications', 'label' => __('Email notifications', WYSIJA), 'desc' => __('Enter the email addresses that should receive notifications (separate by comma).', WYSIJA)); $step['from_name'] = array('type' => 'fromname', 'class' => 'validate[required]', 'label' => __('Sender of notifications', WYSIJA), 'desc' => __('Choose a FROM name and email address for notifications emails.', WYSIJA)); $step['commentform'] = array('type' => 'commentform', 'label' => __('Subscribe in comments', WYSIJA), 'desc' => __('Visitors who submit a comment on a post can click on a checkbox to subscribe.', WYSIJA)); $showregisteroption = true; //this option is only available for the main site if (is_multisite() && get_current_blog_id() != 1) { $showregisteroption = false; } if ($showregisteroption) { $step['registerform'] = array('type' => 'commentform', 'label' => __('Subscribe in registration form', WYSIJA), 'desc' => __('Allow users who register to your site to subscribe on a list of your choice.', WYSIJA)); } $modelU = WYSIJA::get('user', 'model'); $objUser = $modelU->getCurrentSubscriber(); $step['viewinbrowser'] = array('type' => 'viewinbrowser', 'label' => __('Link to browser version', WYSIJA), 'desc' => __('Displays at the top of your newsletters. Don\'t forget to include the link tag, ie: [link]The link[/link]', WYSIJA)); $step['unsubscribe_linkname'] = array('type' => 'input', 'label' => __('Text of "Unsubscribe" link', WYSIJA), 'desc' => __('This changes the label for the unsubscribe link in the footer of your newsletters.', WYSIJA)); $step['unsubscribe_page'] = array('type' => 'page_selection', 'label' => __('Unsubscribe page', WYSIJA), 'desc' => __('A subscriber is directed to a page of your choice after clicking on the unsubscribe link, at the bottom of a newsletter.', WYSIJA)); $model_config = WYSIJA::get('config', 'model'); ?> <table class="form-table"> <tbody> <?php // display that premium is activated if (WYSIJA::is_plugin_active('wysija-newsletters-premium/index.php') && $this->model->getValue('premium_key')) { ?> <tr> <td class="premium_activated" colspan="2"> <i class="dashicons dashicons-awards"></i><?php echo __('Your Premium is activated.', WYSIJA); ?> </td> </tr> <?php } echo $this->buildMyForm($step, $model_config->values, 'config'); ?> </tbody> </table> <?php }
function define_translated_strings() { $config =& WYSIJA::get('config', 'model'); $linkcontent = __("It doesn't always work the way we want it to, doesn't it? We have a [link]dedicated support website[/link] with documentation and a ticketing system.", WYSIJA); $finds = array('[link]', '[/link]'); $replace = array('<a target="_blank" href="http://support.wysija.com" title="support.wysija.com">', '</a>'); $truelinkhelp = '<p>' . str_replace($finds, $replace, $linkcontent) . '</p>'; $extra = __('[link]Request a feature for Wysija[/link] in User Voice.', WYSIJA); $finds = array('[link]', '[/link]'); $replace = array('<a target="_blank" href="http://wysija.uservoice.com/forums/150107-feature-request" title="Wysija User Voice">', '</a>'); $truelinkhelp .= '<p>' . str_replace($finds, $replace, $extra) . '</p>'; $truelinkhelp .= '<p>' . __('Wysija Version: ', WYSIJA) . '<strong>' . WYSIJA::get_version() . '</strong></p>'; $this->menus = array('campaigns' => array('title' => 'Wysija'), 'subscribers' => array('title' => __('Subscribers', WYSIJA)), 'config' => array('title' => __('Settings', WYSIJA))); $this->menuHelp = $truelinkhelp; if ($config->getValue('queue_sends_slow')) { $msg = $config->getValue('ignore_msgs'); if (!isset($msg['queuesendsslow'])) { $this->notice(__('Tired of waiting more than 48h to send your emails?', WYSIJA) . ' ' . str_replace(array('[link]', '[/link]'), array('<a href="http://support.wysija.com/knowledgebase/how-fast-can-i-send-emails-optimal-sending-configurations-explained/?utm_source=wpadmin&utm_campaign=slowqueue" target="_blank">', '</a>'), __('[link]Find out[/link] how you can improve this.', WYSIJA)) . ' <a class="linkignore queuesendsslow" href="javascript:;">' . __('Hide!', WYSIJA) . '</a>'); } } if (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON && !WYSIJA::is_plugin_active('wp-cron-control/wp-cron-control.php')) { $msg = $config->getValue('ignore_msgs'); if (!isset($msg['crondisabled'])) { $this->notice(__("Oops! Looks like your site's event scheduler (wp-cron) is turned off.", WYSIJA) . ' ' . str_replace(array('[link]', '[/link]'), array('<a href="http://support.wysija.com/knowledgebase/your-cron-is-disabled/" target="_blank">', '</a>'), __('[link]Read more.[/link]', WYSIJA)) . ' <a class="linkignore crondisabled" href="javascript:;">' . __('Hide!', WYSIJA) . '</a>'); } } if (WYSIJA_ITF) { global $wysija_installing; if (!$config->getValue('sending_emails_ok')) { $msg = $config->getValue('ignore_msgs'); $urlsendingmethod = 'admin.php?page=wysija_config#tab-sendingmethod'; if ($_REQUEST['page'] === 'wysija_config') { $urlsendingmethod = '#tab-sendingmethod'; } } } }
function add_text_cron_premium($content) { if (WYSIJA::is_plugin_active('wysija-newsletters-premium/index.php') && $this->model->getValue('premium_key')) { $content = __('I\'m a premium user, MailPoet.com will make sure my emails get sent on time.', WYSIJA) . '<br/>'; $content .= __('If I want I can [link]create an additional cron job[/link] on my end to increase the sending frequency.', WYSIJA) . '<br/><span>' . __('Use this URL in your cron job: [cron_url]') . '</span>'; } return $content; }
/** * let's fix all the conflicts that we may have */ function resolveConflicts() { // check conflicting themes $possibleConflictiveThemes = $this->controller->get_conflictive_plugins(true); $conflictingTheme = null; $currentTheme = strtolower(function_exists('wp_get_theme') ? wp_get_theme() : get_current_theme()); foreach ($possibleConflictiveThemes as $keyTheme => $conflictTheme) { if ($keyTheme === $currentTheme) { $conflictingTheme = $keyTheme; } } // if the current theme is known to make troubles, let's resolve this if ($conflictingTheme !== null) { $helperConflicts = WYSIJA::get('conflicts', 'helper'); $helperConflicts->resolve(array($possibleConflictiveThemes[$conflictingTheme])); } // check conflicting plugins $possibleConflictivePlugins = $this->controller->get_conflictive_plugins(); $conflictingPlugins = array(); foreach ($possibleConflictivePlugins as $keyPlg => $conflictPlug) { if (WYSIJA::is_plugin_active($conflictPlug['file'])) { //plugin is activated $conflictingPlugins[$keyPlg] = $conflictPlug; } } if ($conflictingPlugins) { $helperConflicts = WYSIJA::get('conflicts', 'helper'); $helperConflicts->resolve($conflictingPlugins); } }
function is_caching_active() { $checkPlugins = array('wp-super-cache/wp-cache.php', 'w3-total-cache/w3-total-cache.php', 'quick-cache/quick-cache.php', 'hyper-cache/plugin.php'); foreach ($checkPlugins as $pluginFileName) { if (WYSIJA::is_plugin_active($pluginFileName)) { switch ($pluginFileName) { case 'wp-super-cache/wp-cache.php': global $cache_enabled, $super_cache_enabled; if (!(WP_CACHE && $cache_enabled && $super_cache_enabled)) { continue 2; } break; case 'w3-total-cache/w3-total-cache.php': $config =& w3_instance("W3_Config"); if (!(WP_CACHE && $config->get_boolean("pgcache.enabled"))) { continue 2; } break; case 'quick-cache/quick-cache.php': if (!(WP_CACHE && $GLOBALS["WS_PLUGIN__"]["qcache"]["o"]["enabled"])) { continue 2; } break; case 'hyper-cache/plugin.php': if (!WP_CACHE) { continue 2; } break; default: continue 2; } return true; } } return false; }
/** * install the premium package from wysija's remote server */ function install_wjp() { $premiumpluginname = 'wysija-newsletters-premium/index.php'; echo '<html><head></head><body style="font-family: sans-serif;font-size: 12px;line-height: 1.4em;">'; if (WYSIJA::is_plugin_active($premiumpluginname)) { echo '<p>' . __('Plugin is already installed and activated.', WYSIJA) . '</p>'; exit; } //test if plugin is installed but not activated $pluginslist = get_plugins(); if (isset($pluginslist[$premiumpluginname])) { //try to activate it simply error_reporting(E_ALL); ini_set('display_errors', '1'); activate_plugin($premiumpluginname); echo '<p>' . __('Your Premium features are now activated. Happy emailing!', WYSIJA) . '</p>'; } else { $helper_package = WYSIJA::get('package', 'helper'); $helper_package->install('wysija-newsletters-premium', true); } echo '</body></html>'; exit; }
function WYSIJA_help_front(){ parent::WYSIJA_help(); /*if(defined('WYSIJA_DBG_ALL')){ $config=WYSIJA::get('config','model'); define('WYSIJA_DBG',(int)$config->getValue('debug_new')); if(WYSIJA_DBG>0) include_once(WYSIJA_INC.'debug.php'); if(!function_exists('dbg')) { function dbg($mixed,$exit=true){} } }*/ /* the controller is frontend if there is any wysija data requested */ /*$config=WYSIJA::get("config","model"); if($config->getValue("debug_on")) include_once(WYSIJA_INC."debug.php");*/ //include_once(WYSIJA_INC."debug.php"); // wysija form shortcode add_shortcode('wysija_form', array($this,'scan_form_shortcode')); // wysija total of subscribers shortcode add_shortcode('wysija_subscribers_count', array($this,'scan_subscribers_count_shortcode')); /* We try to process the least possible code */ if(isset($_REQUEST['wysija-page']) || isset($_REQUEST['wysija-launch'])){ if(defined('DOING_AJAX')){ add_action('wp_ajax_nopriv_wysija_ajax', array($this, 'ajax')); }else{ $paramscontroller=$_REQUEST['controller']; //this is an exception on one server this params stats was not accepted if($paramscontroller=='stat') $paramscontroller='stats'; $this->controller=WYSIJA::get($paramscontroller,'controller'); if(isset($_REQUEST['action']) && method_exists($this->controller, $_REQUEST['action'])){ add_action('init',array($this->controller,$_REQUEST['action'])); //$this->controller->$_REQUEST['action'](); }else $this->error('Action does not exist.'); if(isset($_REQUEST['wysija-page'])){ /* set the content filter to replace the shortcode */ add_filter('wp_title', array($this,'meta_page_title')); add_filter( 'the_title', array($this,'scan_title')); add_filter( 'the_content', array($this,'scan_content'),98); if(isset($_REQUEST['message_success'])){ add_filter( 'the_content', array($this,'scan_content_NLform'),99 ); } } if(isset($_REQUEST['wysija-page'])){ /* set the content filter to replace the shortcode */ add_filter('wp_title', array($this,'meta_page_title')); add_filter( 'the_title', array($this,'scan_title')); add_filter( 'the_content', array($this,'scan_content'),98); if(isset($_REQUEST['message_success'])){ add_filter( 'the_content', array($this,'scan_content_NLform'),99 ); } } } }else{ add_filter('the_content', array($this,'scan_content_NLform'),99 ); //if the comment form checkbox option is activated we add some hooks to process it $mConfig=WYSIJA::get('config','model'); if($mConfig->getValue('commentform')){ add_action('comment_form', array($this,'comment_form_extend')); add_action('comment_post', array($this,'comment_posted'), 60,2); } //if the register form checkbox option is activated we add some hooks to process it if($mConfig->getValue('registerform')){ if(is_multisite()){ add_action('signup_extra_fields', array($this,'register_form_extend')); // we need this condition otherwise we will send two confirmation emails when on ms with buddypress if(!WYSIJA::is_plugin_active('buddypress/bp-loader.php')){ add_filter('wpmu_validate_user_signup', array($this,'registerms_posted'), 60,3); } }else{ add_action('register_form', array($this,'register_form_extend')); add_action('register_post', array($this,'register_posted'), 60,3); } if(WYSIJA::is_plugin_active('buddypress/bp-loader.php')){ add_action('bp_after_signup_profile_fields', array($this,'register_form_bp_extend')); add_action('bp_signup_validate', array($this,'register_bp'),60,3); // we can have just one activation for the wp user and the wysija confirmation when bp and multisite are activated if(is_multisite()){ add_action('wpmu_activate_user', array($this,'wpmu_activate_user')); } } } } }
function install_wjp() { $premiumpluginname = 'wysija-newsletters-premium/index.php'; echo '<html><head></head><body style="font-family: sans-serif;font-size: 12px;line-height: 1.4em;">'; if (WYSIJA::is_plugin_active($premiumpluginname)) { echo '<p>' . __('Plugin is already installed and activated.', WYSIJA) . '</p>'; exit; } //test if plugin is installed but not activated $pluginslist = get_plugins(); if (isset($pluginslist[$premiumpluginname])) { //try to activate it simply error_reporting(E_ALL); ini_set('display_errors', '1'); activate_plugin($premiumpluginname); echo '<p>' . __('Your Premium features are now activated. Happy emailing!', WYSIJA) . '</p>'; } else { //we need to download it include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; include_once WYSIJA_INC . 'wp-special' . DS . 'wp-upgrader-skin.php'; $upgrader = new Plugin_Upgrader(new WysijaPlugin_Upgrader_Skin(compact('title', 'url', 'nonce', 'plugin', 'api'))); $response = $upgrader->install('http://packager.wysija.com/download/zip?key=wysija-newsletters-premium'); } echo '</body></html>'; exit; }
function __construct() { parent::__construct(); // wysija form shortcode add_shortcode('wysija_form', array($this, 'scan_form_shortcode')); // wysija total of subscribers shortcode add_shortcode('wysija_subscribers_count', array($this, 'scan_subscribers_count_shortcode')); // init shortcode [wysija_archive] require_once WYSIJA_CORE . 'controller.php'; require_once WYSIJA_CORE . 'module' . DS . 'module.php'; // @todo: move to autoloader $archive_std = WYSIJA_module::get_instance_by_name('archive_std'); // implement hook "wysija_front_init() if (!empty($archive_std) && is_a($archive_std, 'WYSIJA_module')) { $archive_std->front_init(); } /* We try to process the least possible code */ if (isset($_REQUEST['wysija-page']) || isset($_REQUEST['wysija-launch'])) { if (defined('DOING_AJAX')) { add_action('wp_ajax_nopriv_wysija_ajax', array($this, 'ajax')); } else { $paramscontroller = $_REQUEST['controller']; //this is an exception on one server this params stats was not accepted if ($paramscontroller == 'stat') { $paramscontroller = 'stats'; } $this->controller = WYSIJA::get($paramscontroller, 'controller'); if (isset($_REQUEST['action']) && method_exists($this->controller, $_REQUEST['action'])) { add_action('init', array($this->controller, $_REQUEST['action'])); //$this->controller->$_REQUEST['action'](); } else { $this->error('Action does not exist.'); } if (isset($_REQUEST['wysija-page'])) { /* set the content filter to replace the shortcode */ add_filter('wp_title', array($this, 'meta_page_title')); add_filter('the_title', array($this, 'scan_title')); add_filter('the_content', array($this, 'scan_content'), 98); if (isset($_REQUEST['message_success'])) { add_filter('the_content', array($this, 'scan_content_NLform'), 99); } } } } else { add_filter('the_content', array($this, 'scan_content_NLform'), 99); //if the comment form checkbox option is activated we add some hooks to process it $model_config = WYSIJA::get('config', 'model'); if ($model_config->getValue('commentform')) { add_action('comment_form', array($this, 'comment_form_extend')); add_action('comment_post', array($this, 'comment_posted'), 60, 2); } // if the register form checkbox option is activated we add some hooks to process it if ($model_config->getValue('registerform')) { if (is_multisite()) { add_action('signup_extra_fields', array($this, 'register_form_extend')); // we need this condition otherwise we will send two confirmation emails when on ms with buddypress if (!WYSIJA::is_plugin_active('buddypress/bp-loader.php')) { add_filter('wpmu_validate_user_signup', array($this, 'registerms_posted'), 60, 3); } } else { add_action('register_form', array($this, 'register_form_extend')); add_action('register_post', array($this, 'register_posted'), 60, 3); } // special case when buddypress is activated if (WYSIJA::is_plugin_active('buddypress/bp-loader.php')) { add_action('bp_after_signup_profile_fields', array($this, 'register_form_bp_extend')); add_action('bp_signup_validate', array($this, 'register_bp'), 60, 3); // we can have just one confirmation email for the wp user and the wysija confirmation when bp and multisite are activated if (is_multisite()) { add_action('wpmu_activate_user', array($this, 'wpmu_activate_user')); } } } } }
/** * Displays the add ons page and lists * the plugins and services available. */ public function add_ons_page() { require_once WYSIJA_DIR . '/add-ons/add-ons-list.php'; echo '<div class="module-container">'; foreach (add_ons_list() as $plugin => $product) { $status = ''; // Status class. /** * Queries if the plugin is installed, * active and meets the requirements * it requires if any. */ if (file_exists($this->wp_plugin_path . plugin_basename($product['plugin_url']))) { $status .= ' installed'; } else { $status .= ' not-installed'; } if (WYSIJA::is_plugin_active($product['plugin_url'])) { $status .= ' active'; } else { $status .= ' inactive'; } if (empty($product['requires'])) { $status .= ' ready'; } elseif (!empty($product['requires']) && file_exists($this->wp_plugin_path . plugin_basename($product['requires']))) { $status .= ' ready'; if (WYSIJA::is_plugin_active($product['requires'])) { $status .= ' ready'; } else { $status .= ' not-ready'; } } elseif (!empty($product['requires']) && !file_exists($this->wp_plugin_path . plugin_basename($product['requires']))) { $status .= ' not-ready'; } if (WYSIJA::is_plugin_active('wysija-newsletters-premium/index.php')) { $status .= ' premium-active'; } echo '<div class="mailpoet-module' . esc_attr($status) . '" id="product">' . '<h3>' . esc_attr($product['name']) . '</h3>'; if (!empty($product['thumbnail'])) { echo '<div class="mailpoet-module-image"><img src="' . esc_url($this->image_url . $product['thumbnail']) . '" width="100%" title="' . esc_attr($product['name']) . '" alt=""></div>'; } echo '<div class="mailpoet-module-content">' . '<div class="mailpoet-module-description">' . '<p>' . wp_kses($product['description'], array()) . '</p>'; if (!empty($product['review'])) { echo '<p><strong>' . esc_attr__('MailPoet says: ', WYSIJA) . '<em>' . esc_attr($product['review']) . '</em>' . '</strong></p>'; } if (WYSIJA::is_plugin_active('wysija-newsletters-premium/index.php') && !empty($product['premium_offer'])) { echo '<p><strong>' . esc_attr($product['premium_offer']) . '</strong></p>'; } echo '</div>' . '</div>' . '<div class="mailpoet-module-actions">'; if (!empty($product['author_url'])) { echo '<a href="' . esc_url($product['author_url']) . '" target="_blank" rel="external" class="button-primary website">' . esc_attr__('Website', WYSIJA) . '</a> '; } if ($product['free'] == false && !empty($product['purchase_url'])) { if (!empty($product['plugin_url']) && !file_exists($this->wp_plugin_path . plugin_basename($product['plugin_url']))) { echo '<a href="' . esc_url($product['purchase_url']) . '" target="_blank" rel="external" class="button-primary purchase">' . esc_attr__('Purchase', WYSIJA) . '</a> '; } // end if plugin is installed, don't show purchase button. } // end if product is not free. if ($product['service'] == false) { if ($product['on_wordpress.org'] == true) { if (!file_exists($this->wp_plugin_path . plugin_basename($product['plugin_url']))) { echo '<a href="' . esc_url(admin_url('plugin-install.php?tab=search&type=term&s=' . strtolower(str_replace(' ', '+', $product['search'])))) . '" class="button-primary install">' . esc_attr__('Install from WordPress.org', WYSIJA) . '</a> '; } } // end if $product['on_wordpress.org']; if (!empty($product['plugin_url']) && file_exists($this->wp_plugin_path . plugin_basename($product['plugin_url']))) { if (!WYSIJA::is_plugin_active($product['plugin_url'])) { if (!empty($product['requires'])) { $requires = '&requires=' . $product['requires'] . '&requires_name=' . $product['requires_name']; } else { $requires = ''; } echo '<a href="' . esc_url(admin_url('admin.php?page=wysija_config&action=activate&module=' . $product['plugin_url'] . $requires)) . '" class="button-primary activate">' . esc_attr__('Activate', WYSIJA) . '</a> '; } else { if (!empty($product['config_url'])) { echo '<a href="' . esc_url($product['config_url']) . '" class="mailpoet-configure-button button-secondary">' . esc_attr__('Configure', WYSIJA) . '</a>'; } } } } echo '</div>' . '</div>'; } // end if local is yes. echo '<div class="submit-idea">' . '<p>' . wp_kses(sprintf(__('Don\'t see the add-on you\'re looking for? <a href="%s">Submit it</a> in our contact form.', WYSIJA), 'http://www.mailpoet.com/contact/" target="blank'), array('a' => array('href' => array()))) . '</p>' . '</div>' . '</div>'; }
function fieldFormHTML_commentform($key, $value, $model, $paramsex) { /*second part concerning the checkbox*/ $formsHelp =& WYSIJA::get('forms', 'helper'); $checked = false; if ($this->model->getValue($key)) { $checked = true; } $checkboxDetails = array('id' => $key, 'name' => 'wysija[' . $model . '][' . $key . ']', 'class' => 'activateInput'); $contentAfter = ''; //if it's the commentform field and jetpacks is activated with its comment module then we disable the box if ($key == 'commentform' && WYSIJA::is_plugin_active('jetpack/jetpack.php') && in_array('comments', Jetpack::get_active_modules())) { $checkboxDetails['disabled'] = 'disabled'; $contentAfter = '<p>' . __('This feature cannot work because the "Comments" feature of the plugin JetPack is enabled.', WYSIJA) . '</p>'; } //if it's the register form field and registration is not allowed on the site then we just disable it $active_signup = false; if (is_multisite()) { $active_signup = get_site_option('registration'); if (!$active_signup) { $active_signup = 'all'; } $active_signup = apply_filters('wpmu_active_signup', $active_signup); if (in_array($active_signup, array('none', 'blog'))) { $active_signup = false; } else { $active_signup = true; } } else { $active_signup = get_option('users_can_register'); } if ($key == 'registerform' && !$active_signup) { $checkboxDetails['disabled'] = 'disabled'; $contentAfter = '<p>' . __('Registration is disabled on this site.', WYSIJA) . '</p>'; } $fieldHTML = '<p style="float:left;"><label for="' . $key . '">'; $fieldHTML .= $formsHelp->checkbox($checkboxDetails, 1, $checked); $fieldHTML .= '</label>'; $value = $this->model->getValue($key . '_linkname'); $fieldHTML .= '<div id="' . $key . '_linkname' . '" class="linknamecboxes">'; if ($contentAfter) { $fieldHTML .= '</div>'; $fieldHTML .= $contentAfter; } else { $fieldHTML .= $formsHelp->input(array('name' => 'wysija[' . $model . '][' . $key . '_linkname]', 'size' => '75'), $value) . '</p>'; $modelList =& WYSIJA::get('list', 'model'); $lists = $modelList->get(array('name', 'list_id'), array('is_enabled' => 1)); $valuefield = $this->model->getValue($key . '_lists'); if (!$valuefield) { $valuefield = array(); } foreach ($lists as $list) { if (in_array($list['list_id'], $valuefield)) { $checked = true; } else { $checked = false; } $fieldHTML .= '<p class="labelcheck"><label for="list-' . $list['list_id'] . '">' . $formsHelp->checkbox(array('id' => 'list-' . $list['list_id'], 'name' => 'wysija[config][' . $key . '_lists][]', 'class' => 'validate[minCheckbox[1]]'), $list['list_id'], $checked) . $list['name'] . '</label></p>'; } $fieldHTML .= '</div>'; } return $fieldHTML; }