<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title><?php echo $adminTitle; ?> </title> <link rel="stylesheet" type="text/css" media="screen" href="/css/reset-fonts-grids.css" /> <link rel="stylesheet" type="text/css" media="screen" href="/css/styleforms.css" /> <link rel="stylesheet" type="text/css" media="screen" href="/css/style_admin.css" /> <?php foreach (Mtpl::getJS() as $js) { echo '<script type="text/javascript" src="' . $jsdir . $js . '.js"></script>'; } ?> <script type="text/javascript"> <?php if (is_array($javascript)) { foreach ($javascript as $inst) { echo $inst . "\n"; } } // ===================================================== // = Javascript for dialog window and any ajax request = // ===================================================== ?> $(function() {
public function getJSblock($root = array()) { if (!is_array($root)) { $root = array($root); } $root[] = '/js'; $out = ''; $groups = Mtpl::getJSgroups(); if (count($groups) > 0) { $assetsversion = (int) file_get_contents(APP_ROOT . 'app/ASSETSVERSION'); foreach (Mtpl::getJSgroups() as $group) { $jsfile = '/cache/' . $group . $assetsversion . '.js'; $out .= ' <script type="text/javascript" src="' . $jsfile . '"></script>'; } } foreach (Mtpl::getJS() as $js) { if (preg_match('`^https*`', $js)) { $jsfile = $js; } else { $jsfile = self::first_in_assets($root, $js . '.js'); } if (!$jsfile) { throw new Exception('non exist ' . $js); } $out .= ' <script type="text/javascript" src="' . $jsfile . '"></script>'; } return $out; }