Ejemplo n.º 1
0
 /**
  * constructor
  *
  * @since 1.9
  *
  * @param object $polylang polylang object
  */
 public function __construct(&$polylang)
 {
     parent::__construct($polylang, array('module' => 'share-slugs', 'title' => __('Share slugs', 'polylang'), 'description' => __('Allows to share the same url slug accross languages for posts and terms.', 'polylang')));
     if (class_exists('PLL_Share_Post_Slug', true) && get_option('permalink_structure')) {
         add_action('admin_print_footer_scripts', array(&$this, 'print_js'));
     }
 }
Ejemplo n.º 2
0
 /**
  * constructor
  *
  * @since 1.9
  *
  * @param object $polylang polylang object
  */
 public function __construct(&$polylang)
 {
     parent::__construct($polylang, array('module' => 'licenses', 'title' => __('License keys', 'polylang'), 'description' => __('Manage licenses for Polylang Pro or addons.', 'polylang')));
     $this->buttons['cancel'] = sprintf('<button type="button" class="button button-secondary cancel">%s</button>', __('Close'));
     $this->items = apply_filters('pll_settings_licenses', array());
     add_action('wp_ajax_pll_deactivate_license', array(&$this, 'deactivate_license'));
 }
Ejemplo n.º 3
0
 public function __construct(&$polylang)
 {
     parent::__construct($polylang, array('module' => 'cpt', 'title' => __('Custom post types and Taxonomies', 'polylang'), 'description' => __('Activate the languages and translations management for the custom post types and taxonomies.', 'polylang')));
     // FIXME should be OK when the modules will be loaded from the settings page
     $post_types = get_post_types(array('public' => true, '_builtin' => false));
     $post_types = array_diff($post_types, get_post_types(array('_pll' => true)));
     $this->post_types = array_unique(apply_filters('pll_get_post_types', $post_types, true));
     $taxonomies = get_taxonomies(array('public' => true, '_builtin' => false));
     $taxonomies = array_diff($taxonomies, get_taxonomies(array('_pll' => true)));
     $this->taxonomies = array_unique(apply_filters('pll_get_taxonomies', $taxonomies, true));
 }
Ejemplo n.º 4
0
    public function print_js()
    {
        wp_enqueue_script('jquery');
        if (parent::is_active() && 3 > $this->options['force_lang']) {
            $func = 'removeClass( "inactive" ).addClass( "active" )';
            $link = sprintf('<span class="deactivate">%s</span>', $this->action_links['deactivate']);
        } else {
            $func = 'removeClass( "active" ).addClass( "inactive" )';
            $link = sprintf('<span class="activate">%s</span>', $this->action_links['activate']);
        }
        $deactivated = sprintf('<span class="deactivated">%s</span>', $this->action_links['deactivated']);
        ?>
		<script type='text/javascript'>
			//<![CDATA[
			( function( $ ){
				$( "input[name='force_lang']" ).change( function() {
					var value = $( this ).val();
					if ( 3 > value ) {
						$( "#pll-module-browser" ).<?php 
        echo $func;
        ?>
.children( "td" ).children( ".row-actions" ).html( '<?php 
        echo $link;
        ?>
' );
					}
					else {
						$( "#pll-module-browser" ).removeClass( "active" ).addClass( "inactive" ).children( "td" ).children( ".row-actions" ).html( '<?php 
        echo $deactivated;
        ?>
' );
					}
				} );
			} )( jQuery );
			// ]]>
		</script><?php 
    }
Ejemplo n.º 5
0
 public function __construct(&$polylang)
 {
     parent::__construct($polylang, array('module' => 'url', 'title' => __('URL modifications', 'polylang'), 'description' => __('Decide how your URLs will look like.', 'polylang'), 'configure' => true));
     $this->links_model =& $polylang->links_model;
     $this->page_on_front =& $polylang->static_pages->page_on_front;
 }
Ejemplo n.º 6
0
 public function __construct(&$polylang)
 {
     parent::__construct($polylang, array('module' => 'tools', 'title' => __('Tools', 'polylang'), 'description' => __('Decide whether to remove all data when deleting Polylang.', 'polylang')));
 }
Ejemplo n.º 7
0
 public function __construct(&$polylang)
 {
     parent::__construct($polylang, array('module' => 'wpml', 'title' => __('WPML Compatibility', 'polylang'), 'description' => __('WPML compatibility mode of Polylang', 'polylang')));
 }
 /**
  * constructor
  *
  * @since 1.9
  *
  * @param object $polylang polylang object
  */
 public function __construct(&$polylang)
 {
     parent::__construct($polylang, array('module' => 'translate-slugs', 'title' => __('Translate slugs', 'polylang'), 'description' => __('Allows to translate custom post types and taxonomies slugs in urls.', 'polylang')));
 }
Ejemplo n.º 9
0
 public function __construct(&$polylang)
 {
     parent::__construct($polylang, array('module' => 'sync', 'title' => __('Synchronization', 'polylang'), 'description' => __('The synchronization options allow to maintain exact same values (or translations in the case of taxonomies and page parent) of meta content between the translations of a post or page.', 'polylang')));
 }
Ejemplo n.º 10
0
 public function __construct(&$polylang)
 {
     parent::__construct($polylang, array('module' => 'media', 'title' => __('Media'), 'description' => __('Activate languages and translations for media', 'polylang'), 'active_option' => 'media_support'));
 }