Use compatibility_info() function if at all possible instead of compatibility_version()
[squirrelmail.git] / plugins / translate / setup.php
index 072a19b8ae702f8076410ee5668d018b2e109a64..60ca8e1559b26551b13802cb0c72c6ad38b5c766 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * setup.php
  *
@@ -7,21 +8,13 @@
  *
  * Translation of composed messages is not supported.
  *
- * Copyright (c) 1999-2004 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
- *
+ * @copyright &copy; 1999-2007 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
  * @subpackage translate
  */
 
-/**
- * If SM_PATH isn't defined, define it.
- * @ignore
- */
-if (!defined('SM_PATH'))  {
-    define('SM_PATH','../../');
-}
 
 /**
  * Initialize the translation plugin
@@ -34,11 +27,13 @@ function squirrelmail_plugin_init_translate() {
   $squirrelmail_plugin_hooks['read_body_bottom']['translate'] = 'translate_read_form';
   $squirrelmail_plugin_hooks['optpage_register_block']['translate'] = 'translate_optpage_register_block';
   $squirrelmail_plugin_hooks['loading_prefs']['translate'] = 'translate_pref';
-//  $squirrelmail_plugin_hooks['compose_button_row']['translate'] = 'translate_button';
+  $squirrelmail_plugin_hooks['options_save']['translate'] = 'translate_save';
+  $squirrelmail_plugin_hooks['optpage_set_loadinfo']['translate'] = 'translate_set_loadinfo';
+  //  $squirrelmail_plugin_hooks['compose_button_row']['translate'] = 'translate_button';
 }
 
-/** 
- * Shows translation box in message display window 
+/**
+ * Shows translation box in message display window
  * @access private
  */
 function translate_read_form() {
@@ -74,4 +69,21 @@ function translate_pref() {
     include_once(SM_PATH . 'plugins/translate/functions.php');
     translate_pref_function();
 }
-?>
\ No newline at end of file
+
+/**
+ * Calls user's translation preferences saving function
+ * @access private
+ */
+function translate_save() {
+    include_once(SM_PATH . 'plugins/translate/functions.php');
+    translate_save_function();
+}
+
+/**
+ * Calls user's translation preferences set_loadinfo function
+ * @access private
+ */
+function translate_set_loadinfo() {
+    include_once(SM_PATH . 'plugins/translate/functions.php');
+    translate_set_loadinfo_function();
+}