1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-05-05 18:38:18 +03:00

Рефакторинг путей

This commit is contained in:
Mzhelskiy Maxim 2013-08-08 18:00:37 +07:00
parent 9df6d48208
commit ea91335ce9
42 changed files with 347 additions and 306 deletions

View file

@ -1608,7 +1608,7 @@ class ActionBlog extends Action {
)
);
require_once Config::Get('path.root.engine').'/lib/external/XXTEA/encrypt.php';
require_once Config::Get('path.framework.libs_vendor.server').'/XXTEA/encrypt.php';
/**
* Формируем код подтверждения в URL
*/
@ -1646,7 +1646,7 @@ class ActionBlog extends Action {
* Обработка отправленого пользователю приглашения вступить в блог
*/
protected function EventInviteBlog() {
require_once Config::Get('path.root.engine').'/lib/external/XXTEA/encrypt.php';
require_once Config::Get('path.framework.libs_vendor.server').'/XXTEA/encrypt.php';
/**
* Получаем код подтверждения из ревеста и дешефруем его
*/

View file

@ -692,7 +692,7 @@ class ActionProfile extends Action {
* Добавление пользователя в друзья, по отправленной заявке
*/
public function EventFriendOffer() {
require_once Config::Get('path.root.engine').'/lib/external/XXTEA/encrypt.php';
require_once Config::Get('path.framework.libs_vendor.server').'/XXTEA/encrypt.php';
/**
* Из реквеста дешефруем ID польователя
*/
@ -1074,7 +1074,7 @@ class ActionProfile extends Action {
)
);
require_once Config::Get('path.root.engine').'/lib/external/XXTEA/encrypt.php';
require_once Config::Get('path.framework.libs_vendor.server').'/XXTEA/encrypt.php';
$sCode=$this->oUserCurrent->getId().'_'.$oUser->getId();
$sCode=rawurlencode(base64_encode(xxtea_encrypt($sCode, Config::Get('module.talk.encrypt'))));

View file

@ -178,7 +178,7 @@ class ModuleBlog_EntityBlog extends Entity {
if ($sPath=$this->getAvatar()) {
return preg_replace("#_\d{1,3}x\d{1,3}(\.\w{3,4})$#", ((($iSize==0)?"":"_{$iSize}x{$iSize}") . "\\1"),$sPath);
} else {
return Config::Get('path.static.assets').'/images/avatars/avatar_blog_'.$iSize.'x'.$iSize.'.png';
return Config::Get('path.skin.assets.web').'/images/avatars/avatar_blog_'.$iSize.'x'.$iSize.'.png';
}
}
/**

View file

@ -1,5 +1,5 @@
<?php
require_once(Config::Get('path.root.engine').'/lib/external/Sphinx/sphinxapi.php');
require_once(Config::Get('path.framework.libs_vendor.server').'/Sphinx/sphinxapi.php');
/**
* Модуль для работы с машиной полнотекстового поиска Sphinx

View file

@ -366,7 +366,7 @@ class ModuleUser_EntityUser extends Entity {
if ($sPath=$this->getProfileAvatar()) {
return str_replace('_100x100',(($iSize==0)?"":"_{$iSize}x{$iSize}"),$sPath."?".date('His',strtotime($this->getProfileDate())));
} else {
return Config::Get('path.static.assets').'/images/avatars/avatar_'.($this->getProfileSex()=='woman' ? 'female' : 'male').'_'.$iSize.'x'.$iSize.'.png';
return Config::Get('path.skin.assets.web').'/images/avatars/avatar_'.($this->getProfileSex()=='woman' ? 'female' : 'male').'_'.$iSize.'x'.$iSize.'.png';
}
}
/**
@ -386,7 +386,7 @@ class ModuleUser_EntityUser extends Entity {
* @return string
*/
public function getProfileFotoDefault() {
return Config::Get('path.static.assets').'/images/avatars/user_photo_'.($this->getProfileSex()=='woman' ? 'female' : 'male').'.png';
return Config::Get('path.skin.assets.web').'/images/avatars/user_photo_'.($this->getProfileSex()=='woman' ? 'female' : 'male').'.png';
}
/**
* Возвращает объект голосования за пользователя текущего пользователя

View file

@ -22,6 +22,19 @@
* Все изменения нужно вносить в файл config/config.local.php
*/
/**
* Основные настройки путей
* Если необходимо установить движек в директорию(не корень сайта) то следует сделать так:
* $config['path']['root']['web'] = 'http://'.$_SERVER['HTTP_HOST'].'/subdir';
* и увеличить значение $config['path']['offset_request_url'] на число вложенных директорий,
* например, для директории первой вложенности www.site.ru/livestreet/ поставить значение равное 1
*/
$config['path']['root']['server'] = dirname(dirname(dirname(__FILE__)));
$config['path']['root']['web'] = isset($_SERVER['HTTP_HOST']) ? 'http://'.$_SERVER['HTTP_HOST'] : null;
$config['path']['offset_request_url'] = 0;
/**
* Настройки HTML вида
*/
@ -406,84 +419,84 @@ $config['block']['rule_profile'] = array(
$config['head']['default']['js'] = array(
/* Vendor libs */
"___path.static.framework___/js/vendor/html5shiv.js" => array('browser'=>'lt IE 9'),
"___path.static.framework___/js/vendor/jquery-1.9.1.min.js",
"___path.static.framework___/js/vendor/jquery-ui/js/jquery-ui-1.10.2.custom.min.js",
"___path.static.framework___/js/vendor/jquery-ui/js/localization/jquery-ui-datepicker-ru.js",
"___path.static.framework___/js/vendor/jquery.browser.js",
"___path.static.framework___/js/vendor/jquery.scrollto.js",
"___path.static.framework___/js/vendor/jquery.rich-array.min.js",
"___path.static.framework___/js/vendor/jquery.form.js",
"___path.static.framework___/js/vendor/jquery.jqplugin.js",
"___path.static.framework___/js/vendor/jquery.cookie.js",
"___path.static.framework___/js/vendor/jquery.serializejson.js",
"___path.static.framework___/js/vendor/jquery.file.js",
"___path.static.framework___/js/vendor/jcrop/jquery.Jcrop.js",
"___path.static.framework___/js/vendor/jquery.placeholder.min.js",
"___path.static.framework___/js/vendor/jquery.charcount.js",
"___path.static.framework___/js/vendor/jquery.imagesloaded.js",
"___path.static.framework___/js/vendor/notifier/jquery.notifier.js",
"___path.static.framework___/js/vendor/prettify/prettify.js",
"___path.static.framework___/js/vendor/prettyphoto/js/jquery.prettyphoto.js",
"___path.static.framework___/js/vendor/parsley/parsley.js",
"___path.static.framework___/js/vendor/parsley/i18n/messages.ru.js",
"___path.framework.frontend.web___/js/vendor/html5shiv.js" => array('browser'=>'lt IE 9'),
"___path.framework.frontend.web___/js/vendor/jquery-1.9.1.min.js",
"___path.framework.frontend.web___/js/vendor/jquery-ui/js/jquery-ui-1.10.2.custom.min.js",
"___path.framework.frontend.web___/js/vendor/jquery-ui/js/localization/jquery-ui-datepicker-ru.js",
"___path.framework.frontend.web___/js/vendor/jquery.browser.js",
"___path.framework.frontend.web___/js/vendor/jquery.scrollto.js",
"___path.framework.frontend.web___/js/vendor/jquery.rich-array.min.js",
"___path.framework.frontend.web___/js/vendor/jquery.form.js",
"___path.framework.frontend.web___/js/vendor/jquery.jqplugin.js",
"___path.framework.frontend.web___/js/vendor/jquery.cookie.js",
"___path.framework.frontend.web___/js/vendor/jquery.serializejson.js",
"___path.framework.frontend.web___/js/vendor/jquery.file.js",
"___path.framework.frontend.web___/js/vendor/jcrop/jquery.Jcrop.js",
"___path.framework.frontend.web___/js/vendor/jquery.placeholder.min.js",
"___path.framework.frontend.web___/js/vendor/jquery.charcount.js",
"___path.framework.frontend.web___/js/vendor/jquery.imagesloaded.js",
"___path.framework.frontend.web___/js/vendor/notifier/jquery.notifier.js",
"___path.framework.frontend.web___/js/vendor/prettify/prettify.js",
"___path.framework.frontend.web___/js/vendor/prettyphoto/js/jquery.prettyphoto.js",
"___path.framework.frontend.web___/js/vendor/parsley/parsley.js",
"___path.framework.frontend.web___/js/vendor/parsley/i18n/messages.ru.js",
/* Core */
"___path.static.framework___/js/core/main.js",
"___path.static.framework___/js/core/hook.js",
"___path.framework.frontend.web___/js/core/main.js",
"___path.framework.frontend.web___/js/core/hook.js",
/* User Interface */
"___path.static.framework___/js/ui/popup.js",
"___path.static.framework___/js/ui/dropdown.js",
"___path.static.framework___/js/ui/tooltip.js",
"___path.static.framework___/js/ui/popover.js",
"___path.static.framework___/js/ui/tab.js",
"___path.static.framework___/js/ui/modal.js",
"___path.static.framework___/js/ui/toolbar.js",
"___path.framework.frontend.web___/js/ui/popup.js",
"___path.framework.frontend.web___/js/ui/dropdown.js",
"___path.framework.frontend.web___/js/ui/tooltip.js",
"___path.framework.frontend.web___/js/ui/popover.js",
"___path.framework.frontend.web___/js/ui/tab.js",
"___path.framework.frontend.web___/js/ui/modal.js",
"___path.framework.frontend.web___/js/ui/toolbar.js",
/* LiveStreet */
"___path.root.web___/application/frontend/common/js/favourite.js",
"___path.root.web___/application/frontend/common/js/blocks.js",
"___path.root.web___/application/frontend/common/js/pagination.js",
"___path.root.web___/application/frontend/common/js/editor.js",
"___path.root.web___/application/frontend/common/js/talk.js",
"___path.root.web___/application/frontend/common/js/vote.js",
"___path.root.web___/application/frontend/common/js/poll.js",
"___path.root.web___/application/frontend/common/js/subscribe.js",
"___path.root.web___/application/frontend/common/js/geo.js",
"___path.root.web___/application/frontend/common/js/wall.js",
"___path.root.web___/application/frontend/common/js/usernote.js",
"___path.root.web___/application/frontend/common/js/comments.js",
"___path.root.web___/application/frontend/common/js/blog.js",
"___path.root.web___/application/frontend/common/js/user.js",
"___path.root.web___/application/frontend/common/js/userfeed.js",
"___path.root.web___/application/frontend/common/js/stream.js",
"___path.root.web___/application/frontend/common/js/photoset.js",
"___path.root.web___/application/frontend/common/js/toolbar.js",
"___path.root.web___/application/frontend/common/js/settings.js",
"___path.root.web___/application/frontend/common/js/topic.js",
"___path.root.web___/application/frontend/common/js/admin.js",
"___path.root.web___/application/frontend/common/js/admin.userfield.js",
"___path.root.web___/application/frontend/common/js/captcha.js",
"___path.root.web___/application/frontend/common/js/init.js",
"___path.application.web___/frontend/common/js/favourite.js",
"___path.application.web___/frontend/common/js/blocks.js",
"___path.application.web___/frontend/common/js/pagination.js",
"___path.application.web___/frontend/common/js/editor.js",
"___path.application.web___/frontend/common/js/talk.js",
"___path.application.web___/frontend/common/js/vote.js",
"___path.application.web___/frontend/common/js/poll.js",
"___path.application.web___/frontend/common/js/subscribe.js",
"___path.application.web___/frontend/common/js/geo.js",
"___path.application.web___/frontend/common/js/wall.js",
"___path.application.web___/frontend/common/js/usernote.js",
"___path.application.web___/frontend/common/js/comments.js",
"___path.application.web___/frontend/common/js/blog.js",
"___path.application.web___/frontend/common/js/user.js",
"___path.application.web___/frontend/common/js/userfeed.js",
"___path.application.web___/frontend/common/js/stream.js",
"___path.application.web___/frontend/common/js/photoset.js",
"___path.application.web___/frontend/common/js/toolbar.js",
"___path.application.web___/frontend/common/js/settings.js",
"___path.application.web___/frontend/common/js/topic.js",
"___path.application.web___/frontend/common/js/admin.js",
"___path.application.web___/frontend/common/js/admin.userfield.js",
"___path.application.web___/frontend/common/js/captcha.js",
"___path.application.web___/frontend/common/js/init.js",
"http://yandex.st/share/share.js" => array('merge'=>false),
);
$config['head']['default']['css'] = array(
// Framework styles
"___path.static.framework___/css/reset.css",
"___path.static.framework___/css/helpers.css",
"___path.static.framework___/css/text.css",
"___path.static.framework___/css/dropdowns.css",
"___path.static.framework___/css/buttons.css",
"___path.static.framework___/css/forms.css",
"___path.static.framework___/css/navs.css",
"___path.static.framework___/css/modals.css",
"___path.static.framework___/css/tooltip.css",
"___path.static.framework___/css/popover.css",
"___path.static.framework___/css/alerts.css",
"___path.static.framework___/css/toolbar.css"
"___path.framework.frontend.web___/css/reset.css",
"___path.framework.frontend.web___/css/helpers.css",
"___path.framework.frontend.web___/css/text.css",
"___path.framework.frontend.web___/css/dropdowns.css",
"___path.framework.frontend.web___/css/buttons.css",
"___path.framework.frontend.web___/css/forms.css",
"___path.framework.frontend.web___/css/navs.css",
"___path.framework.frontend.web___/css/modals.css",
"___path.framework.frontend.web___/css/tooltip.css",
"___path.framework.frontend.web___/css/popover.css",
"___path.framework.frontend.web___/css/alerts.css",
"___path.framework.frontend.web___/css/toolbar.css"
);
/**

View file

@ -41,7 +41,7 @@ ls.captcha = (function ($) {
* @return {String} URL каптчи
*/
this.getCaptchaUrl = function () {
return DIR_ENGINE_LIBS + '/vendor/kcaptcha/index.php?' + SESSION_NAME + '=' + SESSION_ID + '&n=' + Math.random();
return PATH_FRAMEWORK_LIBS_VENDOR + '/kcaptcha/index.php?' + SESSION_NAME + '=' + SESSION_ID + '&n=' + Math.random();
};
/**

View file

@ -4,8 +4,8 @@
<Contact>{$sAdminMail}</Contact>
<Url type="text/html" template="{router page='search'}topics/?q={literal}{searchTerms}{/literal}" />
<LongName>{$sHtmlDescription}</LongName>
<Image height="64" width="64" type="image/png">{cfg name='path.static.assets'}/images/favicons/logo.png</Image>
<Image height="16" width="16" type="image/vnd.microsoft.icon">{cfg name='path.static.assets'}/images/favicons/favicon.ico</Image>
<Image height="64" width="64" type="image/png">{cfg name='path.skin.assets.web'}/images/favicons/logo.png</Image>
<Image height="16" width="16" type="image/vnd.microsoft.icon">{cfg name='path.skin.assets.web'}/images/favicons/favicon.ico</Image>
<Developer>{cfg name='view.name'} ({cfg name='path.root.web'})</Developer>
<Attribution>
© «{cfg name='view.name'}»

View file

@ -19,7 +19,7 @@
{$sFooterLinkColor = '949fa3'} {* Цвет ссылки в футере *}
{* Путь до папки с изображенями *}
{$sImagesDir = "{cfg name='path.static.assets'}/images/emails"}
{$sImagesDir = "{cfg name='path.skin.assets.web'}/images/emails"}
{* Фон *}

View file

@ -35,7 +35,7 @@
{/if}
{/if}
<script src="{cfg name='path.static.framework'}/js/vendor/tinymce/tiny_mce.js"></script>
<script src="{cfg name='path.framework.frontend.web'}/js/vendor/tinymce/tiny_mce.js"></script>
<script>
jQuery(function($) {
@ -62,7 +62,7 @@
{/if}
{/if}
<script src="{cfg name='path.static.framework'}/js/vendor/markitup/jquery.markitup.js"></script>
<script src="{cfg name='path.framework.frontend.web'}/js/vendor/markitup/jquery.markitup.js"></script>
<script>
jQuery(function($) {

View file

@ -8,7 +8,7 @@
{block name='field_holder' prepend}
{hookb run="registration_captcha" isPopup=$isModal}
<span {if ! $isModal}style="background-image: url({cfg name='path.root.engine_lib'}/external/kcaptcha/index.php?{$_sPhpSessionName}={$_sPhpSessionId});"{/if}
<span {if ! $isModal}style="background-image: url({cfg name='path.framework.libs_vendor.web'}/kcaptcha/index.php?{$_sPhpSessionName}={$_sPhpSessionId});"{/if}
class="form-auth-captcha js-form-auth-captcha"></span>
<input type="text"
id="{$sFieldName}"

View file

@ -25,7 +25,7 @@
*}
{$aHtmlHeadFiles.css}
<link href="{cfg name='path.static.assets'}/images/favicons/favicon.ico?v1" rel="shortcut icon" />
<link href="{cfg name='path.skin.assets.web'}/images/favicons/favicon.ico?v1" rel="shortcut icon" />
<link rel="search" type="application/opensearchdescription+xml" href="{router page='search'}opensearch/" title="{cfg name='view.name'}" />
{**
@ -41,15 +41,23 @@
<script>
var DIR_WEB_ROOT = '{cfg name="path.root.web"}',
DIR_STATIC_SKIN = '{cfg name="path.static.skin"}',
DIR_STATIC_FRAMEWORK = '{cfg name="path.static.framework"}',
DIR_ENGINE_LIBS = '{cfg name="path.root.engine_lib"}',
LIVESTREET_SECURITY_KEY = '{$LIVESTREET_SECURITY_KEY}',
SESSION_ID = '{$_sPhpSessionId}',
SESSION_NAME = '{$_sPhpSessionName}',
LANGUAGE = '{$oConfig->GetValue('lang.current')}',
WYSIWYG = {if $oConfig->GetValue('view.wysiwyg')}true{else}false{/if};
var PATH_ROOT = '{cfg name="path.root.web"}',
PATH_SKIN = '{cfg name="path.skin.web"}',
PATH_FRAMEWORK_FRONTEND = '{cfg name="path.framework.frontend.web"}',
PATH_FRAMEWORK_LIBS_VENDOR = '{cfg name="path.framework.libs_vendor.web"}',
/**
* Для совместимости с прошлыми версиями. БУДУТ УДАЛЕНЫ
*/
DIR_WEB_ROOT = '{cfg name="path.root.web"}',
DIR_STATIC_SKIN = '{cfg name="path.skin.web"}',
DIR_STATIC_FRAMEWORK = '{cfg name="path.framework.frontend.web"}',
DIR_ENGINE_LIBS = '{cfg name="path.framework.web"}/libs',
LIVESTREET_SECURITY_KEY = '{$LIVESTREET_SECURITY_KEY}',
SESSION_ID = '{$_sPhpSessionId}',
SESSION_NAME = '{$_sPhpSessionName}',
LANGUAGE = '{$oConfig->GetValue('lang.current')}',
WYSIWYG = {if $oConfig->GetValue('view.wysiwyg')}true{else}false{/if};
var aRouter = [];
{foreach $aRouter as $sPage => $sPath}

View file

@ -21,38 +21,38 @@ $config['view']['grid']['fluid_max_width'] = 1200;
$config['view']['grid']['fixed_width'] = 1000;
$config['head']['default']['js'] = Config::Get('head.default.js');
$config['head']['default']['js'][] = '___path.static.assets___/js/init.js';
$config['head']['default']['js'][] = '___path.skin.assets.web___/js/init.js';
$config['head']['default']['css'] = array_merge(Config::Get('head.default.css'), array(
// Template styles
"___path.static.assets___/css/base.css",
"___path.static.framework___/js/vendor/jquery-ui/css/smoothness/jquery-ui-1.10.2.custom.css",
"___path.static.framework___/js/vendor/markitup/skins/synio/style.css",
"___path.static.framework___/js/vendor/markitup/sets/synio/style.css",
"___path.static.framework___/js/vendor/jcrop/jquery.Jcrop.css",
"___path.static.framework___/js/vendor/prettify/prettify.css",
"___path.static.framework___/js/vendor/prettyphoto/css/prettyphoto.css",
"___path.static.framework___/js/vendor/notifier/jquery.notifier.css",
"___path.static.assets___/css/grid.css",
"___path.static.assets___/css/forms.css",
"___path.static.assets___/css/common.css",
"___path.static.assets___/css/icons.css",
"___path.static.assets___/css/navs.css",
"___path.static.assets___/css/tables.css",
"___path.static.assets___/css/topic.css",
"___path.static.assets___/css/photoset.css",
"___path.static.assets___/css/comments.css",
"___path.static.assets___/css/blocks.css",
"___path.static.assets___/css/blog.css",
"___path.static.assets___/css/modals.css",
"___path.static.assets___/css/profile.css",
"___path.static.assets___/css/wall.css",
"___path.static.assets___/css/activity.css",
"___path.static.assets___/css/admin.css",
"___path.static.assets___/css/toolbar.css",
"___path.static.assets___/css/poll.css",
"___path.static.skin___/themes/___view.theme___/style.css",
"___path.static.assets___/css/print.css",
"___path.skin.assets.web___/css/base.css",
"___path.framework.frontend.web___/js/vendor/jquery-ui/css/smoothness/jquery-ui-1.10.2.custom.css",
"___path.framework.frontend.web___/js/vendor/markitup/skins/synio/style.css",
"___path.framework.frontend.web___/js/vendor/markitup/sets/synio/style.css",
"___path.framework.frontend.web___/js/vendor/jcrop/jquery.Jcrop.css",
"___path.framework.frontend.web___/js/vendor/prettify/prettify.css",
"___path.framework.frontend.web___/js/vendor/prettyphoto/css/prettyphoto.css",
"___path.framework.frontend.web___/js/vendor/notifier/jquery.notifier.css",
"___path.skin.assets.web___/css/grid.css",
"___path.skin.assets.web___/css/forms.css",
"___path.skin.assets.web___/css/common.css",
"___path.skin.assets.web___/css/icons.css",
"___path.skin.assets.web___/css/navs.css",
"___path.skin.assets.web___/css/tables.css",
"___path.skin.assets.web___/css/topic.css",
"___path.skin.assets.web___/css/photoset.css",
"___path.skin.assets.web___/css/comments.css",
"___path.skin.assets.web___/css/blocks.css",
"___path.skin.assets.web___/css/blog.css",
"___path.skin.assets.web___/css/modals.css",
"___path.skin.assets.web___/css/profile.css",
"___path.skin.assets.web___/css/wall.css",
"___path.skin.assets.web___/css/activity.css",
"___path.skin.assets.web___/css/admin.css",
"___path.skin.assets.web___/css/toolbar.css",
"___path.skin.assets.web___/css/poll.css",
"___path.skin.web___/themes/___view.theme___/style.css",
"___path.skin.assets.web___/css/print.css",
));

View file

@ -4,8 +4,8 @@
<Contact>{$sAdminMail}</Contact>
<Url type="text/html" template="{router page='search'}topics/?q={literal}{searchTerms}{/literal}" />
<LongName>{$sHtmlDescription}</LongName>
<Image height="64" width="64" type="image/png">{cfg name='path.static.assets'}/images/favicons/logo.png</Image>
<Image height="16" width="16" type="image/vnd.microsoft.icon">{cfg name='path.static.assets'}/images/favicons/favicon.ico</Image>
<Image height="64" width="64" type="image/png">{cfg name='path.skin.assets.web'}/images/favicons/logo.png</Image>
<Image height="16" width="16" type="image/vnd.microsoft.icon">{cfg name='path.skin.assets.web'}/images/favicons/favicon.ico</Image>
<Developer>{cfg name='view.name'} ({cfg name='path.root.web'})</Developer>
<Attribution>
© «{cfg name='view.name'}»

View file

@ -19,7 +19,7 @@
{$sFooterLinkColor = '949fa3'} {* Цвет ссылки в футере *}
{* Путь до папки с изображенями *}
{$sImagesDir = "{cfg name='path.static.assets'}/images/emails"}
{$sImagesDir = "{cfg name='path.skin.assets.web'}/images/emails"}
{* Фон *}

View file

@ -35,7 +35,7 @@
{/if}
{/if}
<script src="{cfg name='path.static.framework'}/js/vendor/tinymce/tiny_mce.js"></script>
<script src="{cfg name='path.framework.frontend.web'}/js/vendor/tinymce/tiny_mce.js"></script>
<script>
jQuery(function($) {
@ -62,7 +62,7 @@
{/if}
{/if}
<script src="{cfg name='path.static.framework'}/js/vendor/markitup/jquery.markitup.js"></script>
<script src="{cfg name='path.framework.frontend.web'}/js/vendor/markitup/jquery.markitup.js"></script>
<script>
jQuery(function($) {

View file

@ -43,7 +43,7 @@
*}
{hookb run="registration_captcha" isPopup=$isModal}
<p class="form-signup-field-captcha"><label for="js-form-signup-captcha">{$aLang.registration_captcha}</label>
<span {if ! $isModal}style="background-image: url({cfg name='path.root.engine_lib'}/external/kcaptcha/index.php?{$_sPhpSessionName}={$_sPhpSessionId});"{/if} class="form-auth-captcha js-form-auth-captcha"></span>
<span {if ! $isModal}style="background-image: url({cfg name='path.framework.libs_vendor.web'}/kcaptcha/index.php?{$_sPhpSessionName}={$_sPhpSessionId});"{/if} class="form-auth-captcha js-form-auth-captcha"></span>
<input type="text" name="captcha" value="" maxlength="3" id="js-form-signup-captcha" class="width-100 js-ajax-validate js-form-signup-captcha" />
<small class="validate-error-hide validate-error-field-captcha"></small></p>
{/hookb}

View file

@ -27,7 +27,7 @@
{$aHtmlHeadFiles.css}
<link href='http://fonts.googleapis.com/css?family=PT+Sans:400,700&amp;subset=latin,cyrillic' rel='stylesheet' type='text/css'>
<link href="{cfg name='path.static.assets'}/images/favicons/favicon.ico?v1" rel="shortcut icon" />
<link href="{cfg name='path.skin.assets.web'}/images/favicons/favicon.ico?v1" rel="shortcut icon" />
<link rel="search" type="application/opensearchdescription+xml" href="{router page='search'}opensearch/" title="{cfg name='view.name'}" />
{**
@ -43,15 +43,23 @@
<script>
var DIR_WEB_ROOT = '{cfg name="path.root.web"}',
DIR_STATIC_SKIN = '{cfg name="path.static.skin"}',
DIR_STATIC_FRAMEWORK = '{cfg name="path.static.framework"}',
DIR_ENGINE_LIBS = '{cfg name="path.root.engine_lib"}',
LIVESTREET_SECURITY_KEY = '{$LIVESTREET_SECURITY_KEY}',
SESSION_ID = '{$_sPhpSessionId}',
SESSION_NAME = '{$_sPhpSessionName}',
LANGUAGE = '{$oConfig->GetValue('lang.current')}',
WYSIWYG = {if $oConfig->GetValue('view.wysiwyg')}true{else}false{/if};
var PATH_ROOT = '{cfg name="path.root.web"}',
PATH_SKIN = '{cfg name="path.skin.web"}',
PATH_FRAMEWORK_FRONTEND = '{cfg name="path.framework.frontend.web"}',
PATH_FRAMEWORK_LIBS_VENDOR = '{cfg name="path.framework.libs_vendor.web"}',
/**
* Для совместимости с прошлыми версиями. БУДУТ УДАЛЕНЫ
*/
DIR_WEB_ROOT = '{cfg name="path.root.web"}',
DIR_STATIC_SKIN = '{cfg name="path.skin.web"}',
DIR_STATIC_FRAMEWORK = '{cfg name="path.framework.frontend.web"}',
DIR_ENGINE_LIBS = '{cfg name="path.framework.web"}/libs',
LIVESTREET_SECURITY_KEY = '{$LIVESTREET_SECURITY_KEY}',
SESSION_ID = '{$_sPhpSessionId}',
SESSION_NAME = '{$_sPhpSessionName}',
LANGUAGE = '{$oConfig->GetValue('lang.current')}',
WYSIWYG = {if $oConfig->GetValue('view.wysiwyg')}true{else}false{/if};
var aRouter = [];
{foreach $aRouter as $sPage => $sPath}

View file

@ -33,47 +33,47 @@ $config['view']['grid']['fixed_width'] = 976;
/* Styles */
$config['head']['default']['js'] = Config::Get('head.default.js');
$config['head']['default']['js'][] = '___path.static.assets___/js/init.js';
$config['head']['default']['js'][] = '___path.static.assets___/js/stream.js';
$config['head']['default']['js'][] = '___path.static.assets___/js/blog.js';
$config['head']['default']['js'][] = '___path.skin.assets.web___/js/init.js';
$config['head']['default']['js'][] = '___path.skin.assets.web___/js/stream.js';
$config['head']['default']['js'][] = '___path.skin.assets.web___/js/blog.js';
/* JavaScript */
$config['head']['default']['css'] = array_merge(Config::Get('head.default.css'), array(
// Template styles
"___path.static.assets___/css/base.css",
"___path.static.framework___/js/vendor/jquery-ui/css/smoothness/jquery-ui-1.10.2.custom.css",
"___path.static.framework___/js/vendor/markitup/skins/synio/style.css",
"___path.static.framework___/js/vendor/markitup/sets/synio/style.css",
"___path.static.framework___/js/vendor/jcrop/jquery.Jcrop.css",
"___path.static.framework___/js/vendor/prettify/prettify.css",
"___path.static.framework___/js/vendor/prettyphoto/css/prettyphoto.css",
"___path.static.assets___/css/grid.css",
"___path.static.assets___/css/common.css",
"___path.static.assets___/css/text.css",
"___path.static.assets___/css/forms.css",
"___path.skin.assets.web___/css/base.css",
"___path.framework.frontend.web___/js/vendor/jquery-ui/css/smoothness/jquery-ui-1.10.2.custom.css",
"___path.framework.frontend.web___/js/vendor/markitup/skins/synio/style.css",
"___path.framework.frontend.web___/js/vendor/markitup/sets/synio/style.css",
"___path.framework.frontend.web___/js/vendor/jcrop/jquery.Jcrop.css",
"___path.framework.frontend.web___/js/vendor/prettify/prettify.css",
"___path.framework.frontend.web___/js/vendor/prettyphoto/css/prettyphoto.css",
"___path.skin.assets.web___/css/grid.css",
"___path.skin.assets.web___/css/common.css",
"___path.skin.assets.web___/css/text.css",
"___path.skin.assets.web___/css/forms.css",
"___path.static.assets___/css/buttons.css",
"___path.static.assets___/css/tooltip.css",
"___path.static.assets___/css/popovers.css",
"___path.static.assets___/css/modals.css",
"___path.static.assets___/css/dropdowns.css",
"___path.static.assets___/css/toolbar.css",
"___path.static.assets___/css/vendor/jquery.notifier.css",
"___path.static.assets___/css/navs.css",
"___path.static.assets___/css/icons.css",
"___path.static.assets___/css/tables.css",
"___path.static.assets___/css/topic.css",
"___path.static.assets___/css/photoset.css",
"___path.static.assets___/css/comments.css",
"___path.static.assets___/css/blocks.css",
"___path.static.assets___/css/blog.css",
"___path.static.assets___/css/profile.css",
"___path.static.assets___/css/wall.css",
"___path.static.assets___/css/activity.css",
"___path.static.assets___/css/admin.css",
"___path.static.assets___/css/poll.css",
"___path.static.skin___/themes/___view.theme___/style.css",
"___path.static.assets___/css/print.css",
"___path.skin.assets.web___/css/buttons.css",
"___path.skin.assets.web___/css/tooltip.css",
"___path.skin.assets.web___/css/popovers.css",
"___path.skin.assets.web___/css/modals.css",
"___path.skin.assets.web___/css/dropdowns.css",
"___path.skin.assets.web___/css/toolbar.css",
"___path.skin.assets.web___/css/vendor/jquery.notifier.css",
"___path.skin.assets.web___/css/navs.css",
"___path.skin.assets.web___/css/icons.css",
"___path.skin.assets.web___/css/tables.css",
"___path.skin.assets.web___/css/topic.css",
"___path.skin.assets.web___/css/photoset.css",
"___path.skin.assets.web___/css/comments.css",
"___path.skin.assets.web___/css/blocks.css",
"___path.skin.assets.web___/css/blog.css",
"___path.skin.assets.web___/css/profile.css",
"___path.skin.assets.web___/css/wall.css",
"___path.skin.assets.web___/css/activity.css",
"___path.skin.assets.web___/css/admin.css",
"___path.skin.assets.web___/css/poll.css",
"___path.skin.web___/themes/___view.theme___/style.css",
"___path.skin.assets.web___/css/print.css",
));

View file

@ -43,7 +43,7 @@ abstract class ActionPlugin extends Action {
* Проверяем в списке шаблонов
*/
$aMatches[1]=strtolower($aMatches[1]);
$aPaths=glob(Config::Get('path.root.application').'/plugins/'.$aMatches[1].'/templates/skin/*/actions/Action'.ucfirst($aMatches[2]),GLOB_ONLYDIR);
$aPaths=glob(Config::Get('path.application.plugins.server').'/'.$aMatches[1].'/templates/skin/*/actions/Action'.ucfirst($aMatches[2]),GLOB_ONLYDIR);
$sTemplateName=($aPaths and in_array(
Config::Get('view.skin'),
array_map(
@ -57,7 +57,7 @@ abstract class ActionPlugin extends Action {
? Config::Get('view.skin')
: 'default';
$sDir=Config::Get('path.root.application')."/plugins/{$aMatches[1]}/templates/skin/{$sTemplateName}/";
$sDir=Config::Get('path.application.plugins.server')."/{$aMatches[1]}/templates/skin/{$sTemplateName}/";
$this->sTemplatePathPlugin = is_dir($sDir) ? $sDir : null;
}

View file

@ -16,7 +16,7 @@
*/
set_include_path(get_include_path().PATH_SEPARATOR.dirname(__FILE__));
require_once(Config::Get('path.root.framework').'/libs/application/ProfilerSimple/Profiler.class.php');
require_once(Config::Get('path.framework.libs_application.server').'/ProfilerSimple/Profiler.class.php');
require_once("LsObject.class.php");
require_once("Plugin.class.php");
@ -422,7 +422,7 @@ class Engine extends LsObject {
*
*/
protected function InitHooks() {
$sDirHooks=Config::Get('path.root.application').'/classes/hooks/';
$sDirHooks=Config::Get('path.application.server').'/classes/hooks/';
$aFiles=glob($sDirHooks.'Hook*.class.php');
if($aFiles and count($aFiles)) {
@ -448,7 +448,7 @@ class Engine extends LsObject {
*/
protected function InitPluginHooks() {
if($aPluginList = func_list_plugins()) {
$sDirHooks=Config::Get('path.root.application').'/plugins/';
$sDirHooks=Config::Get('path.application.plugins.server').'/';
foreach ($aPluginList as $sPluginName) {
$aFiles=glob($sDirHooks.$sPluginName.'/classes/hooks/Hook*.class.php');
@ -1004,8 +1004,8 @@ class Engine extends LsObject {
$oObject,
self::CI_OBJECT
);
$sPath = Config::get('path.root.application').'/';
$sPathFramework = Config::get('path.root.framework').'/';
$sPath = Config::get('path.application.server').'/';
$sPathFramework = Config::get('path.framework.server').'/';
if($aInfo[self::CI_ENTITY]){
// Сущность
if($aInfo[self::CI_PLUGIN]){

View file

@ -228,7 +228,7 @@ abstract class Plugin extends LsObject {
*/
public function GetVersion() {
preg_match('/^Plugin([\w]+)$/i',get_class($this),$aMatches);
$sPluginXML = Config::Get('path.root.application').'/plugins/'.func_underscore($aMatches[1]).'/'.ModulePlugin::PLUGIN_XML_FILE;
$sPluginXML = Config::Get('path.application.plugins.server').'/'.func_underscore($aMatches[1]).'/'.ModulePlugin::PLUGIN_XML_FILE;
if($oXml = @simplexml_load_file($sPluginXML)) {
return (string)$oXml->version;
}
@ -256,7 +256,7 @@ abstract class Plugin extends LsObject {
? func_underscore($aMatches[1])
: func_underscore($sName);
return Config::Get('path.root.application').'/plugins/'.$sName.'/';
return Config::Get('path.application.plugins.server').'/'.$sName.'/';
}
/**
* Возвращает полный web-адрес до плагина
@ -283,12 +283,12 @@ abstract class Plugin extends LsObject {
? func_underscore($aMatches[1])
: func_underscore($sName);
if(!isset(self::$aTemplatePath[$sName])) {
$aPaths=glob(Config::Get('path.root.application').'/plugins/'.$sName.'/templates/skin/*',GLOB_ONLYDIR);
$aPaths=glob(Config::Get('path.application.plugins.server').'/'.$sName.'/templates/skin/*',GLOB_ONLYDIR);
$sTemplateName=($aPaths and in_array(Config::Get('view.skin'),array_map('basename',$aPaths)))
? Config::Get('view.skin')
: 'default';
$sDir=Config::Get('path.root.application')."/plugins/{$sName}/templates/skin/{$sTemplateName}/";
$sDir=Config::Get('path.application.plugins.server')."/{$sName}/templates/skin/{$sTemplateName}/";
self::$aTemplatePath[$sName] = is_dir($sDir) ? $sDir : null;
}
return self::$aTemplatePath[$sName];
@ -305,12 +305,12 @@ abstract class Plugin extends LsObject {
? func_underscore($aMatches[1])
: func_underscore($sName);
if(!isset(self::$aTemplateWebPath[$sName])) {
$aPaths=glob(Config::Get('path.root.application').'/plugins/'.$sName.'/templates/skin/*',GLOB_ONLYDIR);
$aPaths=glob(Config::Get('path.application.plugins.server').'/'.$sName.'/templates/skin/*',GLOB_ONLYDIR);
$sTemplateName=($aPaths and in_array(Config::Get('view.skin'),array_map('basename',$aPaths)))
? Config::Get('view.skin')
: 'default';
self::$aTemplateWebPath[$sName]=Config::Get('path.root.web')."/application/plugins/{$sName}/templates/skin/{$sTemplateName}/";
self::$aTemplateWebPath[$sName]=Config::Get('path.application.plugins.web')."/{$sName}/templates/skin/{$sTemplateName}/";
}
return self::$aTemplateWebPath[$sName];
}

View file

@ -15,7 +15,7 @@
---------------------------------------------------------
*/
require_once(Config::Get('path.root.framework').'/libs/vendor/DklabCache/config.php');
require_once(Config::Get('path.framework.libs_vendor.server').'/DklabCache/config.php');
require_once(LS_DKCACHE_PATH.'Zend/Cache.php');
require_once(LS_DKCACHE_PATH.'Cache/Backend/MemcachedMultiload.php');
require_once(LS_DKCACHE_PATH.'Cache/Backend/TagEmuWrapper.php');

View file

@ -15,7 +15,7 @@
---------------------------------------------------------
*/
require_once(Config::Get('path.root.framework').'/libs/vendor/DbSimple/Generic.php');
require_once(Config::Get('path.framework.libs_vendor.server').'/DbSimple/Generic.php');
/**
* Модуль для работы с базой данных
* Создаёт объект БД библиотеки DbSimple Дмитрия Котерова

View file

@ -15,7 +15,7 @@
---------------------------------------------------------
*/
require_once Config::Get('path.root.framework').'/libs/vendor/LiveImage/Image.php';
require_once Config::Get('path.framework.libs_vendor.server').'/LiveImage/Image.php';
/**
* Модуль обработки изображений

View file

@ -152,7 +152,7 @@ class ModuleLang extends Module {
*/
if($aPluginList = Engine::getInstance()->GetPlugins()) {
$aPluginList=array_keys($aPluginList);
$sDir=Config::Get('path.root.application').'/plugins/';
$sDir=Config::Get('path.application.plugins.server').'/';
foreach ($aPluginList as $sPluginName) {
$aFiles=glob($sDir.$sPluginName.'/templates/'.Config::Get('lang.dir').'/'.$sLangName.'.php');

View file

@ -80,7 +80,7 @@ class ModuleLogger extends Module {
*
*/
public function Init() {
$this->sPathLogs=Config::Get('path.root.application').'/logs/';
$this->sPathLogs=Config::Get('path.application.server').'/logs/';
$this->SetFileName(Config::Get('sys.logs.file'));
$this->iRandom=rand(1000,9999);
}

View file

@ -15,7 +15,7 @@
---------------------------------------------------------
*/
require_once(Config::Get('path.root.framework').'/libs/vendor/phpMailer/class.phpmailer.php');
require_once(Config::Get('path.framework.libs_vendor.server').'/phpMailer/class.phpmailer.php');
/**
* Модуль для отправки почты(e-mail) через phpMailer

View file

@ -67,7 +67,7 @@ class ModulePlugin extends Module {
*
*/
public function Init() {
$this->sPluginsDir=Config::Get('path.root.application').'/plugins/';
$this->sPluginsDir=Config::Get('path.application.plugins.server').'/';
}
/**
* Получает список информации о всех плагинах, загруженных в plugin-директорию

View file

@ -15,7 +15,7 @@
---------------------------------------------------------
*/
require_once(Config::Get('path.root.framework').'/libs/vendor/Jevix/jevix.class.php');
require_once(Config::Get('path.framework.libs_vendor.server').'/Jevix/jevix.class.php');
/**
* Модуль обработки текста на основе типографа Jevix

View file

@ -59,7 +59,7 @@ class ModuleValidate_EntityValidatorDate extends ModuleValidate_EntityValidator
return true;
}
require_once(Config::Get('path.root.framework').'/libs/vendor/DateTime/DateTimeParser.php');
require_once(Config::Get('path.framework.libs_vendor.server').'/DateTime/DateTimeParser.php');
$aFormats=is_string($this->format) ? array($this->format) : $this->format;
$bValid=false;

View file

@ -75,7 +75,7 @@ class ModuleValidate_EntityValidatorType extends ModuleValidate_EntityValidator
return true;
}
require_once(Config::Get('path.root.framework').'/libs/vendor/DateTime/DateTimeParser.php');
require_once(Config::Get('path.framework.libs_vendor.server').'/DateTime/DateTimeParser.php');
if($this->type==='integer') {
$bValid=preg_match('/^[-+]?[0-9]+$/',trim($sValue));

View file

@ -15,10 +15,10 @@
---------------------------------------------------------
*/
require_once(Config::Get('path.root.framework').'/libs/vendor/Smarty/libs/Smarty.class.php');
require_once(Config::Get('path.root.framework').'/libs/application/SmartyLS/SmartyLS.class.php');
require_once(Config::Get('path.root.framework').'/libs/vendor/CSSTidy-1.3/class.csstidy.php');
require_once(Config::Get('path.root.framework').'/libs/vendor/JSMin-1.1.1/jsmin.php');
require_once(Config::Get('path.framework.libs_vendor.server').'/Smarty/libs/Smarty.class.php');
require_once(Config::Get('path.framework.libs_application.server').'/SmartyLS/SmartyLS.class.php');
require_once(Config::Get('path.framework.libs_vendor.server').'/CSSTidy-1.3/class.csstidy.php');
require_once(Config::Get('path.framework.libs_vendor.server').'/JSMin-1.1.1/jsmin.php');
/**
* Модуль обработки шаблонов используя шаблонизатор Smarty
@ -207,7 +207,7 @@ class ModuleViewer extends Module {
*/
$this->oSmarty = $this->CreateSmartyObject();
$this->oSmarty->error_reporting=error_reporting() & ~E_NOTICE; // подавляем NOTICE ошибки - в этом вся прелесть смарти )
$this->oSmarty->setTemplateDir(array_merge((array)Config::Get('path.smarty.template'),array(Config::Get('path.root.application').'/plugins/')));
$this->oSmarty->setTemplateDir(array_merge((array)Config::Get('path.smarty.template'),array(Config::Get('path.application.plugins.server').'/')));
$this->oSmarty->compile_check=Config::Get('smarty.compile_check');
$this->oSmarty->force_compile=Config::Get('smarty.force_compile');
/**
@ -1430,15 +1430,15 @@ class ModuleViewer extends Module {
*/
if (Config::Get('view.skin')!='default') {
// /root/plugins/[plugin name]/templates/skin/[skin name]/dir/test.tpl
if (preg_match('@^'.preg_quote(Config::Get('path.root.application')).'/plugins/([\w\-_]+)/templates/skin/'.preg_quote(Config::Get('view.skin')).'/@i',$sName,$aMatch)) {
$sFile=str_replace($aMatch[0],Config::Get('path.root.application').'/plugins/'.$aMatch[1].'/templates/skin/default/',$sName);
if (preg_match('@^'.preg_quote(Config::Get('path.application.plugins.server')).'/([\w\-_]+)/templates/skin/'.preg_quote(Config::Get('view.skin')).'/@i',$sName,$aMatch)) {
$sFile=str_replace($aMatch[0],Config::Get('path.application.plugins.server').'/'.$aMatch[1].'/templates/skin/default/',$sName);
if ($this->TemplateExists($sFile)) {
return $sFile;
}
}
// [plugin name]/templates/skin/[skin name]/dir/test.tpl
if (preg_match('@^([\w\-_]+)/templates/skin/'.preg_quote(Config::Get('view.skin')).'/@i',$sName,$aMatch)) {
$sFile=Config::Get('path.root.application').'/plugins/'.str_replace($aMatch[0],$aMatch[1].'/templates/skin/default/',$sName);
$sFile=Config::Get('path.application.plugins.server').'/'.str_replace($aMatch[0],$aMatch[1].'/templates/skin/default/',$sName);
if ($this->TemplateExists($sFile)) {
return $sFile;
}

View file

@ -28,7 +28,7 @@ function smarty_function_cfg($aParams,&$oSmarty) {
trigger_error("Config: missing 'name' parametr",E_USER_WARNING);
return ;
}
require_once(Config::Get('path.root.framework').'/libs/application/ConfigSimple/Config.class.php');
require_once(Config::Get('path.framework.libs_application.server').'/ConfigSimple/Config.class.php');
if(!isset($aParams['instance'])) {
$aParams['instance'] = Config::DEFAULT_CONFIG_INSTANCE;
}

View file

@ -39,7 +39,7 @@
* @return string
*/
function smarty_function_date_format($aParams,&$oSmarty) {
require_once(Config::Get('path.root.framework').'/classes/engine/Engine.class.php');
require_once(Config::Get('path.framework.server').'/classes/engine/Engine.class.php');
$oEngine = Engine::getInstance();
$sFormatDefault = "d F Y, H:i"; // формат даты по умолчанию

View file

@ -28,7 +28,7 @@ function smarty_function_router($aParams,&$oSmarty) {
trigger_error("Router: missing 'page' parametr",E_USER_WARNING);
return ;
}
require_once(Config::Get('path.root.framework').'/classes/engine/Router.class.php');
require_once(Config::Get('path.framework.server').'/classes/engine/Router.class.php');
if(!$sPath = Router::GetPath($aParams['page'])) {
trigger_error("Router: unknown 'page' given",E_USER_WARNING);

View file

@ -19,7 +19,7 @@
* !!!!! ВНИМАНИЕ !!!!!
*
* Ничего не изменяйте в этом файле!
* Все изменения нужно вносить в файл /config/config.local.php
* Все изменения нужно вносить в файл /application/config/config.local.php
*/
/**
@ -37,40 +37,52 @@ $config['view']['noindex'] = true; // "прятать" или нет
*/
$config['pagination']['pages']['count'] = 4; // количество ссылок на другие страницы в пагинации
/**
* Настройка путей
* Если необходимо установить движек в директорию(не корень сайта) то следует сделать так:
* $config['path']['root']['web'] = 'http://'.$_SERVER['HTTP_HOST'].'/subdir';
* $config['path']['root']['server'] = $_SERVER['DOCUMENT_ROOT'].'/subdir';
* и возможно придёться увеличить значение $config['path']['offset_request_url'] на число вложенных директорий,
* например, для директории первой вложенности www.site.ru/livestreet/ поставить значение равное 1
* Настройки путей
* Основные
*/
if (isset($_SERVER['HTTP_HOST'])) {
$config['path']['root']['web'] = 'http://'.$_SERVER['HTTP_HOST']; // полный WEB адрес сайта
} else {
// for CLI scripts. or you can append "HTTP_HOST=http://yoursite.url" before script run command
$config['path']['root']['web'] = null;
}
$config['path']['root']['server'] = dirname(dirname(dirname(__FILE__))); // полный путь до сайта в файловой системе
$config['path']['root']['application'] = '___path.root.server___/application'; // полный путь до сайта в файловой системе
$config['path']['root']['engine'] = LS_FRAMEWORK_PATH; // полный путь до сайта в файловой системе;
$config['path']['root']['engine_lib'] = '___path.root.web___/framework/libs'; // полный путь до сайта в файловой системе
$config['path']['root']['framework'] = '___path.root.engine___';
$config['path']['static']['root'] = '___path.root.web___'; // чтоб можно было статику засунуть на отдельный сервер
$config['path']['static']['skin'] = '___path.static.root___/application/frontend/skin/___view.skin___';
$config['path']['static']['assets'] = '___path.static.skin___/assets'; // Папка с ассетами (js, css, images)
$config['path']['static']['framework'] = "___path.static.root___/framework/frontend/framework"; // Front-end framework todo: need fix path
$config['path']['uploads']['root'] = '/uploads'; // директория для загрузки файлов
$config['path']['uploads']['images'] ='___path.uploads.root___/images';
$config['path']['root']['server']=dirname(dirname(dirname(__FILE__))); // Из расчета, что каталог с фреймворком лежит в корне сайта, иначе нужно переопределить настройку в конфиге /application/config/config.php
$config['path']['root']['web']=isset($_SERVER['HTTP_HOST']) ? 'http://'.$_SERVER['HTTP_HOST'] : null;
$config['path']['application']['server']='___path.root.server___/application';
$config['path']['application']['web']='___path.root.web___/application';
$config['path']['framework']['server']=dirname(dirname(__FILE__));
$config['path']['framework']['web']='___path.root.web___/'.trim(str_replace(dirname(dirname(dirname(__FILE__))),'',$config['path']['framework']['server']),'/'); // Подставляет название каталога в котором фреймворк, относительно корня сайта. Необходимо переопределить при изменении расположения фреймворка.
/**
* Производные
*/
$config['path']['application']['plugins']['server']='___path.application.server___/plugins';
$config['path']['application']['plugins']['web']='___path.application.web___/plugins';
$config['path']['framework']['libs_vendor']['server']='___path.framework.server___/libs/vendor';
$config['path']['framework']['libs_vendor']['web']='___path.framework.web___/libs/vendor';
$config['path']['framework']['libs_application']['server']='___path.framework.server___/libs/application';
$config['path']['framework']['libs_application']['web']='___path.framework.web___/libs/application';
$config['path']['framework']['frontend']['web']='___path.framework.web___/frontend/framework';
$config['path']['skin']['web']='___path.application.web___/frontend/skin/___view.skin___';
$config['path']['skin']['assets']['web']='___path.skin.web___/assets';
$config['path']['uploads']['base']='/uploads';
$config['path']['uploads']['images']='___path.uploads.base___/images';
$config['path']['offset_request_url'] = 0; // иногда помогает если сервер использует внутренние реврайты
/**
* Для совместимости с прошлыми версиями
* Данные настройки будут удалены
*/
//$config['path']['root']['application'] = '___path.root.server___/application'; // полный путь до сайта в файловой системе
$config['path']['root']['engine'] = '___path.framework.server___'; // полный путь до сайта в файловой системе;
$config['path']['root']['engine_lib'] = '___path.framework.web___/libs'; // полный путь до сайта в файловой системе
//$config['path']['root']['framework'] = '___path.root.engine___';
$config['path']['static']['root'] = '___path.root.web___'; // чтоб можно было статику засунуть на отдельный сервер
$config['path']['static']['skin'] = '___path.skin.web___';
//$config['path']['static']['assets'] = '___path.static.skin___/assets'; // Папка с ассетами (js, css, images)
//$config['path']['static']['framework'] = "___path.static.root___/framework/frontend/framework"; // Front-end framework todo: need fix path
$config['path']['uploads']['root'] = '___path.uploads.base___'; // директория для загрузки файлов
/**
* Настройки шаблонизатора Smarty
*/
$config['path']['smarty']['template'] = '___path.root.application___/frontend/skin/___view.skin___';
$config['path']['smarty']['compiled'] = '___path.root.application___/tmp/templates/compiled';
$config['path']['smarty']['cache'] = '___path.root.application___/tmp/templates/cache';
$config['path']['smarty']['plug'] = '___path.root.framework___/classes/modules/viewer/plugs';
$config['path']['smarty']['template'] = '___path.application.server___/frontend/skin/___view.skin___';
$config['path']['smarty']['compiled'] = '___path.application.server___/tmp/templates/compiled';
$config['path']['smarty']['cache'] = '___path.application.server___/tmp/templates/cache';
$config['path']['smarty']['plug'] = '___path.framework.server___/classes/modules/viewer/plugs';
$config['smarty']['compile_check'] = true; // Проверять или нет файлы шаблона на изменения перед компиляцией, false может значительно увеличить быстродействие, но потребует ручного удаления кеша при изменения шаблона
$config['smarty']['force_compile'] = false; // Принудительно компилировать шаблоны при каждом запросе, true - существенно снижает производительность
/**
@ -112,7 +124,7 @@ $config['sys']['mail']['include_talk'] = true; // Вклю
// Устанавливаем настройки кеширования
$config['sys']['cache']['use'] = true; // использовать кеширование или нет
$config['sys']['cache']['type'] = 'file'; // тип кеширования: file, xcache и memory. memory использует мемкеш, xcache - использует XCache
$config['sys']['cache']['dir'] = '___path.root.application___/tmp/'; // каталог для файлового кеша, также используется для временных картинок. По умолчанию подставляем каталог для хранения сессий
$config['sys']['cache']['dir'] = '___path.application.server___/tmp/'; // каталог для файлового кеша, также используется для временных картинок. По умолчанию подставляем каталог для хранения сессий
$config['sys']['cache']['prefix'] = 'livestreet_cache'; // префикс кеширования, чтоб можно было на одной машине держать несколько сайтов с общим кешевым хранилищем
$config['sys']['cache']['directory_level'] = 1; // уровень вложенности директорий файлового кеша
$config['sys']['cache']['solid'] = true; // Настройка использования раздельного и монолитного кеша для отдельных операций
@ -136,7 +148,7 @@ $config['sys']['logs']['hacker_console'] = false; // позволяет уд
$config['lang']['current'] = 'ru'; // текущий язык текстовок
$config['lang']['default'] = 'ru'; // язык, который будет использовать на сайте по умолчанию
$config['lang']['dir'] = 'i18n'; // название директории с языковыми файлами
$config['lang']['path'] = '___path.root.application___/frontend/___lang.dir___'; // полный путь до языковых файлов
$config['lang']['path'] = '___path.application.server___/frontend/___lang.dir___'; // полный путь до языковых файлов
$config['lang']['load_to_js'] = array(); // Массив текстовок, которые необходимо прогружать на страницу в виде JS хеша, позволяет использовать текстовки внутри js
/**
* Настройки модулей
@ -166,8 +178,8 @@ $config['module']['image']['default']['watermark_min_height'] = 130;
$config['module']['image']['default']['round_corner'] = false;
$config['module']['image']['default']['round_corner_radius'] = '18';
$config['module']['image']['default']['round_corner_rate'] = '40';
$config['module']['image']['default']['path']['watermarks'] = '___path.root.framework___/libs/vendor/LiveImage/watermarks/';
$config['module']['image']['default']['path']['fonts'] = '___path.root.framework___/libs/vendor/LiveImage/fonts/';
$config['module']['image']['default']['path']['watermarks'] = '___path.framework.libs_vendor.server___/LiveImage/watermarks/';
$config['module']['image']['default']['path']['fonts'] = '___path.framework.libs_vendor.server___/LiveImage/fonts/';
$config['module']['image']['default']['jpg_quality'] = 95; // Число от 0 до 100
// Модуль Security
@ -216,56 +228,56 @@ $config['router']['config']['action_not_found'] = 'error';
$config['head']['default']['js'] = array(
/* Vendor libs */
"___path.static.framework___/js/vendor/html5shiv.js" => array('browser'=>'lt IE 9'),
"___path.static.framework___/js/vendor/jquery-1.9.1.min.js",
"___path.static.framework___/js/vendor/jquery-ui/js/jquery-ui-1.10.2.custom.min.js",
"___path.static.framework___/js/vendor/jquery-ui/js/localization/jquery-ui-datepicker-ru.js",
"___path.static.framework___/js/vendor/jquery.browser.js",
"___path.static.framework___/js/vendor/jquery.scrollto.js",
"___path.static.framework___/js/vendor/jquery.rich-array.min.js",
"___path.static.framework___/js/vendor/jquery.form.js",
"___path.static.framework___/js/vendor/jquery.jqplugin.js",
"___path.static.framework___/js/vendor/jquery.cookie.js",
"___path.static.framework___/js/vendor/jquery.serializejson.js",
"___path.static.framework___/js/vendor/jquery.file.js",
"___path.static.framework___/js/vendor/jcrop/jquery.Jcrop.js",
"___path.static.framework___/js/vendor/jquery.placeholder.min.js",
"___path.static.framework___/js/vendor/jquery.charcount.js",
"___path.static.framework___/js/vendor/jquery.imagesloaded.js",
"___path.static.framework___/js/vendor/notifier/jquery.notifier.js",
"___path.static.framework___/js/vendor/prettify/prettify.js",
"___path.static.framework___/js/vendor/prettyphoto/js/jquery.prettyphoto.js",
"___path.static.framework___/js/vendor/parsley/parsley.js",
"___path.static.framework___/js/vendor/parsley/i18n/messages.ru.js",
"___path.framework.frontend.web___/js/vendor/html5shiv.js" => array('browser'=>'lt IE 9'),
"___path.framework.frontend.web___/js/vendor/jquery-1.9.1.min.js",
"___path.framework.frontend.web___/js/vendor/jquery-ui/js/jquery-ui-1.10.2.custom.min.js",
"___path.framework.frontend.web___/js/vendor/jquery-ui/js/localization/jquery-ui-datepicker-ru.js",
"___path.framework.frontend.web___/js/vendor/jquery.browser.js",
"___path.framework.frontend.web___/js/vendor/jquery.scrollto.js",
"___path.framework.frontend.web___/js/vendor/jquery.rich-array.min.js",
"___path.framework.frontend.web___/js/vendor/jquery.form.js",
"___path.framework.frontend.web___/js/vendor/jquery.jqplugin.js",
"___path.framework.frontend.web___/js/vendor/jquery.cookie.js",
"___path.framework.frontend.web___/js/vendor/jquery.serializejson.js",
"___path.framework.frontend.web___/js/vendor/jquery.file.js",
"___path.framework.frontend.web___/js/vendor/jcrop/jquery.Jcrop.js",
"___path.framework.frontend.web___/js/vendor/jquery.placeholder.min.js",
"___path.framework.frontend.web___/js/vendor/jquery.charcount.js",
"___path.framework.frontend.web___/js/vendor/jquery.imagesloaded.js",
"___path.framework.frontend.web___/js/vendor/notifier/jquery.notifier.js",
"___path.framework.frontend.web___/js/vendor/prettify/prettify.js",
"___path.framework.frontend.web___/js/vendor/prettyphoto/js/jquery.prettyphoto.js",
"___path.framework.frontend.web___/js/vendor/parsley/parsley.js",
"___path.framework.frontend.web___/js/vendor/parsley/i18n/messages.ru.js",
/* Core */
"___path.static.framework___/js/core/main.js",
"___path.static.framework___/js/core/hook.js",
"___path.framework.frontend.web___/js/core/main.js",
"___path.framework.frontend.web___/js/core/hook.js",
/* User Interface */
"___path.static.framework___/js/ui/popup.js",
"___path.static.framework___/js/ui/dropdown.js",
"___path.static.framework___/js/ui/tooltip.js",
"___path.static.framework___/js/ui/popover.js",
"___path.static.framework___/js/ui/tab.js",
"___path.static.framework___/js/ui/modal.js",
"___path.static.framework___/js/ui/toolbar.js",
"___path.framework.frontend.web___/js/ui/popup.js",
"___path.framework.frontend.web___/js/ui/dropdown.js",
"___path.framework.frontend.web___/js/ui/tooltip.js",
"___path.framework.frontend.web___/js/ui/popover.js",
"___path.framework.frontend.web___/js/ui/tab.js",
"___path.framework.frontend.web___/js/ui/modal.js",
"___path.framework.frontend.web___/js/ui/toolbar.js",
);
$config['head']['default']['css'] = array(
// Framework styles
"___path.static.framework___/css/reset.css",
"___path.static.framework___/css/helpers.css",
"___path.static.framework___/css/text.css",
"___path.static.framework___/css/dropdowns.css",
"___path.static.framework___/css/buttons.css",
"___path.static.framework___/css/forms.css",
"___path.static.framework___/css/navs.css",
"___path.static.framework___/css/modals.css",
"___path.static.framework___/css/tooltip.css",
"___path.static.framework___/css/popover.css",
"___path.static.framework___/css/alerts.css",
"___path.static.framework___/css/toolbar.css"
"___path.framework.frontend.web___/css/reset.css",
"___path.framework.frontend.web___/css/helpers.css",
"___path.framework.frontend.web___/css/text.css",
"___path.framework.frontend.web___/css/dropdowns.css",
"___path.framework.frontend.web___/css/buttons.css",
"___path.framework.frontend.web___/css/forms.css",
"___path.framework.frontend.web___/css/navs.css",
"___path.framework.frontend.web___/css/modals.css",
"___path.framework.frontend.web___/css/tooltip.css",
"___path.framework.frontend.web___/css/popover.css",
"___path.framework.frontend.web___/css/alerts.css",
"___path.framework.frontend.web___/css/toolbar.css"
);
/**

View file

@ -19,11 +19,11 @@
* Основные константы
*/
define('LS_VERSION','1.1.0.dev');
define('LS_FRAMEWORK_PATH',dirname(dirname(__FILE__)));
define('LS_VERSION_FRAMEWORK','2.0.0.dev');
/**
* Operations with Config object
*/
require_once(LS_FRAMEWORK_PATH."/libs/application/ConfigSimple/Config.class.php");
require_once(dirname(dirname(__FILE__))."/libs/application/ConfigSimple/Config.class.php");
/**
* Загружаем основной конфиг фреймворка
*/
@ -31,14 +31,14 @@ Config::LoadFromFile(dirname(__FILE__).'/config.php');
/**
* Загружаем основной конфиг приложения
*/
Config::LoadFromFile(Config::Get('path.root.application').'/config/config.php',false);
Config::LoadFromFile(Config::Get('path.application.server').'/config/config.php',false);
$fGetConfig = create_function('$sPath', '$config=array(); return include $sPath;');
/**
* Загружает конфиги модулей вида /config/modules/[module_name]/config.php
*/
$sDirConfig=Config::get('path.root.application').'/config/modules/';
$sDirConfig=Config::get('path.application.server').'/config/modules/';
if ($hDirConfig = opendir($sDirConfig)) {
while (false !== ($sDirModule = readdir($hDirConfig))) {
if ($sDirModule !='.' and $sDirModule !='..' and is_dir($sDirConfig.$sDirModule)) {
@ -69,7 +69,7 @@ if ($hDirConfig = opendir($sDirConfig)) {
/**
* Инклудим все *.php файлы из каталога {path.root.framework}/include/ - это файлы ядра
*/
$sDirInclude=Config::get('path.root.framework').'/include/';
$sDirInclude=Config::get('path.framework.server').'/include/';
if ($hDirInclude = opendir($sDirInclude)) {
while (false !== ($sFileInclude = readdir($hDirInclude))) {
$sFileIncludePathFull=$sDirInclude.$sFileInclude;
@ -86,7 +86,7 @@ if ($hDirInclude = opendir($sDirInclude)) {
/**
* Инклудим все *.php файлы из каталога {path.root.application}/include/ - пользовательские файлы
*/
$sDirInclude=Config::get('path.root.application').'/include/';
$sDirInclude=Config::get('path.application.server').'/include/';
if ($hDirInclude = opendir($sDirInclude)) {
while (false !== ($sFileInclude = readdir($hDirInclude))) {
$sFileIncludePathFull=$sDirInclude.$sFileInclude;
@ -104,7 +104,7 @@ if ($hDirInclude = opendir($sDirInclude)) {
* Ищет routes-конфиги модулей и объединяет их с текущим
* @see Router.class.php
*/
$sDirConfig=Config::get('path.root.application').'/config/modules/';
$sDirConfig=Config::get('path.application.server').'/config/modules/';
if ($hDirConfig = opendir($sDirConfig)) {
while (false !== ($sDirModule = readdir($hDirConfig))) {
if ($sDirModule !='.' and $sDirModule !='..' and is_dir($sDirConfig.$sDirModule)) {
@ -135,8 +135,8 @@ if(isset($_SERVER['HTTP_APP_ENV']) && $_SERVER['HTTP_APP_ENV']=='test') {
/**
* Подгружаем файл тестового конфига
*/
if(file_exists(Config::Get('path.root.application').'/config/config.test.php')) {
Config::LoadFromFile(Config::Get('path.root.application').'/config/config.test.php',false);
if(file_exists(Config::Get('path.application.server').'/config/config.test.php')) {
Config::LoadFromFile(Config::Get('path.application.server').'/config/config.test.php',false);
} else {
throw new Exception("Config for test envirenment is not found.
Rename /config/config.test.php.dist to /config/config.test.php and rewrite DB settings.
@ -146,11 +146,11 @@ if(isset($_SERVER['HTTP_APP_ENV']) && $_SERVER['HTTP_APP_ENV']=='test') {
/**
* Подгружаем файлы локального и продакшн-конфига
*/
if(file_exists(Config::Get('path.root.application').'/config/config.local.php')) {
Config::LoadFromFile(Config::Get('path.root.application').'/config/config.local.php',false);
if(file_exists(Config::Get('path.application.server').'/config/config.local.php')) {
Config::LoadFromFile(Config::Get('path.application.server').'/config/config.local.php',false);
}
if(file_exists(Config::Get('path.root.application').'/config/config.stable.php')) {
Config::LoadFromFile(Config::Get('path.root.application').'/config/config.stable.php',false);
if(file_exists(Config::Get('path.application.server').'/config/config.stable.php')) {
Config::LoadFromFile(Config::Get('path.application.server').'/config/config.stable.php',false);
}
}
@ -158,7 +158,7 @@ if(isset($_SERVER['HTTP_APP_ENV']) && $_SERVER['HTTP_APP_ENV']=='test') {
* Загружает конфиги плагинов вида /plugins/[plugin_name]/config/*.php
* и include-файлы /plugins/[plugin_name]/include/*.php
*/
$sPluginsDir = Config::Get('path.root.application').'/plugins';
$sPluginsDir = Config::Get('path.application.plugins.server');
$sPluginsListFile = $sPluginsDir.'/'.Config::Get('sys.plugins.activation_file');
if($aPluginsList=@file($sPluginsListFile)) {
$aPluginsList=array_map('trim',$aPluginsList);

View file

@ -187,7 +187,7 @@ ls.swfupload = (function ($) {
button_cursor: SWFUpload.CURSOR.HAND,
// Flash Settings
flash_url : DIR_STATIC_FRAMEWORK+'/js/vendor/swfupload/swfupload.swf',
flash_url : PATH_FRAMEWORK_FRONTEND+'/js/vendor/swfupload/swfupload.swf',
custom_settings : {
},
@ -209,7 +209,7 @@ ls.swfupload = (function ($) {
}else{
ls.debug('window.swfobject && swfobject.swfupload is undefined, load swfobject/plugin/swfupload.js');
$.getScript(
DIR_STATIC_FRAMEWORK+'/js/vendor/swfobject/plugin/swfupload.js',
PATH_FRAMEWORK_FRONTEND+'/js/vendor/swfobject/plugin/swfupload.js',
f.onSwfobjectSwfupload
);
}
@ -221,7 +221,7 @@ ls.swfupload = (function ($) {
}else{
ls.debug('window.SWFUpload is undefined, load swfupload/swfupload.js');
$.getScript(
DIR_STATIC_FRAMEWORK+'/js/vendor/swfupload/swfupload.js',
PATH_FRAMEWORK_FRONTEND+'/js/vendor/swfupload/swfupload.js',
f.onSwfupload
);
}
@ -239,7 +239,7 @@ ls.swfupload = (function ($) {
}else{
ls.debug('window.swfobject is undefined, load swfobject/swfobject.js');
$.getScript(
DIR_STATIC_FRAMEWORK+'/js/vendor/swfobject/swfobject.js',
PATH_FRAMEWORK_FRONTEND+'/js/vendor/swfobject/swfobject.js',
f.onSwfobject
);
}

View file

@ -22,9 +22,9 @@
inline : 1
}, {
plugin_url : url,
DIR_WEB_ROOT: DIR_WEB_ROOT,
PATH_ROOT: PATH_ROOT,
ajaxurl: aRouter['ajax'],
LIVESTREET_SECURITY_KEY: LIVESTREET_SECURITY_KEY,
LIVESTREET_SECURITY_KEY: LIVESTREET_SECURITY_KEY
});
});
ed.addButton('lsimage', {title : 'lseditor.image_title', cmd : 'mceLsEditorImage', image : url + '/img/img.gif'});
@ -65,7 +65,7 @@
inline : 1
}, {
plugin_url : url,
DIR_WEB_ROOT: DIR_WEB_ROOT,
PATH_ROOT: PATH_ROOT
});
});
ed.addButton('lsvideo', {title : 'lseditor.video_title', cmd : 'mceLsEditorVideo', image : url + '/img/video.gif'});

View file

@ -56,7 +56,7 @@ function isAjaxRequest() {
function dump($msg) {
if (Config::Get('sys.logs.hacker_console') && !isAjaxRequest()) {
if (!class_exists('Debug_HackerConsole_Main')) {
require_once Config::Get('path.root.framework')."/libs/vendor/HackerConsole/Main.php";
require_once Config::Get('path.framework.libs_vendor.server')."/HackerConsole/Main.php";
new Debug_HackerConsole_Main(true);
}
call_user_func(array('Debug_HackerConsole_Main', 'out'), $msg);
@ -429,7 +429,7 @@ function func_camelize($sStr) {
function func_list_plugins($bAll = false){
$sPluginsDir = Config::Get('path.root.application').'/plugins';
$sPluginsDir = Config::Get('path.application.plugins.server');
$sPluginsListFile = $sPluginsDir.'/'.Config::Get('sys.plugins.activation_file');
$aPlugin = array();
if($bAll){

View file

@ -23,9 +23,9 @@ header('X-Powered-By: LiveStreet CMS');
// Получаем объект конфигурации
$sPathToFramework=dirname(__FILE__).'/framework/';
require_once("{$sPathToFramework}/config/loader.php");
require_once(Config::Get('path.root.framework')."/classes/engine/Engine.class.php");
require_once(Config::Get('path.framework.server')."/classes/engine/Engine.class.php");
$oProfiler=ProfilerSimple::getInstance(Config::Get('path.root.application').'/logs/'.Config::Get('sys.logs.profiler_file'),Config::Get('sys.logs.profiler'));
$oProfiler=ProfilerSimple::getInstance(Config::Get('path.application.server').'/logs/'.Config::Get('sys.logs.profiler_file'),Config::Get('sys.logs.profiler'));
$iTimeId=$oProfiler->Start('full_time');
$oRouter=Router::getInstance();