Browse Source

Overlooked 2.0 backward compatibility while reverting the commit last time, well now it's fixed again...I hope

Signed-off-by: emanuele <[email protected]>
emanuele 11 years ago
parent
commit
3fd625e288
3 changed files with 8 additions and 3 deletions
  1. 4 1
      Sources/Display.php
  2. 2 1
      Sources/MessageIndex.php
  3. 2 1
      Sources/Subs-Editor.php

+ 4 - 1
Sources/Display.php

@@ -1164,7 +1164,10 @@ function Display()
 		$context['mod_buttons'][] = array('text' => 'restore_topic', 'image' => '', 'lang' => true, 'url' => $scripturl . '?action=restoretopic;topics=' . $context['current_topic'] . ';' . $context['session_var'] . '=' . $context['session_id']);
 
 	// Allow adding new mod buttons easily.
-	call_integration_hook('integrate_display_buttons');
+	// Note: $context['normal_buttons'] and $context['mod_buttons'] are added for backward compatibility with 2.0, but are deprecated and should not be used
+	call_integration_hook('integrate_display_buttons', array(&$context['normal_buttons']));
+	// Note: integrate_mod_buttons is no more necessary and deprecated, but is kept for backward compatibility with 2.0
+	call_integration_hook('integrate_mod_buttons', array(&$context['mod_buttons']));
 }
 
 /**

+ 2 - 1
Sources/MessageIndex.php

@@ -661,7 +661,8 @@ function MessageIndex()
 	);
 
 	// Allow adding new buttons easily.
-	call_integration_hook('integrate_messageindex_buttons');
+	// Note: $context['normal_buttons'] is added for backward compatibility with 2.0, but is deprecated and should not be used
+	call_integration_hook('integrate_messageindex_buttons', array(&$context['normal_buttons']));
 }
 
 /**

+ 2 - 1
Sources/Subs-Editor.php

@@ -1656,7 +1656,8 @@ function create_control_richedit($editorOptions)
 		);
 
 		// Allow mods to modify BBC buttons.
-		call_integration_hook('integrate_bbc_buttons');
+		// Note: pass the array here is not necessary and is deprecated, but it is ketp for backward compatibility with 2.0
+		call_integration_hook('integrate_bbc_buttons', array(&$context['bbc_tags']));
 
 		// Show the toggle?
 		if (empty($modSettings['disable_wysiwyg']))