/** * Include scripts from request * * For each tool to add, just pass a GET parameter like: * - "tool_name=true" * - "tool_dir=tool_name" * - "tool_family[]=tool_name" * * @param string $type * @param array $request * @return string */ function treat_request($type, array $request = null) { $str = ''; if (!empty($request)) { foreach ($request as $tool => $i) { if (!empty($i) && is_array($i)) { foreach ($i as $_file) { $str .= prepare_library_include($type, $tool, $_file); } } elseif (!empty($i)) { $str .= prepare_library_include($type, $tool, $i); } else { $str .= prepare_library_include($type, $tool); } } } return $str; }
function include(fileName) { "use strict"; document.write("<script type='text/javascript' src='/<?php echo _ASSETSLIB_JS_HTTP; ?> "+fileName+"'><\/"+"script>" ); if (typeof window._dbg === 'function') { _dbg("Inclusion of file ["+fileName+"]"); } } // from http://javascript.about.com/library/bladdjs.htm function addJavascript(filepath, _tag) { var tag = _tag || 'head'; var th = document.getElementsByTagName(tag)[0]; var s = document.createElement('script'); s.setAttribute('type','text/javascript'); s.setAttribute('src',filepath); th.appendChild(s); } // Settings : global javascript options of pages var settings; if (settings===undefined) settings = []; <?php // Inclusion of debugger echo prepare_library_include('js', 'debug'); ?> // Endfile
@error_reporting(E_ALL ^ E_NOTICE); require_once __DIR__ . '/../../assets-library.php'; css_header(); ?> /* -------------------------------- Global Default CSS Styles -------------------------------- */ <?php // reset echo library_include('css', 'commons', 'reset'); ?> /* body global styles */ body { background-color: #fff; margin: 40px; font-size: 82%; font-family: "Lucida Grande", Verdana, Sans-serif; color: #4F5155; direction: <?php echo _CSS_DIRECTION; ?> ; } <?php // typography echo prepare_library_include('css', 'commons', 'typography'); // form echo prepare_library_include('css', 'commons', 'form'); // utilities echo prepare_library_include('css', 'commons', 'utilities');