瀏覽代碼

compose_button_row hook updated to new plugin/templating scheme. Please learn from this and fix plugins instead of reverting other code

pdontthink 19 年之前
父節點
當前提交
98859870d4
共有 2 個文件被更改,包括 4 次插入3 次删除
  1. 2 2
      plugins/squirrelspell/setup.php
  2. 2 1
      plugins/squirrelspell/sqspell_functions.php

+ 2 - 2
plugins/squirrelspell/setup.php

@@ -22,7 +22,7 @@
  */
  */
 function squirrelmail_plugin_init_squirrelspell() {
 function squirrelmail_plugin_init_squirrelspell() {
   global $squirrelmail_plugin_hooks;
   global $squirrelmail_plugin_hooks;
-  $squirrelmail_plugin_hooks['compose_button_row']['squirrelspell'] =
+  $squirrelmail_plugin_hooks['template_construct_compose_buttons.tpl']['squirrelspell'] = 
       'squirrelspell_setup';
       'squirrelspell_setup';
   $squirrelmail_plugin_hooks['optpage_register_block']['squirrelspell'] =
   $squirrelmail_plugin_hooks['optpage_register_block']['squirrelspell'] =
       'squirrelspell_optpage_register_block';
       'squirrelspell_optpage_register_block';
@@ -54,7 +54,7 @@ function squirrelspell_optpage_register_block() {
  */
  */
 function squirrelspell_setup() {
 function squirrelspell_setup() {
   include_once(SM_PATH . 'plugins/squirrelspell/sqspell_functions.php');
   include_once(SM_PATH . 'plugins/squirrelspell/sqspell_functions.php');
-  squirrelspell_setup_function();
+  return squirrelspell_setup_function();
 }
 }
 
 
 /**
 /**

+ 2 - 1
plugins/squirrelspell/sqspell_functions.php

@@ -62,7 +62,7 @@ function squirrelspell_setup_function() {
      * use document.write() so the "Check Spelling" button is not
      * use document.write() so the "Check Spelling" button is not
      * displayed if js is off in the browser.
      * displayed if js is off in the browser.
      */
      */
-    echo "<script type=\"text/javascript\">\n".
+    $output = "<script type=\"text/javascript\">\n".
       "<!--\n".
       "<!--\n".
       'document.write("<input type=\"button\" value=\"'.
       'document.write("<input type=\"button\" value=\"'.
       _("Check Spelling").
       _("Check Spelling").
@@ -71,6 +71,7 @@ function squirrelspell_setup_function() {
       'resizable=yes\')\" />");' . "\n".
       'resizable=yes\')\" />");' . "\n".
       "//-->\n".
       "//-->\n".
       "</script>\n";
       "</script>\n";
+    return array('compose_button_row' => $output);
   }
   }
 }
 }