Hook special
From Sohowiki
(Difference between revisions)
(→Available special hooks) |
|||
(105 intermediate revisions by 7 users not shown) | |||
Line 5: | Line 5: | ||
;Description | ;Description | ||
: Utilizes special hook built-in to make it easier for your plugin to tie into a certain commonly-utilized areas of the product (like adding a button for your plugin to the main menu). | : Utilizes special hook built-in to make it easier for your plugin to tie into a certain commonly-utilized areas of the product (like adding a button for your plugin to the main menu). | ||
− | |||
− | |||
==Available special hooks== | ==Available special hooks== | ||
===page_editor_object=== | ===page_editor_object=== | ||
− | < | + | Used to add a draggable icon object for your plugin to the Page Editor. |
+ | |||
+ | Note: This only a part of what is involved in adding your plugin to the Page Editor. For more detailed information see [[Plugging-in to the Page Editor]]. | ||
+ | |||
+ | <pre>$data = array(); | ||
$data['draggable_object_image'] = "eng-icon_scroll.gif"; | $data['draggable_object_image'] = "eng-icon_scroll.gif"; | ||
$data['draggable_object_id'] = "scroll_obj"; | $data['draggable_object_id'] = "scroll_obj"; | ||
$data['properties_dialog_id'] = "scrollProps"; | $data['properties_dialog_id'] = "scrollProps"; | ||
$data['mod_folder'] = $plugin_folder; | $data['mod_folder'] = $plugin_folder; | ||
− | $data['properties_dialog_file'] = $plugin_folder | + | $data['properties_dialog_file'] = $plugin_folder."/scroll_props.php"; |
− | $data['place_object_js_function'] = $plugin_folder | + | $data['place_object_js_function'] = $plugin_folder."/scroll_js.php"; |
− | hook_special("page_editor_object", $data);</ | + | hook_special("page_editor_object", $data);</pre> |
+ | |||
+ | |||
+ | ===Add button to the main menu=== | ||
+ | <pre>$data = array(); | ||
+ | $data['enabled_button_image'] = "plugin_icon-supersearch.gif"; | ||
+ | $data['disabled_button_image'] = "plugin_icon-supersearch.gif"; | ||
+ | $data['enabled_button_link'] = "display_settings.php"; | ||
+ | $data['button_caption_text'] = "Super Search"; | ||
+ | hook_special("main_menu_button", $data);</pre> | ||
+ | |||
+ | |||
+ | [[Category:Plugins]] |
Latest revision as of 11:20, 31 March 2009
Contents |
Overview
- Syntax
- hook_special(target special hook, data array)
- Description
- Utilizes special hook built-in to make it easier for your plugin to tie into a certain commonly-utilized areas of the product (like adding a button for your plugin to the main menu).
Available special hooks
page_editor_object
Used to add a draggable icon object for your plugin to the Page Editor.
Note: This only a part of what is involved in adding your plugin to the Page Editor. For more detailed information see Plugging-in to the Page Editor.
$data = array(); $data['draggable_object_image'] = "eng-icon_scroll.gif"; $data['draggable_object_id'] = "scroll_obj"; $data['properties_dialog_id'] = "scrollProps"; $data['mod_folder'] = $plugin_folder; $data['properties_dialog_file'] = $plugin_folder."/scroll_props.php"; $data['place_object_js_function'] = $plugin_folder."/scroll_js.php"; hook_special("page_editor_object", $data);
$data = array(); $data['enabled_button_image'] = "plugin_icon-supersearch.gif"; $data['disabled_button_image'] = "plugin_icon-supersearch.gif"; $data['enabled_button_link'] = "display_settings.php"; $data['button_caption_text'] = "Super Search"; hook_special("main_menu_button", $data);