function my_default_head_section() { global $page; echo '<!DOCTYPE HTML> <html' . mso_get_val('head_section_html_add') . '><head>' . mso_hook('head_start') . ' <meta charset="UTF-8"> <title>' . mso_head_meta('title') . '</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="MaxSite CMS"> <meta name="description" content="' . mso_head_meta('description') . '"> <meta name="keywords" content="' . mso_head_meta('keywords') . '"> <meta property="og:title" content="' . mso_head_meta('title') . '"> <meta property="og:description" content="' . mso_head_meta('description') . '"> <meta property="og:url" content="' . mso_link_rel('canonical', '', true) . '"> <link rel="shortcut icon" href="' . getinfo('template_url') . 'assets/images/favicons/' . mso_get_option('default_favicon', 'templates', 'favicon1.png') . '" type="image/x-icon"> '; if (is_type('page') and isset($page['page_meta']['image_for_page'][0])) { echo '<meta property="og:image" content="' . $page['page_meta']['image_for_page'][0] . '">'; } if (mso_get_option('default_canonical', 'templates', 0)) { echo mso_link_rel('canonical'); } echo mso_rss(); if ($fn = mso_fe('custom/head-start.php')) { require $fn; } // autoload файлов if ($autoload_css = mso_get_path_files(getinfo('template_dir') . 'assets/css/', getinfo('template_url') . 'assets/css/', true, array('css'))) { foreach ($autoload_css as $fn_css) { echo '<link rel="stylesheet" href="' . $fn_css . '">' . NR; } } my_out_component_css(); mso_hook('head_css'); my_default_out_profiles(); // своя версия jQuery, если нужно if ($j = mso_get_val('jquery_url', false)) { echo '<script src="' . $j . '"></script>' . NR; } else { if (mso_fe('assets/js/jquery.min.js')) { echo mso_add_file('assets/js/jquery.min.js'); } else { echo mso_load_jquery(); } } mso_hook('head'); // autoload js-файлов if ($autoload_js = mso_get_path_files(getinfo('template_dir') . 'assets/js/autoload/', getinfo('template_url') . 'assets/js/autoload/', true, array('js'))) { foreach ($autoload_js as $fn_js) { echo '<script src="' . $fn_js . '"></script>' . NR; } } if ($fn = mso_fe('custom/head.php')) { require $fn; } if ($fn = mso_page_foreach('head')) { require $fn; } if (function_exists('ushka')) { echo ushka('head'); } if (mso_fe('assets/js/my.js')) { echo mso_add_file('assets/js/my.js'); } if ($my_style = mso_get_option('my_style', 'templates', '')) { echo NR . '<!-- custom css-my_style -->' . NR . '<style>' . NR . $my_style . '</style>'; } mso_hook('head_end'); if (function_exists('ushka')) { echo ushka('google_analytics_top'); } echo NR . '</head>'; }
function mso_default_head_section($options = array()) { // ob_start(); # задел на будущее - буферизация // <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=8"><![endif]--> echo '<!DOCTYPE HTML> <html><head>' . mso_hook('head-start') . ' <meta charset="UTF-8"> <title>' . mso_head_meta('title') . '</title> <meta name="generator" content="MaxSite CMS"> <meta name="description" content="' . mso_head_meta('description') . '"> <meta name="keywords" content="' . mso_head_meta('keywords') . '"> <link rel="shortcut icon" href="' . getinfo('template_url') . 'images/favicons/' . mso_get_option('default_favicon', 'templates', 'favicon1.png') . '" type="image/x-icon"> '; if (mso_get_option('default_canonical', 'templates', 0)) { echo mso_link_rel('canonical'); } echo NT . '<!-- RSS -->' . NT . mso_rss(); if (file_exists(getinfo('template_dir') . 'custom/head-start.php')) { require getinfo('template_dir') . 'custom/head-start.php'; } echo NT . '<!-- CSS -->' . NT . '<link rel="stylesheet" href="'; if (file_exists(getinfo('template_dir') . 'css/css.php')) { echo getinfo('template_url') . 'css/css.php'; } else { if (file_exists(getinfo('template_dir') . 'css/my_style.css')) { echo getinfo('template_url') . 'css/my_style.css'; } else { if (file_exists(getinfo('template_dir') . 'css/style-all-mini.css')) { echo getinfo('template_url') . 'css/style-all-mini.css'; } elseif (file_exists(getinfo('template_dir') . 'css/style-all.css')) { echo getinfo('template_url') . 'css/style-all.css'; } else { echo getinfo('templates_url') . 'default/css/style-all-mini.css'; } } } echo '">'; // подключение var_style.css // если есть var_style.php, то используем только его if (file_exists(getinfo('template_dir') . 'css/var_style.php')) { require getinfo('template_dir') . 'css/var_style.php'; } else { $var_file = ''; if (file_exists(getinfo('template_dir') . 'css/var_style.css')) { $var_file = getinfo('template') . '/css/var_style.css'; } elseif (file_exists(getinfo('templates_dir') . 'default/css/var_style.css')) { $var_file = 'default/css/var_style.css'; } // если var_style.css нулевой длины, то не подключаем его if (filesize(getinfo('templates_dir') . $var_file)) { echo NT . '<link rel="stylesheet" href="' . getinfo('templates_url') . $var_file . '">'; } } echo NT . '<link rel="stylesheet" href="' . getinfo('template_url') . 'css/print.css" media="print">'; out_component_css(); echo NT . mso_load_jquery(); echo NT . '<!-- plugins -->' . NR; mso_hook('head'); echo NT . '<!-- /plugins -->' . NR; mso_add_file('css/add_style.css'); default_out_profiles(); if (file_exists(getinfo('template_dir') . 'custom/head.php')) { require getinfo('template_dir') . 'custom/head.php'; } if ($f = mso_page_foreach('head')) { require $f; } if (function_exists('ushka')) { echo ushka('head'); } if (file_exists(getinfo('template_dir') . 'js/my.js')) { echo ' <script src="' . getinfo('template_url') . 'js/my.js"></script>'; } if ($my_style = mso_get_option('my_style', 'templates', '')) { echo NR . '<!-- custom css-my_style -->' . NR . '<style>' . NR . $my_style . '</style>'; } mso_hook('head-end'); if (function_exists('ushka')) { echo ushka('google_analytics_top'); } /* # буферизация на будущее $head = ob_get_contents(); ob_end_clean(); echo $head; */ echo NR . '</head>'; if (!$_POST) { flush(); } }