Beispiel #1
0
 public function add_profile_column_data($column_name, $post_id)
 {
     if ($column_name == 'profile') {
         $document = $this->lgtm->get_group('post', $post_id);
         if (isset($document->source)) {
             $post_id = $document->source;
         }
         $profiles = Lingotek::get_profiles();
         $content_profiles = get_option('lingotek_content_type');
         $post_profile = Lingotek_Post_actions::get_post_profile($post_id);
         $post_language = $this->pllm->get_post_language($post_id);
         $post_type = 'post';
         if (isset($_REQUEST['post_type'])) {
             $post_type = $_REQUEST['post_type'];
         }
         if ($post_profile) {
             echo $profiles[$post_profile->description]['name'] . sprintf('<a title="%s">%s</a>', __('Not set to the content default profile', 'wp-lingotek'), '*');
         } else {
             if ($post_language && isset($content_profiles[$post_type]['sources'][$post_language->slug])) {
                 $profile = $content_profiles[$post_type]['sources'][$post_language->slug];
                 echo $profiles[$profile]['name'];
             } else {
                 if (!empty($content_profiles)) {
                     echo $profiles[$content_profiles[$post_type]['profile']]['name'];
                 } else {
                     if ($post_type == 'post') {
                         _e('Automatic', 'wp-lingotek');
                     } else {
                         if ($post_type == 'page') {
                             _e('Manual', 'wp-lingotek');
                         }
                     }
                 }
             }
         }
     }
 }