Extension:AddScriptCss

<?php /*

Purpose
Inserts & (i.e. CSS) scripts at the bottom of the page's head or within the page's body. Securily insert arbitrary code to the page's head using.

Features

 * Security: local files (URI) only
 * Files must be located in wiki installation home directory/scripts
 * Security:
 * Only 'edit' restricted pages can access 'addtohead' functionality.
 * Use global variable '$bwScriptsDirectory' to customize scripts directory
 * Use global variable '$bwScriptsDirectory' to customize scripts directory

Examples

 * (R1) e.g. 
 * (R2) e.g.


 * R1) Results in  being added to the page's body section provided the said file exists.


 * R2) The CSS file  will be added to the page's HEAD section (provided it exists).

Syntax
Form 1: 

Form 2:

If no 'type' field is present, then the extension assumes 'js'.

If no 'pos' field is present, then the extension assumes 'body'

USAGE NOTES
When using 'pos=body', it is recommended to use the extension 'ParserCacheControl' in order to better integrate this extension with the standard MW parser cache.

Dependency

 * Depends on Extension:StubManager

History

 * Adjusted for new ExtensionClass version (no automatic registering of hooks of ExtensionClass)
 * Adjusted singleton invocation to end of file (PHP limitation)
 * Imported required functionality from ExtensionClass
 * Imported 'addtohead' tag functionality from SecureHTML extension
 * Removed dependency on ExtensionClass
 * Added support for a global setting '$bwScriptsDirectory'

Installation
To install independantly from BizzWiki:
 * Download & Install Extension:StubManager extension
 * Dowload all this extension's files and place in the desired directory
 * Apply the following changes to 'LocalSettings.php' after the statements of Extension:StubManager:

TODO

 * - internationalize