- Timestamp:
- 03/04/2010 02:12:58 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WordPress/plugin/transposh/wp/transposh_postpublish.php
r346 r386 16 16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 17 * 18 */18 */ 19 19 20 20 /* 21 21 * Provides the side widget in the page/edit pages which will do translations 22 */22 */ 23 23 24 24 /** … … 40 40 if ($this->transposh->options->get_enable_auto_post_translate()) { 41 41 add_action('edit_post',array(&$this, 'on_edit')); 42 // add_action('publish_post',array(&$this, 'on_publish'));42 // add_action('publish_post',array(&$this, 'on_publish')); 43 43 add_action('admin_menu', array(&$this, 'on_admin_menu')); 44 44 } … … 55 55 if ($_GET['justedited']) { 56 56 wp_enqueue_script("google","http://www.google.com/jsapi",array(),'1',true); 57 wp_enqueue_script("transposh","{$this->transposh->transposh_plugin_url}/js/transposhadmin.js?post_url={$this->transposh->post_url}&post={$_GET['post']}",array("jquery"),TRANSPOSH_PLUGIN_VER,true); 57 wp_enqueue_script("transposh","{$this->transposh->transposh_plugin_url}/js/transposhadmin.js",array("jquery"),TRANSPOSH_PLUGIN_VER,true); 58 wp_localize_script("transposh","t_jp",array( 59 'post_url' => $this->transposh->post_url, 60 'post' => $_GET['post'], 61 'msnkey'=>$this->transposh->options->get_msn_key(), 62 'msn_langs' => json_encode($GLOBALS['bing_languages']), 63 'google_lang' => json_encode($GLOBALS['google_languages']), 64 'preferred'=> $this->transposh->options->get_preferred_translator()/*, 65 'plugin_url' => $this->transposh_plugin_url, 66 'edit' => ($this->edit_mode? '1' : ''), 67 //'rtl' => (in_array ($this->target_language, $GLOBALS['rtl_languages'])? 'true' : ''), 68 'lang' => $this->target_language, 69 // those two options show if the script can support said engines 70 'prefix' => SPAN_PREFIX, 71 72 'progress'=>$this->edit_mode || $this->options->get_widget_progressbar() ? '1' : '')*/ 73 // 'l10n_print_after' => 'try{convertEntities(inlineEditL10n);}catch(e){};' 74 )); 58 75 wp_enqueue_style("jquery","http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/ui-lightness/jquery-ui.css",array(),'1.0'); 59 76 wp_enqueue_script("jqueryui","http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js",array("jquery"),'1.7.2',true); 77 /* if ($this->transposh->options->get_enable_msn_translate() && $this->transposh->options->get_msn_key()) { 78 wp_enqueue_script("mstranslate","http://api.microsofttranslator.com/V1/Ajax.svc/Embed?appId=".$this->transposh->options->get_msn_key(),array(),'1',true); 79 }*/ 60 80 } 61 81 } … … 75 95 // TODO - grab phrases from rss excerpt 76 96 //$output = get_the_excerpt(); 77 // echo apply_filters('the_excerpt_rss', $output); 78 97 // echo apply_filters('the_excerpt_rss', $output); 98 //TODO - get comments text 99 79 100 $parser = new parser(); 80 101 $phrases = $parser->get_phrases_list($content); … … 106 127 } 107 128 129 // add the title 130 // if ($json['length']) 131 $json['posttitle'] = $title; 132 108 133 // the header helps with debugging 109 134 header("Content-type: text/javascript");
Note: See TracChangeset
for help on using the changeset viewer.
