PHP-связи: 
			> if ($fn = mso_fe('components/logo-ns-descr-random-text/logo-ns-descr-random-text.php')) require($fn);
*/
$pt = new Page_out();
// подготавливаем объект для вывода
// если в опции явно указан адрес лого, то берем его
$logo = trim(mso_get_option('default_header_logo_custom', 'templates', false));
if (!$logo) {
    $logo = getinfo('stylesheet_url') . 'images/logos/' . mso_get_option('default_header_logo', 'templates', 'logo01.png');
}
$logo = '<img src="' . $logo . '" alt="' . getinfo('name_site') . '" title="' . getinfo('name_site') . '">';
if (!is_type('home')) {
    $logo = $pt->link(getinfo('siteurl'), $logo);
}
// вывод
$pt->div_start('logo-ns-descr-random-text', 'wrap');
$pt->div_start('r1');
$pt->html($logo);
$pt->div_end('r1');
$pt->div_start('r2');
$pt->div($pt->name_site(), 'name_site');
$pt->div(getinfo('description_site'), 'description_site');
$pt->div_end('r2');
$pt->div_start('r3');
if ($fn = mso_fe('components/_random-text/_random-text.php')) {
    require $fn;
}
$pt->div_end('r3');
$pt->clearfix();
$pt->div_end('logo-ns-descr-random-text', 'wrap');
# end file
Esempio n. 2
0
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
if (function_exists('ushka')) {
    echo ushka('main-start');
}
if ($fn = mso_fe('custom/main-start.php')) {
    require $fn;
}
# end of file
Esempio n. 3
0
            // здесь комментарии
            if ($f = mso_page_foreach('page-comments-start')) {
                require $f;
            }
            if (mso_get_option('comment_other_system', 'general', false)) {
                // внешнее комментирование
                if ($fn = mso_find_ts_file('type/page/units/page-comments-other-system.php')) {
                    require $fn;
                }
                // + стандартное комментирование
                if (mso_get_option('comment_other_system_standart', 'general', false)) {
                    if ($fn = mso_find_ts_file('type/page/units/page-comments.php')) {
                        require $fn;
                    }
                }
            } elseif (mso_hook_present('page-comment-unit-file') and $fn = mso_fe(mso_hook('page-comment-unit-file'), '')) {
                require $fn;
            } elseif ($fn = mso_find_ts_file('type/page/units/page-comments.php')) {
                require $fn;
            }
            if ($f = mso_page_foreach('page-comments-end')) {
                require $f;
            }
        }
        // end foreach
    }
    // else page_content_only
} else {
    if ($f = mso_page_foreach('pages-not-found')) {
        require $f;
        // подключаем кастомный вывод
Esempio n. 4
0
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
/**
 * MaxSite CMS
 * (c) http://max-3000.com/
 *
 * файл functions.php подключается при инициализации сайта
 *
 */
# данные для админки
if (is_type('admin')) {
    # регистрируем сайдбар
    mso_register_sidebar('1', tf('Первый сайдбар'));
    # функции для админки
    if ($fn = mso_fe('custom/template-admin.php')) {
        require_once $fn;
    }
} else {
    # набор из mso_set_val
    if ($fn = mso_fe('custom/set_val.php')) {
        require_once $fn;
    }
    # дополнительный файл template.php
    if ($fn = mso_fe('custom/template.php')) {
        require_once $fn;
    }
}
# end file
Esempio n. 5
0
/**
*  Система событий
*  
*  @param $event — событие
*  @param $ARGS — массив аргументов
*  
*  Событие — это файл, функция или компонент
*  
*  $EVENT['событие'] = array(
*  		'file' => 'файл'
*  	or
*  		'function' => 'функция'
*  	or
*  		'component' => 'компонент'
*   or
*  		'val' => 'ключ для mso_get_val()'
*   or
*  		'text' => 'любой текст'
*  
*  		'options' => array(опции, если есть)
*  );
*  
*  Sample:
*  
*  In variables.php 
*  		$VAR['event'] = SET_DIR . 'event.php';
*  
*  In text.php
* 		mso_event('layout/top')
*  		mso_event('next-prev')
*  		mso_event('pagination', array(другие опции))
*  
*  In SET_DIR/event.php
*  		$EVENT['layout/top'] = array('file' => SET_DIR . 'layout/top.php');
*  		$EVENT['next-prev'] = array('file' => SET_DIR . 'next-prev.php');
*		$EVENT['pagination'] = array('component' => 'jpaginate', 'options' => array(опции));
*/
function mso_event($event, $args = array())
{
    global $VAR;
    static $ecache = array();
    // кеш для файлов $VAR['event']
    if (!$VAR['event']) {
        return;
    }
    // не задан файл event
    // проверим статичный кеш
    if (isset($ecache[$VAR['event']])) {
        $EVENT = $ecache[$VAR['event']];
    } else {
        if (!file_exists($VAR['event'])) {
            return;
        }
        // нет файла
        require $VAR['event'];
        // подключили файл
        if (isset($EVENT)) {
            // в нём должен быть массив $EVENT
            $ecache[$VAR['event']] = $EVENT;
        } else {
            return;
        }
    }
    // теперь всегда есть $EVENT
    if (isset($EVENT[$event])) {
        // аргументы могут быть заданы как при вызове mso_event, так и в $EVENT
        // приоритет в mso_event
        $OPTIONS = $args;
        if (isset($EVENT[$event]['options'])) {
            // могут быть опции в $EVENT
            $OPTIONS = $EVENT[$event]['options'];
        }
        if (isset($EVENT[$event]['file'])) {
            // в файле будет доступна переменная $OPTIONS
            if ($fn = mso_fe($EVENT[$event]['file'])) {
                require $fn;
            }
        } elseif (isset($EVENT[$event]['function'])) {
            $fu = $EVENT[$event]['function'];
            if (function_exists($fu)) {
                return $fu($OPTIONS);
            }
        } elseif (isset($EVENT[$event]['component'])) {
            mso_component($EVENT[$event]['component'], $OPTIONS);
        } elseif (isset($EVENT[$event]['val'])) {
            return mso_get_val($EVENT[$event]['val']);
        } elseif (isset($EVENT[$event]['text'])) {
            return $EVENT[$event]['text'];
        }
    }
}
Esempio n. 6
0
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
/*
    (c) MaxSite CMS, http://max-3000.com/
*/
// условие вывода компонента
// php-условие как в виджетах
if ($rules = trim(mso_get_option('file1_rules_output', getinfo('template'), ''))) {
    $rules_result = eval('return ( ' . $rules . ' ) ? 1 : 0;');
    if ($rules_result === false) {
        $rules_result = 1;
    }
    if ($rules_result !== 1) {
        return;
    }
}
if ($fn = mso_fe(mso_get_option('file1_file', getinfo('template'), ''))) {
    if (mso_get_option('file1_use_tmpl', getinfo('template'), '')) {
        eval(mso_tmpl($fn));
    } else {
        require $fn;
    }
}
# end of file
Esempio n. 7
0
File: top1.php Progetto: LeonisX/cms
<div class="logo-block flex flex-vcenter pad20">
	<div class="w100-max"><?php 
echo $logo;
?>
</div>
	<div class=""><?php 
eval(mso_tmpl_prepare(mso_get_option('top1_block', getinfo('template'), '')));
?>
</div>
</div>

<div class="menu-search flex flex-vcenter mar20-rl bg-gray800 flex-wrap-tablet">
	
	<div class="w100-tablet"><?php 
if ($fn = mso_fe('components/_menu/_menu.php')) {
    require $fn;
}
?>
</div>
	
	<div class="">
		<form name="f_search" class="f_search" method="get">
			<input class="my-search my-search--hidden" type="search" name="s" id="sss" placeholder="<?php 
echo tf('Поиск...');
?>
"><label class="label-search i-search icon-square bg-gray700 t-gray200 cursor-pointer" for="sss"></label>
		</form>
		<script> var searchForm = $(".f_search"); var searchInput = $(".my-search"); var searchLabel = $(".label-search"); searchForm.submit(function (e) { e.preventDefault(); window.location.href = "<?php 
echo getinfo('siteurl');
?>
Esempio n. 8
0
/**
*  разные подключения в HEAD секции
*  
*  @return echo
*/
function mso_head()
{
    global $VAR;
    $baseurl = BASE_URL;
    $current_page_url = CURRENT_PAGE_URL;
    if ($VAR['remove_protocol']) {
        $baseurl = mso_remove_protocol($baseurl);
        $current_page_url = mso_remove_protocol($current_page_url);
    }
    if ($VAR['nofavicon'] === false) {
        if (mso_fe(BASE_DIR . $VAR['nd_images'] . '/favicon.png')) {
            echo NR . '<link rel="shortcut icon" href="' . $baseurl . $VAR['nd_images'] . '/favicon.png" type="image/x-icon">';
        }
    }
    // autoload css-файлов из BASE_DIR
    if ($VAR['nocss'] === false) {
        echo mso_autoload($VAR['nd_css'], true, false, '/');
    }
    if ($VAR['nojs'] === false) {
        echo mso_autoload($VAR['nd_js'], true, false);
    }
    // autoload js-файлов из BASE_DIR
    if ($VAR['autoload_css_page'] === true) {
        // разрешена автозагрузка из текущей page
        echo mso_autoload('css', false, true, '/');
    }
    if ($VAR['autoload_js_page'] === true) {
        // разрешена автозагрузка из текущей page
        echo mso_autoload('js', false, true);
    }
    // autoload js-файлов из CURRENT_PAGE_DIR
}
Esempio n. 9
0
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
// if ($fn = mso_fe('custom/sidebars.php')) require($fn);
if (function_exists('ushka')) {
    echo ushka('main-end');
}
if ($fn = mso_fe('custom/main-end.php')) {
    require $fn;
}
# end of file
Esempio n. 10
0
function mso_lessc($less_file = '', $css_file = '', $css_url = '', $use_cache = false, $use_mini = true, $use_mini_n = false)
{
    if (is_array($less_file)) {
        $options = $less_file;
        // для красоты кода и чтобы не путаться
        $less_file = isset($options['less_file']) ? $options['less_file'] : '';
        $css_file = isset($options['css_file']) ? $options['css_file'] : '';
        $css_url = isset($options['css_url']) ? $options['css_url'] : '';
        $use_cache = isset($options['use_cache']) ? $options['use_cache'] : false;
        $use_mini = isset($options['use_mini']) ? $options['use_mini'] : true;
        $use_mini_n = isset($options['use_mini_n']) ? $options['use_mini_n'] : false;
    }
    if (!$less_file or !$css_file) {
        return;
    }
    // не указаны файлы
    if ($use_cache) {
        if (file_exists($less_file) and file_exists($css_file)) {
            $flag_compiling = false;
            // флаг == true — требуется компиляция
            $t_css = filemtime($css_file);
            // время css-файла
            // смотрим все файлы каталога
            $CI =& get_instance();
            // подключение CodeIgniter
            $CI->load->helper('file_helper');
            // хелпер для работы с файлами
            $all_files_in_dirs = get_filenames(dirname($less_file), true);
            foreach ($all_files_in_dirs as $file) {
                if (substr(strrchr($file, '.'), 1) !== 'less') {
                    continue;
                }
                // проверка расширения файла
                if (filemtime($file) > $t_css) {
                    $flag_compiling = true;
                    // нужна компиляция
                    break;
                }
            }
            if (!$flag_compiling) {
                if ($css_url) {
                    // в виде имени файла
                    return NT . '<link rel="stylesheet" href="' . $css_url . '">';
                } else {
                    // в виде содержимого
                    return file_get_contents($css_file);
                }
            }
        }
    }
    if (file_exists($less_file)) {
        $fc_all = file_get_contents($less_file);
    } else {
        return;
    }
    // нет файла, выходим
    // проверка на разрешение записывать css-файл
    if (file_exists($css_file) and !is_writable($css_file)) {
        // и что делать???
        return tf('LESS: результирующий css-файл не имеет разрешений на запись.');
        // die(tf('Нет возможности выполнить less-компиляцию: ') . $css_file);
    }
    if ($fc_all) {
        require_once getinfo('plugins_dir') . 'less_compiling/less/lessc.inc.php';
        $compiler = new lessc();
        // возможно есть php-файл для своих функций
        // строится как исходный + .php
        // пример http://leafo.net/lessphp/docs/#custom_functions
        if (file_exists($less_file . '.php')) {
            require_once $less_file . '.php';
        }
        // это общие custom_functions
        // их набор зависит от версии LESSPHP
        if ($fn = mso_fe(getinfo('plugins_dir') . 'less_compiling/less/custom_functions.php')) {
            require $fn;
        }
        $compiler->addImportDir(dirname($less_file));
        // новый 0.3.7 api
        $compiler->indentChar = "\t";
        // для совметимости со старым вариантом — удалить в январе 2014!!!
        $fc_all = str_replace('@MSO_IMPORT_ALL_FONTS;', '@MSO_IMPORT_ALL(fonts);', $fc_all);
        $fc_all = str_replace('@MSO_IMPORT_ALL_MIXINS;', '@MSO_IMPORT_ALL(mixins);', $fc_all);
        $fc_all = str_replace('@MSO_IMPORT_ALL_BLOCKS;', '@MSO_IMPORT_ALL(blocks);', $fc_all);
        $fc_all = str_replace('@MSO_IMPORT_ALL_HELPERS;', '@MSO_IMPORT_ALL(helpers);', $fc_all);
        $fc_all = str_replace('@MSO_IMPORT_ALL_COMPONENTS;', '@MSO_IMPORT_ALL(components);', $fc_all);
        $fc_all = str_replace('@MSO_IMPORT_ALL_PLUGINS;', '@MSO_IMPORT_ALL(plugins);', $fc_all);
        $fc_all = str_replace('@MSO_IMPORT_ALL_TYPE;', '@MSO_IMPORT_ALL(type);', $fc_all);
        // универсальная конструкция: @MSO_IMPORT_ALL(каталог);
        $fc_all = preg_replace_callback('!(@MSO_IMPORT_ALL\\()(.*?)(\\);)!is', '_mso_less_import_all_callback', $fc_all);
        // в тексте исходного файла $fc_all может быть php-код
        ob_start();
        eval('?>' . $fc_all . '<?php ');
        $fc_all = ob_get_contents();
        ob_end_clean();
        try {
            $out = $compiler->compile($fc_all);
            // новый 0.3.7 api
        } catch (Exception $ex) {
            $out = _mso_less_exception($ex->getMessage(), $fc_all);
            die($out);
            // рубим, ибо нефиг писать с ошибками
        }
        // сжатие кода
        if ($use_mini) {
            if ($use_mini_n) {
                $out = str_replace("\t", ' ', $out);
                $out = str_replace(array("\r\n", "\r", "\n", '  ', '    '), '', $out);
            }
            $out = str_replace("\n\t", '', $out);
            $out = str_replace("\n}", '}', $out);
            $out = str_replace('; ', ';', $out);
            $out = str_replace(';}', '}', $out);
            $out = str_replace(': ', ':', $out);
            $out = str_replace('{ ', '{', $out);
            $out = str_replace(' }', '}', $out);
            $out = str_replace(' {', '{', $out);
            $out = str_replace(', ', ',', $out);
            $out = str_replace(' > ', '>', $out);
            $out = str_replace('} ', '}', $out);
            $out = str_replace('  ', ' ', $out);
        }
        $fp = fopen($css_file, "w");
        fwrite($fp, $out);
        fclose($fp);
        if ($css_url) {
            return NT . '<link rel="stylesheet" href="' . $css_url . '">';
            // в виде имени файла
        } else {
            // в виде содержимого
            return $out;
        }
    }
}
		Название  Меню | Меню      логин
		
	CSS-стили: 
		var_style.less:
			>	@import url('components/ns-menu-login.less');
		
	PHP-связи: 
			>	if ($fn = mso_fe('components/ns-menu-login/ns-menu-login.php')) require($fn);
*/
$pt = new Page_out();
// подготавливаем объект для вывода
$name_site = mso_get_option('ns-menu-login-name_site', 'templates', getinfo('name_site'));
if (!is_type('home')) {
    $name_site = $pt->link(getinfo('siteurl'), $name_site);
}
// вывод
$pt->div_start('ns-menu-login', 'wrap');
$pt->div($name_site, 'r1');
$pt->div_start('r2');
if ($fn = mso_fe('components/_menu/_menu.php')) {
    require $fn;
}
$pt->div_end('r2');
$pt->div_start('r3');
if ($fn = mso_fe('components/_login/_login.php')) {
    require $fn;
}
$pt->div_end('r3');
$pt->clearfix();
$pt->div_end('ns-menu-login', 'wrap');
# end file
Esempio n. 12
0
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
/**
 * MaxSite CMS
 * (c) http://max-3000.com/
 */
# файл functions.php подключается при инициализации сайта
# в этом файле нельзя выводить данные в браузер!
# Для своих функций используйте custom/my_functions.php
# регистрируем сайдбары - имя, заголовок.
# если имя совпадает, то берется последний заголовок
mso_register_sidebar('1', tf('Первый сайдбар'));
# основные функции шаблона
require_once getinfo('shared_dir') . 'functions/template.php';
# набор из mso_set_val
require_once getinfo('shared_dir') . 'functions/set_val.php';
# библиотека для вывода записей в цикле и вывод колонок
require_once getinfo('shared_dir') . 'stock/page-out/page-out.php';
# библиотека для работы с изображениями
require_once getinfo('shared_dir') . 'stock/thumb/thumb.php';
# дополнительный файл my_functions.php
if ($fn = mso_fe('custom/my_functions.php')) {
    require_once $fn;
}
# end file
Esempio n. 13
0
    echo ushka('footer-start');
}
if ($fn = mso_fe('custom/footer-start.php')) {
    require $fn;
}
if ($fn = mso_fe('custom/footer_components.php')) {
    require $fn;
} else {
    if ($fn = my_get_component_fn('footer_component1', 'footer-copy-stat')) {
        require $fn;
    }
    if ($fn = my_get_component_fn('footer_component2')) {
        require $fn;
    }
    if ($fn = my_get_component_fn('footer_component3')) {
        require $fn;
    }
    if ($fn = my_get_component_fn('footer_component4')) {
        require $fn;
    }
    if ($fn = my_get_component_fn('footer_component5')) {
        require $fn;
    }
}
if (function_exists('ushka')) {
    echo ushka('footer-end');
}
if ($fn = mso_fe('custom/footer-end.php')) {
    require $fn;
}
# end of file
Esempio n. 14
0
    echo ushka('header-start');
}
if ($fn = mso_fe('custom/header-start.php')) {
    require $fn;
}
if ($fn = mso_fe('custom/header_components.php')) {
    require $fn;
} else {
    if ($fn = my_get_component_fn('header_component1', 'top1')) {
        require $fn;
    }
    if ($fn = my_get_component_fn('header_component2')) {
        require $fn;
    }
    if ($fn = my_get_component_fn('header_component3')) {
        require $fn;
    }
    if ($fn = my_get_component_fn('header_component4')) {
        require $fn;
    }
    if ($fn = my_get_component_fn('header_component5')) {
        require $fn;
    }
}
if (function_exists('ushka')) {
    echo ushka('header-end');
}
if ($fn = mso_fe('custom/header-end.php')) {
    require $fn;
}
# end of file
Esempio n. 15
0
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
if ($fn = mso_fe('custom/body-end.php')) {
    require $fn;
}
if (function_exists('ushka')) {
    echo ushka('google_analytics');
    echo ushka('body_end');
}
mso_hook('body_end');
// lazy-загрузка js-файлов
if ($lazy_js = mso_get_path_files(getinfo('template_dir') . 'assets/js/lazy/', getinfo('template_url') . 'assets/js/lazy/', true, array('js'))) {
    foreach ($lazy_js as $fn_js) {
        echo '<script src="' . $fn_js . '"></script>' . NR;
    }
}
# end of file
Esempio n. 16
0
        }
    }
}
$fn_main = mso_get_val('main_file', '');
if ($fn_main and file_exists($fn_main)) {
    $MAIN_FILE = $fn_main;
} else {
    // main.php может находиться в каталоге main/ или в основном каталоге шаблона
    if ($fn = mso_fe('main/main.php')) {
        $fn_main = $fn;
    } else {
        $fn_main = getinfo('template_dir') . 'main.php';
    }
    // может быть задан main-файл по-умолчанию в опции main_template_default
    if ($page_template = mso_get_option('main_template_default', 'templates', '')) {
        if ($fn = mso_fe('main/' . $page_template . '/main.php')) {
            $fn_main = $fn;
            // выставляем путь к файлу
        }
    }
    $MAIN_FILE = $fn_main;
}
// css-класс для main
$main_name = str_replace(getinfo('template_dir'), '', $MAIN_FILE);
$main_name = str_replace('/main.php', '', $main_name);
$main_name = str_replace('main/', '', $main_name);
$main_name = 'main-' . $main_name;
mso_set_val('main_class', $main_name);
// дополнительный файл там же — main-function.php если есть, то подключаем сразу
$main_file_function = str_replace('.php', '-function.php', $MAIN_FILE);
if (file_exists($main_file_function)) {
Esempio n. 17
0
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
# секция HEAD
if ($fn = mso_fe('custom/head-section.php')) {
    require $fn;
} else {
    my_default_head_section();
}
// подключение через функцию
echo '<body' . (mso_get_val('body_class') ? ' class="' . mso_get_val('body_class') . '"' : '') . '>';
mso_hook('body_start');
if (function_exists('ushka')) {
    echo ushka('body_start');
}
if ($fn = mso_fe('custom/body-start.php')) {
    require $fn;
}
if (function_exists('ushka')) {
    echo ushka('header-pre');
}
if ($fn = mso_fe('custom/header-pre.php')) {
    require $fn;
}
# end of file
	PHP-связи: 
			> if ($fn = mso_fe('components/logo-ns-descr-icons/logo-ns-descr-icons.php')) require($fn);
*/
$pt = new Page_out();
// подготавливаем объект для вывода
// если в опции явно указан адрес лого, то берем его
$logo = trim(mso_get_option('default_header_logo_custom', 'templates', false));
if (!$logo) {
    $logo = getinfo('stylesheet_url') . 'images/logos/' . mso_get_option('default_header_logo', 'templates', 'logo01.png');
}
$logo = '<img src="' . $logo . '" alt="' . getinfo('name_site') . '" title="' . getinfo('name_site') . '">';
if (!is_type('home')) {
    $logo = $pt->link(getinfo('siteurl'), $logo);
}
// вывод
$pt->div_start('logo-ns-descr-icons', 'wrap');
$pt->div_start('r1');
$pt->html($logo);
$pt->div_end('r1');
$pt->div_start('r2');
$pt->div($pt->name_site(), 'name_site');
$pt->div(getinfo('description_site'), 'description_site');
$pt->div_end('r2');
$pt->div_start('r3');
if ($fn = mso_fe('components/_social/_social.php')) {
    require $fn;
}
$pt->div_end('r3');
$pt->clearfix();
$pt->div_end('logo-ns-descr-icons', 'wrap');
# end file
Esempio n. 19
0
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>';
}
Esempio n. 20
0
    exit('No direct script access allowed');
}
/*
	Файл: date-menu2.php

	Название: «Дата и меню2»
	
	Расположение: header
	
	Схематичный вид: 
		дата | Меню 2
		

	PHP-связи: 
			>	if ($fn = mso_fe('components/date-menu2/date-menu2.php')) require($fn);
*/
$pt = new Page_out();
// подготавливаем объект для вывода
// вывод
$pt->div_start('date-menu2', 'wrap');
$pt->div_start('r1');
echo mso_date_convert('D, j F Y г.', date('Y-m-d H:i:s'), true, 'Понедельник Вторник Среда Четверг Пятница Суббота Воскресенье', 'января февраля марта апреля мая июня июля августа сентября октября ноября декабря');
$pt->div_end('r1');
$pt->div_start('r2');
if ($fn = mso_fe('components/menu2/menu2.php')) {
    require $fn;
}
$pt->div_end('r2');
$pt->clearfix();
$pt->div_end('date-menu2', 'wrap');
# end file
Esempio n. 21
0
if ($fn = mso_fe(BASEPATH . 'lpf-content/config/variables.php')) {
    require $fn;
}
if ($fn = mso_fe(CURRENT_PAGE_DIR . 'variables.php')) {
    require $fn;
} else {
    mso_get_yaml(CURRENT_PAGE_FILE);
}
if ($fn = mso_fe(CURRENT_PAGE_DIR . 'functions.php')) {
    require $fn;
}
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) or isset($_POST) and $_POST) {
    if ($fn = mso_fe(CURRENT_PAGE_DIR . '_post2.php')) {
        require $fn;
    }
    if ($fn = mso_fe(CURRENT_PAGE_DIR . '_post.php')) {
        require $fn;
        exit;
    }
}
if ($VAR['no_output_only_file'] and $fn = mso_fe(CURRENT_PAGE_DIR . $VAR['no_output_only_file'])) {
    require $fn;
    exit;
}
if ($VAR['generate_static_page']) {
    ob_start();
}
if ($VAR['before_file'] and $fn = mso_fe($VAR['before_file'])) {
    require $fn;
}
#end of file
Esempio n. 22
0
function forms_content_callback($matches)
{
    $text = $matches[1];
    $text = str_replace("\r", "", $text);
    $text = str_replace('&nbsp;', ' ', $text);
    $text = str_replace("\t", ' ', $text);
    $text = str_replace('<br />', "<br>", $text);
    $text = str_replace('<br>', "\n", $text);
    $text = str_replace("\n\n", "\n", $text);
    $text = str_replace('     ', ' ', $text);
    $text = str_replace('    ', ' ', $text);
    $text = str_replace('   ', ' ', $text);
    $text = str_replace('  ', ' ', $text);
    $text = str_replace("\n ", "\n", $text);
    $text = str_replace("\n\n", "\n", $text);
    $text = trim($text);
    // число антиспама привязано и к сессии
    $ses = getinfo('session');
    $ses = preg_replace("/\\D/", '', $ses['session_id']);
    $ses = substr($ses, 0, 4);
    $antispam_num = date('jw') + date('t') * date('G') + $ses;
    // служебная секция [options]
    $def = array('email' => mso_get_option('admin_email', 'general', '*****@*****.**'), 'subject' => '', 'from' => '', 'redirect' => '', 'redirect_pause' => '2', 'ushka' => '', 'reset' => 1, 'require_title' => '*', 'antispam' => tf('Наберите число'), 'antispam_ok' => $antispam_num);
    $options = mso_section_to_array($text, 'options', $def, true);
    // если секции [options] нет, то ставим дефолт
    if (!$options) {
        $options[0] = $def;
    }
    if ($options) {
        $options = $options[0];
    }
    // служебная секция [files]
    $def = array('file_count' => 0, 'file_type' => 'jpg|jpeg|png|svg', 'file_max_size' => 200, 'file_description' => 'Скриншоты', 'file_tip' => tf('Выберите для загрузки файлы (jpg, jpeg, png, svg) размером до 200 Кб'));
    $files = mso_section_to_array($text, 'files', $def, true);
    if ($files) {
        $files = $files[0];
        // только одна секция
        // если полей меньше 1, то обнуляем массив
        if ((int) $files['file_count'] < 1) {
            $files = array();
        }
    }
    // поля формы [field]
    $def = array('require' => 0, 'type' => 'text', 'description' => '', 'placeholder' => '', 'tip' => '', 'value' => '', 'attr' => '', 'clean' => 'base', 'values' => '', 'default' => '', 'subject' => 0, 'from' => 0);
    $fields = mso_section_to_array($text, 'field', $def, true);
    $options = array_map('trim', $options);
    // pr($options);
    // pr($files);
    // pr($fields);
    // pr($text);
    // html-формат вывода
    $format['container_class'] = 'mso-forms';
    // css-класс для div-контейнера формы
    $format['textarea'] = '<p><label><span>[description][require_title]</span><textarea [field_param]>[value]</textarea></label>[tip]</p>';
    $format['checkbox'] = '<p><label><span></span><input [field_param] value="1" type="checkbox"> [description]</label>[tip]</p>';
    $format['select'] = '<p><label><span>[description][require_title]</span><select [field_param]>[option]</select></label>[tip]</p>';
    $format['input'] = '<p><label><span>[description][require_title]</span><input [field_param]></label>[tip]</p>';
    $format['tip'] = '<span class="mso-forms-tip">[tip]</span>';
    $format['file_description'] = '<p><label><span>[file_description]</span></label></p>';
    $format['file_field'] = '<p>[file_field]</p>';
    $format['file_tip'] = '<p><span class="mso-forms-tip">[file_tip]</span></p>';
    $format['message_ok'] = '<p class="mso-forms-ok">' . tf('Ваше сообщение отправлено') . '</p>';
    $format['message_error'] = '<p class="mso-forms-error">[error]</p>';
    $format['antispam'] = '<p><label><span>[antispam] [antispam_ok][require_title]</span>[input]</label></p>';
    $format['buttons'] = '<p class="mso-forms-buttons">[submit] [reset]</p>';
    $format['mail_field'] = '[description]: [post_value] [NR]';
    // подключаем файл формата из текущего шаблона
    if ($fn = mso_fe('custom/plugins/forms/format.php')) {
        require $fn;
    }
    $out = '';
    // затираем исходный текст формы
    if ($_POST) {
        // если это отправка
        $result_post = forms_content_post($options, $files, $fields, $format);
        // в $result_post результат отправки
        if ($result_post['show_ok']) {
            $out .= $format['message_ok'];
            if ($options['redirect']) {
                // редирект через N секунд
                header('Refresh: ' . $options['redirect_pause'] . '; url=' . $options['redirect']);
            }
        } elseif ($result_post['show_error']) {
            // вывод сообщений об ошибках
            foreach ($result_post['show_error'] as $error) {
                $out .= str_replace('[message_error]', tf($error), $format['message_error']);
            }
            if ($result_post['show_form']) {
                $out .= forms_show_form($options, $files, $result_post['fields'], $format);
            }
        }
    } else {
        // выводим форму
        $out .= forms_show_form($options, $files, $fields, $format);
    }
    return $out;
}
Esempio n. 23
0
 foreach ($pages as $page) {
     if ($f = mso_page_foreach('page')) {
         require $f;
         // здесь комментарии
         if ($fn = mso_find_ts_file('type/page/units/page-comments.php')) {
             require $fn;
         }
         continue;
     }
     $p->load($page);
     $p->div_start('mso-page-only', '<article>');
     // у page в записи может быть метаполе info-top-custom
     // где указываетеся свой файл вывода
     // файл указывается в type_foreach/info-top/файл.php
     $info_top_custom = $p->meta_val('info-top-custom');
     if ($info_top_custom and $f = mso_fe('type_foreach/info-top/' . $info_top_custom)) {
         require $f;
     } else {
         // для типа page может быть свой info-top
         if ($f = mso_page_foreach('info-top-page')) {
             require $f;
         } else {
             if ($f = mso_page_foreach('info-top')) {
                 require $f;
             } else {
                 $p->html(NR . '<header>');
                 $p->line('[title]');
                 $p->div_start('mso-info mso-info-top');
                 $p->line('[date][edit][cat][tag][view_count]');
                 $p->div_end('mso-info mso-info-top');
                 $p->html('</header>');
Esempio n. 24
0
             }
             if (trim($UNIT['file'])) {
                 // в подключаемом файле доступна переменная $UNIT — массив параметров
                 if ($fn = mso_find_ts_file('type/home/units/' . trim($UNIT['file']))) {
                     require $fn;
                 }
             } elseif (isset($UNIT['html']) and trim($UNIT['html'])) {
                 echo trim($UNIT['html']);
             } elseif (isset($UNIT['require']) and trim($UNIT['require'])) {
                 if ($fn = mso_fe(trim($UNIT['require']))) {
                     require $fn;
                 }
             } elseif (isset($UNIT['ushka']) and trim($UNIT['ushka']) and function_exists('ushka')) {
                 echo ushka(trim($UNIT['ushka']));
             } elseif (isset($UNIT['component']) and trim($UNIT['component'])) {
                 if ($_fn = mso_fe('components/' . trim($UNIT['component']) . '/' . trim($UNIT['component']) . '.php')) {
                     require $_fn;
                 }
             } elseif (isset($UNIT['option_key'], $UNIT['option_type'], $UNIT['option_default']) and trim($UNIT['option_key']) and trim($UNIT['option_type']) and trim($UNIT['option_default'])) {
                 echo mso_get_option(trim($UNIT['option_key']), trim($UNIT['option_type']), trim($UNIT['option_default']));
             } elseif (isset($UNIT['sidebar']) and trim($UNIT['sidebar'])) {
                 mso_show_sidebar($UNIT['sidebar']);
             }
         }
     }
 } else {
     // блоки рубрик на главной
     if (mso_get_option('home_cat_block', 'templates', '0')) {
         // обычный вывод
         if (mso_get_option('home_full_text', 'templates', '1')) {
             if ($fn = mso_find_ts_file('type/home/units/home-cat-block-full.php')) {
Esempio n. 25
0
echo $TITLE;
?>
</title>
<?php 
mso_meta();
mso_head();
if ($fn = mso_fe($VAR['head_file'])) {
    require $fn;
}
?>
</head>
<body<?php 
echo $VAR['body_attr'] ? ' ' . $VAR['body_attr'] : '';
?>
>
<?php 
if ($fn = mso_fe($VAR['start_file'])) {
    require $fn;
}
mso_output_text();
if ($fn = mso_fe($VAR['end_file'])) {
    require $fn;
}
if ($VAR['after_file'] and $fn = mso_fe($VAR['after_file'])) {
    require $fn;
}
mso_stat_out();
if ($fn = $VAR['generate_static_page']) {
    file_put_contents($fn, str_replace(BASE_URL, $VAR['generate_static_page_base_url'], ob_get_flush()));
}
# end of file
Esempio n. 26
0
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
if (function_exists('ushka')) {
    echo ushka('content-start');
}
if ($fn = mso_fe('custom/content-start.php')) {
    require $fn;
}
if ($fn = mso_fe('custom/content-out.php')) {
    require $fn;
} else {
    global $CONTENT_OUT;
    echo $CONTENT_OUT;
}
if (function_exists('ushka')) {
    echo ushka('content-end');
}
if ($fn = mso_fe('custom/content-end.php')) {
    require $fn;
}
# end of file
Esempio n. 27
0
}
?>

	</div>

	<?php 
if ($fn = mso_fe('main/blocks/footer-pre.php')) {
    require $fn;
}
?>

	<div class="footer pad20 bg-gray700 t-white bor6px bor-gray400 bor-solid-t">
		<?php 
if ($fn = mso_fe('main/blocks/footer.php')) {
    require $fn;
}
?>
	</div>

</div></div>

<?php 
if ($fn = mso_fe('main/blocks/body-end.php')) {
    require $fn;
}
?>

</body></html><?php 
if ($fn = mso_fe('main/blocks/_end.php')) {
    require $fn;
}
	Описание: Слева меню, справа форма поиска
	
	Расположение: header
	
	Схематичный вид: 
		Меню | Меню      [Поиск]
		
	CSS-стили: 
		var_style.less:
			>	@import url('components/menu-search.less');
		
	PHP-связи: 
			>	if ($fn = mso_fe('components/menu-search/menu-search.php')) require($fn);
*/
$pt = new Page_out();
// подготавливаем объект для вывода
// вывод
$pt->div_start('menu-search', 'wrap');
$pt->div_start('r1');
if ($fn = mso_fe('components/_menu/_menu.php')) {
    require $fn;
}
$pt->div_end('r1');
$pt->div_start('r2');
if ($fn = mso_fe('components/_search/_search.php')) {
    require $fn;
}
$pt->div_end('r2');
$pt->clearfix();
$pt->div_end('menu-search', 'wrap');
# end file