private function maybe_add_missing_setting()
 {
     if ($this->settings->display_notices_setting_is_missing()) {
         $this->settings->create_display_notices_setting();
     }
 }
type="radio" name="icl_theme_localization_type" value="1" <?php 
if ($sitepress_settings['theme_localization_type'] == 1) {
    ?>
checked="checked"<?php 
}
?>
 />&nbsp;<?php 
_e("Translate the theme and plugins using WPML's String Translation", 'sitepress');
?>
			    </label>
			    <?php 
if (isset($icl_st_note)) {
    echo '<br><small><i>' . $icl_st_note . '</i></small>';
}
if ($sitepress_settings['theme_localization_type'] == 1) {
    $themes_and_plugins_settings = new WPML_ST_Themes_And_Plugins_Settings();
    $display_strings_scan_notices_checked = checked(true, $themes_and_plugins_settings->must_display_notices(), false);
    ?>
				    <blockquote>
					    <input type="checkbox" id="wpml_st_display_strings_scan_notices" name="wpml_st_display_strings_scan_notices" value="1" <?php 
    echo $display_strings_scan_notices_checked;
    ?>
>
					    <label for="wpml_st_display_strings_scan_notices"><?php 
    _e('Show an alert when activating plugins and themes, to scan for new strings', 'wpml-string-translation');
    ?>
</label>
				    </blockquote>
				    <?php 
}
?>
 public function remove_notice($id)
 {
     $this->admin_notices->remove_notice($this->settings->get_notices_group(), $id);
 }
Exemplo n.º 4
0
     $iclsettings['sync_post_taxonomies'] = @intval($_POST['icl_sync_post_taxonomies']);
     $iclsettings['sync_post_date'] = @intval($_POST['icl_sync_post_date']);
     $iclsettings['sync_comments_on_duplicates'] = @intval($_POST['icl_sync_comments_on_duplicates']);
     $this->save_settings($iclsettings);
     echo 1;
     break;
 case 'language_domains':
     $language_domains_helper = new WPML_Lang_Domains_Box($this);
     echo $language_domains_helper->render();
     break;
 case 'icl_theme_localization_type':
     $display_strings_scan_notices = false;
     if (array_key_exists('wpml_st_display_strings_scan_notices', $_POST)) {
         $display_strings_scan_notices = (bool) $_POST['wpml_st_display_strings_scan_notices'];
     }
     $themes_and_plugins_settings = new WPML_ST_Themes_And_Plugins_Settings();
     $themes_and_plugins_settings->set_strings_scan_notices($display_strings_scan_notices);
     $icl_tl_type = @intval($_POST['icl_theme_localization_type']);
     $iclsettings['theme_localization_type'] = $icl_tl_type;
     $iclsettings['theme_localization_load_textdomain'] = @intval($_POST['icl_theme_localization_load_td']);
     $filtered_textdomain_value = filter_input(INPUT_POST, 'textdomain_value', FILTER_SANITIZE_FULL_SPECIAL_CHARS, FILTER_NULL_ON_FAILURE);
     $iclsettings['gettext_theme_domain_name'] = $filtered_textdomain_value;
     if ($icl_tl_type == 1) {
         do_action('wpml_scan_theme_for_strings', true);
     } elseif ($icl_tl_type == 2) {
         $parent_theme = get_template_directory();
         $child_theme = get_stylesheet_directory();
         $languages_folders = array();
         if ($found_folder = icl_tf_determine_mo_folder($parent_theme)) {
             $languages_folders['parent'] = $found_folder;
         }