';
$GLOBALS['block']['custom_htmlhead']['slimbox.js'] = getJavaScriptSourceLink(TEMPLATE_PATH.'lib/slimbox/slimbox.mootools-1.2.js');
}
/**
* Initialize Frontend Edit DomReady JavaScript
*/
function init_frontend_edit_js() {
initJSLib();
$GLOBALS['block']['js_ondomready'][] = ' var felink_status = 0;
$$("a.fe-link").each(function(r) { r.setStyle("display", "none"); });
$("fe-link").addEvent("click", function() {
if(felink_status == 1) {
$$("a.fe-link").each(function(r) { r.setStyle("display", "none"); });
$("fe-link").removeClass("enabled"); $("fe-link").addClass("disabled"); felink_status = 0;
} else {
$$("a.fe-link").each(function(r) { r.setStyle("display", ""); });
$("fe-link").removeClass("disabled"); $("fe-link").addClass("enabled"); felink_status = 1;
}
});';
}
/**
* Create JavaScript Domready Section
*/
function jsOnDomReady($js='', $return=false, $prefix=' ') {
if($js) {
initJSLib();
$_js = $prefix . '';
if($return) {
return $_js;
}
$GLOBALS['block']['custom_htmlhead'][] = $_js;
}
}
/**
* Create JavaScript UnLoad Section
*/
function jsOnUnLoad($js='', $return=false, $prefix=' ') {
if($js) {
initJSLib();
$_js = $prefix . '';
if($return) {
return $_js;
}
$GLOBALS['block']['custom_htmlhead'][] = $_js;
}
}
/**
* Simple MooTools Plugin Loader
*/
function initJSPlugin($plugin='', $more=false) {
// enhance teplate JS parser for MooTools More
// sample:
if(is_string($plugin) && $more === false && substr(strtoupper($plugin), 0, 5) == 'MORE:') {
$plugin = trim(substr($plugin, 5));
$more = true;
}
if($more === false) {
$plugin = 'mootools.'.$plugin.'.js';
if(empty($GLOBALS['block']['custom_htmlhead'][$plugin])) {
initJSLib();
$GLOBALS['block']['custom_htmlhead'][$plugin] = getJavaScriptSourceLink(TEMPLATE_PATH.'lib/mootools/plugin-1.2/'.$plugin);
}
} else {
// Load MooTools More Plugins - simple Wrapper 'Fx/Fx.Slide,Fx/Fx.Scroll...'
// it does not check dependends
if(!is_array($plugin)) {
$plugin = convertStringToArray($plugin);
}
if(count($plugin)) {
initJSLib();
// add mootools more core
array_unshift($plugin, 'Core/More');
foreach($plugin as $more) {
if(empty($GLOBALS['block']['custom_htmlhead'][$more]) && is_file(PHPWCMS_TEMPLATE.'lib/mootools/more/'.$more.'.js')) {
$GLOBALS['block']['custom_htmlhead'][$more] = getJavaScriptSourceLink(TEMPLATE_PATH.'lib/mootools/more/'.$more.'.js');
}
}
}
}
return TRUE;
}
?>