<?php
/**
 *
 * @category        snippets
 * @package         globalBlocks
 * @author          Ruud Eisinga
 * @license         http://www.gnu.org/licenses/gpl.html
 * @platform        WebsiteBaker 2.7.x
 * @version         1.0
 * @lastmodified    Date: 2012-03-07
 *
 */
/* -------------------------------------------------------- */

-----------------------------------------------------------------------------------------
 March 7, 2012
 Code snippet GlobalBlocks v0.1 for WebsiteBaker v2.7.x and up
 Licencsed under GNU/GPL, written by Ruud Eisinga (Ruud)
-----------------------------------------------------------------------------------------

Installation:
Install the zipfile as a normal module through the WB backend.

Using the snippet:

Full functioncall:  globalBlock($sectionId, $include_frontend_css = true, $buffer = false, $only_on_pages = null);

The $sectionId parameter is (mandatory) the ID of the section to be included.

The $include_frontend_css forces to add an existing frontend.css used by the (module) included section.

The $buffer parameter tells the function to output directly of return the content as a variable.

The $only_on_pages parameter accepts a single PAGE_ID or an array of PAGE_ID's or a comma seperated string of PAGE_ID's.
If the parameter is provided, the content will only be included if the current PAGE_ID is found in this parameter.

Examples:

1. Include section 123 on all pages with direct output and frontend.ccs/.js included):
	<?php globalBlock(123); ?>
	
2. Include section 123 on all pages with buffered output and no frontend.ccs/.js included):
	<?php $buffer = globalBlock(123, false, true); ?>
	
3. Include section 123 only on pages 1,4 5 and 8 with buffered output and frontend.ccs/.js included):
	<?php $buffer = globalBlock(123, true, true, array(1,4,5,8) ); ?>
	or
	<?php $buffer = globalBlock(123, true, true, "1,4,5,8" ); ?>
	
4. Include section 123 on all pages except PAGE_ID=1 with direct output and frontend.ccs/.js included):
	<?php if(!PAGE_ID == 1) { globalBlock(123, true, true); } ?>

