Example #1
0
 /**
  * Get content for sidebar editor
  * 
  * @global object $my_transposh_plugin
  * @since  1.0
  * @param  array $args
  * @return array 
  */
 protected function _get_content($args = array())
 {
     global $my_transposh_plugin;
     $langs = array();
     /**
      * isset($my_transposh_plugin->options->viewable_languages)
      * returns false because transposh dev has not implemented __isset
      * using get_option instead for robustness
      */
     if (defined('TRANSPOSH_OPTIONS') && method_exists('transposh_consts', 'get_language_orig_name')) {
         $options = get_option(TRANSPOSH_OPTIONS);
         if (isset($options['viewable_languages'])) {
             foreach (explode(',', $options['viewable_languages']) as $lng) {
                 $langs[$lng] = transposh_consts::get_language_orig_name($lng);
             }
         }
     }
     if (isset($args['include'])) {
         $langs = array_intersect_key($langs, array_flip($args['include']));
     }
     return $langs;
 }
Example #2
0
 function comment_row_actions($actions, $comment)
 {
     $comment_lang = get_comment_meta($comment->comment_ID, 'tp_language', true);
     if (!$comment_lang) {
         $text = __('Unset', TRANSPOSH_TEXT_DOMAIN);
     } else {
         $text = transposh_consts::get_language_name($comment_lang) . " - " . transposh_consts::get_language_orig_name($comment_lang);
     }
     $actions['language'] = __('Language', TRANSPOSH_TEXT_DOMAIN) . "(<a data-cid=\"{$comment->comment_ID}\" data-lang=\"{$comment_lang}\" href=\"\" onclick=\"return false\">{$text}</a>)";
     return $actions;
 }