Sohowiki Sandbox

From Sohowiki
(Difference between revisions)
Jump to: navigation, search
(hook_attach())
(hook_attach())
Line 1: Line 1:
 
Write now, organize and place later. This is the place to draft content before you know exactly where it should go...also good place for expermimenting with wiki markup.
 
Write now, organize and place later. This is the place to draft content before you know exactly where it should go...also good place for expermimenting with wiki markup.
  
==hook_attach()==
+
==hook_attach==
Include your custom script at a designated place in the Pro Edition source code.
+
hook_attach(plugin file, hook id)
  
Example hook from sohoadmin/program/header.php
+
Includes (attaches) your custom script (plugin file) at a pre-designated place (hook id) in the Pro Edition source code.
 +
 
 +
'''Example 1 - hook from sohoadmin/program/header.php'''
 
<pre>eval(hook("header.php:top_javascript", basename(__FILE__)));</pre>
 
<pre>eval(hook("header.php:top_javascript", basename(__FILE__)));</pre>
  
Example hook attachement call taken from from install_manifest.php for QuickEdit Dropdown Menu plugin...
+
'''Example 2 - hook attachement call in install_manifest.php (taken from QuickEdit Dropdown Menu plugin)...'''
 
<pre>hook_attach("quickedit_js.php", "header.php:top_javascript");</pre>
 
<pre>hook_attach("quickedit_js.php", "header.php:top_javascript");</pre>
 +
 +
==hook_overwrite==
 +
hook_overwrite(source filename, plugin file)
 +
 +
Example 1 - calling hook_overwrite from your install_manifest.php
 +
<pre>hook_overwrite("sohoadmin/program/main_menu.php", "main_menu-helloworld.php");</pre>

Revision as of 15:15, 18 May 2006

Write now, organize and place later. This is the place to draft content before you know exactly where it should go...also good place for expermimenting with wiki markup.

hook_attach

hook_attach(plugin file, hook id)

Includes (attaches) your custom script (plugin file) at a pre-designated place (hook id) in the Pro Edition source code.

Example 1 - hook from sohoadmin/program/header.php

eval(hook("header.php:top_javascript", basename(__FILE__)));

Example 2 - hook attachement call in install_manifest.php (taken from QuickEdit Dropdown Menu plugin)...

hook_attach("quickedit_js.php", "header.php:top_javascript");

hook_overwrite

hook_overwrite(source filename, plugin file)

Example 1 - calling hook_overwrite from your install_manifest.php

hook_overwrite("sohoadmin/program/main_menu.php", "main_menu-helloworld.php");
Personal tools