예제 #1
0
 /**
  * Constructs new Wpml_Xliff_Export instance.
  */
 public function __construct()
 {
     $this->main_language = Wpml2mlp_Helper::get_main_language();
     $this->translation_builder = new Wpml2mlp_Translations_Builder($this->main_language);
     $this->language_holder = new Wpml2mlp_Language_Holder();
     $this->xliff_creator = new Wpml2mlp_Xliff_Creator();
     $this->xliff_creator->setup();
 }
예제 #2
0
 /**
  * Constructor
  *
  * @param wpdb $wpdb
  */
 public function __construct(wpdb $wpdb = NULL)
 {
     if (NULL === $wpdb) {
         return;
     }
     $this->wpdb = $wpdb;
     $link_table = $wpdb->base_prefix . 'multilingual_linked';
     $site_relations = new Mlp_Site_Relations($wpdb, 'mlp_site_relations');
     $content_relations = new Mlp_Content_Relations($this->wpdb, $site_relations, $link_table);
     $this->site_creator = new Wpml2mlp_Site_Creator($this->wpdb);
     $this->post_creator = new Wpml2mlp_Post_Creator($this->wpdb, $content_relations);
     $this->categorie_creator = new Wpml2mlp_Categorie_Creator($this->wpdb, $content_relations);
     $this->main_language = Wpml2mlp_Helper::get_main_language();
     $this->translation_builder = new Wpml2mlp_Translations_Builder($this->main_language);
     $this->language_holder = new Wpml2mlp_Language_Holder();
     $this->xliff_extractor = new Wpml2mlp_Xliff_Extractor();
     self::$show_success_msg = FALSE;
     self::$xliff_message = FALSE;
 }
예제 #3
0
 /**
  * Gets the main post id from multisite language post.
  *
  * @param $post
  *
  * @return int
  *
  */
 public static function get_default_post_ID($post)
 {
     $main_language = Wpml2mlp_Helper::get_main_language();
     return (int) icl_object_id($post->ID, $post->post_type, TRUE, $main_language);
 }